Ejemplo n.º 1
0
        public static bool IsAllowedLayoutAttribute(IParser parser, LayoutContainerType container, LayoutContainerAttribute attrib)
        {
            LayoutContainerAttributeType attribType;

            if (_layoutAttributes.TryGetValue(parser.PeekToken().Kind, out attribType))
            {
                parser.NextToken();
                attrib.StartIndex    = parser.Token.Span.Start;
                attrib.AttributeType = attribType;

                List <LayoutContainerType> allowedContainers;
                if (!_attributesToAllowedContainers.TryGetValue(attribType, out allowedContainers))
                {
                    parser.ReportSyntaxError("Invalid layout attribute found.");
                    return(false);
                }

                if (!allowedContainers.Contains(container))
                {
                    parser.ReportSyntaxError("Layout attribute not allowed in this layout container.");
                    return(false);
                }

                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public static bool TryParseAttribute(IParser parser, LayoutContainerType containingType, out LayoutContainerAttribute attrib)
        {
            attrib = new LayoutContainerAttribute();
            bool result = true;

            if (!LayoutContainerHelpers.IsAllowedLayoutAttribute(parser, containingType, attrib))
            {
                return(false);
            }

            switch (parser.PeekToken().Kind)
            {
            case TokenKind.CommentKeyword:

                break;

            case TokenKind.FontPitchKeyword:

                break;

            case TokenKind.HiddenKeyword:

                break;

            case TokenKind.StyleKeyword:

                break;

            case TokenKind.SplitterKeyword:

                break;

            case TokenKind.TagKeyword:

                break;

            case TokenKind.TextKeyword:

                break;

            case TokenKind.ActionKeyword:

                break;

            case TokenKind.ImageKeyword:

                break;

            case TokenKind.WantFixedPageSizeKeyword:

                break;

            case TokenKind.AggregateTextKeyword:

                break;

            case TokenKind.DoubleClickKeyword:

                break;

            case TokenKind.UnhidableColumnsKeyword:

                break;

            case TokenKind.UnmovableColumnsKeyword:

                break;

            case TokenKind.UnsizableColumnsKeyword:

                break;

            case TokenKind.UnsortableColumnsKeyword:

                break;

            case TokenKind.WidthKeyword:

                break;

            case TokenKind.HeightKeyword:

                break;
            }

            return(result);
        }