示例#1
0
        private void LoadLookups()
        {
            SearchLookupEditRegion.Properties.DataSource = _context.REGION.OrderBy(r => r.CODE).Select(r => new CodeName()
            {
                Code = r.CODE, Name = r.DESC
            });
            SearchLookupEditCountry.Properties.DataSource = _context.COUNTRY.OrderBy(c => c.CODE).Select(c => new CodeName()
            {
                Code = c.CODE, Name = c.NAME
            });
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = null
            };

            _supplierCombo.Items.Add(loadBlank);
            _supplierCombo.Items.AddRange(_context.Supplier
                                          .OrderBy(o => o.Name).AsEnumerable()
                                          .Select(s => new ImageComboBoxItem()
            {
                Description = s.Name, Value = s.GUID
            })
                                          .ToList());
            GridControlSupplierState.RepositoryItems.Add(_supplierCombo);        //per DX recommendation to avoid memory leaks
        }
示例#2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            ilstBatchNo.Items.Clear();

            if (icboEquipment.SelectedItem == null)
            {
                return;
            }

            ImageComboBoxItem item = (ImageComboBoxItem)icboEquipment.SelectedItem;

            if (!(item.Value is WIPStation))
            {
                return;
            }

            WIPStation station = (WIPStation)item.Value;

            List <BatchByWorkday> batchNumbers =
                GetBatchNumbers(
                    station.T133LeafID,
                    edtPrdtDate.DateTime.ToString("yyyy-MM-dd"));

            foreach (BatchByWorkday batchNumber in batchNumbers)
            {
                ilstBatchNo.Items.Add(
                    new ImageListBoxItem()
                {
                    Description = batchNumber.BatchNumber,
                    Value       = batchNumber.Clone(),
                    ImageIndex  = -1,
                });
            }
        }
        private void fillDimensionComboBox()
        {
            ImageComboBoxItem defaultItem = null;

            _dimensionComboBox.Properties.Items.Clear();
            foreach (var dimension in _importDataColumn.CurrentlySupportedDimensions)
            {
                var newItem = new ImageComboBoxItem
                {
                    Description = dimension.DisplayName,
                    Value       = dimension.Name
                };
                if (dimension.IsDefault)
                {
                    defaultItem = newItem;
                }
                _dimensionComboBox.Properties.Items.Add(newItem);
            }
            if (_dimensionComboBox.Properties.Items.Contains(defaultItem))
            {
                _dimensionComboBox.EditValue = DimensionHelper.GetDefaultDimension(_importDataColumn.Dimensions).Name;
            }
            else if (_dimensionComboBox.Properties.Items.Count > 0)
            {
                _dimensionComboBox.EditValue = _dimensionComboBox.Properties.Items[0];
            }
        }
示例#4
0
        void fillCalendarDayContents(CalendarOptions options)
        {
            ImageList imgList = new ImageList();

            cmbTextFrom.Properties.SmallImages = imgList;
            cmbTextFrom.Properties.Items.Clear();
            foreach (var dayContent in PluginsManager.Instance.CalendarDayContents)
            {
                imgList.Images.Add(dayContent.Image);
                ImageComboBoxItem item = new ImageComboBoxItem(dayContent.Name, dayContent.GlobalId, imgList.Images.Count - 1);
                cmbTextFrom.Properties.Items.Add(item);
            }

            if (cmbTextFrom.Properties.Items.Count > 0)
            {
                var item = cmbTextFrom.Properties.Items.GetItem(options.CalendarTextType);
                if (item != null)
                {
                    cmbTextFrom.SelectedItem = item;
                }
                else
                {
                    cmbTextFrom.SelectedIndex = 0;
                }
            }
        }
示例#5
0
        private void LoadLookups()
        {
            modified = false;
            newRec   = false;
            var oper = from operRec in context.OPERATOR orderby operRec.CODE ascending select new { operRec.CODE, operRec.NAME };
            var crus = from cruRec in context.CRU orderby cruRec.CODE ascending select new { cruRec.CODE, cruRec.NAME };
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditOperator.Properties.Items.Add(loadBlank);
            foreach (var result in oper)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditOperator.Properties.Items.Add(load);
            }
            foreach (var result in crus)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditCode.Properties.Items.Add(load);
            }
            setReadOnly(true);
            enableNavigator(false);
        }
示例#6
0
        private void ListComboLists()
        {
            ImageComboBoxItem item;

            // Fill manufacturers list
            foreach (Manufacturer manufacturer in Manufacturer.FindAll())
            {
                item             = new ImageComboBoxItem();
                item.Value       = manufacturer;
                item.Description = manufacturer.Name;
                item.ImageIndex  = 1;

                cboManufacturer.Properties.Items.Add(item);
            }

            // Fill models list
            foreach (string stritem in OTCContext.Project.GetDeviceModels())
            {
                item             = new ImageComboBoxItem();
                item.Value       = stritem;
                item.Description = stritem;
                item.ImageIndex  = 2;

                cboModel.Properties.Items.Add(item);
            }
        }
        private void ListComboLists()
        {
            ImageComboBoxItem item;
            List <string>     models  = new List <string>();
            List <string>     modules = new List <string>();

            // Fill manufacturers list
            foreach (Manufacturer manufacturer in Manufacturer.FindAll())
            {
                item             = new ImageComboBoxItem();
                item.Value       = manufacturer;
                item.Description = manufacturer.Name;
                item.ImageIndex  = 1;

                cboManufacturer.Properties.Items.Add(item);
            }

            // Fill models list
            foreach (AccessoryDecoder decoder in AccessoryDecoder.FindAll())
            {
                if (!string.IsNullOrEmpty(decoder.Model) && !models.Contains(decoder.Model))
                {
                    item             = new ImageComboBoxItem();
                    item.Value       = decoder.Model;
                    item.Description = decoder.Model;
                    item.ImageIndex  = 2;

                    cboModel.Properties.Items.Add(item);
                }
            }
        }
示例#8
0
        /// <summary>
        /// 绑定ComboBox数据项
        /// </summary>
        /// <param name="cmb"></param>
        /// <param name="source"></param>
        /// <param name="displayField"></param>
        /// <param name="valueField"></param>
        public static void BindImageComboBox <T>(RepositoryItemImageComboBox cmb, IEnumerable <T> source, Func <T, bool> filterExpression, string displayField, string valueField)
        {
            if (source == null || !source.Any() || cmb == null || string.IsNullOrWhiteSpace(displayField) ||
                string.IsNullOrWhiteSpace(valueField))
            {
                cmb?.Items.Clear();
                return;
            }

            cmb.Items.Clear();

            IEnumerable <T> rows = source.Where(filterExpression);

            Type         type             = typeof(T);
            PropertyInfo valuefieldInfo   = type.GetProperty(valueField, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            PropertyInfo displayfieldInfo = type.GetProperty(displayField, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);

            foreach (T row in rows)
            {
                ImageComboBoxItem itemtemp1 = new ImageComboBoxItem();

                itemtemp1.Value       = valuefieldInfo?.GetValue(row, null);
                itemtemp1.Description = displayfieldInfo?.GetValue(row, null)?.ToString();
                cmb.Items.Add(itemtemp1);
            }
        }
示例#9
0
        private void ListEvents(Rwm.Otc.Layout.ElementAction.EventType selectedEvent)
        {
            ImageComboBoxItem item;

            cboEvent.Properties.Items.Clear();

            item             = new ImageComboBoxItem();
            item.Description = StringUtils.SplitCamelCaseString(Rwm.Otc.Layout.ElementAction.EventType.OnAccessoryStatusChange.ToString());
            item.Value       = Rwm.Otc.Layout.ElementAction.EventType.OnAccessoryStatusChange;
            item.ImageIndex  = 0;
            cboEvent.Properties.Items.Add(item);

            if (selectedEvent == Rwm.Otc.Layout.ElementAction.EventType.OnAccessoryStatusChange)
            {
                cboEvent.SelectedItem = item;
            }

            item             = new ImageComboBoxItem();
            item.Description = StringUtils.SplitCamelCaseString(Rwm.Otc.Layout.ElementAction.EventType.OnSensorStatusChange.ToString());
            item.Value       = Rwm.Otc.Layout.ElementAction.EventType.OnSensorStatusChange;
            item.ImageIndex  = 0;
            cboEvent.Properties.Items.Add(item);

            if (selectedEvent == Rwm.Otc.Layout.ElementAction.EventType.OnSensorStatusChange)
            {
                cboEvent.SelectedItem = item;
            }
        }
        private void ManageGrade_Load(object sender, System.EventArgs e)
        {
            //初始化权限列表
            List <SalaryNode> allGrade = SalaryNode.工资等级表.FindAll(a => a.类型 == (int)节点类型.薪等);

            foreach (SalaryNode grade in allGrade)
            {
                ImageComboBoxItem item = new ImageComboBoxItem();
                item.Description = grade.称;
                item.Value       = grade.标识;
                repositoryItemImageComboBox1.Items.Add(item);
            }
            List <Role> allRoles = Role.GetAll();

            foreach (Role role in allRoles)
            {
                repositoryItemComboBox1.Items.Add(role.Name);
            }
            //只显示当前薪等表里的权限,历史记录隐藏
            impowerList.Clear();
            foreach (RoleGrade rg in RoleGrade.GetAll())
            {
                if (SalaryNode.工资等级表.Find(a => a.标识 == rg.薪等标识) != null)
                {
                    impowerList.Add(rg);
                }
            }
            gridControl1.DataSource = impowerList;
        }
示例#11
0
        private void görüntüYükleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MyFolderDialog.ShowDialog();
            string[] fileEntries = Directory.GetFiles(MyFolderDialog.SelectedPath, "*.tif"); // seçilenn klasördeki tif dosyalarını çek dicez buray
            if (fileEntries.Length > 0)
            {
                foreach (string file in fileEntries)
                {
                    imageCollection1.Images.Add(AForge.Imaging.Image.FromFile(file));
                    imageCollection2.Images.Add(AForge.Imaging.Image.FromFile(file));
                    imageCollection3.Images.Add(AForge.Imaging.Image.FromFile(file));
                }

                for (int i = 0; i < imageCollection1.Images.Count; i++)
                {
                    ImageComboBoxItem someItem = new ImageComboBoxItem();
                    someItem.Description = (i + 1).ToString();
                    someItem.ImageIndex  = i;
                    someItem.Value       = i;
                    imageComboBoxEdit1.Properties.Items.Add(someItem);
                }
            }
            MessageBox.Show("Mask  Resimleri Yükleyiniz.");
            MyFolderDialog.ShowDialog();
            string[] MaskfileEntries = Directory.GetFiles(MyFolderDialog.SelectedPath, "*.gif"); // seçilenn klasördeki tif dosyalarını çek dicez buray
            if (MaskfileEntries.Length > 0)
            {
                foreach (string file in MaskfileEntries)
                {
                    imageCollection1Mask.Images.Add(AForge.Imaging.Image.FromFile(file)); //mask resimler imagecollectiona eklenir
                }
            }

            imageComboBoxEdit1.SelectedIndex = 0; // imagecombobox a varsayılan olarak ilk resmi atasın
        }
        private void DrawDescription(ListBoxDrawItemEventArgs e, ImageComboBoxItem iItem)
        {
            Rectangle textRect = e.Bounds;

            textRect.X += imageSize.Width + 3;
            e.Appearance.DrawString(e.Cache, iItem.Description, textRect);
        }
        private void ListComboLists()
        {
            ImageComboBoxItem item;
            List <string>     deviceModels = new List <string>();

            // Fill manufacturers list
            foreach (Manufacturer manufacturer in Manufacturer.FindAll())
            {
                item             = new ImageComboBoxItem();
                item.Value       = manufacturer;
                item.Description = manufacturer.Name;
                item.ImageIndex  = 1;

                cboManufacturer.Properties.Items.Add(item);
            }

            // Fill models list
            foreach (FeedbackEncoder decoder in FeedbackEncoder.FindAll())
            {
                if (!deviceModels.Contains(decoder.Name))
                {
                    item             = new ImageComboBoxItem();
                    item.Value       = decoder.Name;
                    item.Description = decoder.Name;
                    item.ImageIndex  = 2;

                    cboModel.Properties.Items.Add(item);
                }
            }
        }
示例#14
0
        private void LinkDel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ImageComboBoxItem selItem = lbType.SelectedItem as ImageComboBoxItem;

            if (selItem != null)
            {
                var    drs    = _intelibType.Select("type_id=" + selItem.Value);
                string doc_id = drs[0]["doc_id"].ToString();
                if (doc_id == TmoComm.login_docInfo.doc_id.ToString())
                {
                    DXMessageBox.btnOKClick += (_sender, _e) =>
                    {
                        bool del = Tmo_FakeEntityClient.Instance.DeleteData("tmo_intervenelibtype", "type_id", selItem.Value.ToString());
                        if (del)
                        {
                            DXMessageBox.Show("干预库类型删除成功!", true);
                            _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                            TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
                        }
                    };
                    DXMessageBox.ShowQuestion(string.Format("确定要删除干预库类型【{0}】吗?", selItem.Description));
                }
                else
                {
                    DXMessageBox.ShowWarning("没有权限(非创建者)!\n创建者ID[" + doc_id + "]");
                }
            }
        }
示例#15
0
        private void LinkEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ImageComboBoxItem selItem = lbType.SelectedItem as ImageComboBoxItem;

            if (selItem != null)
            {
                var    drs    = _intelibType.Select("type_id=" + selItem.Value);
                string doc_id = drs[0]["doc_id"].ToString();
                if (doc_id == TmoComm.login_docInfo.doc_id.ToString())
                {
                    UCIntervenelibTypeEditor typeEditor = new UCIntervenelibTypeEditor()
                    {
                        Title = "修改干预库类型", PrimaryKeyValue = selItem.Value.ToString(), DbOperaType = DBOperateType.Update
                    };
                    if (typeEditor.ShowDialog() == DialogResult.OK)
                    {
                        DXMessageBox.Show("干预库类型修改成功!", true);
                        _intelibType = Tmo_FakeEntityClient.Instance.GetData("tmo_intervenelibtype");
                        TSCommon.BindImageComboBox(lbType, _intelibType, null, "type_name", "type_id");
                    }
                    typeEditor.Dispose();
                }
                else
                {
                    DXMessageBox.ShowWarning("没有权限(非创建者)!\n创建者ID[" + doc_id + "]");
                }
            }
        }
示例#16
0
 private void PointFeatureLabelCtrl_Load(object sender, EventArgs e)
 {
     if (this.m_OverLayerProperty != null)
     {
         int num;
         this.rdoPointPlacementMethod.SelectedIndex = (int)this.m_OverLayerProperty.PointPlacementMethod;
         if (this.m_OverLayerProperty.RotationType == esriLabelRotationType.esriRotateLabelGeographic)
         {
             this.rdoRotationType.SelectedIndex = 0;
         }
         else
         {
             this.rdoRotationType.SelectedIndex = 1;
         }
         this.chkPerpendicularToAngle.Checked = this.m_OverLayerProperty.PerpendicularToAngle;
         this.m_Priorities = this.m_OverLayerProperty.PointPlacementPriorities;
         string placementPrioritiesStr = this.GetPlacementPrioritiesStr(this.m_Priorities);
         for (num = 0; num < this.imageComboBoxEdit1.Properties.Items.Count; num++)
         {
             ImageComboBoxItem item = this.imageComboBoxEdit1.Properties.Items[num];
             if (item.Value.ToString() == placementPrioritiesStr)
             {
                 this.imageComboBoxEdit1.SelectedIndex = num;
                 break;
             }
         }
         double[] pointPlacementAngles = (double[])this.m_OverLayerProperty.PointPlacementAngles;
         for (num = 0; num < pointPlacementAngles.Length; num++)
         {
             this.listPointPlacementAngles.Items.Add(pointPlacementAngles[num]);
         }
         this.rdoPointPlacementMethod_SelectedIndexChanged(this, e);
         this.m_CanDo = true;
     }
 }
示例#17
0
        private void FillItems(Element selected)
        {
            ImageComboBoxItem item = null;

            // Create an image collection
            this.ImageList = new ImageList();
            this.Properties.SmallImages = this.ImageList;

            this.Properties.Items.Clear();

            if (Otc.OTCContext.Project != null)
            {
                foreach (Element eb in Element.FindAll())
                {
                    if (eb.Properties == this.ElementType)
                    {
                        // Adds the type image if necessary
                        if (!this.ImageList.Images.ContainsKey(eb.Properties.ID.ToString()))
                        {
                            this.ImageList.Images.Add(eb.Properties.ID.ToString(), eb.Properties.TypeIcon);
                        }

                        item            = new ImageComboBoxItem(eb.ToString(), eb);
                        item.ImageIndex = this.ImageList.Images.IndexOfKey(eb.Properties.ID.ToString());

                        this.Properties.Items.Add(item);

                        if (selected != null && eb == selected)
                        {
                            this.EditValue = item;
                        }
                    }
                }
            }
        }
示例#18
0
        private void ListStatus(int selectedStatus)
        {
            ImageComboBoxItem item;

            cboStatus.Properties.Items.Clear();

            item             = new ImageComboBoxItem();
            item.Description = "No status filter";
            item.Value       = ElementAction.CONDITION_DISABLED;
            item.ImageIndex  = 3;

            cboStatus.Properties.Items.Add(item);
            cboStatus.SelectedItem = item;

            foreach (AccessoryStatus enumInfo in this.OwnerBlock.Properties.AccessoryStatus)
            {
                if (enumInfo.Status > ActionEditorView.STATUS_UNKNOWN)
                {
                    item             = new ImageComboBoxItem();
                    item.Description = StringUtils.SplitCamelCaseString(enumInfo.Name);
                    item.Value       = enumInfo;
                    item.ImageIndex  = 2;

                    cboStatus.Properties.Items.Add(item);

                    if (enumInfo.Status == selectedStatus)
                    {
                        cboStatus.SelectedItem = item;
                    }
                }
            }
        }
示例#19
0
        public void uc_Detail_Customer_Load(object sender, EventArgs e)
        {
            if (Data_Customer.ToString() != "")
            {
                List <category> lst_category = new List <category>();

                lst_category = DAL_QLCategory.Get_List_Category("category");

                ImageComboBoxItem item;
                foreach (var data in lst_category)
                {
                    item = new ImageComboBoxItem(data.Name, data.id, data.id);
                    cbb_category.Properties.Items.Add(item);
                }
                _ID_CUSTOMER              = Util.Cnv_Int(Data_Customer["id"].ToString().Trim());
                txt_edit_fullname.Text    = Data_Customer["FullName"].ToString().Trim();
                txt_edit_note.Text        = Data_Customer["Note"].ToString().Trim();
                txt_edit_familyphone.Text = Data_Customer["FamilyPhone"].ToString().Trim();
                txt_edit_idcard.Text      = Data_Customer["IdCard"].ToString().Trim();
                txt_money.Text            = Util.formatMoney(Convert.ToInt32(Data_Customer["Money"].ToString().Trim()));
                txt_cycle.Value           = Convert.ToInt32(Data_Customer["Cycle"].ToString().Trim());
                txt_edit_phone.Text       = Data_Customer["PhoneNumber"].ToString().Trim();
                radio_edit_sex.EditValue  = (bool)Data_Customer["Sex"];
                txt_edit_address.Text     = Data_Customer["Address"].ToString().Trim();
                cbb_category.EditValue    = int.Parse(Data_Customer["IdCategory"].ToString());
                birthDay_customer.Text    = (DateTime.Parse(Data_Customer["BirthDay"].ToString().Trim())).ToString(Variable.format_date);
                date_paid.Text            = (DateTime.Parse(Data_Customer["CreatedAt"].ToString().Trim())).ToString(Variable.format_date);
            }
        }
示例#20
0
        private void LoadLookups()
        {
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = null
            };

            var lookup = new List <CodeName> {
                new CodeName(null)
            };

            _supplierCombo.Items.Add(loadBlank);
            _supplierCombo.Items.AddRange(_context.Supplier
                                          .OrderBy(o => o.Name).AsEnumerable()
                                          .Select(s => new ImageComboBoxItem()
            {
                Description = s.Name, Value = s.GUID
            })
                                          .ToList());
            GridControlSupplierServType.RepositoryItems.Add(_supplierCombo);        //per DX recommendation to avoid memory leaks

            //var col = _operatorSearch.View.Columns.Add();
            //col.FieldName = "Code";
            //col = _operatorSearch.View.Columns.Add();
            //col.FieldName = "Name";
            //_operatorSearch.DisplayMember = "DisplayName";
            //_operatorSearch.ValueMember = "Code";
            //_operatorSearch.NullText = string.Empty;
            //_operatorSearch.BestFitMode = BestFitMode.BestFitResizePopup;
            //_operatorSearch.DataSource = lookup;
            //_operatorSearch.View.BestFitColumns();
            //_operatorSearch.Popup += new EventHandler(SearchLookupEdit_Popup);
            //GridControlSupplierCity.RepositoryItems.Add(_operatorSearch);		//per DX recommendation to avoid memory leaks
        }
示例#21
0
        private void FillItems(Category selected)
        {
            ImageComboBoxItem item;

            // Create an image collection
            if (this.Properties.SmallImages == null)
            {
                this.ImageList = new ImageList();
                this.ImageList.Images.Add(Collection.Properties.Resources.ICO_CATEGORY_16);
                this.Properties.SmallImages = this.ImageList;
            }

            this.Properties.Items.Clear();

            if (OTCContext.Project != null)
            {
                foreach (Category category in Category.FindAll())
                {
                    item = new ImageComboBoxItem(category.Name, category, 0);
                    this.Properties.Items.Add(item);

                    if (selected != null && category == selected)
                    {
                        this.EditValue = item;
                    }
                }

                if (selected == null || this.EditValue == null)
                {
                    this.EditValue = this.Properties.Items[0];
                }
            }
        }
示例#22
0
        private void SetModelList(string selected)
        {
            ImageComboBoxItem item;
            List <string>     models = new List <string>();

            // Fill models list
            cboModel.Properties.Items.Clear();
            foreach (AccessoryDecoder decoder in AccessoryDecoder.FindAll())
            {
                if (!string.IsNullOrEmpty(decoder.Model) && !models.Contains(decoder.Model))
                {
                    item             = new ImageComboBoxItem();
                    item.Value       = decoder.Model;
                    item.Description = decoder.Model;
                    item.ImageIndex  = 2;

                    cboModel.Properties.Items.Add(item);
                    models.Add(decoder.Model);
                }
            }

            if (selected != null)
            {
                cboModel.Text = selected;
            }
        }
        private static void DrawDescription(ListBoxDrawItemEventArgs e, ImageComboBoxItem imageComboBoxItem)
        {
            var textRectangle = e.Bounds;

            textRectangle.X += _imageSize.Width + 3;
            e.Appearance.DrawString(e.Cache, imageComboBoxItem.Description, textRectangle);
        }
示例#24
0
        /// <summary>
        /// Stores the displayed settings to <paramref name="settings"/>
        /// </summary>
        /// <param name="settings">The destination of the store operation.</param>
        private void StoreSettings(ImportSettings settings)
        {
            settings.UseAsWhiteList = rdoWhiteList.Checked;
            List <FilterRule> filterRules = new List <FilterRule>(dgvFilter.Rows.Count);

            foreach (DataGridViewRow row in dgvFilter.Rows)
            {
                ImageComboBoxItem modifier = row.Cells[0].Value as ImageComboBoxItem;
                ImageComboBoxItem element  = row.Cells[1].Value as ImageComboBoxItem;
                if (modifier != null && element != null)
                {
                    if (modifier.Tag is FilterModifiers && element.Tag is FilterElements)
                    {
                        filterRules.Add(new FilterRule((FilterModifiers)modifier.Tag, (FilterElements)element.Tag));
                    }
                }
            }
            settings.FilterRules = filterRules;

            settings.CreateRelationships   = chkCreateRelationships.Checked;
            settings.CreateAssociations    = chkCreateAssociations.Checked;
            settings.LabelAggregations     = chkLabelAssociations.Checked;
            settings.RemoveFields          = chkRemoveFields.Checked;
            settings.CreateGeneralizations = chkCreateGeneralizations.Checked;
            settings.CreateRealizations    = chkCreateRealizations.Checked;
            settings.CreateNestings        = chkCreateNesting.Checked;
        }
示例#25
0
        private void LoadLookups()
        {
            var agy  = from agyRec in context.AGY orderby agyRec.NO ascending select new { agyRec.NO, agyRec.NAME };
            var crus = from airRec in context.CRU orderby airRec.CODE ascending select new { airRec.CODE, airRec.NAME };
            var cat  = from catRec in context.ROOMCOD orderby catRec.CODE ascending select new { catRec.CODE, catRec.DESC };
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditLoadCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCopyCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditAgency.Properties.Items.Add(loadBlank);
            foreach (var result in crus)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditLoadCode.Properties.Items.Add(load);
                ImageComboBoxEditCopyCode.Properties.Items.Add(load);
            }
            foreach (var result in agy)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.NO.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.NO.TrimEnd()
                };
                ImageComboBoxEditAgency.Properties.Items.Add(load);
            }
            ImageComboBoxEditAgency.Properties.ReadOnly = true;
        }
示例#26
0
        private void ListStatus(int selectedStatus)
        {
            ImageComboBoxItem item;

            imlStatus.Images.Clear();
            cboStatus.Properties.Items.Clear();

            if (this.SelectedBlock == null)
            {
                return;
            }

            foreach (AccessoryStatus status in this.SelectedBlock.Properties.AccessoryStatus)
            {
                imlStatus.Images.Add(this.SelectedBlock.GetImage(OTCContext.Project.Theme, status.Status));

                item             = new ImageComboBoxItem();
                item.Description = StringUtils.SplitCamelCaseString(status.Name);
                item.Value       = status;
                item.ImageIndex  = imlStatus.Images.Count - 1;

                cboStatus.Properties.Items.Add(item);

                if (selectedStatus == status.Status)
                {
                    cboStatus.SelectedItem = item;
                }
            }
        }
        private RepositoryItem getTransporterMembraneRepository(TransporterExpressionContainerDTO containerDTO)
        {
            string displayName       = containerDTO.ContainerPathDTO.DisplayName;
            string fullDisplayName   = membraneContainerDisplayName(containerDTO.MembraneLocation, containerDTO);
            var    allMembranesTypes = _presenter.AllProteinMembraneLocationsFor(containerDTO).ToList();

            if (allMembranesTypes.Count > 1)
            {
                displayName = fullDisplayName;
            }

            var repositoryItemImageComboBox = new UxRepositoryItemImageComboBox(gridView, _imageListRetriever)
            {
                ReadOnly = (allMembranesTypes.Count == 1), AllowDropDownWhenReadOnly = DefaultBoolean.False
            };

            if (repositoryItemImageComboBox.ReadOnly)
            {
                repositoryItemImageComboBox.Buttons.Clear();
            }


            var comboBoxItem = new ImageComboBoxItem(displayName, containerDTO.MembraneLocation, _imageListRetriever.ImageIndex(containerDTO.ContainerPathDTO.IconName));

            repositoryItemImageComboBox.Items.Add(comboBoxItem);
            return(repositoryItemImageComboBox);
        }
示例#28
0
        private void ilstBatchNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ilstBatchNo.SelectedItem == null)
            {
                grdPWOs.DataSource = null;
                GetMethodStandards(0, 0, "");
                return;
            }

            ImageListBoxItem item = ilstBatchNo.SelectedItem as ImageListBoxItem;

            if (item.Value is BatchByWorkday)
            {
                ImageComboBoxItem cboItem = icboEquipment.SelectedItem as ImageComboBoxItem;
                int t107LeafID            = (cboItem.Value as WIPStation).T107LeafID;

                string batchNo           = ((BatchByWorkday)item.Value).BatchNumber;
                List <BatchPWOInfo> pwos = GetPWOWithBatchNo(t107LeafID, batchNo);
                grdPWOs.DataSource = pwos;
                grdvPWOs.BestFitColumns();

                GetMethodStandards(0, (cboItem.Value as WIPStation).T216LeafID, batchNo);
            }
            else
            {
                IRAPMessageBox.Instance.Show("选择项值对象的类型不是 BatchByWorkday", "", MessageBoxIcon.Error);
            }
        }
示例#29
0
        private void LoadLookups()
        {
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            _hotelCombo.Items.Add(loadBlank);
            _hotelCombo.Items.AddRange(_context.HOTEL.Where(a => a.INACTIVE != "Y")
                                       .OrderBy(o => o.CODE).AsEnumerable()
                                       .Select(s => new ImageComboBoxItem()
            {
                Description = String.Format("{0} ({1})", s.CODE, s.NAME), Value = s.CODE
            })
                                       .ToList());
            gridControlMapping.RepositoryItems.Add(_hotelCombo);      //per DX recommendation to avoid memory leaks

            _catCombo.Items.Add(loadBlank);
            _catCombo.Items.AddRange(_context.ROOMCOD
                                     .OrderBy(o => o.CODE).AsEnumerable()
                                     .Select(s => new ImageComboBoxItem()
            {
                Description = String.Format("{0} ({1})", s.CODE, s.DESC), Value = s.CODE
            })
                                     .ToList());
            gridControlMapping.RepositoryItems.Add(_catCombo);          //per DX recommendation to avoid memory leaks
        }
示例#30
0
        private void LoadLookups()
        {
            var pack = from airRec in context.PACK orderby airRec.CODE ascending select new { airRec.CODE, airRec.NAME };
            var cat  = from catRec in context.ROOMCOD orderby catRec.CODE ascending select new { catRec.CODE, catRec.DESC };
            ImageComboBoxItem loadBlank = new ImageComboBoxItem()
            {
                Description = "", Value = ""
            };

            ImageComboBoxEditLoadCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCopyCode.Properties.Items.Add(loadBlank);
            ImageComboBoxEditCategory.Properties.Items.Add(loadBlank);
            foreach (var result in pack)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.NAME.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditLoadCode.Properties.Items.Add(load);
                ImageComboBoxEditCopyCode.Properties.Items.Add(load);
            }

            foreach (var result in cat)
            {
                ImageComboBoxItem load = new ImageComboBoxItem()
                {
                    Description = result.CODE.TrimEnd() + "  " + "(" + result.DESC.TrimEnd() + ")", Value = result.CODE.TrimEnd()
                };
                ImageComboBoxEditCategory.Properties.Items.Add(load);
            }
            ImageComboBoxEditCategory.Properties.ReadOnly = true;
        }
示例#31
0
 void InitOrientationDropDown()
 {
     foreach (Orientation orientation in Enum.GetValues(typeof(Orientation)))
     {
         ImageComboBoxItem cbItem = new ImageComboBoxItem(orientation.ToString(), orientation);
         repositoryItemImageComboBox1.Items.Add(cbItem);
     }
     bEIOrientation.EditValue = Orientation.Horizontal;
     bEIOrientation.EditValueChanged += barEditItem2_EditValueChanged;
 }
示例#32
0
        private void SetDataSource(string tenFile, long? kichthuoc, string loai, string ngaytao, string fileType)
        {
            string name = tenFile;
            DataRow dr = dtFileAtt.NewRow();
            if (!System.IO.File.Exists(tenFile))
            {
                name = name.Substring(name.LastIndexOf("\\")+1);
            }
            ImageComboBoxItem item = new ImageComboBoxItem(name,imageList1.Images.IndexOfKey(fileType));
            repositoryItemImageComboBox1.Items.Add(item);

            dr["NAME"] = name;
            if (kichthuoc != null)
                dr["SIZE"] = (((kichthuoc / 1024) < 1) ? 1 : (kichthuoc / 1024)).ToString() + " KB";
            else
                dr["SIZE"] = "";
            dr["TYPE"] = loai;
            dr["DATE"] = ngaytao;
            dtFileAtt.Rows.Add(dr);
            gridControl1.DataSource = dtFileAtt;
        }
示例#33
0
 /// <summary>
 /// 初始化RepositoryItemImageComboBox
 /// </summary>
 /// <param name="cbx">RepositoryItemImageComboBox控件</param>
 /// <param name="comboboxno">ComboBox配置编号</param>
 /// <param name="fieldtype">字段类型,如果是I则说明绑定此字段是Int类型,现在只支持Int和String类型的字段</param>
 public static void InitRepositoryItemComboBox(RepositoryItemImageComboBox cbx, string comboboxno,string fieldtype)
 {
     string sSql = "SELECT sGridDisplayField,sGridColumnText, sEnGridColumnText "
                 + "FROM sysLookupSetting "
                 + "WHERE sType='ComboBox' AND sLookupNo='" + comboboxno + "'";
     DataTable dtTmp = DbHelperSQL.Query(sSql).Tables[0];
     if (dtTmp != null && dtTmp.Rows.Count > 0)
     {
         string[] ValueFields = Public.GetSplitString(dtTmp.Rows[0]["sGridDisplayField"].ToString(), ",");
         string[] DisplayText = Public.GetSplitString(LangCenter.Instance.IsDefaultLanguage ?
             dtTmp.Rows[0]["sGridColumnText"].ToString() : dtTmp.Rows[0]["sEnGridColumnText"].ToString(), ",");
         if (ValueFields.Length == DisplayText.Length)
         {
             cbx.Items.Clear();
             for (int i = 0; i < ValueFields.Length; i++)
             {
                 if (fieldtype == "I")
                 {
                     ImageComboBoxItem item = new ImageComboBoxItem();
                     item.Description = DisplayText[i];
                     item.Value = Convert.ToInt32(ValueFields[i]);
                     cbx.Properties.Items.Add(item);
                 }
                 else
                     cbx.Properties.Items.Add(new ImageComboBoxItem(DisplayText[i], ValueFields[i]));
             }
         }
         else
             Public.SystemInfo(LangCenter.Instance.GetSystemMessage("InitComboBoxFailed"), true);
     }
 }
示例#34
0
 private void SetUpLanguagePicker()
 {
     ImageComboBoxItem german = new ImageComboBoxItem("Deutsch", "german");
     german.Tag = new CultureInfo("de-DE");
     ImageComboBoxItem english = new ImageComboBoxItem("English", "english");
     english.Tag = new CultureInfo("en");
     iCB_language.Items.Add(german);
     iCB_language.Items.Add(english);
     iCB_language.SelectedIndex = 0;
 }
示例#35
0
        private void FrmSmmuserEdit_new_Load(object sender, EventArgs e)
        {
            listView1.View = System.Windows.Forms.View.List;
            if (_smmuser == null)
            {
                _smmuser = new Smmuser();
                isNew = true;
            }
            else
            {
                tbUserid.Enabled = false;
            }
            for (int i = 0; i < imageList2.Images.Count; i++)
            {
                //imageComboBoxEdit1
                ImageComboBoxItem tempItem = new ImageComboBoxItem();
                //tempItem.Description = i.ToString();
                tempItem.ImageIndex = i;
                tempItem.Value = i;
                imageComboBoxEdit1.Properties.Items.Add(tempItem);
            }

            tbUserid.DataBindings.Add("Text", DataObject, "Userid");
            tbUserName.DataBindings.Add("Text", DataObject, "UserName");
            tbPassword.DataBindings.Add("Text", DataObject, "Password");
            tbExpireDate.DataBindings.Add("Text", DataObject, "ExpireDate");
            //tbDisableflg.DataBindings.Add("Text", DataObject, "Disableflg");
            //tbLastlogon.DataBindings.Add("Text", DataObject, "Lastlogon");

            tbRemark.DataBindings.Add("Text", DataObject, "Remark");
            int tempint = 0;
            if (int.TryParse(DataObject.Lastlogon,out tempint))
            {
                imageComboBoxEdit1.SelectedIndex = tempint;
            }
            else
            {
                imageComboBoxEdit1.SelectedIndex = tempint;
            }

            if (DataObject.Disableflg == "Y") {
                tbDisableflg.Checked = true;
            }
            smuGroupTable = DataConverter.ToDataTable(SmmprogService.GetList("SelectSmugroupByUserid", userNo), typeof(Smugroup));

            foreach (DataRow row in smuGroupTable.Rows)
            {
                groupItems.Add(row["Groupno"], row);
                ListViewItem listItem = new ListViewItem();
                listItem.Name = row["Groupno"].ToString();
                listItem.Text = row["Groupname"].ToString();
                listItem.ImageIndex = 0;
                listItem.Tag = DataConverter.RowToObject<Smugroup>(row);
                listView1.Items.Add(listItem);
            }
            if (currentuser!="admin")
            {
                btn_addgroup.Enabled = false;
                btn_DeleteGroup.Enabled = false;

            }
        }
示例#36
0
        private void SetupFunctionDropdown()
        {
            repositoryItemImageComboBox1.Items.Clear();
            AnalogInputConfiguration obj;

            for (int i = 1; i <= 30; i++)
            {
                obj = Session.DefaultSession.FindObject<AnalogInputConfiguration>(CriteriaOperator.Parse("[CardSerial] == ? AND [CardRevision] == ? AND [CardModel] == ? AND [Input] == ?", _CardSerialNumber, _CardRevision, _CardModel, i));

                ImageComboBoxItem item;
                string ButtonDescription = obj.InputName;

                item = new ImageComboBoxItem
                {
                    Description = string.Format("Input {0} Button On ({1})", i, ButtonDescription),
                    Value = i + "|down",
                    ImageIndex = 6
                };
                repositoryItemImageComboBox1.Items.Add(item);

                item = new ImageComboBoxItem
                {
                    Description = string.Format("Input {0} Button Off ({1})", i, ButtonDescription),
                    Value = i + "|up",
                    ImageIndex = 5
                };
                repositoryItemImageComboBox1.Items.Add(item);
            }

            ilFunction.EditValue = "1|down";
        }
示例#37
0
        /// <summary>
        /// Populates the main form filters the images in the database using the string specified in the search field.
        /// </summary>
        private void PerformSearch()
        {
            if (string.IsNullOrEmpty(tSICB_search.Text)) return;
            string keyword = tSICB_search.Text.ToLowerInvariant();
            SearchItem item = new SearchItem(keyword, _searchCriterion);
            if (!_searchKeywords.Contains(item))
            {
                _searchKeywords.Add(item);
                ImageComboBoxItem displayItem = new ImageComboBoxItem(keyword);
                string imageKey = "";
                switch (_searchCriterion)
                {
                    case SearchCriterion.Product: imageKey = "product"; break;
                    case SearchCriterion.ProductWithLicense: imageKey = "productwithlicense"; break;
                    case SearchCriterion.UserWithLicense: imageKey = "userwithlicense"; break;
                    case SearchCriterion.LicenseByProduct: imageKey = "licensebyuser"; break;
                    case SearchCriterion.LicenseByUser: imageKey = "licensebyproduct"; break;
                    default: imageKey = "product"; break;
                }
                displayItem.ImageKey = imageKey;
                tSICB_search.Items.Add(displayItem);
            }

            SelectControls(item.SearchCriterion);

            switch (_searchCriterion)
            {
                case SearchCriterion.Product:
                    SearchProduct();
                    break;
                case SearchCriterion.UserWithLicense:
                    SearchUserWithLicense();
                    break;
                case SearchCriterion.ProductWithLicense:
                    SearchProductWithLicense();
                    break;

                case SearchCriterion.LicenseByUser:
                    SearchLicenseByUser();
                    break;

                case SearchCriterion.LicenseByProduct:
                    SearchLicenseByProduct();
                    break;

                default:
                    SearchProduct();
                    break;
            }
        }
示例#38
0
        private void PopulateLanguageComboBox()
        {
            comboLanguage.Items.Clear();

            var imageList = new ImageList() {
                ImageSize = new Size(16, 16),
                ColorDepth = ColorDepth.Depth32Bit
            };
            comboLanguage.IconList = imageList;

            int selectedIndex = -1;
            foreach (var langPair in _languageList) {
                var item = new ImageComboBoxItem(langPair.Name, imageList.Images.Count) {
                    Tag = langPair.Culture
                };
                imageList.Images.Add(langPair.Image);
                comboLanguage.Items.Add(item);

                if (langPair.Culture.Equals(CultureInfo.CurrentUICulture)) {
                    selectedIndex = comboLanguage.Items.Count - 1;
                }
            }

            //Handle case when there is not explicitly set culture (default to first one, i.e. english)
            if (CultureInfo.CurrentUICulture.Equals(CultureInfo.InvariantCulture))
                selectedIndex = 0;

            comboLanguage.SelectedIndex = selectedIndex;
        }
示例#39
0
        private void SetupScriptNewScript()
        {
            XPCollection collection = new XPCollection(typeof(Database.AnalogOutputScripts), CriteriaOperator.Parse(String.Format("CardModel == '{0}' AND CardRevision == '{1}' AND CardSerial == {2}", _CardModel, _CardRevision, _CardSerialNumber)));

            foreach (Database.AnalogOutputScripts dbitem in collection)
            {
                ImageComboBoxItem item;
                if (dbitem.Bit == -1)
                {
                    // Offset is a byte
                    item = new ImageComboBoxItem
                    {
                        Description = string.Format("Offset 0x{0}", dbitem.Offset),
                        Value = dbitem.Oid,
                        ImageIndex = 6
                    };
                }
                else
                {
                    // Offset is a bit
                    item = new ImageComboBoxItem
                    {
                        Description = string.Format("Offset 0x{0}, Bit {1}", dbitem.Offset, dbitem.Bit),
                        Value = dbitem.Oid,
                        ImageIndex = 6
                    };
                }

                bool itemadded = false;
                foreach (ImageComboBoxItem cbitem in repositoryItemImageComboBox1.Items)
                {
                    if (cbitem.Description == item.Description)
                        itemadded = true;
                }
                if (itemadded == false)
                    repositoryItemImageComboBox1.Items.Add(item);
            }
            collection.Dispose();
        }
 /// <summary>
 /// 初始化Grid中ComboBox数据
 /// </summary>
 /// <param name="dictNo"></param>
 /// <param name="combobox"></param>
 private void InitDetailComboBox(string dictNo, RepositoryItemComboBox combobox)
 {
     DataTable dtTmp = SystemPublic.GetDictData(dictNo);
     combobox.Items.Clear();
     foreach (DataRow dr in dtTmp.Rows)
     {
         ImageComboBoxItem item = new ImageComboBoxItem();
         item.Description = LangCenter.Instance.IsDefaultLanguage ? dr["sDictDataCName"].ToString() : dr["sDictDataEName"].ToString();
         item.Value = dr["sDictDataNo"];
         combobox.Items.Add(item);
     }
 }