Пример #1
0
        public void TestNumericIndeterminateSymbol()
        {
            Action instantiateSymbol = new Action(() =>
            {
                Indeterminate indeterminate = new Indeterminate('2', 1);
            });

            Assert.ThrowsException <ArgumentException>(instantiateSymbol);
        }
Пример #2
0
        public void TestInstantiateZeroCoefficient()
        {
            Indeterminate indt = new Indeterminate('X', 2);
            Term          term = new Term(0, new Indeterminate[] { indt });

            MultivariatePolynomial testPolynomial = new MultivariatePolynomial(new Term[] { term });
            string expected = "0";
            string actual   = testPolynomial.ToString();

            Assert.AreEqual(expected, actual, $"Expected: \"{expected}\"; Actual: \"{actual}\"");
        }
Пример #3
0
        private protected virtual void OnIndeterminate()
        {
            UpdateVisualState();

            // Create the args
            var args = new RoutedEventArgs();

            args.OriginalSource = this;

            // Raise the event
            Indeterminate?.Invoke(this, args);
        }
Пример #4
0
 public void Log(object o, Indeterminate indeterminate)
 {
     this.sb.AppendLine("Name: " + this._name);
     this.sb.AppendLine("Object: " + (o != null ? o.ToString() : string.Empty));
     this.sb.AppendLine("Indeterminate: " + indeterminate.Message);
     lock (log_obj)
     {
         using (var writer = new StreamWriter("log.txt", true))
         {
             writer.WriteLine(this.sb.ToString());
             writer.Flush();
             writer.Close();
         }
     }
 }
Пример #5
0
        public static SupplierModifier GetModifier(this IEnumerable <Supplier> suppliers)
        {
            Indeterminate <string> supplierName = null;
            Indeterminate <long>   status       = null;
            Indeterminate <string> city         = null;
            var ids = new List <long>();

            foreach (var supplier in suppliers)
            {
                ids.Add(supplier.SupplierId);
                if (supplierName == null)
                {
                    supplierName =
                        new Indeterminate <string>(supplier.SupplierName);
                }
                else
                {
                    supplierName.Value = supplier.SupplierName;
                }
                if (status == null)
                {
                    status = new Indeterminate <long>(supplier.Status);
                }
                else
                {
                    status.Value = supplier.Status;
                }
                if (city == null)
                {
                    city = new Indeterminate <string>(supplier.City);
                }
                else
                {
                    city.Value = supplier.City;
                }
            }
            var result = new SupplierModifier(ids)
            {
                SupplierName = new UpdatableField <string>(supplierName,
                                                           ids.Count == 1), // Can only update if modifying a single entity
                Status = new UpdatableField <long>(status),
                City   = new UpdatableField <string>(city)
            };

            return(result);
        }
        void ReleaseDesignerOutlets()
        {
            if (AsyncProgress != null)
            {
                AsyncProgress.Dispose();
                AsyncProgress = null;
            }

            if (FeedbackLabel != null)
            {
                FeedbackLabel.Dispose();
                FeedbackLabel = null;
            }

            if (Indeterminate != null)
            {
                Indeterminate.Dispose();
                Indeterminate = null;
            }

            if (LevelIndicator != null)
            {
                LevelIndicator.Dispose();
                LevelIndicator = null;
            }

            if (ProgressIndicator != null)
            {
                ProgressIndicator.Dispose();
                ProgressIndicator = null;
            }

            if (Rating != null)
            {
                Rating.Dispose();
                Rating = null;
            }

            if (Relevance != null)
            {
                Relevance.Dispose();
                Relevance = null;
            }
        }
Пример #7
0
 public void SetView(View view)
 {
     if (view != null)
     {
         if (view.GetType() == typeof(Determinate))
         {
             mDeterminateView = (Determinate)view;
         }
         if (view.GetType() == typeof(Indeterminate))
         {
             mIndeterminateView = (Indeterminate)view;
         }
         mView = view;
         if (IsShowing)
         {
             mCustomViewContainer.RemoveAllViews();
             AddViewToFrame(view);
         }
     }
 }
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Start animation on progress bars
            Indeterminate.StartAnimation(this);
            AsyncProgress.StartAnimation(this);

            // Wireup controls
            LevelIndicator.Activated += (sender, e) => {
                FeedbackLabel.StringValue = string.Format("Level: {0:###}", LevelIndicator.DoubleValue);
            };

            Rating.Activated += (sender, e) => {
                FeedbackLabel.StringValue = string.Format("Rating: {0:###}", Rating.DoubleValue);
            };

            Relevance.Activated += (sender, e) => {
                FeedbackLabel.StringValue = string.Format("Relevance: {0:###}", Relevance.DoubleValue);
            };
        }
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            InputProps["data-indeterminate"] = Indeterminate.ToString();
        }
Пример #10
0
 private void UwpControl_Indeterminate(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     Indeterminate?.Invoke(this, EventArgs.Empty);
 }
Пример #11
0
 protected virtual void OnIndeterminate()
 {
     Indeterminate?.Invoke(this, RoutedEventArgsFactory.Create(this));
 }
Пример #12
0
 private void IndeterminateHandler(object sender, RoutedEventArgs e)
 {
     Indeterminate?.Invoke(this, e);
 }