예제 #1
0
 public GlobalSetting(MainWindow.RequestConfigList requestConfigList, ArkDesktop.CoreKit.ConfigManager manager)
 {
     InitializeComponent();
     this.requestConfigList = requestConfigList;
     this.manager           = manager;
     if (File.Exists("AutoRun.txt"))
     {
         AutoRunListTextBox.Text = "";
         using (var fs = File.OpenRead("AutoRun.txt"))
             using (var sr = new StreamReader(fs))
                 while (sr.EndOfStream == false)
                 {
                     try
                     {
                         string s = sr.ReadLine();
                         var    g = Guid.Parse(s);
                         AutoRunListTextBox.Text += g.ToString().Substring(24) + ' ';
                         var f = from i in manager.Configs where i.ConfigGuid == g select i.ConfigName;
                         if (f.Any())
                         {
                             AutoRunListTextBox.Text += f.First();
                         }
                         else
                         {
                             AutoRunListTextBox.Text += "(未找到)";
                         }
                         AutoRunListTextBox.Text += '\n';
                     }
                     catch (Exception) { }
                 }
     }
 }
예제 #2
0
        public GlobalSetting(MainWindow.RequestConfigList requestConfigList, ArkDesktop.CoreKit.ConfigManager manager)
        {
            userClick = false;
            InitializeComponent();
            this.requestConfigList = requestConfigList;
            this.manager           = manager;
            if (File.Exists("AutoRun.txt"))
            {
                AutoRunListTextBox.Text = "";
                using (var fs = File.OpenRead("AutoRun.txt"))
                    using (var sr = new StreamReader(fs))
                        while (sr.EndOfStream == false)
                        {
                            try
                            {
                                string s = sr.ReadLine();
                                var    g = Guid.Parse(s);
                                AutoRunListTextBox.Text += g.ToString().Substring(24) + ' ';
                                var f = from i in manager.Configs where i.ConfigGuid == g select i.ConfigName;
                                if (f.Any())
                                {
                                    AutoRunListTextBox.Text += f.First();
                                }
                                else
                                {
                                    AutoRunListTextBox.Text += "(未找到)";
                                }
                                AutoRunListTextBox.Text += '\n';
                            }
                            catch (Exception) { }
                        }
            }
            var key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", false);

            AutoRunCheckbox.IsChecked    = (key.GetValue("ArkDesktop") as string) == GetType().Assembly.Location + " -autorun";
            AutoUpdateCheckBox.IsChecked = File.Exists("AutoUpdate.flag");
            userClick = true;
        }