Esempio n. 1
0
        private void LoadSnippetOptions()
        {
            foreach (SnippetOptions options in SnippetOptions.LoadAvailableOptions())
            {
                MenuItem item = new MenuItem();
                item.Header      = options.Name;
                item.IsCheckable = true;
                item.Tag         = options;
                item.Checked    += HandleOptionsSelection;
                item.IsChecked   = false;
                OptionsMenu.Items.Add(item);
            }

            ((MenuItem)OptionsMenu.Items[0]).IsChecked = true;
        }
Esempio n. 2
0
        private void LoadSnippetOptions()
        {
            foreach (SnippetOptions options in SnippetOptions.LoadAvailableOptions())
            {
                MenuItem item = new MenuItem();
                item.Header      = options.Name;
                item.IsCheckable = true;
                item.Tag         = options;
                item.Checked    += HandleOptionsSelection;
                item.IsChecked   = false;
                OptionsMenu.Items.Add(item);
            }

            // Default to the last option...
            OptionsMenu.Items.Cast <MenuItem>().Last().IsChecked = true;
        }
Esempio n. 3
0
 private static SnippetOptions FromXmlElement(XmlElement element)
 {
     SnippetOptions ret = new SnippetOptions(element.Attributes["name"].Value);
     foreach (XmlElement tag in element.GetElementsByTagName("Assembly"))
     {
         ret.Assemblies.Add(tag.Attributes["name"].Value);
     }
     foreach (XmlElement tag in element.GetElementsByTagName("Namespace"))
     {
         ret.Namespaces.Add(tag.Attributes["name"].Value);
     }
     foreach (XmlElement tag in element.GetElementsByTagName("CompilerOption"))
     {
         ret.CompilerOptions[tag.Attributes["name"].Value] = tag.Attributes["value"].Value;
     }
     return ret;
 }
Esempio n. 4
0
        private static SnippetOptions FromXmlElement(XmlElement element)
        {
            SnippetOptions ret = new SnippetOptions(element.Attributes["name"].Value);

            foreach (XmlElement tag in element.GetElementsByTagName("Assembly"))
            {
                ret.Assemblies.Add(tag.Attributes["name"].Value);
            }
            foreach (XmlElement tag in element.GetElementsByTagName("Namespace"))
            {
                ret.Namespaces.Add(tag.Attributes["name"].Value);
            }
            foreach (XmlElement tag in element.GetElementsByTagName("CompilerOption"))
            {
                ret.CompilerOptions[tag.Attributes["name"].Value] = tag.Attributes["value"].Value;
            }
            return(ret);
        }
Esempio n. 5
0
 /// <summary>
 /// Generates a snippet from the given text, with the given options.
 /// </summary>
 public Snippet(string snippetText, SnippetOptions options)
 {
     this.snippetText = snippetText;
     this.options = options;
 }
Esempio n. 6
0
 /// <summary>
 /// Generates a snippet from the given text, with the given options.
 /// </summary>
 public Snippet(string snippetText, SnippetOptions options)
 {
     this.snippetText = snippetText;
     this.options     = options;
 }