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