Exemple #1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            int size = 500;

            int.TryParse(sizeTB.Text, out size);
            mySettings.LogFileSize = size;
            mySettings.LogFilePath = nameTB.Text;
            mySettings.Save();
            SetRegistryConfigLocation();
            Dispose();
        }
Exemple #2
0
        internal static void Init()
        {
            Properties.Settings mySettings = new Properties.Settings();

            string logFileDirectory;

            LogFilePath = mySettings.LogFilePath;
            //Preferences.LocalSettings.GetString("Log_path", null);

            if (LogFilePath != null)
            {
                logFileDirectory = Path.GetDirectoryName(LogFilePath);
                if (Directory.Exists(logFileDirectory) == false)
                {
                    LogFilePath = null;
                }
            }
            if (LogFilePath == null)
            {
                string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
                appPath = Path.GetDirectoryName(appPath);

                LogFilePath = Path.Combine(appPath, "P4EXP_Log.txt");

                mySettings.LogFilePath = LogFilePath;
            }
            LogFileMaxSize = mySettings.LogFileSize;

            mySettings.Save();

            string ext      = Path.GetExtension(LogFilePath);
            string baseName = Path.GetFileNameWithoutExtension(LogFilePath);

            logFileDirectory = Path.GetDirectoryName(LogFilePath);

            RolloverFilePath = string.Format("{0}_prev{1}", baseName, ext);
            RolloverFilePath = Path.Combine(logFileDirectory, RolloverFilePath);

            _intialized = true;
        }
Exemple #3
0
 private void YesBtn_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.OK;
     mySettings.Save();
     Dispose();
 }