RdZoid
RdZoid
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
ok
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
I cant close this
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
or the other says I dont have permission
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
I tried it says the application did not respond
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
$close
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
$close
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
ok I thought that could've been it, my instructor said dot console when creating it though so probably just a flub, thanks though!
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
does the .Console break it?
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
but why would it even need that? lol doens't make sense
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
if I do that it's just greyed out and doesn't fix it
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
well that works...
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
No description
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
On every Console.WriteLine
35 replies
CC#
Created by RdZoid on 3/4/2025 in #help
Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
using Microsoft.AspNetCore.SignalR.Client;

namespace AJS.DVDCentral.UI.Console
{
public class SignalRConnection
{
private string hubAddress;
HubConnection _connection;

public string User { get; set; }
public string Message { get; set; }
string owner;

public SignalRConnection(string hubAddress)
{
this.hubAddress = hubAddress;
}
public SignalRConnection(string hubAddress, string owner)
{
this.hubAddress = hubAddress;
this.owner = owner;
}

public HubConnection HubConnection
{
get { return _connection; }
}

public void Start()
{
_connection = new HubConnectionBuilder()
.WithUrl(hubAddress)
.Build();

_connection.On<string, string>("ReceiveMessage", (s1, s2) => OnSend(s1, s2));


_connection.StartAsync();
}

private void OnSend(string user, string message)
{
Console.WriteLine($"{user}: {message}");
User = user;
Message = message;
}

public void Stop()
{

_connection.StopAsync();
}

public void ConnectToChannel(string user)
{
Start();
string message = user + " connected...";

try
{
_connection.InvokeAsync("SendMessage", "System", message);

}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}

public void SendMessageToChannel(string user, string message)
{
try
{
//Start();
//Console.WriteLine($"{user} {message}");
_connection.InvokeAsync("SendMessage", user, message);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

}

}
}
using Microsoft.AspNetCore.SignalR.Client;

namespace AJS.DVDCentral.UI.Console
{
public class SignalRConnection
{
private string hubAddress;
HubConnection _connection;

public string User { get; set; }
public string Message { get; set; }
string owner;

public SignalRConnection(string hubAddress)
{
this.hubAddress = hubAddress;
}
public SignalRConnection(string hubAddress, string owner)
{
this.hubAddress = hubAddress;
this.owner = owner;
}

public HubConnection HubConnection
{
get { return _connection; }
}

public void Start()
{
_connection = new HubConnectionBuilder()
.WithUrl(hubAddress)
.Build();

_connection.On<string, string>("ReceiveMessage", (s1, s2) => OnSend(s1, s2));


_connection.StartAsync();
}

private void OnSend(string user, string message)
{
Console.WriteLine($"{user}: {message}");
User = user;
Message = message;
}

public void Stop()
{

_connection.StopAsync();
}

public void ConnectToChannel(string user)
{
Start();
string message = user + " connected...";

try
{
_connection.InvokeAsync("SendMessage", "System", message);

}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}

public void SendMessageToChannel(string user, string message)
{
try
{
//Start();
//Console.WriteLine($"{user} {message}");
_connection.InvokeAsync("SendMessage", user, message);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

}

}
}
35 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
thank you for your help!
31 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
ok nice, weird workaround but a workaround nonetheless
31 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
holy shit that worked
31 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
like that^?
31 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
private void Refresh()
{
lbxCustomers.DataSource = null;
lbxCustomers.DataSource = customers;
lbxCustomers.DisplayMember = "FullName";
lbxCustomers.ValueMember = "Id";
lblStatus.Text = $"{lbxCustomers.Items.Count} Customers loaded";
lblStatus.ForeColor = Color.Blue;
dataSourceChange = true;
}
private void Refresh()
{
lbxCustomers.DataSource = null;
lbxCustomers.DataSource = customers;
lbxCustomers.DisplayMember = "FullName";
lbxCustomers.ValueMember = "Id";
lblStatus.Text = $"{lbxCustomers.Items.Count} Customers loaded";
lblStatus.ForeColor = Color.Blue;
dataSourceChange = true;
}
31 replies
CC#
Created by RdZoid on 5/3/2024 in #help
listbox SelectedIndexChanged on load?
public partial class frmBanking : Form
{
List<Customer> customers;
MySettings settings;
private bool dataSourceChange;

public frmBanking()
{
InitializeComponent();

}

private void frmBanking_Load(object sender, EventArgs e)
{
this.dataSourceChange = true;
this.lbxCustomers.DataSource = new string[] { "foo", "bar" };
this.dataSourceChange = false;

try
{


settings = Program.Configuration.GetSection("MySettings").Get<MySettings>();

this.Text = settings.Text;


lblStatus.ForeColor = Color.Black;


//customers = CustomerManager.Populate();
customers = CustomerManager.ReadXML(settings.CustomerXMLFilename);


Refresh();



}
catch (Exception ex)
{
lblStatus.ForeColor = Color.Red;
lblStatus.Text = ex.Message;
}
}

private void Refresh()
{
lbxCustomers.DataSource = null;
lbxCustomers.DataSource = customers;
lbxCustomers.DisplayMember = "FullName";
lbxCustomers.ValueMember = "Id";
lblStatus.Text = $"{lbxCustomers.Items.Count} Customers loaded";
lblStatus.ForeColor = Color.Blue;
}



private void lbxCustomers_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.dataSourceChange)
{
this.lbxCustomers.SelectedIndex = -1;
return;
}

try
{
lblStatus.ForeColor = Color.Black;
lblStatus.Text = string.Empty;


if (lbxCustomers.SelectedIndex >= 0)
{
Customer customer = customers[lbxCustomers.SelectedIndex];

txtFirstName.Text = customer.FirstName;
txtLastName.Text = customer.LastName;
txtSSN.Text = customer.SSN;
txtId.Text = customer.Id.ToString();
dtBirthDate.Text = customer.Birthdate.ToString();


dgvDeposits.DataSource = null;
dgvWithdrawals.DataSource = null;


}

}
catch (Exception ex)
{
lblStatus.ForeColor = Color.Red;
lblStatus.Text = ex.Message;
}
}
public partial class frmBanking : Form
{
List<Customer> customers;
MySettings settings;
private bool dataSourceChange;

public frmBanking()
{
InitializeComponent();

}

private void frmBanking_Load(object sender, EventArgs e)
{
this.dataSourceChange = true;
this.lbxCustomers.DataSource = new string[] { "foo", "bar" };
this.dataSourceChange = false;

try
{


settings = Program.Configuration.GetSection("MySettings").Get<MySettings>();

this.Text = settings.Text;


lblStatus.ForeColor = Color.Black;


//customers = CustomerManager.Populate();
customers = CustomerManager.ReadXML(settings.CustomerXMLFilename);


Refresh();



}
catch (Exception ex)
{
lblStatus.ForeColor = Color.Red;
lblStatus.Text = ex.Message;
}
}

private void Refresh()
{
lbxCustomers.DataSource = null;
lbxCustomers.DataSource = customers;
lbxCustomers.DisplayMember = "FullName";
lbxCustomers.ValueMember = "Id";
lblStatus.Text = $"{lbxCustomers.Items.Count} Customers loaded";
lblStatus.ForeColor = Color.Blue;
}



private void lbxCustomers_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.dataSourceChange)
{
this.lbxCustomers.SelectedIndex = -1;
return;
}

try
{
lblStatus.ForeColor = Color.Black;
lblStatus.Text = string.Empty;


if (lbxCustomers.SelectedIndex >= 0)
{
Customer customer = customers[lbxCustomers.SelectedIndex];

txtFirstName.Text = customer.FirstName;
txtLastName.Text = customer.LastName;
txtSSN.Text = customer.SSN;
txtId.Text = customer.Id.ToString();
dtBirthDate.Text = customer.Birthdate.ToString();


dgvDeposits.DataSource = null;
dgvWithdrawals.DataSource = null;


}

}
catch (Exception ex)
{
lblStatus.ForeColor = Color.Red;
lblStatus.Text = ex.Message;
}
}
31 replies