Exemple #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;
        }
Exemple #2
0
            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);
            }
Exemple #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;
            }
        }
 private void frmPropGrid_Load(object sender, System.EventArgs e)
 {
     propertyGrid1.Location       = new Point(0);
     propertyGrid1.Size           = this.ClientSize;
     propertyGrid1.ToolbarVisible = true;
     propertyGrid1.Refresh();
 }
Exemple #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();
     }
 }
 /// <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();
     }
 }
Exemple #7
0
 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);
     }
 }
 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();
     }
 }
        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();
                }
            }
        }
Exemple #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;
         }
     }
 }
 private void PropertyGrid1_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e)
 {
     PropertyGrid1.Refresh();
 }
Exemple #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);
                        }
                    }
                }
            }
        }
        /// <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();
            }
            ;
        }
Exemple #14
0
 void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     Grid.Refresh();
 }
Exemple #15
0
 private void done_Click(object sender, System.EventArgs e)
 {
     validater.DoneEntering();
     PropertyGrid.Refresh();
 }