BetterExplorer.Utilities.GetRegistryValue C# (CSharp) Метод

GetRegistryValue() публичный статический Метод

public static GetRegistryValue ( string Name, string DefaultValue ) : Object
Name string
DefaultValue string
Результат Object
		public static Object GetRegistryValue(string Name, string DefaultValue) {
			using (RegistryKey rk = Registry.CurrentUser, rks = rk.OpenSubKey(@"Software\BExplorer", true)) {
				return rks.GetValue(Name, DefaultValue);
			}
		}

Usage Example

Пример #1
0
        private void InitializeInitialTabs()
        {
            var InitialTabs = Utilities.GetRegistryValue("OpenedTabs", "").ToString().Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

            if (InitialTabs.Length == 0 || !_IsrestoreTabs)
            {
                var sho = FileSystemListItem.ToFileSystemItem(this._ShellListView.LVHandle, tcMain.StartUpLocation.ToShellParsingName());

                if (tcMain.Items.OfType <Wpf.Controls.TabItem>().Any())
                {
                    NavigationController(sho);
                }
                else
                {
                    var tab = tcMain.NewTab(sho, true);
                    this.SelectTab(tab);
                }
            }
            if (_IsrestoreTabs)
            {
                isOnLoad = true;
                int i = 0;
                foreach (string str in InitialTabs)
                {
                    try {
                        i++;
                        if (str.ToLowerInvariant() == "::{22877a6d-37a1-461a-91b0-dbda5aaebc99}")
                        {
                            continue;
                        }
                        var tab = tcMain.NewTab(FileSystemListItem.ToFileSystemItem(this._ShellListView.LVHandle, str.ToShellParsingName()), i == InitialTabs.Length);
                        if (i == InitialTabs.Length)
                        {
                            this.SelectTab(tab);
                            bcbc.SetPathWithoutNavigate(str);
                        }
                    } catch {
                        //AddToLog(String.Format("Unable to load {0} into a tab!", str));
                        MessageBox.Show("BetterExplorer is unable to load one of the tabs from your last session. Your other tabs are perfectly okay though! \r\n\r\nThis location was unable to be loaded: " + str, "Unable to Create New Tab", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }

                if (tcMain.Items.Count == 0)
                {
                    tcMain.NewTab();

                    string idk = tcMain.StartUpLocation.StartsWith("::") ? tcMain.StartUpLocation.ToShellParsingName() : tcMain.StartUpLocation.Replace("\"", "");
                    NavigationController(FileSystemListItem.ToFileSystemItem(this._ShellListView.LVHandle, idk));
                    (tcMain.SelectedItem as Wpf.Controls.TabItem).ShellObject = _ShellListView.CurrentFolder;
                    (tcMain.SelectedItem as Wpf.Controls.TabItem).ToolTip     = _ShellListView.CurrentFolder.ParsingName.Replace("%20", " ").Replace("%3A", ":").Replace("%5C", @"\");
                }

                isOnLoad = false;
            }
        }
All Usage Examples Of BetterExplorer.Utilities::GetRegistryValue