Exemple #1
0
 void OnChanged(string optionId)
 {
     if (scope == null || service.GetOption(optionId).IsApplicableToScope(scope))
     {
         OptionChanged?.Invoke(this, new EditorOptionChangedEventArgs(optionId));
     }
     for (int i = weakChildren.Count - 1; i >= 0; i--)
     {
         var child = weakChildren[i].Target as EditorOptions;
         if (child == null)
         {
             weakChildren.RemoveAt(i);
             continue;
         }
         if (!child.dict.ContainsKey(optionId))
         {
             child.OnChanged(optionId);
         }
     }
 }
Exemple #2
0
        private void _optionChanged(object sender, PropertyChangedEventArgs pcea)
        {
            try
            {
                if (!(sender is OptionChoiceEntity))
                {
                    throw new InvalidOperationException();
                }

                OptionChoiceEntity optChoiceEntity = sender as OptionChoiceEntity;
                OptionChangeKind   kind            = OptionChangeKind.Default;

                switch (pcea.PropertyName)
                {
                case nameof(optChoiceEntity.Taken):
                    kind = OptionChangeKind.Taken;
                    break;

                case nameof(optChoiceEntity.TakenStart):
                case nameof(optChoiceEntity.TakenEnd):
                    kind = OptionChangeKind.TakenDates;
                    break;

                case nameof(optChoiceEntity.PeopleCount):
                    kind = OptionChangeKind.PeopleCount;
                    break;
                }

                OptionChoiceEntityChange optChange = new OptionChoiceEntityChange(kind, optChoiceEntity);

                OptionChanged?.Invoke(null, optChange);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
        }
 void TextViewOptionsGroup_TextViewOptionChanged(object sender, TextViewOptionChangedEventArgs e) =>
 OptionChanged?.Invoke(this, new OptionChangedEventArgs(e.ContentType, e.OptionId));
Exemple #4
0
 /// <summary>
 /// Raises the <see cref="OptionChanged"/> event.
 /// </summary>
 protected virtual void OnOptionChanged(PropertyChangedEventArgs e)
 {
     OptionChanged?.Invoke(this, e);
 }
Exemple #5
0
 private void tabSelectedIndexChanged(object sender, EventArgs e)
 {
     OptionChanged?.Invoke(tabControl1.SelectedIndex == 0);
 }
Exemple #6
0
 public static void OnOptionChanged(OptionEventArgs e)
 {
     OptionChanged?.Invoke(null, e);
 }
Exemple #7
0
 private void OnOptionChanged(OptionKey optionKey)
 => OptionChanged?.Invoke(this, optionKey);
 public void Notify()
 {
     OptionChanged?.Invoke();
 }
Exemple #9
0
 public override void SaveSettingsToStorage()
 {
     base.SaveSettingsToStorage();
     OptionChanged?.Invoke(this, EventArgs.Empty);
 }
Exemple #10
0
 public override void RaisePropertyChanged([CallerMemberName] string propertyName = "")
 {
     base.RaisePropertyChanged(propertyName);
     OptionChanged?.Invoke();
 }
Exemple #11
0
 protected virtual void OnOptionsChanged(OptionsEventArgs args)
 {
     OptionChanged?.Invoke(this, args);
 }