private void OnListChange()
        {
            var selectedIndex = SelectedIndex;

            Descriptors.Clear();
            DocManager.Inst.Project.expressions.Values.ToList().ForEach(Descriptors.Add);
            if (selectedIndex >= descriptors.Count)
            {
                selectedIndex = Index;
            }
            SelectedIndex = selectedIndex;
        }
        public override void ExitStart(CaseRegressionParser.StartContext context)
        {
            if (Descriptors.Count > 1)
            {
                throw new InvalidOperationException($"Expected one item in the {nameof(Descriptors)} stack.");
            }

            var(type, value) = Descriptors.First();

            RootDescriptor = value as GroupDescriptor
                             ?? throw new InvalidOperationException(
                                       "Expected root item to be a type of"
                                       + $" '{typeof(GroupDescriptor).FullName}' instead of '{type.FullName}'.");

            Descriptors.Clear();
        }
示例#3
0
 public static void Clear()
 {
     lock (Descriptors) {
         Descriptors.Clear();
     }
 }
示例#4
0
 /// <summary>
 /// Clear the highlight descriptors of the current typing area.
 /// </summary>
 public new void Clear()
 {
     Descriptors.Clear();
 }