コード例 #1
0
        public ICleanUpSourceSettings CreateSettings(bool useSegmentLocker           = false,
                                                     bool useContentLocker           = false,
                                                     bool useStructureLocker         = false,
                                                     SegmentLockItem segmentLockItem = null,
                                                     ContextDef contextDef           = null,
                                                     bool backGroundColor            = false,
                                                     bool bold          = false,
                                                     bool fontNameSize  = false,
                                                     bool italic        = false,
                                                     bool strikeThrough = false,
                                                     bool textColor     = false,
                                                     bool textDirection = false,
                                                     bool textPosition  = false,
                                                     bool underLine     = false)
        {
            var settings = Substitute.For <ICleanUpSourceSettings>();

            settings.UseSegmentLocker   = useSegmentLocker;
            settings.UseContentLocker   = useContentLocker;
            settings.UseStructureLocker = useStructureLocker;
            settings.SegmentLockList    = new BindingList <SegmentLockItem>(new List <SegmentLockItem>()
            {
                segmentLockItem
            });
            settings.StructureLockList = new List <ContextDef>()
            {
                contextDef
            };

            return(settings);
        }
コード例 #2
0
        void ParseContextItem(ContextDef parent)
        {
            PushNode(parent);
            ExprSeq exprSeq = ParseExprSeq(ParseFlag.ParseLines);

            //parent.ExprSeq = expr;
            parent.CreateTopicDef(exprSeq);
            PopNode();
        }
コード例 #3
0
        void ParseContext(AstNode parent)
        {
            Advance();//past 'context
            Token name = CurrentToken;

            RootBlock.AddEntityDef(new EntityDef(name));
            Advance();//past name
            //
            ContextDef def = new ContextDef(name);

            parent.AddChild(def);
            //
            do
            {
                CreateState(CurrentList);
                ParseContextItem(def);
                PopState();
            } while (Advance());
        }
コード例 #4
0
        void ParseContextDecorator(AstNode parent)
        {
            ContextDecoratorDef contextDecDef = new ContextDecoratorDef();

            CreateState(CurrentList);
            ContextDef contextDef = new ContextDef(CurrentToken);

            contextDecDef.ContextDef = contextDef;
            switch (CurrentToken.Kind)
            {
            case TokenKind.PlusPlus:
                contextDef.ContextDefKind = ContextDefKind.Next;
                break;
            }
            PopState();
            Advance(); //past [..]
            ParseRhsItem(contextDecDef);
            parent.AddChild(contextDecDef);
        }
コード例 #5
0
 public void PushContextDef(ContextDef def)
 {
     ContextDefStack.Push(def);
 }