//-------------------------------------------------- //CLIENT START //-------------------------------------------------- public void InitializeClient() //odpala sie przy listen { button_change_password.IsEnabled = false; //init kleinta adresInterfejsuDoNasluchu = CommClientPC.GetLocalIPAddress(); textBlock_debugLog.Text = ""; textBlock_debugLog.Text += "Nasluchiwanie na adresie: " + adresInterfejsuDoNasluchu.ToString(); textBlock_debugLog.Text += "\n"; if ((string)button_listen.Content == "Listen") { button_listen.Content = "Listening"; } else if ((string)button_listen.Content == "Nasłuchuj") { button_listen.Content = "Nasłuchiwanie"; } client = new CommClientPC(OutputDelegate, ConnectedDelegate); client.DisconnectAction = DisconnectDelegate; client.DeviceNameAction = DeviceNameDelegate; client.FileInstAction = FileInstDelegate; client.FileRemoveAction = FileRemoveDelegate; client.Password = passwordString; ClientHolder.Client = client; client.Start(adresInterfejsuDoNasluchu); }
private void NotifyIcon_DoubleClick(object sender, EventArgs e) { //if(notifyIcon.Tag as string == "ready") client = ClientHolder.Client; if (client != null && client.IsConnected == true) { //TransferWindow transferWindow = new TransferWindow(); transferWindow.Show(); } else { //Nothing } }
public TrayIcon(System.Windows.Window okno, TransferWindow transferWindow) { client = ClientHolder.Client; this.transferWindow = transferWindow; string iconName = "Ikony/notconnected.ico"; string appName = Application.ProductName; System.Windows.Resources.StreamResourceInfo sri = System.Windows.Application.GetResourceStream(new Uri(@"/" + appName + ";component/" + iconName, UriKind.RelativeOrAbsolute)); Icon icon = new Icon(sri.Stream); notifyIcon = new NotifyIcon(); notifyIcon.Icon = icon; notifyIcon.Text = "Double click when connected to open the transfer window"; notifyIcon.Visible = true; notifyIcon.Tag = "not ready"; notifyIcon.DoubleClick += NotifyIcon_DoubleClick; //-------------------------------------------------- //DO NAPRAWIENIA //-------------------------------------------------- }
public PasswordForConnection() { InitializeComponent(); client = ClientHolder.Client; }