示例#1
0
        private void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
#if (!DEBUG)
            string fileName = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            AppDomain.CurrentDomain.SetData("DataDirectory", fileName);
#endif
        }
示例#2
0
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (!Directory.Exists(this.ParentFolderName))
     {
         this.ParentFolderName = Directory.GetCurrentDirectory();
     }
 }
示例#3
0
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (Loaded != null)
     {
         Loaded.Invoke(Assembly.GetExecutingAssembly(), this);
     }
 }
示例#4
0
文件: Log.cs 项目: gilby125/CliverBot
        //new public void Reload()
        //{
        //    base.Reload();
        //    Log_SettingsLoaded(null, null);
        //}

        void Log_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (string.IsNullOrEmpty(PreWorkDir))
            {
                PreWorkDir = Regex.Replace(Cliver.Log.AppDir, @":.*", @":\" + PrefWorkDirName, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                if (System.Threading.Thread.CurrentThread.GetApartmentState() == System.Threading.ApartmentState.STA)
                {
                    if (!LogMessage.AskYesNo("A folder where the application will store log data is not specified. By default it will be created in the following path:\r\n" + PreWorkDir + "\r\nClick Yes if you agree, click No if you want to specify another location.", true, false))
                    {
                        System.Windows.Forms.FolderBrowserDialog f = new System.Windows.Forms.FolderBrowserDialog();
                        f.Description = "Specify a folder where the application will store log data.";
                        while (f.ShowDialog(/*MainForm.This*/) != System.Windows.Forms.DialogResult.OK)
                        {
                            ;
                        }
                        PreWorkDir = f.SelectedPath;
                    }
                }
                else
                {
                    LogMessage.Inform("A folder where the application will store log data is: " + PreWorkDir + ".\nIt can be changed in the app's settings");
                }
                Save();
            }
        }
示例#5
0
        private void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            try
            {
                // LOAD THE XML CONFIG
                XDocument doc = XDocument.Load(@"C:\Centralizador\Centralizador_config.xml");

                // SOFTLAND DB
                DicCompanies = doc.Root.Element("SoftlandDB").Descendants("Empresa").ToDictionary(d => (string)d.Attribute("id"), d => (string)d);
                DBServer     = doc.Root.Element("DataBase").Element("DBServer").Value;
                DBUser       = doc.Root.Element("DataBase").Element("DBUser").Value;
                DBPassword   = doc.Root.Element("DataBase").Element("DBPassword").Value;
                //CEN
                UserCen     = doc.Root.Element("CEN").Element("UserCen").Value;
                PasswordCeN = doc.Root.Element("CEN").Element("PasswordCen").Value;
                UrlCen      = new Uri(doc.Root.Element("CEN").Element("UrlCen").Value);

                //OUTLOOK
                User365     = doc.Root.Element("Outlook365").Element("User365").Value;
                Password365 = doc.Root.Element("Outlook365").Element("Password365").Value;
                UserCC365   = doc.Root.Element("Outlook365").Element("UserCC365").Value;
                //CERT
                SerialNumber = doc.Root.Element("CertificadoDigital").Element("SerialNumber").Value;

                //REEMPLAZOS
                DicReem = doc.Root.Element("Reemplazos").Descendants("Empresa").ToDictionary(d => (string)d.Attribute("id"), d => (int)d);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#6
0
 private void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (Default.TrayMinimize)
     {
         TrayIconManager.Enable(WindowManager.ProjectPreviewScreen, WindowManager.InProgressScreen, WindowManager.ResultsScreen);
     }
 }
示例#7
0
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (FixedDownloadPathHistory == null)
     {
         FixedDownloadPathHistory = new System.Collections.ObjectModel.ObservableCollection <string>();
     }
 }
示例#8
0
        void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            DirectorBase db = new DirectorBase(cte.lib);

            this["jcproshopConnectionString"] = db.GetConnection().ConnectionString;
            this["fvConnectionString"]        = db.GetConnection().ConnectionString;
        }
示例#9
0
        private void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
#if (DEBUG)
            this["CobranzasConnectionString"] = "Data Source=usmiavs006;Initial Catalog=Cobranzas1A;Integrated Security=True";
#else
            this["CobranzasConnectionString"] = "Data Source=usmiavs006;Initial Catalog=Cobranzas;Integrated Security=True";
#endif
        }
示例#10
0
 private void Default_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     toolStripButtonPlay.Checked         = Settings.Default.FmPlayOnEdit;
     toolStripButtonHook.Checked         = Settings.Default.FmHook;
     toolStripComboBoxVelo.SelectedIndex = Settings.Default.FmVelocity;
     toolStripComboBoxGate.SelectedIndex = Settings.Default.FmGateTime;
     toolStripComboBoxNote.SelectedIndex = Settings.Default.FmNote;
 }
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     this["CustomConnectionString"] = "Data Source=" + ExampleData.connServerName + ";"
                                      + "Initial Catalog=" + ExampleData.connDatabaseName + ";"
                                      + "Persist Security Info=false;"
                                      + "User ID=" + ExampleData.strConnUserName + ";"
                                      + "Password="******";";
 }
示例#12
0
        void Output_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            OutputFieldSeparator = EscapedOutputFieldSeparator != null?EscapedOutputFieldSeparator.Trim('\'') : "";

            OutputEmptyFieldSubstitute = EscapedOutputEmptyFieldSubstitute != null?EscapedOutputEmptyFieldSubstitute.Trim('\'') : "";

            OutputFieldSeparatorSubstitute = EscapedOutputFieldSeparatorSubstitute != null?EscapedOutputFieldSeparatorSubstitute.Trim('\'') : "";
        }
示例#13
0
        void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            DirectorBase db = new DirectorBase(cte.lib);

            this["lwconnection"] = db.GetConnection().ConnectionString;
            this["isc_alumniConnectionString"] = db.GetConnection().ConnectionString;
            this["ghConnectionString"]         = db.GetConnection().ConnectionString;
        }
示例#14
0
        void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            DirectorBase db = new DirectorBase(cte.lib);

            this["GeneralConnectionString"] = db.GetConnection().ConnectionString;
            //SqlConnection connection = (SqlConnection)db.GetConnection();

            //this["GeneralConnectionString"] = connection.ConnectionString;
        }
 protected override void OnSettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     base.OnSettingsLoaded(sender, e);
     _isLoaded = true;
     foreach (SettingsProperty property in Properties)
     {
         _tempValues[property.Name] = base[property.Name];
     }
 }
示例#16
0
 //Decrypts settings from config file
 private void SettingsLoadingEventHandler(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     Settings.Default.Instructor = Environment.UserName;
     if (!Settings.Default.Encrypted)
     {
         //Encrypts
         Settings.Default.Save();
     }
 }
示例#17
0
        }         //

        private void Sorting_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (this.saveLastDirectory)
            {
                this._lastDirectory = this.lastDirectory;
            }
            else
            {
                this._lastDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            }
        }
示例#18
0
        static void Default_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (Properties.Settings.Default.NeedsUpgrade)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.NeedsUpgrade = false;
            }


            LoggingRequested |= IsService && Properties.Settings.Default.ServiceLogging;
        }
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (this.SQLIntegratedSecurity)
     {
         this["PGTConnectionString"] = string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True", this.SQLServerName, this.DatabaseName);
     }
     else
     {
         this["PGTConnectionString"] = string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}", this.SQLServerName, this.DatabaseName, this.SQLServerUsername, this.SQLServerPassword);
     }
 }
示例#20
0
        void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (YoutubeChannels == null)
            {
                YoutubeChannels = new List <YoutubeChannelNodeState>();
            }

            if (FixedDownloadPathHistory == null)
            {
                FixedDownloadPathHistory = new ObservableCollection <string>();
            }
        }
示例#21
0
文件: Settings.cs 项目: santhus/keys
        void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            Dictionary <string, KeyfileSettings> dict = this.jsSerializer.Deserialize <Dictionary <string, KeyfileSettings> >(this.KeyfileSettingsSerialized);

            if (dict != null)
            {
                this.KeyfileSettings = new KeyfileSettingsDictionary(dict);
            }
            else
            {
                this.KeyfileSettings = new KeyfileSettingsDictionary();
            }
        }
        private void FindEmpty_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (this.saveLastDirectory)
            {
                this._lastDirectory = this.lastDirectory;
            }
            else
            {
                this.lastDirectory = string.Empty;
            }

            //Console.WriteLine( "DELETE RANGE: " + deleteRange.MinSize + " -> " + deleteRange.MaxSize );
            //Console.WriteLine( "PRESERVE RANGE: " + preserveRange.MinSize + " -> " + preserveRange.MaxSize );
        }
示例#23
0
 private void Default_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (string.IsNullOrEmpty(Settings.Default.FavPreset1TextBox))
     {
         Settings.Default.FavPreset1TextBox = GetShortName(Settings.Default.FavPreset1ComboBox);
     }
     if (string.IsNullOrEmpty(Settings.Default.FavPreset2TextBox))
     {
         Settings.Default.FavPreset2TextBox = GetShortName(Settings.Default.FavPreset2ComboBox);
     }
     if (string.IsNullOrEmpty(Settings.Default.FavPreset3TextBox))
     {
         Settings.Default.FavPreset3TextBox = GetShortName(Settings.Default.FavPreset3ComboBox);
     }
 }
示例#24
0
        void OnSettingsLoadedHandler(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            if (Settings.Default.UpgradeRequired)
            {
                Settings.Default.Upgrade();
                Settings.Default.UpgradeRequired = false;
                Settings.Default.Save();
            }

            // do not restore in minimized state
            if (Settings.Default.winState == System.Windows.WindowState.Minimized)
            {
                Settings.Default.winState = System.Windows.WindowState.Normal;
            }
        }
示例#25
0
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (UpgradeNeeded)
     {
         try
         {
             Upgrade();
         }
         catch (Exception ex)
         {
             Trace.TraceError(ex.Message);
             // Ignore upgrade errors
         }
         UpgradeNeeded = false;
         Save();
     }
 }
示例#26
0
 void _SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (!UsersFile.Contains(":"))
     {
         if (!Directory.Exists(Cliver.Log.AppCommonDataDir))
         {
             Directory.CreateDirectory(Cliver.Log.AppCommonDataDir);
         }
         string file2 = Cliver.Log.AppCommonDataDir + "\\" + Custom.Default.UsersFile;
         if (!File.Exists(file2))
         {
             File.Copy(UsersFile, file2);
         }
         UsersFile = file2;
         Save();
     }
 }
示例#27
0
        void Input_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            InputFieldSeparator = EscapedInputFieldSeparator != null?EscapedInputFieldSeparator.Trim('\'') : "";

            if (!InputFile.Contains(":"))
            {
                if (!Directory.Exists(Cliver.Log.AppCommonDataDir))
                {
                    Directory.CreateDirectory(Cliver.Log.AppCommonDataDir);
                }
                string input_file2 = Cliver.Log.AppCommonDataDir + "\\" + Input.Default.InputFile;
                if (!File.Exists(input_file2))
                {
                    File.Copy(InputFile, input_file2);
                }
                InputFile = input_file2;
                Save();
            }
        }
示例#28
0
        void Output_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
        {
            OutputFieldSeparator = EscapedOutputFieldSeparator != null?EscapedOutputFieldSeparator.Trim('\'') : ",";

            OutputEmptyFieldSubstitute = EscapedOutputEmptyFieldSubstitute != null?EscapedOutputEmptyFieldSubstitute.Trim('\'') : " ";

            OutputFieldSeparatorSubstitute = EscapedOutputFieldSeparatorSubstitute != null?EscapedOutputFieldSeparatorSubstitute.Trim('\'') : ";";

            if (string.IsNullOrWhiteSpace(OutputFileName))
            {
                if (OutputFieldSeparator == "\t")
                {
                    if (string.IsNullOrWhiteSpace(OutputFieldSeparatorSubstitute) || OutputFieldSeparatorSubstitute.Contains("\t"))
                    {
                        OutputFieldSeparatorSubstitute = " ";
                    }
                    OutputFileName = Cliver.Log.EntryAssemblyName + ".tsv";
                }
                else if (OutputFieldSeparator == ",")
                {
                    if (string.IsNullOrWhiteSpace(OutputFieldSeparatorSubstitute) || OutputFieldSeparatorSubstitute.Contains(","))
                    {
                        OutputFieldSeparatorSubstitute = ";";
                    }
                    OutputFileName = Cliver.Log.EntryAssemblyName + ".csv";
                }
                else
                {
                    if (string.IsNullOrWhiteSpace(OutputFieldSeparatorSubstitute) || OutputFieldSeparatorSubstitute.Contains(" "))
                    {
                        OutputFieldSeparatorSubstitute = " ";
                    }
                    if (string.IsNullOrEmpty(OutputFileName))
                    {
                        OutputFileName = Cliver.Log.EntryAssemblyName + ".txt";
                    }
                }
            }
        }
示例#29
0
 private static void Default_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     updatePath(Settings.Default.DataPath);
 }
示例#30
0
文件: Units.cs 项目: inigofu/bikemap
 private static void SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     UpdateFromSettings();
 }