Ejemplo n.º 1
0
        public void Init(Frame frame)
        {
            mFrame = frame;
            mConfig = frame.Config;

            mFrame.Changed += new Action<Frame, EventArgs>(mWindow_Changed);

            foreach (var screen in Screen.AllScreens) {
                monitorPulldown.Items.Add(screen);
                if (screen.DeviceName.Equals(frame.Monitor.DeviceName))
                    monitorPulldown.SelectedItem = screen;
            }

            if (frame.Output != null) {
                Control panel = frame.Output.ControlPanel;
                panel.Dock = DockStyle.Fill;

                TabPage tab = new TabPage();
                tab.Name = "outputTab";
                tab.Text = "Output";
                tab.Controls.Add(panel);

                mainTab.Controls.Add(tab);

                mainTab.SelectedTab = tab;
            }

            mWindow_Changed(frame, null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// CreateWindowState a input. It is necessary to specify a unique name for the input.
        /// </summary>
        /// <param name="frameName">The name this input is known by within the system.</param>
        /// <param name="overlayAreas">The overlay areas mapped to this input.</param>
        public Frame(string frameName)
        {
            mName = frameName;

            mConfig = new FrameConfig(frameName);
            mMonitor = Screen.AllScreens.FirstOrDefault(s => s.DeviceName.Equals(mConfig.Monitor));
            mWidth = mConfig.Width;
            mHeight = mConfig.Height;
            mTopLeft = mConfig.TopLeft;
            mOrientation = new Rotation(mConfig.Pitch, mConfig.Yaw);
            mCentre = Centre;
            mDraw = mConfig.Draw;
            mDrawEye = mConfig.DrawEye;

            mOrientation.Changed += mOrientation_Changed;

            if (mMonitor == null)
                mMonitor = Screen.PrimaryScreen;
        }