示例#1
0
        /// <summary>
        ///Handler for all of spinners (for transfer values from spinners to VirtualProperties)
        /// </summary>
        private void OnSpinnerValueChangeHandler(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            RibbonSpinner rS = sender as RibbonSpinner;

            if (rS == null)
            {
                throw new Exception("There are no Ribbon spinner inctance for event");
            }

            if (rS.Name == "")
            {
                throw new Exception("There are no name for Ribbon spinner inctance for event");
            }
            else if (rS.Name == setOrderSpinner.Name)
            {
                VirtualProperies.Order = Convert.ToInt32(rS.TextValue);
            }
            else if (rS.Name == stopAndPumpSpinner.Name)
            {
                VirtualProperies.StopAndPump = Convert.ToInt32(rS.TextValue);
            }
            else
            {
                throw new Exception("For " + rS.Name + " not found any action");
            }
        }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            _buttonDropA = new RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdButtonDropA);
            _spinner     = new RibbonSpinner(_ribbon, (uint)RibbonMarkupCommands.cmdSpinner);

            _buttonDropA.ExecuteEvent += new EventHandler <ExecuteEventArgs>(_buttonDropA_ExecuteEvent);
        }
示例#3
0
        private void InitializeSpinners()
        {
            List <RibbonItem>  selectedItems = new List <RibbonItem>();
            IList <RibbonItem> items         = _buildPreviewHelper.Parser.Results.RibbonItems;

            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].RibbonClassName == "RibbonSpinner")
                {
                    selectedItems.Add(items[i]);
                }
            }
            for (int i = 0; i < selectedItems.Count; i++)
            {
                RibbonItem    item    = selectedItems[i];
                RibbonSpinner spinner = (RibbonSpinner)_classBuilder.BuildRibbonClass(item.RibbonClassName, item.CommandName, item.CommandId);
                spinner.RepresentativeString = "XXXXX";
            }
        }