private void menuItem_options_Click(object sender, EventArgs e)
        {
            PropertyGrid myGrid = new PropertyGrid
            {
                SelectedObject = Properties.Settings.Default,
                Anchor         = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right
            };
            int windowHight;
            int windowWidth;

            using (OKCancelForm myConfigurationForm = new OKCancelForm(Text + ":Option"))
            {
                UserControl myControl = new UserControl();
                myControl.Controls.Add(myGrid);
                myConfigurationForm.SetUserControl = myControl;
                myConfigurationForm.CanBeAccepted(true);
                myConfigurationForm.ShowDialog(this);
                while (myConfigurationForm.DialogResult == DialogResult.Yes)
                {
                    windowHight = myConfigurationForm.Height;
                    windowWidth = myConfigurationForm.Width;
                    myConfigurationForm.StartPosition = FormStartPosition.Manual;
                    myGrid.SelectedObject             = Properties.Settings.Default;
                    myControl.Controls.Clear();
                    myControl.Controls.Add(myGrid);
                    myConfigurationForm.SetUserControl = myControl;
                    myConfigurationForm.Controls[0].Refresh();
                    myConfigurationForm.Height = windowHight;
                    myConfigurationForm.Width  = windowWidth;
                    myConfigurationForm.ShowDialog(this);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Handles the Click event of the buttonTransition control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void buttonTransition_Click(object sender, EventArgs e)
 {
     selectedTransitionButton = sender as TransitionButton;
     if (((TransitionButton)sender).Image == null) //add new transition
     {
         OKCancelForm newTransitionForm = new OKCancelForm(newTransitionString);
         newTransitionForm.CanBeAccepted(true);
         PropertyGrid propertyGridTransition = new PropertyGrid
         {
             Anchor         = (AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top),
             SelectedObject = selectedTransitionButton.TransitionData
         };
         UserControl uc = new UserControl();
         uc.Controls.Add(propertyGridTransition);
         newTransitionForm.SetUserControl = uc;
         if (newTransitionForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             OnAddTransition();
         }
         else
         {
             newTransitionForm.Close();
         }
     }
     else //show or delete transition
     {
         OKCancelForm showOrDeleteTransitionDataForm = new OKCancelForm(transitionDataString);
         showOrDeleteTransitionDataForm.CanBeAccepted(true);
         showOrDeleteTransitionDataForm.AddButton("Delete", System.Windows.Forms.DialogResult.Ignore);
         PropertyGrid propertyGridTransition = new PropertyGrid
         {
             Anchor         = (AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top),
             SelectedObject = selectedTransitionButton.TransitionData
         };
         UserControl uc = new UserControl();
         uc.Controls.Add(propertyGridTransition);
         showOrDeleteTransitionDataForm.SetUserControl = uc;
         System.Windows.Forms.DialogResult dr = showOrDeleteTransitionDataForm.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             OnOk();
         }
         else if (dr == System.Windows.Forms.DialogResult.Cancel)
         {
             Properties.Settings.Default.Reload();
         }
         else if (dr == System.Windows.Forms.DialogResult.Ignore)
         {
             OnDelete();
         }
     }
 }
Beispiel #3
0
        private void HelpConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            myGrid = new PropertyGrid
            {
                SelectedObject = Properties.Settings.Default
            };
            myGrid.SelectedGridItemChanged += new SelectedGridItemChangedEventHandler(myGrid_SelectedGridItemChanged);
            myGrid.SizeChanged             += new EventHandler(myGrid_SizeChanged);
            myGrid.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            int          windowHight;
            int          windowWidth;
            OKCancelForm myConfigurationForm = new OKCancelForm(Resources.ConfigurationFormName);

            using (myConfigurationForm)
            {
                myConfigurationForm.AddButton("Reset", System.Windows.Forms.DialogResult.Ignore);
                UserControl myControl = new UserControl();
                myControl.Controls.Add(myGrid);
                myConfigurationForm.SetUserControl = myControl;
                myConfigurationForm.CanBeAccepted(true);
                myConfigurationForm.AutoSize = false;
                myConfigurationForm.Height   = 580;
                myConfigurationForm.Width    = 620;
                System.Windows.Forms.DialogResult dr = myConfigurationForm.ShowDialog(this);
                while (dr == System.Windows.Forms.DialogResult.Ignore)
                {
                    windowHight = myConfigurationForm.Height;
                    windowWidth = myConfigurationForm.Width;
                    myConfigurationForm.StartPosition = FormStartPosition.Manual;
                    myGrid.SelectedObject             = Properties.Settings.Default;
                    myControl.Controls.Clear();
                    myControl.Controls.Add(myGrid);
                    myConfigurationForm.SetUserControl = myControl;
                    myConfigurationForm.Controls[0].Refresh();
                    myConfigurationForm.Height = windowHight;
                    myConfigurationForm.Width  = windowWidth;
                    OnReset();
                    dr = myConfigurationForm.ShowDialog(this);
                    if (dr == System.Windows.Forms.DialogResult.OK)
                    {
                        OnOk();
                    }
                    else if (dr == System.Windows.Forms.DialogResult.Cancel)
                    {
                        OnCancel();
                    }
                }
            }
        }
Beispiel #4
0
 public ModelObserver() : base()
 {
     InitializeComponent();
     SolutionConfigurationManagementRoot.DefaultInstance.AfterSolutionChange += AfterSolutionChange;
     this.m_TreeView.ImageList         = this.m_ImagesForNodes.ImageListNodes;
     m_TreeView.CoupledNodesAreEnabled = Settings.Default.CoupledNodesAreEnabled;
     //solution initialization:
     m_BackForwardTreViewToolStrip.TreeView = this.m_TreeView;
     m_SearchTreeViewToolStrip.TreeView     = this.m_TreeView;
     m_SearchTreeViewToolStrip.SetAdditionalNodeTestDelegate = new SearchTreeViewHelper.AdditionalNodeTestDelegate(NodeSearchTest);
     m_FiltersControl = new FiltersControl();
     m_filterForm     = new OKCancelForm("Set Filters...")
     {
         SetUserControl = m_FiltersControl
     };
     m_filterForm.CanBeAccepted(true);
     m_FiltersControlSettings = new FiltersControl.FilterSettings();
 }
Beispiel #5
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PropertyGrid myGrid = new PropertyGrid();

            myGrid.SelectedObject = Properties.Settings.Default;
            myGrid.Anchor         = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            using (OKCancelForm myConfigurationForm = new OKCancelForm(Resources.ConfigurationFormName))
            {
                UserControl myControl = new UserControl();
                myControl.Controls.Add(myGrid);
                myConfigurationForm.SetUserControl = myControl;
                myConfigurationForm.CanBeAccepted(true);
                if (myConfigurationForm.ShowDialog(this) == DialogResult.OK)
                {
                    Properties.Settings.Default.Save();
                    MessageBox.Show(Resources.ConfigurationForm_MessageAfterChange);
                }
            }
        }
        private bool DisplayQuestionAboutConfiguration()
        {
            if (!Settings.Default.DisplayConfigurationQuestionAtStartup)
            {
                return(false);
            }
            bool _returnValue = false;

            using (OKCancelForm _questionForm = new OKCancelForm(Text))
            {
                ConfigurationQuestionControl _configuration = new ConfigurationQuestionControl();
                _questionForm.SetUserControl = _configuration;
                _questionForm.CanBeAccepted(true);
                if (_questionForm.ShowDialog(this) == DialogResult.OK)
                {
                    Settings.Default.DisplayConfigurationQuestionAtStartup = _configuration.DisplayConfigurationQuestionAtStartup;
                    Settings.Default.UseAlternativeConfiguration           = _configuration.UseAlternativeConfiguration;
                    Settings.Default.Save();
                    _returnValue = true;
                }
            }
            return(_returnValue);
        }