Example #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                AuthenticateService.api = GUI.DataSources.Get().api;
                AuthenticateService.sqlAdaptrer = GUI.DataSources.Get().sqlAdapter;
                ServiceHost host = new ServiceHost(typeof(LavaHost.AuthenticateService));
                FileTransfer.api = GUI.DataSources.Get().api;
                FileTransfer.sqlAdaptrer = GUI.DataSources.Get().sqlAdapter;
                ServiceHost fileHost = new ServiceHost(typeof(LavaHost.FileTransfer));

                host.Open();
                fileHost.Open();

                wnd = new GUI.MainWindow();

                ContextMenu cm = new ContextMenu();
                cm.Popup +=
                    delegate(object cms, EventArgs cme)
                    {
                        MenuItem open = new MenuItem("&Open");
                        open.Click += showMainWindow;

                        MenuItem exit = new MenuItem("&Exit");
                        exit.Click += exitApplication;

                        cm.MenuItems.Clear();

                        cm.MenuItems.Add(open);
                        cm.MenuItems.Add("-");
                        cm.MenuItems.Add(exit);
                    };

                System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
                ni.Icon = LavaServer.Properties.Resources.Main;
                ni.Visible = true;
                ni.DoubleClick += showMainWindow;
                ni.ContextMenu = cm;
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);

            }
        }
Example #2
0
 public AddFileWindow(Window parent)
 {
     InitializeComponent();
     this.parent = (MainWindow)parent;
 }