public void LoadPreferences(Preferences prefs, String key, bool appOnly) { if (!appOnly) { var attrib = (UIExtension.TaskAttribute)prefs.GetProfileInt(key, "AttribToTrack", (int)UIExtension.TaskAttribute.Title); if (!AttributeComboBox.IsSupportedAttribute(attrib)) { attrib = UIExtension.TaskAttribute.Title; } m_AttributeCombo.SetSelectedAttribute(attrib); string scheme = prefs.GetProfileString(key, "ColorScheme", ""); if (!m_ColorsCombo.SetSelectedScheme(scheme)) { m_ColorsCombo.SelectedIndex = 0; } } }
public void LoadPreferences(Preferences prefs, String key, bool appOnly) { if (!appOnly) { // private settings var attrib = (Task.Attribute)prefs.GetProfileInt(key, "AttribToTrack", (int)Task.Attribute.Title); if (!AttributeComboBox.IsSupportedAttribute(attrib)) { attrib = Task.Attribute.Title; } m_AttributeCombo.SetSelectedAttribute(attrib); string scheme = prefs.GetProfileString(key, "ColorScheme", ""); if (!m_ColorsCombo.SetSelectedScheme(scheme)) { m_ColorsCombo.SelectedIndex = 0; } m_InitialSplitPos = prefs.GetProfileInt(key, "SplitterPosFromRight", MatchListDefaultWidth); m_InitialSplitPos = Math.Max(m_InitialSplitPos, MinSplitWidth); var style = (LayoutType)prefs.GetProfileInt(key, "LayoutStyle", (int)LayoutType.Spiral); if (!m_StylesCombo.SetSelectedStyle(style)) { m_StylesCombo.SelectedIndex = 0; } } // App settings ShowSplitterBar(!prefs.GetProfileBool("Preferences", "HidePaneSplitBar", false)); string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string language = prefs.GetProfileString("Preferences", "LanguageFile", ""); m_UserIgnoreFilePath = Path.Combine(appPath, "WordCloud.Ignore.txt"); try { var file = File.OpenWrite(m_UserIgnoreFilePath); file.Close(); } catch (UnauthorizedAccessException) { var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); m_UserIgnoreFilePath = Path.Combine(folderPath, "Abstractspoon\\ToDoList\\WordCloud.Ignore.txt"); try { Directory.CreateDirectory(Path.GetDirectoryName(m_UserIgnoreFilePath)); var file = File.OpenWrite(m_UserIgnoreFilePath); file.Close(); } catch (UnauthorizedAccessException) { m_UserIgnoreFilePath = null; } } m_LangIgnoreFilePath = Path.Combine(appPath, "Resources\\Translations", language); m_LangIgnoreFilePath = Path.ChangeExtension(m_LangIgnoreFilePath, "WordCloud.Ignore.txt"); m_TaskMatchesList.TaskColorIsBackground = prefs.GetProfileBool("Preferences", "ColorTaskBackground", false); m_TaskMatchesList.ShowParentsAsFolders = prefs.GetProfileBool("Preferences", "ShowParentsAsFolders", false); m_TaskMatchesList.ShowCompletionCheckboxes = prefs.GetProfileBool("Preferences", "AllowCheckboxAgainstTreeItem", false); m_TaskMatchesList.ShowLabelTips = !prefs.GetProfileBool("Preferences", "ShowInfoTips", false); UpdateBlacklist(); }