private static bool FrameworkIdMatches(string frameWorkId, ControlDictionaryItem controlDictionaryItem) { return(string.IsNullOrEmpty(frameWorkId) || controlDictionaryItem.FrameworkId == frameWorkId || string.IsNullOrEmpty(controlDictionaryItem.FrameworkId)); }
private ControlDictionary() { items.AddFrameworkSpecificPrimary(ControlType.Edit, typeof(TextBox), typeof(WinFormTextBox), typeof(TextBox), typeof(TextBox)); items.AddWinFormPrimary(typeof(WinFormSlider), ControlType.Slider); items.AddWPFPrimary(typeof(WPFSlider), ControlType.Slider); items.AddSilverlightPrimary(typeof(WPFSlider), ControlType.Slider); items.AddPrimary(typeof(Thumb), ControlType.Thumb); items.AddPrimary(typeof(Button), ControlType.Button); items.AddPrimary(typeof(CheckBox), ControlType.CheckBox); items.AddPrimary(typeof(ListBox), ControlType.List); items.AddPrimary(typeof(Hyperlink), ControlType.Hyperlink); items.AddPrimary(typeof(Tree), ControlType.Tree); items.AddPrimary(typeof(RadioButton), ControlType.RadioButton); items.AddPrimary(typeof(Table), ControlType.Table); items.AddPrimary(typeof(Tab), ControlType.Tab, true); items.AddPrimary(typeof(ListView), ControlType.DataGrid); items.AddPrimary(typeof(ToolStrip), ControlType.ToolBar); items.AddWin32Primary(typeof(MenuBar), ControlType.MenuBar); items.AddWinFormPrimary(typeof(MenuBar), ControlType.MenuBar); items.AddWPFPrimary(typeof(MenuBar), ControlType.Menu); items.AddSilverlightPrimary(typeof(MenuBar), ControlType.Menu); items.AddPrimary(typeof(ProgressBar), ControlType.ProgressBar); items.AddPrimary(typeof(Spinner), ControlType.Spinner); items.Add(new ControlDictionaryItem(typeof(Panel), ControlType.Pane, "", false, true, false, null, true)); ControlDictionaryItem dictionaryItem = ControlDictionaryItem.Primary(typeof(PropertyGrid), ControlType.Pane); dictionaryItem.IsIdentifiedByName = true; items.Add(dictionaryItem); items.AddFrameworkSpecificPrimary(ControlType.Text, typeof(Label), typeof(Label), typeof(WPFLabel), typeof(WPFLabel)); items.AddFrameworkSpecificPrimary(ControlType.ComboBox, typeof(Win32ComboBox), typeof(WinFormComboBox), typeof(WPFComboBox), typeof(SilverlightComboBox)); items.AddFrameworkSpecificPrimary(ControlType.StatusBar, typeof(StatusStrip), typeof(StatusStrip), typeof(WPFStatusBar), typeof(WPFStatusBar)); items.AddWPFPrimary(typeof(CustomUIItem), ControlType.Custom); items.AddWinFormPrimary(typeof(TextBox), ControlType.Document); items.AddWin32Primary(typeof(TextBox), ControlType.Document); items.AddWPFPrimary(typeof(Image), ControlType.Image); items.AddSilverlightPrimary(typeof(Image), ControlType.Image); items.AddWin32Primary(typeof(Image), ControlType.Image); items.AddSilverlightPrimary(typeof(SilverlightChildWindow), ControlType.Window); items.AddSecondary(typeof(TableRowHeader), ControlType.Header); items.AddSecondary(typeof(TabPage), ControlType.TabItem, true); items.AddSecondary(typeof(VScrollBar), ControlType.ScrollBar); items.AddSecondary(typeof(HScrollBar), ControlType.ScrollBar); items.AddSecondary(typeof(TableHeader), ControlType.Custom); items.AddSecondary(typeof(TableRow), ControlType.Custom); items.AddSecondary(typeof(Menu), ControlType.MenuItem); items.AddSecondary(typeof(ListViewRow), ControlType.DataItem); //TODO: create method for specific implementors (Tree, StatusBar, Label) items.Add(ControlDictionaryItem.WinFormSecondary(typeof(Win32ListItem), ControlType.ListItem)); items.Add(ControlDictionaryItem.Win32Secondary(typeof(Win32ListItem), ControlType.ListItem)); items.Add(ControlDictionaryItem.WPFSecondary(typeof(WPFListItem), ControlType.ListItem)); items.Add(ControlDictionaryItem.SilverlightSecondary(typeof(WPFListItem), ControlType.ListItem)); items.Add(ControlDictionaryItem.WinFormSecondary(typeof(Win32TreeNode), ControlType.TreeItem)); items.Add(ControlDictionaryItem.WPFSecondary(typeof(WPFTreeNode), ControlType.TreeItem)); items.Add(ControlDictionaryItem.Win32Secondary(typeof(Win32TreeNode), ControlType.TreeItem)); items.Add(new ControlDictionaryItem(typeof(DateTimePicker), ControlType.Pane, "SysDateTimePick32", true, true, false, WindowsFramework.WinForms.FrameworkId(), false)); items.Add(new ControlDictionaryItem(typeof(WpfDatePicker), ControlType.Custom, "DatePicker", true, true, false, WindowsFramework.Wpf.FrameworkId(), false)); items.Add(new ControlDictionaryItem(typeof(WpfDatePicker), ControlType.Pane, "DatePicker", true, true, false, WindowsFramework.Silverlight.FrameworkId(), false)); items.Add(new ControlDictionaryItem(typeof(GroupBox), ControlType.Group, string.Empty, false, true, false, null, true)); items.Add(new ControlDictionaryItem(null, ControlType.TitleBar, string.Empty, false, false, true, null, false)); editableControls.Add(typeof(TextBox)); editableControls.Add(typeof(CheckBox)); editableControls.Add(typeof(RadioButton)); editableControls.Add(typeof(ListControl)); }
private static bool ControlTypeMatches(ControlType controlType, ControlDictionaryItem controlDictionaryItem) { return(controlDictionaryItem.ControlType.Equals(controlType)); }