Exemple #1
0
        public static void ClearMintermtable(Grid Minterm)
        {
            var chbox = WpfHelpers.FindChildren <CheckBox>(Minterm);

            foreach (var ch in chbox)
            {
                ch.IsChecked = false;
            }
        }
 private void SetPinModes()
 {
     _pins = WpfHelpers.FindChildren <PinControl>((TabItem)Models.SelectedItem);
     foreach (var c in _pins)
     {
         c.PinMode = PinModes.Input;
         Thread.Sleep(15);
         c.PinMode = PinModes.Output;
     }
 }
Exemple #3
0
        public static Dictionary <int, bool?> GetMintermTableValues(Grid Minterm)
        {
            Dictionary <int, bool?> ret = new Dictionary <int, bool?>();
            var chbox = WpfHelpers.FindChildren <CheckBox>(Minterm);

            foreach (var ch in chbox)
            {
                ret.Add(Convert.ToInt32(ch.Content), ch.IsChecked);
            }
            return(ret);
        }
Exemple #4
0
        public static void SetMintermTableValues(Grid Minterm, List <LogicItem> items)
        {
            var chbox = WpfHelpers.FindChildren <CheckBox>(Minterm);

            foreach (var item in items)
            {
                var box = (from chb in chbox where chb.Content.ToString() == item.Index.ToString() select chb).FirstOrDefault();
                if (box != null)
                {
                    box.IsChecked = item.Checked;
                }
            }
        }
        private void Fill_Click(object sender, RoutedEventArgs e)
        {
            if (!_loaded)
            {
                return;
            }
            var items = WpfHelpers.FindChildren <Rectangle>(Grid8x);

            foreach (Rectangle item in items)
            {
                item.Fill = new SolidColorBrush(Colors.Red);
            }
        }
Exemple #6
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (_loaded)
     {
         return;
     }
     _loaded = true;
     Button_Click(this, e);
     _controls                   = WpfHelpers.FindChildren <AnalogSampler>(this);
     _timer                      = new DispatcherTimer();
     _timer.IsEnabled            = false;
     _timer.Tick                += _timer_Tick;
     Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
 }
Exemple #7
0
        private int CalculateSize(int value)
        {
            int multiply = 1;

            foreach (var radio in WpfHelpers.FindChildren <RadioButton>(MultiplySelect))
            {
                if (radio.IsChecked == true)
                {
                    multiply = Convert.ToInt32(radio.Content);
                    break;
                }
            }
            return(multiply * value);
        }
        private void BtnExpand_Click(object sender, RoutedEventArgs e)
        {
            if (BtnExpand.IsChecked == true)
            {
                BtnExpand.Content = "Colapse All";
            }
            else
            {
                BtnExpand.Content = "Expand All";
            }

            foreach (var expander in WpfHelpers.FindChildren <Expander>(FunctionL))
            {
                expander.IsExpanded = (bool)BtnExpand.IsChecked;
            }
        }
Exemple #9
0
 /// <summary>
 /// Gets a control value by the control's name
 /// </summary>
 /// <param name="controlname">The name of the control, witch's value will be returned</param>
 public dynamic this[string controlname]
 {
     get
     {
         if (string.IsNullOrEmpty(controlname))
         {
             throw new Exception("Can't find control value: " + controlname);
         }
         foreach (var control in WpfHelpers.FindChildren <FrameworkElement>(ItemsPanel))
         {
             if (control.Name == controlname)
             {
                 Type t = control.GetType();
                 if (t == typeof(EditableSlider))
                 {
                     return((control as EditableSlider).Value);
                 }
             }
         }
         throw new Exception("Can't find control value: " + controlname);
     }
 }