コード例 #1
0
        internal IBlock StackBelow(TopLevelScript b1, IBlock b2)
        {
            ParentRelationship b2_oldRelationship = b2.ParentRelationship;
            BlockStack         b3 = MergeStacks(b2, b1.Block);

            RemoveScript(b1);
            Become(b2_oldRelationship, b2, b3);
            return(b3);
        }
コード例 #2
0
        // 'a' shall become 'b', how?
        // - If a is toplevel, remove it and add b in its place
        // - If it isn't the parent has to replace a with b
        void Become(ParentRelationship pr, IBlock a, IBlock b)
        {
            if (pr.Type == ParentRelationshipType.None)
            {
                TopLevelScript tl = FindScript(a);
                RemoveScript(tl);
                AddScript(new TopLevelScript(tl.Location, b, this));
            }
            else
            {
                switch (pr.Type)
                {
                case ParentRelationshipType.Arg:
                    ((InvokationBlock)pr.Parent).SetArg(pr.Index, b);
                    break;

                case ParentRelationshipType.Stack:
                    //
                    break;
                }
            }
        }
コード例 #3
0
ファイル: BlockSpace.cs プロジェクト: andyhebear/kitsune
 // 'a' shall become 'b', how?
 // - If a is toplevel, remove it and add b in its place
 // - If it isn't the parent has to replace a with b
 void Become(ParentRelationship pr, IBlock a, IBlock b)
 {
     if (pr.Type == ParentRelationshipType.None)
     {
         TopLevelScript tl = FindScript(a);
         RemoveScript(tl);
         AddScript(new TopLevelScript(tl.Location, b, this));
     }
     else
     {
         switch (pr.Type)
         {
             case ParentRelationshipType.Arg:
                 ((InvokationBlock)pr.Parent).SetArg(pr.Index, b);
                 break;
             case ParentRelationshipType.Stack:
                 //
                 break;
         }
     }
 }
コード例 #4
0
 public TextBlock(string text)
 {
     ParentRelationship = new ParentRelationship();
     this.text          = text;
     this.TextChanged  += delegate(object sender, string newStr) { };
 }
コード例 #5
0
ファイル: TextBlock.cs プロジェクト: andyhebear/kitsune
 public TextBlock(string text)
 {
     ParentRelationship = new ParentRelationship();
     this.text = text;
     this.TextChanged += delegate(object sender, string newStr) { };
 }