Exemplo n.º 1
0
        private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            // - called when the first setting is requested and caches all values
            // - base class will handle bad input so just logic fixes needed

            if (!UpgradedSettings)
            {
                Upgrade();
                UpgradedSettings = true;
            }

            if (!MigratedSettings)
            {
                MigratedSettings = GetSettingsFromRegistry();
            }

            if (DefaultImportPath == String.Empty && !Directory.Exists(DefaultImportPath))
            {
                DefaultImportPath = String.Empty;
            }

            if (PaintProgramPath == String.Empty && !File.Exists(PaintProgramPath))
            {
                PaintProgramPath = String.Empty;
            }

            if (ColorTheme == String.Empty)
            {
                ColorTheme = ColorThemeStub.DEFAULT.Name;
            }
        }
Exemplo n.º 2
0
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            ServerMode      mode = (ServerMode)this["Mode"];
            ServerArguments args = new ServerArguments();

            //get fix mode
            bool fixMode = ((mode & ServerMode.Fix) != 0) || args.IsFix;

            //assert fix mode
            if (fixMode)
            {
                mode |= ServerMode.Fix;
            }

            //adjust mode
            if (fixMode)
            {
                //switch off network and wcf
                mode |= ServerMode.NoNetwork;
                mode |= ServerMode.NoWCF;

                //switch on database
                if ((mode & ServerMode.NoDatabase) != 0)
                {
                    mode ^= ServerMode.NoDatabase;
                }

                //update mode
                this["Mode"] = mode;
            }

            base.OnSettingsLoaded(sender, e);
        }
Exemplo n.º 3
0
 protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     if (string.IsNullOrEmpty(FormText))
     {
         FormText = "override OnSettingsLoaded";
     }
 }
Exemplo n.º 4
0
        private void settingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
        {
            string[] colorInts = ColorsString.Split(',');
            for (int i = 0; i < colorInts.Length; i++)
            {
                if (i < colorInts.Length / 2)
                {
                    _minColors[i] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
                else
                {
                    _maxColors[i - _minColors.Length] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
            }

            for (int i = 0; i < colorInts.Length; i++)
            {
                if (i < colorInts.Length / 2)
                {
                    _uploadedMinColors[i] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
                else
                {
                    _uploadedMaxColors[i - _uploadedMinColors.Length] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
            }
        }
Exemplo n.º 5
0
 private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     if (HotKeys == null)
     {
         HotKeys = new BindingList <Hotkey>();
     }
 }
Exemplo n.º 6
0
 protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     // coerse the value of FontSize
     if (FontSize < 12 || FontSize > 18)
     {
         FontSize = 12;
     }
 }
Exemplo n.º 7
0
 void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     if (IsFirstRun)
     {
         Upgrade();
         IsFirstRun = false;
     }
 }
Exemplo n.º 8
0
 protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     if (Default.UpgradeRequired)
     {
         Default.Upgrade();
         Default.UpgradeRequired = false;
         Default.Save();
     }
 }
Exemplo n.º 9
0
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            base.OnSettingsLoaded(sender, e);

            if (string.IsNullOrEmpty(OutputLocation))
            {
                OutputLocation = Path.GetFullPath(string.Concat(AppDomain.CurrentDomain.BaseDirectory, "\\Output"));
            }
        }
 private void OnSettingsLoadedEvent(object sender, SettingsLoadedEventArgs settingsLoadedEventArgs)
 {
     if (SomeNumParam >= 100)
     {
         const string msg = "SomeNumParam is invalid! Value must be between 0 and 100";
         Console.WriteLine(msg);
         throw new ArgumentOutOfRangeException(msg);
     }
 }
Exemplo n.º 11
0
        /// <summary>
        /// Raises the SettingsLoaded event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A SettingsLoadedEventArgs that contains the event data.</param>
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            // This will attach the settings to the current process of the comain and watch for the main process to exit.  The general idea is to automatically save
            // the settings when the application that called the settings has terminated.  It should be noted that the typical 'Application.OnExit' can't be used
            // because settings may be accessed in application constructors.
            AppDomain.CurrentDomain.ProcessExit += this.OnProcessExit;

            // Allow the base class to handle the reset of the event.
            base.OnSettingsLoaded(sender, e);
        }
Exemplo n.º 12
0
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            Log.InfoFormat("Settings Loaded");
            base.OnSettingsLoaded(sender, e);

            if (e.Provider is PortableSettingsProvider provider)
            {
                SettingsFilePath = provider.SettingsFilePath;
            }
        }
 private void Default_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     if (Settings.Default.SendToList != null)
     {
         foreach (string serializedItem in Settings.Default.SendToList)
         {
             var settings = _itemFactory.LoadFromSettings(serializedItem);
             Add(settings);
         }
     }
 }
        OnSettingsLoaded
        (
            Object sender,
            SettingsLoadedEventArgs e
        )
        {
            AssertValid();

            Debug.WriteLine("NodeXLApplicationSettingsBase: OnSettingsLoaded()");
            base.OnSettingsLoaded(sender, e);
        }
Exemplo n.º 15
0
        /// <summary>
        /// 設定が読み込まれた後に通知します。
        /// </summary>
        protected virtual void NotifySettingsLoaded(SettingsLoadedEventArgs e)
        {
            var handler = SettingsLoaded;

            if (handler != null)
            {
                Util.SafeCall(() =>
                              handler(this, e));
            }

            OnSettingsLoaded(this, e);
        }
Exemplo n.º 16
0
        private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            if (Settings.Default.UpgradeRequired)
            {
                LOG.Debug("Upgrading settings");
                Settings.Default.Upgrade();
                Settings.Default.UpgradeRequired = false;
            }

            if (Settings.Default.KeyboardShortcutsString == null)
            {
                Settings.Default.KeyboardShortcutsString = "";
            }

            Settings.Default.Save();
        }
Exemplo n.º 17
0
 private void Setttings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     RefreshNetworkList();
     if (settings.AutostartSimConnect)
     {
         buttonSimConnect_Click(sender, new EventArgs());
     }
     if (settings.AutostartForeFlight)
     {
         buttonForeflight_Click(sender, new EventArgs());
     }
     if (!String.IsNullOrWhiteSpace(settings?.ForeFlightLastIPv4BroadcastIp))
     {
         loadedNetworkAddress = IPAddress.Parse(settings.ForeFlightLastIPv4BroadcastIp);
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// Raises the System.Configuration.ApplicationSettingsBase.SettingsLoaded event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A System.Configuration.SettingsLoadedEventArgs that contains the event data.</param>
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            base.OnSettingsLoaded(sender, e);

            Settings settings = Settings.Default;

            if (settings.UpdateRequired)
            {
                settings.Upgrade();
                settings.UpdateRequired = false;
                if (String.IsNullOrWhiteSpace(settings.UDN))
                {
                    settings.UDN = Guid.NewGuid().ToString();
                }
                if (settings.Entries == null)
                {
                    var modeService = Application.RunningMode == RunningMode.Service;
                    settings.Entries = new EntryCollection();
                    settings.Entries.Add(new Folder()
                    {
                        Label     = Resources.Music,
                        Path      = Environment.GetFolderPath(modeService ? Environment.SpecialFolder.CommonMusic : Environment.SpecialFolder.MyMusic),
                        MediaKind = MediaKind.Audio
                    });
                    settings.Entries.Add(new Folder()
                    {
                        Label     = Resources.Pictures,
                        Path      = Environment.GetFolderPath(modeService ? Environment.SpecialFolder.CommonPictures : Environment.SpecialFolder.MyPictures),
                        MediaKind = MediaKind.Image
                    });
                    settings.Entries.Add(new Folder()
                    {
                        Label     = Resources.Videos,
                        Path      = Environment.GetFolderPath(modeService ? Environment.SpecialFolder.CommonVideos : Environment.SpecialFolder.MyVideos),
                        MediaKind = MediaKind.Video
                    });
                    settings.Entries.Add(new Podcast()
                    {
                        Label = Resources.FreeMiPodcasts,
                        Path  = "http://freemiupnp.fr/download/podcasts.xml"
                    });
                }

                settings.Save();
            }
        }
Exemplo n.º 19
0
        private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            if (CSharpImportList == null)
            {
                CSharpImportList = new StringCollection();
            }
            if (JavaImportList == null)
            {
                JavaImportList = new StringCollection();
            }

            ImportList.Clear();
            ImportList.Add(CSharp.CSharpLanguage.Instance, CSharpImportList);
            ImportList.Add(Java.JavaLanguage.Instance, JavaImportList);

            if (string.IsNullOrEmpty(DestinationPath))
            {
                string myDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                DestinationPath = Path.Combine(myDocuments, "NClass Generated Projects");
            }
        }
Exemplo n.º 20
0
        private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            if (Settings.Default.CanUpgrade)
            {
                Settings.Default.Upgrade();
            }

            CanUpgrade = false;

            // Check if the default folder is null or empty
            // and set it to the My Videos folder by default.

            if (String.IsNullOrWhiteSpace(DefaultFolder))
            {
                DefaultFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos);
            }

            if (Settings.Default.LastAudioDevices == null)
            {
                Settings.Default.LastAudioDevices = new StringCollection();
            }
        }
Exemplo n.º 21
0
 private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
 }
Exemplo n.º 22
0
        private void OnSettingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
        {
            #region Version

            if (this.PropertyValues["AddInAutomaticallyCheckNewVersion"].PropertyValue == null)
            {
                this.AddInAutomaticallyCheckNewVersion = ResultPresenterConfiguration.DefaultAddInAutomaticallyCheckNewVersion;
            }

            #endregion

            #region Global

            if (this.PropertyValues["ColdCacheColor"].PropertyValue == null)
            {
                this.ColdCacheColor = ResultPresenterConfiguration.DefaultColdCacheColor;
            }
            if (this.PropertyValues["ColdCacheGraphBarColor1"].PropertyValue == null)
            {
                this.ColdCacheGraphBarColor1 = ResultPresenterConfiguration.DefaultColdCacheGraphBarColor1;
            }
            if (this.PropertyValues["ColdCacheGraphBarColor2"].PropertyValue == null)
            {
                this.ColdCacheGraphBarColor2 = ResultPresenterConfiguration.DefaultColdCacheGraphBarColor2;
            }

            if (this.PropertyValues["WarmCacheColor"].PropertyValue == null)
            {
                this.WarmCacheColor = ResultPresenterConfiguration.DefaultWarmCacheColor;
            }
            if (this.PropertyValues["WarmCacheGraphBarColor1"].PropertyValue == null)
            {
                this.WarmCacheGraphBarColor1 = ResultPresenterConfiguration.DefaultWarmCacheGraphBarColor1;
            }
            if (this.PropertyValues["WarmCacheGraphBarColor2"].PropertyValue == null)
            {
                this.WarmCacheGraphBarColor2 = ResultPresenterConfiguration.DefaultWarmCacheGraphBarColor2;
            }

            if (this.PropertyValues["HighlightColor"].PropertyValue == null)
            {
                this.HighlightColor = ResultPresenterConfiguration.DefaultHighlightColor;
            }

            if (this.PropertyValues["MaxRowsReturned"].PropertyValue == null)
            {
                this.MaxRowsReturned = ResultPresenterConfiguration.DefaultMaxRowsReturned;
            }

            if (this.PropertyValues["DebugEnabled"].PropertyValue == null)
            {
                this.DebugEnabled = ResultPresenterConfiguration.DefaultDebugEnabled;
            }

            if (this.PropertyValues["ExecutionProgressActivitiesEnabled"].PropertyValue == null)
            {
                this.ExecutionProgressActivitiesEnabled = ResultPresenterConfiguration.DefaultExecutionProgressActivitiesEnabled;
            }
            #endregion

            #region Timeline Colors

            if (this.PropertyValues["ProfilerEventsColor"].PropertyValue == null)
            {
                this.ProfilerEventsColor = ResultPresenterConfiguration.DefaultProfilerEventsColor;
            }

            if (this.PropertyValues["PerformanceCountersColor"].PropertyValue == null)
            {
                this.PerformanceCountersColor = ResultPresenterConfiguration.DefaultPerformanceCountersColor;
            }

            if (this.PropertyValues["CachesColor"].PropertyValue == null)
            {
                this.CachesColor = ResultPresenterConfiguration.DefaultCachesColor;
            }

            if (this.PropertyValues["AggregationsColor"].PropertyValue == null)
            {
                this.AggregationsColor = ResultPresenterConfiguration.DefaultAggregationsColor;
            }

            if (this.PropertyValues["PartitionsColor"].PropertyValue == null)
            {
                this.PartitionsColor = ResultPresenterConfiguration.DefaultPartitionsColor;
            }

            if (this.PropertyValues["CachedDimensionsColor"].PropertyValue == null)
            {
                this.CachedDimensionsColor = ResultPresenterConfiguration.DefaultCachedDimensionsColor;
            }

            if (this.PropertyValues["NonCachedDimensionsColor"].PropertyValue == null)
            {
                this.NonCachedDimensionsColor = ResultPresenterConfiguration.DefaultNonCachedDimensionsColor;
            }

            if (this.PropertyValues["RegularMeasuresColor"].PropertyValue == null)
            {
                this.RegularMeasuresColor = ResultPresenterConfiguration.DefaultRegularMeasuresColor;
            }

            if (this.PropertyValues["CalculatedMeasuresColor"].PropertyValue == null)
            {
                this.CalculatedMeasuresColor = ResultPresenterConfiguration.DefaultCalculatedMeasuresColor;
            }

            if (this.PropertyValues["NonEmptyActivitiesColor"].PropertyValue == null)
            {
                this.NonEmptyActivitiesColor = ResultPresenterConfiguration.DefaultNonEmptyActivitiesColor;
            }

            if (this.PropertyValues["SerializationActivitiesColor"].PropertyValue == null)
            {
                this.SerializationActivitiesColor = ResultPresenterConfiguration.DefaultSerializationActivitiesColor;
            }

            #endregion

            #region Timeline others

            if (this.PropertyValues["TimelineEventsNumberThreshold"].PropertyValue == null)
            {
                this.TimelineEventsNumberThreshold = ResultPresenterConfiguration.DefaultTimelineEventsNumberThreshold;
            }

            if (this.PropertyValues["TimelineCachesVisible"].PropertyValue == null)
            {
                this.TimelineCachesVisible = ResultPresenterConfiguration.TimelineCachesVisible;
            }

            if (this.PropertyValues["TimelineAggregationsVisible"].PropertyValue == null)
            {
                this.TimelineAggregationsVisible = ResultPresenterConfiguration.TimelineAggregationsVisible;
            }

            if (this.PropertyValues["TimelinePartitionsVisible"].PropertyValue == null)
            {
                this.TimelinePartitionsVisible = ResultPresenterConfiguration.TimelinePartitionsVisible;
            }

            if (this.PropertyValues["TimelineDimensionsVisible"].PropertyValue == null)
            {
                this.TimelineDimensionsVisible = ResultPresenterConfiguration.TimelineDimensionsVisible;
            }

            if (this.PropertyValues["TimelineMeasuresVisible"].PropertyValue == null)
            {
                this.TimelineMeasuresVisible = ResultPresenterConfiguration.TimelineMeasuresVisible;
            }

            if (this.PropertyValues["TimelineNonEmptyActivitiesVisible"].PropertyValue == null)
            {
                this.TimelineNonEmptyActivitiesVisible = ResultPresenterConfiguration.TimelineNonEmptyActivitiesVisible;
            }

            if (this.PropertyValues["TimelineSerializationActivitiesVisible"].PropertyValue == null)
            {
                this.TimelineSerializationActivitiesVisible = ResultPresenterConfiguration.TimelineSerializationActivitiesVisible;
            }


            #endregion
        }
Exemplo n.º 23
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// settingsloadedeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this SettingsLoadedEventHandler settingsloadedeventhandler, Object sender, SettingsLoadedEventArgs e, AsyncCallback callback)
        {
            if (settingsloadedeventhandler == null)
            {
                throw new ArgumentNullException("settingsloadedeventhandler");
            }

            return(settingsloadedeventhandler.BeginInvoke(sender, e, callback, null));
        }
 private void SettingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
 {
     log.Warn("Settings loaded");
 }
Exemplo n.º 25
0
 private void SettingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
 {
     //Query.DateTimeFormat = this.DateTimeFormat;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Les paramètres ont été chargés
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SettingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
 {
 }
Exemplo n.º 27
0
 private void Settings_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     this.snapIn.IsModified = false;
 }
Exemplo n.º 28
0
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            _cachedToolModalityBehavior = null;

            base.OnSettingsLoaded(sender, e);
        }
Exemplo n.º 29
0
 /// <summary>
 /// Handles the SettingsLoaded event of the <see cref="ProjectManager"/> object.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="SettingsLoadedEventArgs"/> instance containing the event data.</param>
 private void SettingsLoaded(object sender, SettingsLoadedEventArgs e)
 {
     ExpandNodes(e.Settings.ExpandedNodes);
 }
Exemplo n.º 30
0
        private void Default_SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            // Remove placeholder from user settings - Initialization purpose only

            Settings.Default.RecentAnalysisJobs.Remove("placeholder");
        }
Exemplo n.º 31
0
        /// <summary>
        /// Handles the SettingsLoaded event of the <see cref="ProjectManager"/> class.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="SettingsLoadedEventArgs"/> instance containing the event data.</param>
        private void SettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            if (e.Settings.OpenFiles == null) return;

            foreach (var str in e.Settings.OpenFiles)
            {
                SelectMap(GetMapID(str));
            }

            if (!String.IsNullOrEmpty(e.Settings.SelectedFile))
                SelectMap(GetMapID(e.Settings.SelectedFile));
        }
Exemplo n.º 32
0
        protected override void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
        {
            base.OnSettingsLoaded(sender, e);

            Ensure();
        }