public override object this[string propertyName]
 {
     get
     {
         if (base.IsSynchronized)
         {
             lock (this)
             {
                 return(this.GetPropertyValue(propertyName));
             }
         }
         return(this.GetPropertyValue(propertyName));
     }
     set
     {
         SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, base.GetType().FullName, this.SettingsKey, value, false);
         this.OnSettingChanging(this, e);
         if (!e.Cancel)
         {
             base[propertyName] = value;
             PropertyChangedEventArgs args2 = new PropertyChangedEventArgs(propertyName);
             this.OnPropertyChanged(this, args2);
         }
     }
 }
Exemplo n.º 2
0
		protected override void OnSettingChanging(object sender, SettingChangingEventArgs e)
		{
			if (e.SettingName == "ToolModalityBehavior")
				_cachedToolModalityBehavior = null;

			base.OnSettingChanging(sender, e);
		}
Exemplo n.º 3
0
 // Update the application settings and all related objects
 private void UpdateAppSettings(System.Configuration.SettingChangingEventArgs e)
 {
     if ((e != null) && (e.SettingName == "RefreshTime"))
     {
         ChangeRefreshTimer(Convert.ToInt16(e.NewValue));
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Overriden from SettingsBase to support validation event.
        /// </summary>
        public override object this[string propertyName]
        {
            get
            {
                if (IsSynchronized)
                {
                    lock (this)
                    {
                        return(GetPropertyValue(propertyName));
                    }
                }
                else
                {
                    return(GetPropertyValue(propertyName));
                }
            }
            set
            {
                SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, this.GetType().FullName, SettingsKey, value, false);
                OnSettingChanging(this, e);

                if (!e.Cancel)
                {
                    base[propertyName] = value;
                    //CONSIDER: Should we call this even if canceled? I guess not.
                    PropertyChangedEventArgs pe = new PropertyChangedEventArgs(propertyName);
                    OnPropertyChanged(this, pe);
                }
            }
        }
 protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e)
 {
     if (this._onSettingChanging != null)
     {
         this._onSettingChanging(this, e);
     }
 }
Exemplo n.º 6
0
        // Big important stuff here
        void SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e)
        {
            // I hate this line here so much but I have to replace the entire property system later bc it turns out
            // the built in one is dumb with certain things so this gets to stay in the meantime since it works
            Game game = games.Where(i => i.name == e.SettingName.Split('_')[0]).FirstOrDefault();

            switch (e.SettingName)
            {
            case "JK_Path":
                txt_settings_jkPath.Text = (string)e.NewValue;
                game.control.UpdateIcon((string)e.NewValue);
                break;

            case "MotS_Path":
                txt_settings_motsPath.Text = (string)e.NewValue;
                game.control.UpdateIcon((string)e.NewValue);
                break;

            case "JK_Mods_Path":
                txt_settings_jkMods.Text = (string)e.NewValue;
                game.control.PopulateModList((string)e.NewValue);
                break;

            case "MotS_Mods_Path":
                txt_settings_motsMods.Text = (string)e.NewValue;
                game.control.PopulateModList((string)e.NewValue);
                break;
            }
        }
 protected virtual void OnSettingChanging(object sender,
                                          SettingChangingEventArgs e)
 {
     if (SettingChanging != null)
     {
         SettingChanging(sender, e);
     }
 }
        public override object this [string propertyName]
        {
            get
            {
                if (IsSynchronized)
                {
                    lock (this)
                    {
                        return(GetPropertyValue(propertyName));
                    }
                }

                return(GetPropertyValue(propertyName));
            }
            set
            {
                SettingsProperty prop = Properties [propertyName];

                if (prop == null)
                {
                    throw new SettingsPropertyNotFoundException(propertyName);
                }

                if (prop.IsReadOnly)
                {
                    throw new SettingsPropertyIsReadOnlyException(propertyName);
                }

                /* XXX check the type of the property vs the type of @value */
                if (value != null &&
                    !prop.PropertyType.IsAssignableFrom(value.GetType()))
                {
                    throw new SettingsPropertyWrongTypeException(propertyName);
                }

                if (PropertyValues [propertyName] == null)
                {
                    CacheValuesByProvider(prop.Provider);
                }

                SettingChangingEventArgs changing_args = new SettingChangingEventArgs(propertyName,
                                                                                      GetType().FullName,
                                                                                      settingsKey,
                                                                                      value,
                                                                                      false);

                OnSettingChanging(this, changing_args);

                if (changing_args.Cancel == false)
                {
                    /* actually set the value */
                    PropertyValues [propertyName].PropertyValue = value;

                    /* then emit PropertyChanged */
                    OnPropertyChanged(this, new PropertyChangedEventArgs(propertyName));
                }
            }
        }
		protected override void OnSettingChanging(object sender, SettingChangingEventArgs e)
		{
			base.OnSettingChanging(sender, e);

			if (e.SettingName == "Externals")
			{
				EventsHelper.Fire(_externalsChanged, this, EventArgs.Empty);
			}
		}
Exemplo n.º 10
0
        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
        {
            // 如果Host属性修改了,重新定义一个URI
            if (e.SettingName == "Host")
            {
                var a = NetGlobalInfo.RestTemplate;
                a.BaseAddress = new Uri(e.NewValue.ToString());
            }

            // 在此处添加用于处理 SettingChangingEvent 事件的代码。
        }
Exemplo n.º 11
0
        static void Default_SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e)
        {
            Console.WriteLine("Changing {0} to {1}", e.SettingName, e.NewValue);
            Console.WriteLine("OK?");

            ConsoleKeyInfo confirmation = Console.ReadKey();

            if (confirmation.Key != ConsoleKey.Y)
            {
                e.Cancel = true;
            }
            Console.WriteLine();
        }
Exemplo n.º 12
0
        // Update the application settings and all related objects
        private void UpdateAppSettings(System.Configuration.SettingChangingEventArgs e)
        {
            foreach (BaseProcess p in _BIProcesses)
            {
                p.AppSettings = appSettings;
            }
            // Also set app setting s for Infa development process, which is not in standard BI processes array
            _Infa86DevStats.AppSettings = appSettings;

            if ((e != null) && (e.SettingName == "RefreshRateMin"))
            {
                ChangeRefreshTimer(Convert.ToInt16(e.NewValue));
            }
        }
Exemplo n.º 13
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     if (e.SettingName == "cn2")
     {
         var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
         var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");
         if (connectionStringsSection != null)
         {
             connectionStringsSection.ConnectionStrings["CapaPresentacion.Properties.Settings.cn"].ConnectionString = cn2;
             config.Save();
             ConfigurationManager.RefreshSection("connectionStrings");
         }
     }
 }
Exemplo n.º 14
0
        void _AppSettings_SettingChanging(object sender, SettingChangingEventArgs e)
        {
            if (!_Saving)
            {
                try
                {
                    SettingsProperty value = (SettingsProperty)_Settings[e.SettingName];
                    Object sval = _AppSettings[e.SettingName];

                    if (value != null && sval != null)
                    {
                        if (!sval.Equals(e.NewValue))
                        {
                            try
                            {
                                if (!_ChangedSettings.ContainsKey(e.SettingName))
                                {
                                    _ChangedSettings.Add(e.SettingName, value.DefaultValue);
                                }
                            }
                            catch
                            {
                                _ChangedSettings.Add(e.SettingName, value.DefaultValue);
                            }
                        }
                        else
                        {
                            try
                            {
                                _ChangedSettings.Remove(e.SettingName);
                            }
                            catch
                            { }
                        }

                        if (!_ApplyAlwaysEnabled)
                        {
                            if (_ChangedSettings.Count > 0)
                            {
                                ApplyBtn.Enabled = true;
                            }
                            else
                            {
                                ApplyBtn.Enabled = false;
                            }
                        }

                        value.DefaultValue = e.NewValue;
                        e.Cancel = true;
                    }
                }
                catch
                { }
            }
        }
Exemplo n.º 15
0
        private void RefreshInterval_SettingChanging(object sender, SettingChangingEventArgs e)
        {
            if (e.SettingName == "PlaylistRefreshInterval")
            {
                var refreshInterval = (TimeSpan) e.NewValue;

                _refreshInterval = refreshInterval;

                _refreshIntervalTimer.TickInterval = refreshInterval;
                Reset();
            }
        }
Exemplo n.º 16
0
 void appSettings_SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     UpdateAppSettings(e);
 }
 /// <devdoc>
 ///     Fires the SettingChanging event.
 /// </devdoc>
 protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e) {
     if(_onSettingChanging != null) {
         _onSettingChanging(this, e); 
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// Wird aufgerufen, wenn sich ein Konfigurationswert verändert hat.
        /// </summary>
        /// <param name="sender">Wird ignoriert.</param>
        /// <param name="e">Beschreibt die Änderung.</param>
        private void SettingChanging( object sender, SettingChangingEventArgs e )
        {
            // Load
            object oldValue = Properties.Settings.Default[e.SettingName], newValue = e.NewValue;
            string oldString = oldValue as string, newString = newValue as string;

            // Special reset
            if (oldString != null)
                if (oldString.Length < 1)
                    oldValue = null;
            if (newString != null)
                if (newString.Length < 1)
                    newValue = null;

            // None set
            if (oldValue == null)
                if (newValue == null)
                    return;

            // Check for change
            if (Equals( oldValue, e.NewValue ))
                return;

            // Check for quality of change
            switch (e.SettingName)
            {
                // Require restart
                case "DVBNETViewer_FullServer_VCR30Server": m_Restart = true; break;
                case "BroadcastPort": m_Restart = true; break;
                case "BroadcastIP": m_Restart = true; break;
                case "UseRemote": m_Restart = true; break;
                case "UseRadio": m_Restart = true; break;
                case "FreeTV": m_Restart = true; break;
                case "UseTV": m_Restart = true; break;
                case "PayTV": m_Restart = true; break;
                // Require rebuild only
                case "UseCyberlinkCodec": m_Rebuid = true; break;
                case "MPEG2Decoder": m_Rebuid = true; break;
                case "H264Decoder": m_Rebuid = true; break;
                case "MP2Decoder": m_Rebuid = true; break;
                case "AC3Decoder": m_Rebuid = true; break;
                case "AVDelay": m_Rebuid = true; break;
            }
        }
Exemplo n.º 19
0
 private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e)
 {
 }
Exemplo n.º 20
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     // SettingChangingEvent イベントを処理するコードをここに追加してください。
 }
 public override object this[string propertyName]
 {
     get
     {
         if (base.IsSynchronized)
         {
             lock (this)
             {
                 return this.GetPropertyValue(propertyName);
             }
         }
         return this.GetPropertyValue(propertyName);
     }
     set
     {
         SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, base.GetType().FullName, this.SettingsKey, value, false);
         this.OnSettingChanging(this, e);
         if (!e.Cancel)
         {
             base[propertyName] = value;
             PropertyChangedEventArgs args2 = new PropertyChangedEventArgs(propertyName);
             this.OnPropertyChanged(this, args2);
         }
     }
 }
Exemplo n.º 22
0
 private void Settings_SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     // this.Save();
 }
Exemplo n.º 23
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
 }
Exemplo n.º 24
0
        /// <summary>
        /// Handles the SettingChanging event of the <see cref="Application"/>.
        /// </summary>
        private void DefaultSettingChanging(object sender, SettingChangingEventArgs e)
        {
            if (!IsHandleCreated)
              {
            return;
              }

              InitializeScintilaCtrl();
        }
Exemplo n.º 25
0
 /// <summary>
 /// </summary>
 /// <param name="sender"> </param>
 /// <param name="e"> </param>
 private static void SettingsSettingChanging(object sender, SettingChangingEventArgs e)
 {
     Logging.Log(Logger, String.Format("SettingChanging : [{0},{1}]", e.SettingKey, e.NewValue));
 }
 /// <devdoc>
 ///     Overriden from SettingsBase to support validation event.
 /// </devdoc>
 public override object this[string propertyName] {
     get {
         if (IsSynchronized) {
             lock (this) {
                 return GetPropertyValue(propertyName);
             }
         }
         else {
             return GetPropertyValue(propertyName);
         }
         
     }
     set {
         SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, this.GetType().FullName, SettingsKey, value, false);
         OnSettingChanging(this, e);
 
         if (!e.Cancel) {
             base[propertyName] = value;
             //
             PropertyChangedEventArgs pe = new PropertyChangedEventArgs(propertyName);
             OnPropertyChanged(this, pe);
         }
     }
 }
Exemplo n.º 27
0
 /// <summary>
 /// Fires the SettingChanging event.
 /// </summary>
 protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e)
 {
     _onSettingChanging?.Invoke(this, e);
 }
Exemplo n.º 28
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     // Add code to handle the SettingChangingEvent event here.
     Log.DebugFormat("SettingChanging: name={0}, oldVal={1}, newVal={2}", e.SettingName, this[e.SettingName], e.NewValue);
 }
Exemplo n.º 29
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     // Fügen Sie hier Code zum Behandeln des SettingChangingEvent-Ereignisses hinzu.
 }
 protected virtual new void OnSettingChanging(Object sender, SettingChangingEventArgs e)
 {
 }
Exemplo n.º 31
0
 protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 32
0
 private void Settings_SettingChanging(object sender, SettingChangingEventArgs e)
 {
     // this.Save();
 }
Exemplo n.º 33
0
 private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
 {
     // Add code to handle the SettingChangingEvent event here.
 }
Exemplo n.º 34
0
 private void Default_SettingChanging(object sender, SettingChangingEventArgs e)
 {
     if (!DesignMode)
         LoadSettings();
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// settingchangingeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this SettingChangingEventHandler settingchangingeventhandler, Object sender, SettingChangingEventArgs e, AsyncCallback callback)
        {
            if(settingchangingeventhandler == null) throw new ArgumentNullException("settingchangingeventhandler");

            return settingchangingeventhandler.BeginInvoke(sender, e, callback, null);
        }
 //
 // PROTECTED METHODS
 //
 protected override void OnSettingChanging(object sender, SettingChangingEventArgs e) {
     base.OnSettingChanging(sender, e);
     if (e.SettingName == "PrinterName") {
         this["PrinterPaperSize"] = string.Empty;
     }
 }
Exemplo n.º 37
0
 private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e)
 {
     // Fügen Sie hier Code zum Behandeln des SettingChangingEvent-Ereignisses hinzu.
 }
Exemplo n.º 38
0
		protected virtual void OnSettingChanging (object sender, 
							  SettingChangingEventArgs e)
		{
			if (SettingChanging != null)
				SettingChanging (sender, e);
		}
 protected virtual new void OnSettingChanging(Object sender, SettingChangingEventArgs e)
 {
 }
Exemplo n.º 40
0
 private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e)
 {
     SettingChanged = e.SettingName;
 }
Exemplo n.º 41
0
 private void SettingChangingEventHandler(object sender, SettingChangingEventArgs e)
 {
     // Add code to handle the SettingChangingEvent event here.
 }
Exemplo n.º 42
0
 private static void Config_SettingChanging(object sender, SettingChangingEventArgs e)
 {
     IsDirtyDictionary[sender].IsReset = false;
     IsDirtyDictionary[sender].IsDirty = true;
 }
Exemplo n.º 43
0
		public override object this [ string propertyName ] {
			get {
				if (IsSynchronized) {
					lock (this) {
						return GetPropertyValue (propertyName);
					}
				}

				return GetPropertyValue (propertyName);
			}
			set {
				SettingsProperty prop = Properties [ propertyName ];

				if (prop == null)
					throw new SettingsPropertyNotFoundException (propertyName);

				if (prop.IsReadOnly)
					throw new SettingsPropertyIsReadOnlyException (propertyName);

				/* XXX check the type of the property vs the type of @value */
				if (value != null &&
				    !prop.PropertyType.IsAssignableFrom (value.GetType()))
					throw new SettingsPropertyWrongTypeException (propertyName);

				if (PropertyValues [ propertyName ] == null)
					CacheValuesByProvider (prop.Provider);

				SettingChangingEventArgs changing_args = new SettingChangingEventArgs (propertyName,
												       GetType().FullName,
												       settingsKey,
												       value,
												       false);

				OnSettingChanging (this, changing_args);

				if (changing_args.Cancel == false) {
					/* actually set the value */
					PropertyValues [ propertyName ].PropertyValue = value;

					/* then emit PropertyChanged */
					OnPropertyChanged (this, new PropertyChangedEventArgs (propertyName));
				}
			}
		}
Exemplo n.º 44
0
 void Default_SettingChanging(object sender, SettingChangingEventArgs e)
 {
     settingsDirty = true;
 }