private void BijwerkenMRU(string bestandsnaam)
 {
     System.Collections.Specialized.StringCollection mrulijst = new
                                                                System.Collections.Specialized.StringCollection();
     if (WindowMetRibbonControl.Properties.Settings.Default.mru != null)
     {
         mrulijst = WindowMetRibbonControl.Properties.Settings.Default.mru;
         int positie = mrulijst.IndexOf(bestandsnaam);
         if (positie >= 0)
         {
             mrulijst.RemoveAt(positie);
         }
         else
         {
             if (mrulijst.Count >= 6)
             {
                 mrulijst.RemoveAt(5);
             }
         }
     }
     mrulijst.Insert(0, bestandsnaam);
     WindowMetRibbonControl.Properties.Settings.Default.mru = mrulijst;
     WindowMetRibbonControl.Properties.Settings.Default.Save();
     LeesMRU();
 }
Exemple #2
0
        private void MenuItem_OpenRecent_Click(object sender, RoutedEventArgs e)
        {
            var a          = e.OriginalSource.ToString();
            int indexStart = a.IndexOf("Header:") + 7;
            int indexStop  = a.IndexOf("Items") - 1;

            a        = a.Remove(indexStop);
            filePath = a.Substring(indexStart);
            LoadToTextBox(filePath);
            if (propertiesLastFile.Contains(filePath))
            {
                propertiesLastFile.Remove(filePath);
            }
            propertiesLastFile.Insert(0, filePath);
            Properties.Settings.Default.Save();
        }
Exemple #3
0
        private void AddNewRecentWorkItems(string subject)
        {
            Helpers.DebugInfo("Updating recent work items: " + subject);

            _RecentWorkItems.Remove(subject);
            _RecentWorkItems.Insert(0, subject);

            while (_RecentWorkItems.Count > 10)
            {
                _RecentWorkItems.RemoveAt(_RecentWorkItems.Count - 1);
            }

            Properties.Settings.Default["RecentWorkItems"] = _RecentWorkItems;
            Properties.Settings.Default.Save();
        }
        protected void AddToComboBox(EcTextBox tb, ComboBox cb, System.Collections.Specialized.StringCollection sc)
        {
            string strText = tb.Text;

            if (!String.IsNullOrEmpty(strText))
            {
                if (cb.Items.Contains(strText))
                {
                    cb.Items.Remove(strText);
                }

                cb.Items.Insert(0, strText);

                // also save some in the project config file for later recall
                if (sc.Contains(strText))
                {
                    sc.Remove(strText);
                }

                sc.Insert(0, strText);
            }
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if ("".Equals(cboNamespace.Text))
            {
                MessageBox.Show("Enter a namespace first");
                return;
            }

            // save namespaces
            try
            {
                System.Collections.Specialized.StringCollection strColl = new System.Collections.Specialized.StringCollection();

                foreach (string s in cboNamespace.Items.SourceCollection)
                {
                    if (s.Length > 0)
                    {
                        strColl.Add(s);
                    }
                }
                if (!strColl.Contains(cboNamespace.Text))
                {
                    strColl.Insert(0, cboNamespace.Text);
                }
                DictionaryInspector.Properties.Settings.Default.selectedNamespaces = strColl;
                DictionaryInspector.Properties.Settings.Default.Save();
            }
            catch
            {
            }

            // open window
            MainWindow window = new MainWindow(cboNamespace.Text, int.Parse(txtPort.Text));

            window.Show();
            this.Close();
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if ("".Equals(cboNamespace.Text))
            {
                MessageBox.Show("Enter a namespace first");
                return;
            }

            // save namespaces
            try
            {
                System.Collections.Specialized.StringCollection strColl = new System.Collections.Specialized.StringCollection();

                foreach (string s in cboNamespace.Items.SourceCollection )
                {
                    if (s.Length > 0)
                    {
                        strColl.Add(s);
                    }
                }
                if (!strColl.Contains(cboNamespace.Text))
                {
                    strColl.Insert(0,cboNamespace.Text);
                }
                DictionaryInspector.Properties.Settings.Default.selectedNamespaces = strColl;
                DictionaryInspector.Properties.Settings.Default.Save();
            }
            catch
            {
            }

            // open window
            MainWindow window = new MainWindow(cboNamespace.Text, int.Parse(txtPort.Text));
            window.Show();
            this.Close();
        }