public MainWindow() { InitializeComponent(); CultureInfo ci = CultureInfo.InstalledUICulture; Properties.Settings.Default.SystemLanguage = ci.TwoLetterISOLanguageName; ChooseLanguage(); passwordString = Properties.Settings.Default.Password; passwordForConnection = new PasswordForConnection(); passwordForConnection.SetPasswordAction = SetPasswordDelegate; transferWindow = new TransferWindow(); transferWindow.TransferAction = TransferHistoryDelegate; transferWindow.FinishAction = FinishDelegate_TransferWindow; SetRandomPasswordIfFirstLaunch(); openFileDialog = new OpenFileDialog(); openFileDialog.Multiselect = true; trayIcon = new TrayIcon(this, transferWindow); this.Icon = notconnectedIcon; }
public MainWindow() { InitializeComponent(); passwordForConnection = new PasswordForConnection(); passwordForConnection.SetPasswordAction = SetPasswordDelegate; transferWindow = new TransferWindow(); transferWindow.TransferAction = TransferHistoryDelegate; SetRandomPasswordIfFirstLaunch(); trayIcon = new TrayIcon(this, transferWindow); }
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 //-------------------------------------------------- }