Пример #1
0
        public Form1()
        {
            ExitMenu exitMenu = new ExitMenu();

            exitMenu.ExitMenuClick += new EventHandler(exitMenu_ExitMenuClick);

            InitializeComponent();

            InitDefaultHost();
            HostSelected hostSelected = CreateHostSelected();
            EditMenu     editMenu     = CreateEditMenu();

            this.contextMenuStrip1.Items.AddRange(
                AppMenu.CreateAppMenu().
                Builder(HostManagerFactory.GetInstance().GetHostList(),
                        hostSelected,
                        Server.GetInstance().ReadCurrentHostKey()).
                Builder("-").
                Builder("编辑", editMenu).
                Builder("退出", exitMenu).ToMenuList().ToArray()
                );

            this.Hide();
            this.WindowState   = FormWindowState.Minimized;
            this.ShowInTaskbar = false;
        }
Пример #2
0
        private HostSelected CreateHostSelected()
        {
            HostSelected hostSelected = new HostSelected();

            hostSelected.HostSelectedClick += new HostSelectedClickHandler(hostSelected_HostSelectedClick);

            return(hostSelected);
        }