/// <summary>
        /// 页面跳转器
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            var tag = Convert.ToInt32(((Button)sender).Tag);

            switch (tag)
            {
            case 0:
                HomeControl.Display();
                EncoderControl.Display(false);
                DecoderControl.Display(false);
                break;

            case 1:
                HomeControl.Display(false);
                EncoderControl.Display();
                DecoderControl.Display(false);
                break;

            case 2:
                HomeControl.Display(false);
                EncoderControl.Display(false);
                DecoderControl.Display();
                break;
            }
        }
示例#2
0
        private void btnHome_Click(object sender, EventArgs e)
        {
            HomeControl home = new HomeControl(this);

            home.Dock = DockStyle.Fill;
            DisPanel();
            this.Container.Panel2.Controls.Add(home);
        }
示例#3
0
        private void HomeButton_Click(object sender, EventArgs e)
        {
            Button ButtonObject = (Button)sender;

            AnimateIndicator(ButtonObject);
            HomeControl.BringToFront();
            HomeControl.GenerateCon();
        }
示例#4
0
        public void Setup()
        {
            //creating the fake stubs and mocks
            _fakeHeater     = new FakeHeater();
            _fakeTempSensor = new FakeTempSensor();

            //injecting them into the uut via the constructor
            _uut = new HomeControl(_fakeHeater, _fakeTempSensor);
        }
        /// <summary>
        /// ResetWindow() - A Void method that ensures that the MainWindow is ready to populate user specific
        ///               content by emptying the controlPanel section, and the contentPanel section of the window.
        ///               It also sets the Home Control as the initial content.
        /// </summary>
        private void ResetWindow()
        {
            // Set the ContentPanel's Content to the Control
            Control homeControl = new HomeControl();

            this.contentPanel.Content = homeControl;

            // Clear the Controls
            this.controlPanel.Children.Clear();
        }
示例#6
0
 private void Awake()
 {
     if (home == null)
     {
         home = this;
     }
     else
     {
         Destroy(this);
     }
 }
示例#7
0
 private void mnHome_Click(object sender, EventArgs e)
 {
     MenuSelected((sender as ToolStripMenuItem).Name);
     if (homeCtr == null)
     {
         homeCtr      = new HomeControl();
         homeCtr.Dock = DockStyle.Fill;
         pnlMain.Controls.Add(homeCtr);
     }
     homeCtr.BringToFront();
 }
 public MaintenanceMenuControl(HomeControl form)
 {
     InitializeComponent();
     this.form          = form;
     equimentType       = new EquipmentTypeControl();
     user               = new UsersControl();
     brand              = new BrandControl();
     model              = new ModelsControl();
     technologies       = new TechnologiesConnectionControl();
     equipo             = new EquimentControl();
     employeesControl   = new EmployeesControl();
     rentReturnsControl = new RentReturnsControl();
 }
示例#9
0
        private void btnHome_Click(object sender, EventArgs e)
        {
            cardsPanel1.Controls.Clear();
            var kont = new HomeControl();

            cardsPanel1.Controls.Add(kont);
            AddToControlHistory(kont);
            SetSideMenuPosition((Control)sender);

            //menu(menu) -> uredi
            //SwitchActiveControls(firstCustomControl1);
            //dodajProizvod.Visible = false;
        }
示例#10
0
        private void CreateWelcomeTab()
        {
            var newTab     = new TabPage("Welcome");
            var newControl = new HomeControl
            {
                Dock       = DockStyle.Fill,
                ParentForm = this,
                ParentTab  = newTab
            };

            newTab.Controls.Add(newControl);
            tabControl.TabPages.Add(newTab);
            tabControl.SelectTab(newTab);
            newControl.OnShow();
        }
示例#11
0
        private void InitUserControls(IntegrationTestsRunner runner)
        {
            _home = new HomeControl(runner);
            formFunctionPointer      += new functioncall(RenameDB);
            editTablePointer         += new functioncall2(EditTable);
            _home.userFunctionPointer = formFunctionPointer;
            _home.tableEditPointer    = editTablePointer;
            //------------------------------------------------------------

            _renameDBControl     = new RenameDBControl(runner);
            renameDbNamePointer += new renamecall(HomePage);
            _renameDBControl.userSaveControl = renameDbNamePointer;
            //------------------------------------------------------------
            _tableControl = new TableControl(runner);
            tablePointer += new renamecall(HomePage);
            _tableControl.tablePointer = tablePointer;
            //------------------------------------------------------------
            _queryControl = new QueryControl(runner);
            queryPointer += new queryResultcall(ShowResult);
            _queryControl.queryPointer = queryPointer;
            //------------------------------------------------------------
            _resultControl = new ResultControl(runner);
        }
示例#12
0
        private void MainMenu_Load(object sender, EventArgs e)
        {
            HomeControl.BringToFront(); //Brings Vendor List Control to Front
            Button[] MenuButtonArray = new Button[] { HomeButton, SearchButton, OrdersButton, adminButton };

            //Everything written Below can be easily edited using the Designer but Coding it in below ensure that if i edit the Menu Bar in the future
            //It will still function correctly and any new buttons or sizes i add will also work.

            //Setting MenuIndicator Height & Location
            MenuIndicatorPanel.Height   = HomeButton.Height;
            MenuIndicatorPanel.Location = new Point(0, HomeButton.Location.Y);

            int IterationLength = MenuButtonArray.Length;

            for (int i = 0; i < IterationLength; i++)
            {
                //Set Each Buttons Location Manually
                MenuButtonArray[i].Location = new Point(MenuIndicatorPanel.Location.X + MenuIndicatorPanel.Width, MenuButtonArray[i].Location.Y);
                MenuButtonNames[i]          = MenuButtonArray[i].Text;
            }

            //Set Width Of Bar Panel
            SideMenuPanel.Width = MenuIndicatorPanel.Width + HomeButton.Width + 1;
        }
示例#13
0
 private void SpringField_Click(object sender, EventArgs e)
 {
     SidePanel.Top = SpringField.Top;
     HomeControl.BringToFront();
 }
 private void homeController_OnPersonLeft(object sender, HomeControl.PersonPresenceChangedEventArgs e)
 {
     Notify(this.OnPersonLeft, e);
 }
示例#15
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //当前设备编码
            RobotInfo.DeviceCode       = ConfigurationManager.AppSettings["devicecode"];
            this.Text                  = this.Text + RobotInfo.DeviceCode;//当前编码
            SystemInfo.ClientInfoList  = new List <ClientInfo>();
            SystemInfo.clientRequestCQ = new  ConcurrentQueue <ClientRquestInfo>();
            List <ClientIpInfoModel> list = new List <ClientIpInfoModel>();
            DataTable dt = new ClientInfoDal().GetDS();

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ClientIpInfoModel model = new ClientIpInfoModel();
                    model.Id       = Convert.ToInt32(dt.Rows[i]["id"].ToString());
                    model.Code     = dt.Rows[i]["code"].ToString();
                    model.Name     = dt.Rows[i]["name"].ToString();
                    model.IP       = dt.Rows[i]["ip"].ToString();
                    model.Port     = dt.Rows[i]["port"].ToString();
                    model.Timeouts = Convert.ToInt32(dt.Rows[i]["timeouts"].ToString());
                    model.Status   = Convert.ToInt32(dt.Rows[i]["status"].ToString());
                    list.Add(model);

                    ClientInfo info = new ClientInfo();
                    info.Code = dt.Rows[i]["code"].ToString();
                    info.Name = dt.Rows[i]["name"].ToString();
                    info.Ip   = dt.Rows[i]["ip"].ToString();
                    SystemInfo.ClientInfoList.Add(info);
                }
            }
            AppInfo.ClientInfoList = list;

            LoadFctPos();
            LoadIOPos();
            SystemInfo.FctPosList = fctPosList;
            SystemInfo.IoInfoList = ioInfoList;


            try
            {
                button1_Click(null, null);
            }
            catch (Exception ex)
            {
                LogHelper.Log("服务端启动失败" + ex.Message);
                MessageBox.Show("服务端启动失败" + ex.Message);
                return;
            }


            u1 = new UcFlow();
            tabPage5.Controls.Add(u1);
            ioCard = RobotApp.IoCard;

            homeControl      = new HomeControl();
            homeControl.Dock = DockStyle.Fill;
            panel2.Controls.Add(homeControl);

            TaskContinue.Start(delegate
            {
                if (!RobotApp.BRun)
                {
                    return(false);
                }
                bool b = true;
                if (bRefresh)
                {
                    b = ioCard.RefreshDI();
                }
                return(b);
            }, 100, "IoCard");

            u1.ConsoleMsgEvent  += u1_ConsoleMsgEvent;
            u1.SendMessageEvent += u1_SendMessageEvent;
            u1.RobotStatusEvent += u1_RobotStatusEvent;

            homeControl.SendMessageEvent += u1_SendMessageEvent;


            Task.Factory.StartNew(() => {
                WriteLog();
            });
            //日志处理
        }
        private void Notify(EventHandler<Contracts.PersonPresenceChangedEventArgs> handler, HomeControl.PersonPresenceChangedEventArgs e)
        {
            var tmp = handler;
            var eventArgs = new Contracts.PersonPresenceChangedEventArgs(e);
            if (tmp != null) tmp(this, eventArgs);

            var personState = this.State.FirstOrDefault(ps => ps.name == e.Name);
            if (personState != null)
            {
                Parallel.ForEach(reporters, reporter =>
                {
                    try
                    {
                        log.DebugFormat("Reporting person state for {0} with {1}", personState.name, reporter);
                        reporter.ReportPersonState(personState);
                    }
                    catch (Exception ex)
                    {
                        log.Error(string.Format("Error reporting presence for {0} with reporter {1}", personState.name, reporter.ToString()), ex);
                    }
                });
            }
        }
 public PersonPresenceChangedEventArgs(HomeControl.PersonPresenceChangedEventArgs e)
 {
     this.ChangeTimeUtc = e.ChangeTimeUtc;
     this.Name = e.Name;
 }
示例#18
0
 public HomeConnector(string tag, MainConnector parent, HomeControl control)
     : base(parent, control)
 {
     this.Tag = tag;
 }
示例#19
0
 public Form1()
 {
     InitializeComponent();
     SidePanel.Top = SpringField.Top;
     HomeControl.BringToFront();
 }