Ejemplo n.º 1
0
        protected override void Load(NanoXmlElement doc)
        {
            NanoXmlElement recentsEl = doc.GetElement("Recents");

            foreach (NanoXmlElement childElement in recentsEl.ChildElements)
            {
                if (File.Exists(childElement.GetAttribute("filename")))
                {
                    recents.Add(new RecentItem(childElement));
                }
            }

            NanoXmlElement settingsEl = doc.GetElement("Settings");

            settingsEl.GetValueIfExists("ShowModules", ref showModules);
            settingsEl.GetValueIfExists("ShowSkipped", ref showSkipped);
            settingsEl.GetValueIfExists("ShowResources", ref showResources);
            settingsEl.GetValueIfExists("GroupResources", ref groupResources);
            settingsEl.GetValueIfExists("GroupNamespaces", ref groupNamespaces);
            settingsEl.GetValueIfExists("GroupModules", ref groupModules);
            settingsEl.GetValueIfExists("UseColumns", ref useColumns);
            settingsEl.GetValueIfExists("ShowOriginal", ref showOriginal);
            settingsEl.GetValueIfExists("ShowUnicode", ref showUnicode);
            settingsEl.GetValueIfExists("SimplifySystem", ref simplifySystemNames);
            settingsEl.GetValueIfExists("SimplifyNullable", ref simplifyNullable);
            settingsEl.GetValueIfExists("SimplifyRef", ref simplifyRef);
            settingsEl.GetValueIfExists("SortingType", ref sortingType);
            settingsEl.GetValueIfExists("Editor", ref editor);
            settingsEl.GetValueIfExists("DoubleClickAction", ref doubleClickAction);
            settingsEl.GetValueIfExists("WatchClipboard", ref watchClipboard);

            if (editor == null)
            {
                editor = VisualStudioDetector.GetHighestVisualStudio().Description;
            }

            commandsElement = doc.GetElement("Actions");

            NanoXmlElement updateEl = doc.GetElement("Update");

            if (updateEl == null)
            {
                updateEl = doc.GetElement("update");
            }
            if (updateEl != null)
            {
                updateHelper.Load(updateEl);
            }
        }
Ejemplo n.º 2
0
 protected override void LoadDefaults()
 {
     editor = VisualStudioDetector.GetHighestVisualStudio().Description;
 }
Ejemplo n.º 3
0
        public SettingsForm(Mapping mapping, ICommandManager commandManager)
        {
            this.mapping = mapping;
            InitializeComponent();

            string vs = null;

            if (mapping != null)
            {
                vs = Configs.Instance.GetRecentProperty(mapping.Filename, Configs.PROPERTY_EDITOR);
            }
            else
            {
                cbApplyVsToProject.Checked = cbApplyVsToProject.Enabled = false;
            }

            if (vs == null)
            {
                vs = Configs.Instance.Editor;
            }
            IVisualStudioInfo selected = VisualStudioDetector.GetVisualStudioInfo(vs);

            if (selected == null)
            {
                selected = VisualStudioDetector.GetHighestVisualStudio();
            }

            foreach (IVisualStudioInfo info in VisualStudioDetector.GetVisualStudios())
            {
                BrokenListItem item = new BrokenListItem(info.Description);
                try
                {
                    Icon icon = Icon.ExtractAssociatedIcon(info.Path);
                    imageList.Images.Add(icon);
                    item.ImageIndex = imageList.Images.Count - 1;
                }
                catch { }
                item.Tag = info;

                blvEditors.Items.Add(item);

                if (info == selected)
                {
                    item.Selected = true;
                }
            }

            cbShowUnicode.Checked         = Configs.Instance.ShowUnicode;
            cbSimplifySystemNames.Checked = Configs.Instance.SimplifySystemNames;
            cbSimplifyNullable.Checked    = Configs.Instance.SimplifyNullable;
            cbSimplifyRef.Checked         = Configs.Instance.SimplifyRef;
            cbGroupByNamespaces.Checked   = Configs.Instance.GroupNamespaces;
            cbGroupByModules.Checked      = Configs.Instance.GroupModules;
            cbUseColumns.Checked          = Configs.Instance.UseColumns;
            cbWatchClipboard.Checked      = Configs.Instance.WatchClipboard;

            EnumHelper.FillCombobox(cbDoubleClick, Configs.Instance.DoubleClickAction);
            EnumHelper.FillCombobox(cbUpdateInterval, Configs.Instance.UpdateHelper.Interval);

            commandSelector.CommandManager = commandManager;
            commandSelector.CommandType    = typeof(Actions);
        }