Пример #1
0
        /// <summary>
        /// Constructs a properties form and hooks it into the model
        /// </summary>
        public PropertiesForm(ViewerStateModel model)
        {
            // Save the model
            applicationModel = model;
            localModel = (ViewerStateModel)model.Clone();

            // Setup the display of the form
            this.SuspendLayout();

            this.AutoScaleBaseSize = new Size(5, 13);
            this.ClientSize = new System.Drawing.Size(564, 342);
            this.Font = ViewerStateModel.FormFont;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.Name = "PropertiesForm";
            this.Text = Strings.Properties;

            // Add the child controls
            this.Controls.Add(new PropertiesTabControl(localModel, new Point(0, 0), new Size(564, 304), 0));
            this.Controls.Add(new PropertiesOKButton(applicationModel, localModel, new Point(122, 310), 1));
            this.Controls.Add(new PropertiesCancelButton(applicationModel, localModel, new Point(241, 310), 2));
            this.Controls.Add(new PropertiesApplyButton(applicationModel, localModel, new Point(360, 310), 3));

            this.ResumeLayout();
        }
Пример #2
0
        /// <summary>
        /// Attach to the ViewerStateModel and listen for changes
        /// </summary>
        /// <param name="viewer"></param>
        public void AttachToModel( ViewerStateModel viewer )
        {
            this.m_ViewerState = viewer;

            // Add even listeners
            this.m_ViewerState.Changed["LoggingEnabled"].Add( new PropertyEventHandler( this.OnLoggingChanged ) );
            this.m_ViewerState.Changed["LoggingPath"].Add( new PropertyEventHandler( this.OnLoggingChanged ) );
        }
Пример #3
0
        /// <summary>
        /// Constructs a service to keep track of changes to the model objects and store them in the
        /// registry
        /// </summary>
        /// <param name="toSave">The model class with values we want to save in the registry</param>
        public PrintingService( ViewerStateModel viewer )
        {
            this.m_ViewerState = viewer;

            using( Synchronizer.Lock( this.m_ViewerState.SyncRoot ) ) {
                viewer.Document.PrintPage += new PrintPageEventHandler( this.OnPrintPage );
            }

            // Add even listeners
            this.m_ViewerState.Changed["SlidesPerPage"].Add( new PropertyEventHandler( this.OnPageSetupChanged ) );
        }
Пример #4
0
        /// <summary>
        /// Constructs the backend for updating information about the machine state of the
        /// application
        /// </summary>
        /// <param name="viewerState">
        /// The <see cref="ViewerStateModel"/> object to be modified
        /// </param>
        public ViewerStateService( ViewerStateModel viewerState )
        {
            // We need access to the viewer state
            m_ViewerState = viewerState;

            // Create the timer to listen for changes to the environment
            this.m_ScreenCheckTimer = new System.Windows.Forms.Timer();
            this.m_ScreenCheckTimer.Interval = 500;
            this.m_ScreenCheckTimer.Enabled = true;
            this.m_ScreenCheckTimer.Tick += new EventHandler( this.OnScreenCheckTimerTick );
        }
        /// <summary>
        /// Constructs a new Logging Properties page
        /// </summary>
        public LoggingPropertiesPage( ViewerStateModel model )
        {
            this.SuspendLayout();

            this.Location = new System.Drawing.Point( 4, 22 );
            this.Name = "LoggingTabPage";
            this.Size = new System.Drawing.Size( 556, 248 );
            this.TabIndex = 9;
            this.Text = Strings.Logging;

            // Add the controls
            this.Controls.Add( new LoggingGroup( model, new Point( 16, 24 ), new Size( 524, 88 ), 3 ) );

            this.ResumeLayout();
        }
        /// <summary>
        /// Constructs a new Display Properties Page
        /// </summary>
        public DisplayPropertiesPage( ViewerStateModel vsm )
        {
            this.SuspendLayout();

            this.Location = new System.Drawing.Point( 4, 22 );
            this.Name = "DisplayTabPage";
            this.Size = new System.Drawing.Size( 556, 248 );
            this.TabIndex = 6;
            this.Text = Strings.Displays;

            // Add the controls
            this.Controls.Add( new DualMonitorEnabledCheckBox( vsm, new Point( 16, 8 ), new Size( 522, 24 ), 0 ) );
            this.Controls.Add( new MonitorSwitchingGroup( vsm, new Point( 16, 32 ), new Size( 522, 196 ), 1 ) );

            this.ResumeLayout();
        }
            public BroadcastIPGroup(ViewerStateModel model, Point location, Size size, int tabIndex)
            {
                this.SuspendLayout();

                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "groupBox1";
                this.TabStop = false;
                this.Text = Strings.BroadcastIP;

                // Add the controls
                this.Controls.Add(new BroadcastIPCheckBox(model, new Point(16, 12), new Size(220, 24), 0));

                this.ResumeLayout();
            }
Пример #8
0
 public PresenterModel()
 {
     this.m_Stylus = null;
     this.m_CurrentResult = null;
     this.m_Network = new NetworkModel();
     this.m_VersionExchange = new VersionExchangeModel();
     /// Note: We currently assume that the ParticipantModel Guid will be different for each application invocation.
     /// (In particular TCP reconnection relies on this assumption.)  If we need an identifer that persists across
     /// sessions, we'd need to create a new identifier for this.
     ParticipantId = Guid.NewGuid();
     this.m_Participant = new ParticipantModel(ParticipantId, System.Windows.Forms.SystemInformation.UserName);
     this.m_Workspace = new WorkspaceModel();
     this.m_Undo = new UndoModel();
     this.m_ViewerState = new ViewerStateModel();
     this.m_PenState = new PenStateModel();
     TheInstance = this;
 }
Пример #9
0
        /// <summary>
        /// Clones this model object
        /// </summary>
        /// <returns>A Deep copy of this structure</returns>
        public object Clone()
        {
            // Create the clone
            ViewerStateModel clonedModel = new ViewerStateModel();

            // Copy the values
            clonedModel.m_Document                           = this.m_Document;
            clonedModel.m_PrintableDeck                      = this.m_PrintableDeck;
            clonedModel.m_SlidesPerPage                      = this.m_SlidesPerPage;
            clonedModel.m_LoggingEnabled                     = this.m_LoggingEnabled;
            clonedModel.m_LoggingPath                        = this.m_LoggingPath;
            clonedModel.m_NumberOfScreens                    = this.m_NumberOfScreens;
            clonedModel.m_SecondMonitorEnabled               = this.m_SecondMonitorEnabled;
            clonedModel.m_SecondMonitorWindowsAPIsEnabled    = this.m_SecondMonitorWindowsAPIsEnabled;
            clonedModel.m_SecondMonitorCustomCommandsEnabled = this.m_SecondMonitorCustomCommandsEnabled;
            clonedModel.m_SecondMonitorCustomCommandType     = this.m_SecondMonitorCustomCommandType;
            clonedModel.m_SecondMonitorCloneCommand          = this.m_SecondMonitorCloneCommand;
            clonedModel.m_SecondMonitorExtendCommand         = this.m_SecondMonitorExtendCommand;
            clonedModel.m_SlidePreviewEnabled                = this.m_SlidePreviewEnabled;
            clonedModel.m_SlidePreviewWidth                  = this.m_SlidePreviewWidth;
            clonedModel.m_SlidePreviewHeight                 = this.m_SlidePreviewHeight;
            clonedModel.m_AutoScrollEnabled                  = this.m_AutoScrollEnabled;
            clonedModel.m_FEC = this.m_FEC;
            clonedModel.m_InterPacketDelay          = this.m_InterPacketDelay;
            clonedModel.m_BeaconInterval            = this.m_BeaconInterval;
            clonedModel.m_Diagnostic                = (DiagnosticModel)this.m_Diagnostic.Clone();
            clonedModel.m_WebPerformance            = (WebPerformanceModel)this.m_WebPerformance.Clone();
            clonedModel.m_SaveOnClose               = this.m_SaveOnClose;
            clonedModel.m_ShowIP                    = this.m_ShowIP;
            clonedModel.m_BroadcastDisabled         = this.m_BroadcastDisabled;
            clonedModel.m_UseLightColorSet          = this.m_UseLightColorSet;
            clonedModel.m_ClassmateMode             = this.m_ClassmateMode;
            clonedModel.m_DefaultPenWidth           = this.m_DefaultPenWidth;
            clonedModel.m_DefaultHLWidth            = this.m_DefaultHLWidth;
            clonedModel.m_Language                  = this.m_Language;
            clonedModel.m_DeviceName                = this.m_DeviceName;
            clonedModel.m_OutPutSize                = this.m_OutPutSize;
            clonedModel.m_StudentSubmissionInterval = this.m_StudentSubmissionInterval;
            clonedModel.m_StudentNavigationType     = this.m_StudentNavigationType;

            return(clonedModel);
        }
            /// <summary>
            /// Constructor for the group box
            /// </summary>
            public LoggingGroup( ViewerStateModel model, Point location, Size size, int tabIndex )
            {
                this.SuspendLayout();

                this.Location = location;
                this.FlatStyle = FlatStyle.System;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "grpLogging";
                this.TabStop = false;
                this.Text = Strings.LoggingOptions;
                this.Enabled = true;

                // Add the controls
                this.Controls.Add( new LoggingEnabledCheckBox( model, new Point( 10, 18 ), new Size( 260, 24 ), 32 ) );
                this.Controls.Add( new LoggingPathLabel( new Point( 10, 50 ), new Size( 140, 24 ), 68 ) );
                this.Controls.Add( new LoggingPathTextBox( model, new Point( 154, 50 ), new Size( 356, 21 ), 31 ) );

                this.ResumeLayout();
            }
        /// <summary>
        /// Constructs a new General Properties Page
        /// </summary>
        public GeneralPropertiesPage(ViewerStateModel vsm)
        {
            this.SuspendLayout();

            this.Location = new System.Drawing.Point(4, 22);
            this.Name = "GeneralTabPage";
            this.Size = new System.Drawing.Size(556, 248);
            this.TabIndex = 6;
            this.Text = Strings.General;

            // Add the controls
            this.Controls.Add(new DualMonitorGroup(vsm, new Point(16, 16), new Size(250, 40), 0));
            this.Controls.Add(new FilmstripPropertiesGroup(vsm, new Point(16, 62), new Size(250, 88), 2));
            this.Controls.Add(new LanguageGroup(vsm, new Point(16, 156), new Size(250, 70), 4));
            this.Controls.Add(new DefaultSettingsGroup(vsm, new Point(16, 232), new Size(250, 48), 3));
            this.Controls.Add(new SavingFilesGroup(vsm, new Point(290, 146), new Size(250, 39), 7));
            this.Controls.Add(new BroadcastIPGroup(vsm, new Point(290, 16), new Size(250, 40), 8));
            this.Controls.Add(new PenPropertiesGroup(vsm, new Point(290, 62), new Size(250, 83), 6));
            this.Controls.Add(new PrintingGroup(vsm, new Point(290, 232), new Size(250, 48), 9));
            this.Controls.Add(new StudentSubmissionTimerPropertiesGroup(vsm,new Point (290,186),new Size (250,43),10));
            this.ResumeLayout();
        }
            /// <summary>
            /// Constructs the checkbox
            /// </summary>
            public DualMonitorEnabledCheckBox( ViewerStateModel vsm, Point location, Size size, int tabIndex )
            {
                this.m_Model = vsm;

                this.SuspendLayout();

                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "enableSecondMonitorCheckBox";
                this.Text = Strings.EnableSecondMonitor;

                // Set the default value according to the model's current setting
                // NOTE: Split into two steps to avoid deadlock with updating the check state
                bool bShouldBeChecked;
                using( Synchronizer.Lock( this.m_Model.SyncRoot ) )
                    bShouldBeChecked = this.m_Model.SecondMonitorEnabled;
                this.Checked = bShouldBeChecked;
                this.CheckState = bShouldBeChecked ? CheckState.Checked : CheckState.Unchecked;

                this.ResumeLayout();
            }
        /// <summary>
        /// Constructs a new Network Properties page
        /// </summary>
        public NetworkPropertiesPage(ViewerStateModel vsm)
        {
            this.SuspendLayout();

            this.Location = new System.Drawing.Point(4, 22);
            this.Name = "NetworkTabPage";
            this.Size = new System.Drawing.Size(556, 248);
            this.TabIndex = 1;
            this.Text = Strings.Network;

            // Add the controls
            this.Controls.Add(new BeaconIntervalLabel(new Point(16, 16), new Size(170, 32), 0));
            this.Controls.Add(new BeaconIntervalUpDown(vsm, new Point(188, 16), new Size(56, 20), 1));
            this.Controls.Add(new BeaconIntervalUnitsLabel(new Point(252, 16), new Size(68, 23), 2));
            this.Controls.Add(new PacketDelayLabel(new Point(16, 56), new Size(170, 32), 3));
            this.Controls.Add(new PacketDelayUpDown(vsm, new Point(188, 56), new Size(56, 20), 4));
            this.Controls.Add(new PacketDelayUnitsLabel(new Point(252, 56), new Size(24, 23), 5));
            this.Controls.Add(new FECLabel(new Point(16, 88), new Size(170, 32), 6));
            this.Controls.Add(new FECUpDown(vsm, new Point(188, 88), new Size(56, 20), 7));
            this.Controls.Add(new FECUnitsLabel(new Point(252, 88), new Size(78, 23), 8));
            this.Controls.Add(new BroadcastDisabledCheckBox(vsm, new Point(16, 128), new Size(350, 20), 9));

            this.ResumeLayout();
        }
            /// <summary>
            ///
            /// </summary>
            public PrintingGroup( ViewerStateModel vsm, Point location, Size size, int tabIndex )
            {
                this.SuspendLayout();

                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "PrintingGroup";
                this.TabStop = false;
                this.Text = Strings.Printing;
                this.Enabled = true;

                // Add the controls
                this.Controls.Add( new PagesDropDown( vsm, new Point( 16, 18 ), new Size( 40, 20 ), 0 ) );
                this.Controls.Add( new PagesInfoLabel( new Point( 60, 20), new Size( 170, 24 ), 1 ) );

                this.ResumeLayout();
            }
Пример #15
0
        public void UpdateValues(object model)
        {
            // Make sure both objects exist and aren't the same
            if (model != null &&
                model is ViewerStateModel &&
                model != this)
            {
                ViewerStateModel m = (ViewerStateModel)model;

                // Lock both objects
                using (Synchronizer.Lock(this.SyncRoot)) {
                    using (Synchronizer.Lock(m.SyncRoot)) {
                        // Copy over the values
                        if (this.SlidesPerPage != m.SlidesPerPage)
                        {
                            this.SlidesPerPage = m.SlidesPerPage;
                        }
                        if (this.LoggingPath != m.LoggingPath)
                        {
                            this.LoggingPath = m.LoggingPath;
                        }
                        if (this.LoggingEnabled != m.LoggingEnabled)
                        {
                            this.LoggingEnabled = m.LoggingEnabled;
                        }
                        if (this.NumberOfScreens != m.NumberOfScreens)
                        {
                            this.NumberOfScreens = m.NumberOfScreens;
                        }
                        if (this.SecondMonitorEnabled != m.SecondMonitorEnabled)
                        {
                            this.SecondMonitorEnabled = m.SecondMonitorEnabled;
                        }
                        if (this.SecondMonitorWindowsAPIsEnabled != m.SecondMonitorWindowsAPIsEnabled)
                        {
                            this.SecondMonitorWindowsAPIsEnabled = m.SecondMonitorWindowsAPIsEnabled;
                        }
                        if (this.SecondMonitorCustomCommandsEnabled != m.SecondMonitorCustomCommandsEnabled)
                        {
                            this.SecondMonitorCustomCommandsEnabled = m.SecondMonitorCustomCommandsEnabled;
                        }
                        if (this.SecondMonitorCustomCommandType != m.SecondMonitorCustomCommandType)
                        {
                            this.SecondMonitorCustomCommandType = m.SecondMonitorCustomCommandType;
                        }
                        if (this.SecondMonitorCloneCommand != m.SecondMonitorCloneCommand)
                        {
                            this.SecondMonitorCloneCommand = m.SecondMonitorCloneCommand;
                        }
                        if (this.SecondMonitorExtendCommand != m.SecondMonitorExtendCommand)
                        {
                            this.SecondMonitorExtendCommand = m.SecondMonitorExtendCommand;
                        }
                        if (this.SlidePreviewEnabled != m.SlidePreviewEnabled)
                        {
                            this.SlidePreviewEnabled = m.SlidePreviewEnabled;
                        }
                        if (this.SlidePreviewWidth != m.SlidePreviewWidth)
                        {
                            this.SlidePreviewWidth = m.SlidePreviewWidth;
                        }
                        if (this.SlidePreviewHeight != m.SlidePreviewHeight)
                        {
                            this.SlidePreviewHeight = m.SlidePreviewHeight;
                        }
                        if (this.AutoScrollEnabled != m.AutoScrollEnabled)
                        {
                            this.AutoScrollEnabled = m.AutoScrollEnabled;
                        }
                        if (this.ForwardErrorCorrection != m.ForwardErrorCorrection)
                        {
                            this.ForwardErrorCorrection = m.ForwardErrorCorrection;
                        }
                        if (this.InterPacketDelay != m.InterPacketDelay)
                        {
                            this.InterPacketDelay = m.InterPacketDelay;
                        }
                        if (this.BeaconInterval != m.BeaconInterval)
                        {
                            this.BeaconInterval = m.BeaconInterval;
                        }
                        if (this.SaveOnClose != m.SaveOnClose)
                        {
                            this.SaveOnClose = m.SaveOnClose;
                        }
                        if (this.ShowIP != m.ShowIP)
                        {
                            this.ShowIP = m.ShowIP;
                        }
                        if (this.BroadcastDisabled != m.BroadcastDisabled)
                        {
                            this.BroadcastDisabled = m.BroadcastDisabled;
                        }
                        if (this.UseLightColorSet != m.UseLightColorSet)
                        {
                            this.UseLightColorSet = m.UseLightColorSet;
                        }
                        if (this.ClassmateMode != m.ClassmateMode)
                        {
                            this.ClassmateMode = m.ClassmateMode;
                        }
                        if (this.DefaultPenWidth != m.DefaultPenWidth)
                        {
                            this.DefaultPenWidth = m.DefaultPenWidth;
                        }
                        if (this.DefaultHLWidth != m.DefaultHLWidth)
                        {
                            this.DefaultHLWidth = m.DefaultHLWidth;
                        }
                        if (this.Language != m.Language)
                        {
                            this.Language = m.Language;
                        }
                        if (this.DeviceName != m.DeviceName)
                        {
                            this.DeviceName = m.DeviceName;
                        }
                        if (this.OutPutSize != m.OutPutSize)
                        {
                            this.OutPutSize = m.OutPutSize;
                        }
                        if (this.StudentSubmissionInterval != m.StudentSubmissionInterval)
                        {
                            this.StudentSubmissionInterval = m.StudentSubmissionInterval;
                        }
                        if (this.StudentNavigationType != m.StudentNavigationType)
                        {
                            this.StudentNavigationType = m.StudentNavigationType;
                        }
                    }
                }
            }
        }
            public PacketDelayUpDown( ViewerStateModel vsm, Point location, Size size, int tabIndex )
            {
                this.m_VSModel = vsm;
                this.SuspendLayout();

                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "PacketDelayUpDown";
                this.Maximum = 30;
                this.Minimum = 0;
                this.Enabled = true;

                //Retrive the current value from the model
                int currValue;
                using (Synchronizer.Lock(vsm.SyncRoot)) {
                    currValue = vsm.InterPacketDelay;
                }
                this.Value = currValue;

                this.ResumeLayout();
            }
            /// <summary>
            /// Constructor for the check box
            /// </summary>
            public BroadcastDisabledCheckBox(ViewerStateModel model, Point location, Size size, int tabIndex)
            {
                this.m_ViewerState = model;

                this.SuspendLayout();

                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Enabled = true;
                this.Name = "BroadcastDisabledCheckBox";
                this.Text = Strings.DisableAdvertisementBroadcast;

                bool bShouldBeChecked = false;

                if (model != null) {
                    using (Synchronizer.Lock(model.SyncRoot)) {
                        bShouldBeChecked = model.BroadcastDisabled;
                    }
                }

                if (bShouldBeChecked) {
                    this.Checked = true;
                    this.CheckState = CheckState.Checked;
                }
                else {
                    this.Checked = false;
                    this.CheckState = CheckState.Unchecked;
                }

                this.ResumeLayout();
            }
            public BeaconIntervalUpDown(ViewerStateModel vsm, Point location, Size size, int tabIndex )
            {
                this.m_VSModel = vsm;

                this.SuspendLayout();

                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "BeaconIntervalUpDown";

                //Retrive the current value from the model
                int currValue;
                using (Synchronizer.Lock(vsm.SyncRoot)) {
                    currValue = vsm.BeaconInterval;
                }
                this.Value = currValue;

                this.Maximum = 300.0M;
                this.Minimum = 1M;
                this.Increment = 1M;
                this.DecimalPlaces = 0;
                this.Enabled = true;

                this.ResumeLayout();
            }
            /// <summary>
            /// Constructor for the group
            /// </summary>
            public MonitorSwitchingGroup( ViewerStateModel vsm, Point location, Size size, int tabIndex )
            {
                this.SuspendLayout();

                this.FlatStyle = FlatStyle.System;
                this.Location = location;
                this.Size = size;
                this.TabIndex = tabIndex;
                this.Name = "MonitorSwitchingGroup";
                this.TabStop = false;
                this.Text = Strings.MultiMonitorSwitching;
                this.Enabled = true;

                // Add the controls
                this.Controls.Add( new MonitorWarningLabel( new Point(16,16), new Size( 500, 24), 2 ) );
                this.Controls.Add( new WindowsAPICheckBox( vsm, new Point( 16, 44 ), new Size( 168, 24 ), 3 ) );
                this.Controls.Add( new CustomCommandsCheckBox( vsm, new Point( 16, 70 ), new Size( 268, 24 ), 4 ) );
                this.Controls.Add( new RestoreSettingsButton( vsm, new Point( 304, 43 ), new Size( 164, 27 ), 5 ) );
                this.Controls.Add( new SpecialCommandsGroup( vsm, new Point( 12, 94 ), new Size( 445, 94 ), 6 ) );
                this.Controls.Add( new CloneButton( vsm, new Point( 184, 43 ), new Size( 60, 27 ), 13 ) );
                this.Controls.Add( new ExtendButton( vsm, new Point( 244, 43 ), new Size( 60, 27 ), 14 ) );

                this.ResumeLayout();
            }
                    public ExtendedTextBox( ViewerStateModel vsm, Point location, Size size, int tabIndex )
                    {
                        this.m_ViewerState = vsm;

                        this.SuspendLayout();

                        this.Location = location;
                        this.Size = size;
                        this.TabIndex = tabIndex;
                        this.Name = "ExtendedTextBox";
                        this.ReadOnly = false;
                        this.Text = "";
                        this.Enabled = true;

                        if( this.m_ViewerState != null ) {
                            string text = "";
                            using( Synchronizer.Lock( this.m_ViewerState.SyncRoot ) ) {
                                text = this.m_ViewerState.SecondMonitorExtendCommand;
                            }

                            this.Text = text;
                        }

                        this.ResumeLayout();
                    }
                public PagesDropDown( ViewerStateModel vsm, Point location, Size size, int tabIndex )
                {
                    this.m_VSModel = vsm;
                    this.SuspendLayout();

                    this.FlatStyle = FlatStyle.System;
                    this.Location = location;
                    this.Size = size;
                    this.TabIndex = tabIndex;
                    this.Items.Add( 1 );
                    this.Items.Add( 2 );
                    this.Items.Add( 4 );
                    this.Items.Add( 6 );

                    using(Synchronizer.Lock( vsm.SyncRoot ) )
                        this.SelectedItem = vsm.SlidesPerPage;

                    this.ResumeLayout();
                }
                public LoggingPathTextBox( ViewerStateModel model, Point location, Size size, int tabIndex )
                {
                    this.m_ViewerState = model;

                    this.SuspendLayout();

                    this.Location = location;
                    this.Size = size;
                    this.TabIndex = tabIndex;
                    this.Name = "LoggingPathTextBox";
                    this.ReadOnly = false;
                    this.Text = "";
                    this.Enabled = true;

                    if( model != null ) {
                        string text = "";
                        using( Synchronizer.Lock( model.SyncRoot ) ) {
                            text = model.LoggingPath;
                        }

                        this.Text = text;
                    }

                    this.ResumeLayout();
                }
Пример #23
0
            public PropertiesOKButton(ViewerStateModel oldModel, ViewerStateModel newModel, Point location, int tabIndex)
            {
                this.applicationModel = oldModel;
                this.localModel = newModel;

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.FlatStyle = FlatStyle.System;
                this.Font = ViewerStateModel.StringFont;
                this.Location = location;
                this.Name = "propertiesOKButton";
                this.TabIndex = tabIndex;
                this.Text = Strings.OK;
            }
                /// <summary>
                /// Constructor for the check box
                /// </summary>
                public LoggingEnabledCheckBox( ViewerStateModel model, Point location, Size size, int tabIndex )
                {
                    this.m_ViewerState = model;

                    this.SuspendLayout();

                    this.FlatStyle = FlatStyle.System;
                    this.Location = location;
                    this.Size = size;
                    this.TabIndex = tabIndex;
                    this.Enabled = true;
                    this.Name = "LoggingEnabledCheckBox";
                    this.Text = Strings.EnableLogging;

                    // Set the default value according to the model's current setting
                    // NOTE: Split into two steps to avoid deadlock with updating the check state
                    bool bShouldBeChecked = true;

                    if( model != null ) {
                        using( Synchronizer.Lock( model.SyncRoot ) ) {
                            bShouldBeChecked = model.LoggingEnabled;
                        }
                    }

                    if( bShouldBeChecked ) {
                        this.Checked = true;
                        this.CheckState = CheckState.Checked;
                    } else {
                        this.Checked = false;
                        this.CheckState = CheckState.Unchecked;
                    }

                    this.ResumeLayout();
                }
Пример #25
0
 //, Viewer.Slides.MainSlideViewer m)
 public CaptureGraphForm(SlideModel slide, ViewerStateModel viewerstate)
 {
     this.m_ViewerState = viewerstate;
     using (Synchronizer.Lock(this.m_ViewerState.SyncRoot))
     {
         this.m_DeviceName = this.m_ViewerState.DeviceName;
         this.m_OutPutSize = this.m_ViewerState.OutPutSize;
     }
     this.m_Slide = slide;
     InitializeComponent();
 }
Пример #26
0
        /// <summary>
        /// Clones this model object
        /// </summary>
        /// <returns>A Deep copy of this structure</returns>
        public object Clone()
        {
            // Create the clone
            ViewerStateModel clonedModel = new ViewerStateModel();

            // Copy the values
            clonedModel.m_Document = this.m_Document;
            clonedModel.m_PrintableDeck = this.m_PrintableDeck;
            clonedModel.m_SlidesPerPage = this.m_SlidesPerPage;
            clonedModel.m_LoggingEnabled = this.m_LoggingEnabled;
            clonedModel.m_LoggingPath = this.m_LoggingPath;
            clonedModel.m_NumberOfScreens = this.m_NumberOfScreens;
            clonedModel.m_SecondMonitorEnabled = this.m_SecondMonitorEnabled;
            clonedModel.m_SecondMonitorWindowsAPIsEnabled = this.m_SecondMonitorWindowsAPIsEnabled;
            clonedModel.m_SecondMonitorCustomCommandsEnabled = this.m_SecondMonitorCustomCommandsEnabled;
            clonedModel.m_SecondMonitorCustomCommandType = this.m_SecondMonitorCustomCommandType;
            clonedModel.m_SecondMonitorCloneCommand = this.m_SecondMonitorCloneCommand;
            clonedModel.m_SecondMonitorExtendCommand = this.m_SecondMonitorExtendCommand;
            clonedModel.m_SlidePreviewEnabled = this.m_SlidePreviewEnabled;
            clonedModel.m_SlidePreviewWidth = this.m_SlidePreviewWidth;
            clonedModel.m_SlidePreviewHeight = this.m_SlidePreviewHeight;
            clonedModel.m_AutoScrollEnabled = this.m_AutoScrollEnabled;
            clonedModel.m_FEC = this.m_FEC;
            clonedModel.m_InterPacketDelay = this.m_InterPacketDelay;
            clonedModel.m_BeaconInterval = this.m_BeaconInterval;
            clonedModel.m_Diagnostic = (DiagnosticModel) this.m_Diagnostic.Clone();
            clonedModel.m_SaveOnClose = this.m_SaveOnClose;
            clonedModel.m_ShowIP = this.m_ShowIP;
            clonedModel.m_BroadcastDisabled = this.m_BroadcastDisabled;
            clonedModel.m_UseLightColorSet = this.m_UseLightColorSet;
            clonedModel.m_ClassmateMode = this.m_ClassmateMode;
            clonedModel.m_DefaultPenWidth = this.m_DefaultPenWidth;
            clonedModel.m_DefaultHLWidth = this.m_DefaultHLWidth;
            clonedModel.m_Language = this.m_Language;

            return clonedModel;
        }
                public RestoreSettingsButton( ViewerStateModel vsm, Point location, Size size, int tabIndex )
                {
                    this.m_VSM = vsm;

                    this.SuspendLayout();

                    this.FlatStyle = FlatStyle.System;
                    this.Location = location;
                    this.Size = size;
                    this.TabIndex = tabIndex;
                    this.Name = "RestoreSettingsButton";
                    this.Text = Strings.RestoreDefaults;

                    this.ResumeLayout();
                }
 public BackgroundTemplateXmlService(ViewerStateModel viewer)
 {
     this.m_BackgroundTemplateXmlPath = System.Threading.Thread.GetDomain().BaseDirectory+"BackgroundTemplate.xml";
     this.m_ViewerStateModel = viewer;
 }
Пример #29
0
            public PropertiesTabControl(ViewerStateModel model, Point location, Size size, int tabIndex)
            {
                this.SuspendLayout();

                this.Font = ViewerStateModel.StringFont;
                this.ItemSize = new System.Drawing.Size(52, 18);
                this.Location = location;
                this.Name = "tabControl";
                this.SelectedIndex = 0;
                this.Size = size;
                this.TabIndex = tabIndex;

                ///
                /// NOTE: Unused property forms and controls were removed in r1313.
                /// They were deleted rather than commented out to avoid code cruftification.
                /// If you want to restore the InkPlaybackPropertiesPage, ReflectorPropertiesPage,
                /// or NamesProperiesPage in the future, just go take a look at r1312.
                ///

                this.Controls.Add( new GeneralPropertiesPage( model ) );
                this.Controls.Add( new NetworkPropertiesPage( model ) );
                this.Controls.Add( new DisplayPropertiesPage( model ) );
                #if DEBUG && LOGGING
                this.Controls.Add( new LoggingPropertiesPage( model ) );
                #endif

                this.ResumeLayout();
            }
                /// <summary>
                ///
                /// </summary>
                public SpecialCommandsGroup( ViewerStateModel vsm, Point location, Size size, int tabIndex )
                {
                    this.SuspendLayout();

                    this.FlatStyle = FlatStyle.System;
                    this.Location = location;
                    this.Size = size;
                    this.TabIndex = tabIndex;
                    this.Name = "SpecialCommandsGroup";
                    this.TabStop = false;
                    this.Text = Strings.CustomCommands;
                    this.Enabled = true;

                    // Add the controls
                    this.Controls.Add( new DeviceInfoLabel( new Point( 16, 17 ), new Size( 100, 24 ), 7 ) );
                    deviceDropDown = new DeviceDropDown( vsm, new Point( 118, 16 ), new Size( 308, 21 ), 8 );
                    this.Controls.Add( deviceDropDown );
                    this.Controls.Add( new CloneInfoLabel( new Point( 30, 41 ), new Size( 148, 24 ), 9 ) );
                    cloneTextBox = new CloneTextBox( vsm, new Point( 180, 40 ), new Size( 246, 21 ), 10 );
                    this.Controls.Add( cloneTextBox );
                    this.Controls.Add( new ExtendedInfoLabel( new Point( 30, 65 ), new Size( 138, 24 ), 11 ) );
                    extendedTextBox = new ExtendedTextBox( vsm, new Point( 180, 64 ), new Size( 246, 21 ), 12 );
                    this.Controls.Add( extendedTextBox );

                    this.ResumeLayout();
                }
Пример #31
0
            public PropertiesApplyButton(ViewerStateModel oldModel, ViewerStateModel newModel, Point location, int tabIndex)
            {
                this.applicationModel = oldModel;
                this.localModel = newModel;

                this.FlatStyle = FlatStyle.System;
                this.Font = ViewerStateModel.StringFont;
                this.Location = location;
                this.Name = "propertiesApplyButton";
                this.TabIndex = tabIndex;
                this.Text = Strings.Apply;
            }
                    public DeviceDropDown( ViewerStateModel vsm, Point location, Size size, int tabIndex )
                    {
                        this.m_VSModel = vsm;
                        this.SuspendLayout();

                        this.FlatStyle = FlatStyle.System;
                        this.Location = location;
                        this.Size = size;
                        this.TabIndex = tabIndex;
                        this.DropDownStyle = ComboBoxStyle.DropDownList;
                        this.Items.Add( "<none>" );
                        this.Items.Add( "NVIDIA nView -- nvcpl.dll" );
                        this.Items.Add( "<custom>" );

                        using( Synchronizer.Lock( vsm.SyncRoot ) ) {
                            if( this.m_VSModel.SecondMonitorCustomCommandType == "" ) {
                                this.SelectedItem = "<none>";
                            } else {
                                this.SelectedItem = this.m_VSModel.SecondMonitorCustomCommandType;
                            }
                        }

                        this.ResumeLayout();
                    }