예제 #1
0
파일: Form1.cs 프로젝트: KevinFretz/425-426
 private void InfiniteCB_CheckedChanged(object sender, EventArgs e)
 {
     /*
      * if (FiniteCB.Checked)
      * {
      *  PeriodicCB.Visible = Visible;
      *  NullCB.Visible = Visible;
      *  ArraySizeLabel.Visible = Visible;
      *  ArraySizeTB.Visible = Visible;
      *  InfiniteCB.Checked = false;
      * }
      */
     if (InfiniteCB.Checked)
     {
         PeriodicCB.Hide();
         NullCB.Hide();
         ArraySizeLabel.Hide();
         ArraySizeTB.Hide();
         ParallelCB.Hide();
         SequentialCB.Hide();
         LeftToRight.Hide();
         RightToLeft.Hide();
         Random.Hide();
         UserCB.Hide();
         FiniteCB.Checked = false;
     }
 }
        /// <summary>
        /// Run the code activity
        /// </summary>
        /// <param name="executionContext">Workflow context</param>
        protected override void Execute(CodeActivityContext executionContext)
        {
            var result = Text.Get <string>(executionContext)
                         .SafeSubstring(StartIndex.Get <int>(executionContext), Length.Get <int>(executionContext),
                                        LeftToRight.Get <bool>(executionContext));

            Result.Set(executionContext, result);
        }
예제 #3
0
파일: Form1.cs 프로젝트: KevinFretz/425-426
 private void ParallelCB_CheckedChanged(object sender, EventArgs e)
 {
     if (ParallelCB.Checked == true)
     {
         SequentialCB.Checked = false;
         RightToLeft.Hide();
         LeftToRight.Hide();
         Random.Hide();
         UserCB.Hide();
     }
 }
예제 #4
0
        public void MarkInstantiatingFor(SynchronizationRuleBase synchronizationRule, Expression <Func <TLeft, bool> > leftPredicate = null, Expression <Func <TRight, bool> > rightPredicate = null)
        {
            if (synchronizationRule == null)
            {
                throw new ArgumentNullException("synchronizationRule");
            }

            if (!synchronizationRule.LeftType.IsAssignableFrom(typeof(TLeft)))
            {
                throw new ArgumentException("The left types do not conform. The left type of the current rule must be an assignable of the given synchronization rules left type.", "synchronizationRule");
            }
            if (!synchronizationRule.RightType.IsAssignableFrom(typeof(TRight)))
            {
                throw new ArgumentException("The right types do not conform. The right type of the current rule must be an assignable of the given synchronization rules right type.", "synchronizationRule");
            }
            leftPredicate  = SimplifyPredicate(leftPredicate);
            rightPredicate = SimplifyPredicate(rightPredicate);

            ObservingFunc <TLeft, bool> leftFunc = ObservingFunc <TLeft, bool> .FromExpression(leftPredicate);

            ObservingFunc <TRight, bool> rightFunc = ObservingFunc <TRight, bool> .FromExpression(rightPredicate);

            if (leftFunc != null)
            {
                LeftToRight.MarkInstantiatingFor(synchronizationRule.LTR, leftFunc.Evaluate);
                SynchronizationJobs.Add(new LeftInstantiationMonitorJob <TLeft, TRight>(leftFunc));
            }
            else
            {
                LeftToRight.MarkInstantiatingFor(synchronizationRule.LTR);
            }
            if (rightFunc != null)
            {
                RightToLeft.MarkInstantiatingFor(synchronizationRule.RTL, rightFunc.Evaluate);
                SynchronizationJobs.Add(new RightInstantiationMonitorJob <TLeft, TRight>(rightFunc));
            }
            else
            {
                RightToLeft.MarkInstantiatingFor(synchronizationRule.RTL);
            }
        }
예제 #5
0
파일: Form1.cs 프로젝트: KevinFretz/425-426
        public Form1()
        {
            InitializeComponent();



            InfiniteCB.Checked = true;
            PeriodicCB.Hide();
            NullCB.Hide();
            ArraySizeLabel.Hide();
            ArraySizeTB.Hide();
            ParallelCB.Hide();
            SequentialCB.Hide();
            RightToLeft.Hide();
            LeftToRight.Hide();
            Random.Hide();
            UserCB.Hide();
            ParallelCB.Checked  = true;
            PeriodicCB.Checked  = true;
            LeftToRight.Checked = true;
        }
예제 #6
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>
 /// A hash code for the current <see cref="T:System.Object"/>.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked {
         return((LeftToRight.GetHashCode() * 397) ^ (Tags != null ? Tags.GetHashCode() : 0));
     }
 }
예제 #7
0
 public void ToggleReadDirection(object sender, RoutedEventArgs e)
 {
     LeftToRight = !LeftToRight;
     AddUpdateAppSettings("LeftToRight", LeftToRight.ToString());
 }
예제 #8
0
        /// <summary>
        /// Executes the workflow activity.
        /// </summary>
        /// <param name="cube">The cube.</param>
        protected override void Execute(CubeBase Cube)
        {
            var    executionContext = (ActivityContext)Cube.BaseSystemObject;
            string result           = PerformSubstring(pText.Get <string>(executionContext), StartIndex.Get <int>(executionContext), Length.Get <int>(executionContext), LeftToRight.Get <bool>(executionContext));

            pResult.Set(executionContext, result);
        }
 public void LeftToRightAction()
 {
     LeftToRightStart.Value = -ActualWidth;
     LeftToRightEnd.Value   = ActualWidth;
     LeftToRight.Begin();
 }