Esempio n. 1
0
            public override void EnterPropertyAccessor([NotNull] XSharpParser.PropertyAccessorContext context)
            {
                if (!(context.parent is XSharpParser.PropertyContext idContext) || string.IsNullOrWhiteSpace(idContext.Id?.GetText()))
                {
                    return;
                }

                MethodInfoType methodInfoType;

                if (string.Equals(context.Key.Text, "Get", StringComparison.OrdinalIgnoreCase))
                {
                    methodInfoType = MethodInfoType.PropertyGet;
                }
                else if (string.Equals(context.Key.Text, "Set", StringComparison.OrdinalIgnoreCase))
                {
                    methodInfoType = MethodInfoType.PropertySet;
                }
                else
                {
                    throw new ArgumentException("Invalid PropertyAccessor Key");
                }

                var name = $"{idContext.Id.GetText()}[{(methodInfoType == MethodInfoType.PropertyGet ? "Get" : "Set")}]";

                AddMethodInfo(name, GetClassName(context), methodInfoType, context.statementBlock());
            }
Esempio n. 2
0
 public override void ExitPropertyAccessor([NotNull] XSharpParser.PropertyAccessorContext context)
 {
     TagRegion(context, context.ChildCount - 2);
 }
 public override void ExitPropertyAccessor([NotNull] XSharpParser.PropertyAccessorContext context)
 {
 }