Exemplo n.º 1
0
        protected override Control GetEditControl(string PropName, object CurrentValue, object CurrentObj)
        {
            ComboBoxValueCollection comboBoxEntries = new ComboBoxValueCollection();
            //Aaron added 11/11/2013
            //Object wrapper is a wrapper object used to show categories in the grid
            //We need to extract the button object from the wrapper
            ObjectWrapper placeHolder = CurrentObj as ObjectWrapper;



            if (placeHolder.SelectedObject is BSkyEditableComboBox)
            {
                BSkyEditableComboBox bskycomboEditable = placeHolder.SelectedObject as BSkyEditableComboBox;
                if (string.IsNullOrEmpty(bskycomboEditable.Name))
                {
                    MessageBox.Show(BSky.GlobalResources.Properties.Resources.EnterValidValue);
                    return(null);
                }
                ComboBoxEditorWindow w = new ComboBoxEditorWindow();
                //StackPanel sp = rg.Content as StackPanel;
                //Added by Aaron 05/05/2013
                //Did not change code only added comment below
                //If there were existing radio buttons, the code below populates the windows with existing radio buttons
                foreach (string obj in bskycomboEditable.Items)
                {
                    ComboBoxEntry entry = new ComboBoxEntry();
                    entry.entryNameforCombo = obj;

                    comboBoxEntries.Add(entry);
                }
                w.ComboBoxEntries = comboBoxEntries;
                //Aaron 12/26 ADDED AND commented lines below
                // rg.RadioButtons = col;
                return(w);
            }
            else
            {
                BSkyNonEditableComboBox bskycomboNonEditable = placeHolder.SelectedObject as BSkyNonEditableComboBox;
                if (string.IsNullOrEmpty(bskycomboNonEditable.Name))
                {
                    MessageBox.Show(BSky.GlobalResources.Properties.Resources.EnterValidValue);
                    return(null);
                }
                ComboBoxEditorWindow w = new ComboBoxEditorWindow();

                foreach (string obj in bskycomboNonEditable.Items)
                {
                    ComboBoxEntry entry = new ComboBoxEntry();
                    entry.entryNameforCombo = obj;

                    comboBoxEntries.Add(entry);
                }
                w.ComboBoxEntries = comboBoxEntries;
                //Aaron 12/26 ADDED AND commented lines below
                // rg.RadioButtons = col;
                return(w);
            }
            //Aaron added 11/11/2013
            //Commented code below
            //  BSkyRadioGroup rg = CurrentObj as BSkyRadioGroup;



            //Aaron 05/05/2013
            //Did not change code only added comment below
            //This launches the radio group editor window that allows the use to enter details about the radio group


            //Added by Aaron 05/05/2013
            //Did not change code only added comment below
            //the line below adds the BSkyRadioButtonCollection to the observable collection of radio buttons
            //public ObservableCollection<BSkyRadioButton> RadioCollection
            //The observable collection is populated in the setter of
            // w.ComboBoxEntries = comboBoxEntries;
            //Aaron 12/26 ADDED AND commented lines below
            // rg.RadioButtons = col;
            // return w;
        }