Beispiel #1
0
        /// <summary>
        /// Builds the field list with a list of fields form a table
        /// </summary>
        /// <param name="tableName"></param>
        private void BuildToolboxItems(string tableName)
        {
            // get fields and metadata for table
            Caisis.DataAccess.MetadataDa da = new Caisis.DataAccess.MetadataDa();
            DataTable fieldMetadata         = da.GetFieldsByTableName(tableName);
            // build a list of Eform fields by metadata
            IEnumerable <EformField> toolboxFields = from record in fieldMetadata.AsEnumerable()
                                                     let field = record[MetadataField.FieldName].ToString()
                                                                 let controlType = BusinessObject.HasControlType(QueryTable, field) ? BusinessObject.GetControlType(QueryTable, field) : DEFAULT_CONTROL_TYPE
                                                                                   select new EformField(tableName, field, controlType);

            ToolboxList.BuildSectionFields(toolboxFields, true, false);
        }
Beispiel #2
0
        private void PopulateToolBox(IToolboxService toolbox)
        {
            ToolboxList.Clear();
            NavBarItem item;

            item            = toolboxTabList.Items.Add();
            item.Caption    = "指针";
            item.SmallImage = global::QueryDesigner.Properties.Resources._5;
            toolCommon.ItemLinks.Add(item);

            ToolboxItem toolboxItem = new ToolboxItem(typeof(Label));

            item         = toolboxTabList.Items.Add();
            item.Caption = "Label";
            ToolboxBitmapAttribute toolboxBitmap = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.Label));

            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.Label));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(SnControl.ParamTextBox));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "TextBox";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.TextBox));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.TextBox));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(SnControl.ParamComboBox));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "ComboBox";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.ComboBox));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.ComboBox));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(SnControl.ParamDateTimePicker));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "DateTimePicker";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.DateTimePicker));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.DateTimePicker));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(TabControl));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "TabControl";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.TabControl));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.TabControl));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(GroupBox));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "GroupBox";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.GroupBox));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.GroupBox));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(Panel));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "Panel";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.Panel));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.Panel));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(System.Windows.Forms.DataGridView));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "DataGridView";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.DataGridView));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.DataGridView));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(TitlePanel));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "TitlePanel";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.GroupBox));
            item.SmallImage = toolboxBitmap.GetImage(typeof(System.Windows.Forms.GroupBox));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(SnControl.Search));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "Search";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(System.Windows.Forms.ComboBox));
            item.SmallImage = Resources.Search;
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);

            toolboxItem     = new ToolboxItem(typeof(SnControl.ParamRadioButton));
            item            = toolboxTabList.Items.Add();
            item.Caption    = "RadioButton";
            toolboxBitmap   = new ToolboxBitmapAttribute(typeof(RadioButton));
            item.SmallImage = toolboxBitmap.GetImage(typeof(RadioButton));
            toolCommon.ItemLinks.Add(item);
            toolbox.AddToolboxItem(toolboxItem);
            ToolboxList.Add(item, toolboxItem);
        }
        void SetupTools()
        {
            toolboxItems = new ToolboxList ();

            var icon = ImageService.GetPixbuf (Stock.TextFileIcon, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Comment", ClassType.Unknown, true, icon));

            icon = ImageService.GetPixbuf (Stock.ProtectedClass, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Abstract Class", ClassType.Class, true, icon));

            icon = ImageService.GetPixbuf (Stock.Class, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Class", ClassType.Class, false, icon));

            icon = ImageService.GetPixbuf (Stock.Interface, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Interface", ClassType.Interface, false, icon));

            icon = ImageService.GetPixbuf (Stock.Enum, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Enum", ClassType.Enum, false, icon));

            icon = ImageService.GetPixbuf (Stock.Delegate, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Delegate", ClassType.Delegate, false, icon));

            icon = ImageService.GetPixbuf (Stock.Struct, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new FigureToolboxItemNode ("Struct", ClassType.Struct, false, icon));

            icon = ImageService.GetPixbuf (Stock.SplitWindow, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new ConnectorToolboxItemNode ("Association", ConnectionType.Association, icon));

            icon = ImageService.GetPixbuf (Stock.MiscFiles, Gtk.IconSize.SmallToolbar);
            toolboxItems.Add (new ConnectorToolboxItemNode ("Inheritance", ConnectionType.Inheritance, icon));
        }