コード例 #1
0
        private void trackBar1_ValueChanged(object sender, System.EventArgs e)
        {
            editLighting.lights[listBox1.SelectedIndex].DirectionX = ((float)trackBar1.Value / 100.0f) - 1;
            lightPreview1.DrawPreview();

            lightPropertyGrid.Refresh();
            changedEditing = true;
        }
コード例 #2
0
ファイル: ResourceMonitor.cs プロジェクト: r-bel/glorg2
            public monitor(DynamicNode n)
            {
                //MessageBox.Show(n.Owner.ToString());

                props = n.GetType().GetProperties();

                this.Text = "Resource monitor - " + n.ToString();
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
                this.ClientSize = new System.Drawing.Size(480, 640);
                this.StartPosition = FormStartPosition.Manual;
                //this.Location = new Point(this.Parent

                // TABS
                tc = new TabControl();
                tc.Dock = DockStyle.Fill;
                tp_props = new TabPage();
                tc.Controls.AddRange(new Control[] { tp_props });

                // Datagrid for properties
                pg_props = new PropertyGrid();
                pg_props.SelectedObject = n;
                pg_props.Dock = DockStyle.Fill;
                tp_props.Controls.Add(pg_props);

                t = new Timer();
                t.Interval = 100;
                t.Tick += delegate(object sender, EventArgs e) { pg_props.Refresh(); };
                t.Start();

                this.Controls.Add(tc);
            }
コード例 #3
0
        public void SetFromAlias(ServerAlias alias)
        {
            tbAliasName.Text = alias.Name;
            CopyInstance(alias.SessionInfo, _sessionInfo);
            SessionInfoPropertyGrid.Refresh();
            cbIsUserAlias.Checked = alias.IsUserAlias;

            InProcessAlias  inProcess  = alias as InProcessAlias;
            ConnectionAlias connection = alias as ConnectionAlias;

            if (inProcess != null)
            {
                tcAliasType.SelectedTab       = tpInProcessAlias;
                _cbInProcessInstanceName.Text = inProcess.InstanceName;
                cbEmbedded.Checked            = inProcess.IsEmbedded;
            }
            else
            {
                tcAliasType.SelectedTab          = tpConnectionAlias;
                tbHost.Text                      = connection.HostName;
                cbInstanceName.Text              = connection.InstanceName;
                OverridePortNumber               = connection.OverridePortNumber;
                SecurityMode                     = connection.SecurityMode;
                OverrideListenerPortNumber       = connection.OverrideListenerPortNumber;
                ListenerSecurityMode             = connection.ListenerSecurityMode;
                tbEndpointConfigurationName.Text = connection.ClientConfigurationName;
                cbClientSideLogging.Checked      = connection.ClientSideLoggingEnabled;
            }
        }
コード例 #4
0
 private void frmPropGrid_Load(object sender, System.EventArgs e)
 {
     propertyGrid1.Location       = new Point(0);
     propertyGrid1.Size           = this.ClientSize;
     propertyGrid1.ToolbarVisible = true;
     propertyGrid1.Refresh();
 }
コード例 #5
0
 /// <summary>
 /// refresh the application
 /// </summary>
 private void Application_Idle(object sender, EventArgs e)
 {
     if (this.needRefresh && propertyGrid != null && propertyGrid.Parent != null)
     {
         needRefresh = false;
         propertyGrid.Refresh();
     }
 }
コード例 #6
0
 /// <summary>
 /// Update the view - if the values of the registers had changed.
 /// </summary>
 public void UpdateRegistersDisplay()
 {
     if (lstRegisters.InvokeRequired)
     {
         UpdateRegistersCallback cb = new UpdateRegistersCallback(lstRegisters.Refresh);
         this.Invoke(cb, new object[] { });
     }
     else
     {
         lstRegisters.Refresh();
     }
 }
コード例 #7
0
ファイル: FormFunctions.cs プロジェクト: adrianj/AdriansLib
 public static void SetPropertyGridLabelWidth(PropertyGrid grid, int width)
 {
     Control gridView = GetControlOfNamedType(grid, "PropertyGridView");
     Control docComment = GetControlOfNamedType(grid, "DocComment");
     FieldInfo widthField = gridView.GetType().GetField("labelWidth", BindingFlags.Instance | BindingFlags.NonPublic);
     widthField.SetValue(gridView, width);
     grid.Refresh();
     width = (int)widthField.GetValue(gridView);
     FieldInfo heightField = docComment.GetType().GetField("height", BindingFlags.Instance | BindingFlags.NonPublic);
     if (heightField != null)
     {
         int height = (int)heightField.GetValue(docComment);
         Console.WriteLine("" + heightField);
     }
 }
コード例 #8
0
 public void UpdateStackDisplay()
 {
     if (iPrevSP != Regs[14].ReadLong())
     {
         CreateStackBag((uint)(iPrevSP = Regs[14].ReadLong()));
     }
     if (gridStack.InvokeRequired)
     {
         RefreshCallback cb = new RefreshCallback(gridStack.Refresh);
         this.Invoke(cb, new object[] { });
     }
     else
     {
         gridStack.Refresh();
     }
 }
コード例 #9
0
        void OnTimerTick(object sender, EventArgs e)
        {
            if (RefreshOnTimer && mPropertyGrid != null && !mPropertyGrid.Focused && !mPropertyGrid.ContainsFocus)
            {
                bool shouldRefresh = true;

                Control control = GetFocusedControl();
                if (control != null)
                {
                    if (control.GetType().Name == "GridViewListBox")
                    {
                        shouldRefresh = false;
                    }
                }

                if (shouldRefresh)
                {
                    mPropertyGrid.Refresh();
                }
            }
        }
コード例 #10
0
 private void ProcessFrame()
 {
     if (!m_bPaused && m_pBattle != null)
     {
         if (m_pBattle.ProcessFrame())
         {
             pnlBattleGround.Robots = m_pBattle.Robots;
             pnlBattleGround.Refresh();
             try
             {
                 pgrRobotDetails.Refresh();
             }
             catch (InvalidOperationException) {}
         }
         else
         {
             Results pForm = new Results(m_pBattle.Winners);
             pForm.ShowDialog(this);
             m_pBattle = null;
         }
     }
 }
コード例 #11
0
 private void PropertyGrid1_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e)
 {
     PropertyGrid1.Refresh();
 }
コード例 #12
0
        internal void RefreshGrid()
        {
            if (formClosed)
            {
                return;
            }

            if (GameEngine.Current != null && GameEngine.Current.CurrentVector != null)
            {
                ArrayList list      = new ArrayList();
                ArrayList shownList = new ArrayList();

                WorldState worldState = GameEngine.Current.CurrentVector.State;

                if (comboBox.SelectedItem == null)
                {
                    selectedGuid = null;
                }
                else
                {
                    selectedGuid = ((OrganismComboItem)comboBox.SelectedItem).ID;
                }

                if (currentGuid != selectedGuid)
                {
                    currentGuid  = selectedGuid;
                    selectedGuid = null;
                    if (currentGuid != null)
                    {
                        OrganismState o = worldState.GetOrganismState(currentGuid);
                        if (o != null)
                        {
                            selectedObject = new GenericTypeDescriptor(o);
                            propertyGrid.SelectedObject = selectedObject;
                        }
                        else
                        {
                            UnselectObject(currentGuid);
                        }
                    }
                    else
                    {
                        propertyGrid.SelectedObject = null;
                    }
                }
                else
                {
                    if (currentGuid == null)
                    {
                        propertyGrid.SelectedObject = null;
                    }
                    else
                    {
                        OrganismState o = worldState.GetOrganismState(currentGuid);
                        if (o != null)
                        {
                            selectedObject.SetObject(o);
                            propertyGrid.Refresh();
                        }
                        else
                        {
                            UnselectObject(currentGuid);
                        }
                    }
                }
            }
        }
コード例 #13
0
        /// <summary>
        /// Interface for setting the simulator's settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bagSimulator_SetValue(object sender, PropertySpecEventArgs e)
        {
            switch (e.Property.Name)
            {
            case "Page Size":
                theSettings.Simulator.PageSize = (int)e.Value < 8 ? 8 : (int)e.Value;
                break;

            case "Physical Memory Size":
                int iVal = (int)e.Value;
                if (theSettings.Simulator.PageSize > iVal)
                {
                    theSettings.Simulator.MemorySize = theSettings.Simulator.PageSize;
                }
                else
                {
                    theSettings.Simulator.MemorySize = iVal % theSettings.Simulator.PageSize == 0 ?
                                                       iVal : iVal - iVal % theSettings.Simulator.PageSize + theSettings.Simulator.PageSize;
                }
                break;

            case "Show Memory Accesses":
                theSettings.Simulator.bShowAccessesToMemory = (bool)e.Value;
                break;

            case "Enable Physical Memory Simulation":
                theSettings.Simulator.bEnablePhysicalMemorySimulation = (bool)e.Value;
                if ((bool)e.Value == false)
                {
                    theSettings.Simulator.bShowPhysicalAddresses = false;
                    theSettings.Simulator.bShowPageFaults        = false;
                    gridOptions.Refresh();
                }
                break;

            case "Show Physical Addresses":
                theSettings.Simulator.bShowPhysicalAddresses = (bool)e.Value;
                if ((bool)e.Value == true)
                {
                    theSettings.Simulator.bEnablePhysicalMemorySimulation = true;
                    gridOptions.Refresh();
                }
                break;

            case "Show Page Faults":
                theSettings.Simulator.bShowPageFaults = (bool)e.Value;
                if ((bool)e.Value == true)
                {
                    theSettings.Simulator.bEnablePhysicalMemorySimulation = true;
                    gridOptions.Refresh();
                }
                break;

            case "Fill Memory with Garbage":
                theSettings.Simulator.bFillUninitalizeMemoryWithGarbage = (bool)e.Value;
                break;

            case "Text Color":
                theSettings.Simulator.ConsoleTextColor = (Color)e.Value;
                break;

            case "Background Color":
                theSettings.Simulator.ConsoleBackGroundColor = (Color)e.Value;
                break;

            case "Always On Top on Debug Mode":
                theSettings.Simulator.bConsoleAlwaysOnTopOnDebug = (bool)e.Value;
                break;

            case "Clock Resolution":
                theSettings.Simulator.ClockResolution = (int)e.Value;
                break;

            case "Show Registers in Hex":
                theSettings.Simulator.bShowRegistersInHex = (bool)e.Value;
                break;

            case "Show Special Registers":
                theSettings.Simulator.bShowSpecialRegisters = (bool)e.Value;
                break;

            case "Show Debug Information":
                theSettings.Simulator.bShowDebugInformation = (bool)e.Value;
                break;

            case "SP Startup Location":
                theSettings.Simulator.iSP = (int)e.Value;
                break;

            case "Stack Maximum Size":
                theSettings.Simulator.iStackSize = (int)e.Value;
                break;

            default:
                throw new PanicException();
            }
            ;
        }
コード例 #14
0
 void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     Grid.Refresh();
 }
コード例 #15
0
ファイル: DisplayTest.cs プロジェクト: mockingbirdnest/HP
 private void done_Click(object sender, System.EventArgs e)
 {
     validater.DoneEntering();
     PropertyGrid.Refresh();
 }