Beispiel #1
0
        /// <summary>
        /// 获取编辑框
        /// </summary>
        /// <returns></returns>
        public EditorBase GetEditor()
        {
            switch (Type)
            {
            case ConfigItemType.Check:
                CheckBoxEditor cbe = new CheckBoxEditor();

                cbe.OnOffType = OnOffButtonType.Quadrate;
                return(cbe);

            case ConfigItemType.Combo:

                ComboBoxEditor cmb = new ComboBoxEditor();
                cmb.BindValue(Items);
                return(cmb);

            case ConfigItemType.MText:
                TextBoxEditor mtxt = new TextBoxEditor();
                mtxt.Multiline = true;
                mtxt.Height    = 80;
                return(mtxt);

            case ConfigItemType.Number:
                NumbericEditor ntxt = new NumbericEditor();
                return(ntxt);

            default:
                TextBoxEditor txt = new TextBoxEditor();

                return(txt);
            }
        }
Beispiel #2
0
        public RutrackerTorrentFilesDownloaderConfig()
        {
            _torrentFileDownloaders = Context.I.ComponentFactory.GetCreators <ITorrentFileDownloaderPlugin>()
                                      .Select(item => item.GetInstance <ITorrentFileDownloaderPlugin>()).Where(item => item.IsExists);

            ComboBoxEditor.Register("TorrentClientName",
                                    new ObservableCollection <object>(_torrentFileDownloaders.Select(item => item.DisplayName)));
        }
        public void LoadddlKetQuaGiamSat()
        {
            var nhomda = EnumHelper.GetDescriptionForBind(KetQuaGiamSat.ChamDoGPMB);

            ComboBoxEditor.DataSource     = nhomda;
            ComboBoxEditor.DataTextField  = "ValueString";
            ComboBoxEditor.DataValueField = "name";
            ComboBoxEditor.DataBind();
        }
Beispiel #4
0
        public override IPropertyValueEditor CreateEditor(PropertyDescriptor propertyDescriptor, object targetObject)
        {
            var editor = new ComboBoxEditor();

            editor.Style             = eDotNetBarStyle.StyleManagerControlled;
            editor.DrawMode          = DrawMode.OwnerDrawFixed;
            editor.DropDownStyle     = ComboBoxStyle.DropDownList;
            editor.FormattingEnabled = true;
            editor.IntegralHeight    = true;
            editor.Items.AddRange((object[])Items);
            editor.DropDownWidth = DropDownWidth;
            editor.Levels        = Levels;
            return(editor);
        }
Beispiel #5
0
        static public async Task SetDailyJournal(ComboBoxEditor cmbJournal, CrudAPI api)
        {
            var journalSource = new List <string>();
            var cache         = api.GetCache(typeof(Uniconta.DataModel.GLDailyJournal)) ?? await api.LoadCache(typeof(Uniconta.DataModel.GLDailyJournal));

            if (cache != null)
            {
                journalSource.Capacity = cache.Count;
                foreach (var rec in cache.GetKeyStrRecords)
                {
                    journalSource.Add(rec.KeyStr);
                }
            }
            cmbJournal.ItemsSource = journalSource;
        }
Beispiel #6
0
        public override IPropertyValueEditor CreateEditor(PropertyDescriptor propertyDescriptor, object targetObject)
        {
            var            args = new EditorCreateEventArgs(propertyDescriptor);
            ComboBoxEditor editor;

            EditorCreating?.Invoke(this, args);
            if (args.Editor is null)
            {
                editor               = new ComboBoxEditor();
                editor.Style         = eDotNetBarStyle.StyleManagerControlled;
                editor.DrawMode      = DrawMode.OwnerDrawFixed;
                editor.DropDownWidth = 250;
            }
            else
            {
                editor = args.Editor;
            }

            EditorCreated?.Invoke(this, new EditorCreateEventArgs(propertyDescriptor, editor));
            return(editor);
        }
Beispiel #7
0
        /// <summary>
        /// Loads the stringtable into memory from the game work directory
        /// </summary>
        private void LoadStringtable()
        {
            gridControl1.DataRowTemplate.AutoHeightMode = AutoHeightMode.AllContent;
            gridControl1.WordWrap = true;

            mDoc = new XmlDataDocument();
            // mDoc.PreserveWhitespace = true;

            string strTablePath    = Path.Combine(CoreGlobals.getWorkPaths().mGameDataDirectory, mStringTableFilename);
            string strTableXsdPath = Path.Combine(CoreGlobals.getWorkPaths().mGameDataDirectory, "stringtable.xsd");

            // these need to be pulled from the data directory
            mDoc.DataSet.ReadXmlSchema(strTableXsdPath);
            mDoc.Load(strTablePath);

            gridControl1.DataSource = mDoc.DataSet;
            gridControl1.DataMember = "String";

            System.Data.DataTable table = mDoc.DataSet.Tables[2];

            DataColumn[] PrimaryKeyColumns = new DataColumn[1];
            PrimaryKeyColumns[0] = table.Columns["_locID"];
            table.PrimaryKey     = PrimaryKeyColumns;

            Xceed.Grid.Column locColumn = gridControl1.Columns["_locID"];
            if (locColumn != null)
            {
                locColumn.ReadOnly = true;
            }

            Xceed.Grid.Column c = gridControl1.Columns["Language_Id"];
            if (c != null)
            {
                c.Visible = false;
            }

            c = gridControl1.Columns["category"];
            if (c != null)
            {
                // c.Visible = false;
                ComboBoxEditor combo = new ComboBoxEditor();

                combo.Items.Add(new ComboBoxItem(new object[1] {
                    ""
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Code"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Techs"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Squads"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Powers"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Abilities"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Leaders"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Objects"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "UI"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Campaign"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Cinematics"
                }));
                combo.Items.Add(new ComboBoxItem(new object[1] {
                    "Skirmish"
                }));

                c.CellEditorManager = combo;
            }
            mDoc.DataSet.AcceptChanges();

//         ResizeColumns();
        }
Beispiel #8
0
 public EditorCreateEventArgs(PropertyDescriptor propertyDescriptor, ComboBoxEditor editor)
 {
     PropertyDescriptor = propertyDescriptor;
     Editor             = editor;
 }