コード例 #1
0
ファイル: WhileBlock.cs プロジェクト: XxshiftxX/Oblocky
 public void Execute()
 {
     while ((bool)Condition.Value)
     {
         InnerBlock?.Execute();
     }
     NextBlock?.Execute();
 }
コード例 #2
0
 public AutoFitTextBlock()
 {
     this.InitializeComponent();
     this.RegisterPropertyChangedCallback(FontFamilyProperty, (s, e) => RecalculateSize());
     this.RegisterPropertyChangedCallback(FontWeightProperty, (s, e) => RecalculateSize());
     this.RegisterPropertyChangedCallback(FontStyleProperty, (s, e) => RecalculateSize());
     InnerBlock.SetBinding(TextBlock.TextProperty, new Binding()
     {
         Source = this, Path = new PropertyPath("Text")
     });
 }
コード例 #3
0
ファイル: IfBlock.cs プロジェクト: XxshiftxX/Oblocky
        public void Execute()
        {
            var condition = (bool)Condition.Value;

            if (condition)
            {
                InnerBlock?.Execute();

                var next = NextBlock ?? null;

                while (next is ElseBlock || next is ElseIfBlock)
                {
                    next = next?.NextBlock;
                }

                next?.Execute();
            }
            else
            {
                NextBlock?.Execute();
            }
        }
コード例 #4
0
 public override void AssertMainThreadBlockReleaseCallback(InnerBlock completionHandler)
 {
     completionHandler(42);
 }