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();
        }
Ejemplo n.º 2
0
 private void OnSelectExp(SelectExpressionNotification cmd)
 {
     if (Descriptors.Count == 0)
     {
         return;
     }
     if (cmd.SelectorIndex == Index)
     {
         if (Descriptors[SelectedIndex].abbr != cmd.ExpKey)
         {
             SelectedIndex = Descriptors.IndexOf(Descriptors.First(d => d.abbr == cmd.ExpKey));
         }
         DisplayMode = ExpDisMode.Visible;
     }
     else if (cmd.UpdateShadow)
     {
         DisplayMode = DisplayMode == ExpDisMode.Visible ? ExpDisMode.Shadow : ExpDisMode.Hidden;
     }
 }
Ejemplo n.º 3
0
 public ImageDescriptor GetDescriptorForImage <TImage>(TImage image) where TImage : class, IImage
 {
     return(Descriptors.First(x => x.Name == image.Name));
 }