Example #1
0
 public void Execute()
 {
     while ((bool)Condition.Value)
     {
         InnerBlock?.Execute();
     }
     NextBlock?.Execute();
 }
 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")
     });
 }
Example #3
0
        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();
            }
        }
Example #4
0
 public override void AssertMainThreadBlockReleaseCallback(InnerBlock completionHandler)
 {
     completionHandler(42);
 }