当前位置: 首页>>代码示例>>C#>>正文


C# BindingList.Insert方法代码示例

本文整理汇总了C#中BindingList.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# BindingList.Insert方法的具体用法?C# BindingList.Insert怎么用?C# BindingList.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindingList的用法示例。


在下文中一共展示了BindingList.Insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendPOCViewmodel

        public SendPOCViewmodel(IAddressBookModel addressBook)
        {
            _docClasses = new BindingList<DocumentClass>(DocumentClass.GetDocumentClassList());
            _selectedDocumentClass = _docClasses[0];

            _deliverQualityList = new BindingList<Models.DeliveryQuality>(Models.DeliveryQuality.GetDeliveryQualityList());
            _selectedDeliveryQuality = _deliverQualityList[0];
            _addressBook = addressBook;

            _confirmationEMailList = new BindingList<string>(_addressBook.GetMailAdresslist());
            _confirmationEMailList.Insert(0, Properties.Settings.Default.PleaseChoose);
            _selectedEmailToConfirm = _confirmationEMailList[0];
            _confirmByEMail = true;
            _confirmByWebServiceUrl = false;
            _lockedUntilDateTime = DateTime.Today.AddDays(1);
            _lockedUtilTime = new DateTime(_lockedUntilDateTime.Year, _lockedUntilDateTime.Month, _lockedUntilDateTime.Day, 0, 0, 0);
        }
开发者ID:austriapro,项目名称:e-zustellung-privat-word-addin,代码行数:17,代码来源:SendPOCViewmodel.cs

示例2: loadSomeData

        private void loadSomeData()
        {
            if(customers == null)
            {
                CustomerService customerService = new CustomerService();
                customers = new BindingList<Customer>(customerService.GetCustomers().OrderBy(x => x.CustCode).ToList());
                customers.Insert(0, new Customer() { Id = 0, CustCode = "", CustomerName = ""});
            }
            if (customers != null)
            {
                cbxCustomer.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                cbxCustomer.AutoCompleteSource = AutoCompleteSource.ListItems;

                cbxCustomer.DataSource = customers;
                cbxCustomer.DisplayMember = "CustCode";
                cbxCustomer.ValueMember = "Id";
            }
            ProductAttributeService productAttrService = new ProductAttributeService();
            productAttrs = new BindingList<ProductAttributeModel>(productAttrService.GetProductAndAttribute());
            units = new BindingList<MeasurementUnit>(unitService.GetMeasurementUnits());
            if (order != null)
            {
                if (customers != null)
                {
                    cbxCustomer.SelectedIndex = customers.ToList().FindIndex(cus => cus.Id == order.CustId);
                }
                txtDiscount.WorkingText = order.Discount.HasValue ? order.Discount.Value.ToString() : "";
                txtNote.Text = order.Note;
                txtVAT.WorkingText = order.VAT.HasValue ? order.VAT.Value.ToString() : "";
                txtOrderCode.Text = order.OrderCode;
                txtCreatedDate.Text = order.CreatedDate.ToString(BHConstant.DATE_FORMAT);

                txtVAT.Text = Global.formatVNDCurrencyText(txtVAT.WorkingText);
                txtDiscount.Text = Global.formatVNDCurrencyText(txtDiscount.WorkingText);
                txtWare.Text = order.WareHouse;
                txtReason.Text = order.Reason;
            }
            else
            {
                txtCreatedDate.Text = BaoHienRepository.GetBaoHienDBDataContext().GetSystemDate().ToString(BHConstant.DATE_FORMAT);
                txtOrderCode.Text = Global.GetTempSeedID(BHConstant.PREFIX_FOR_ORDER);
            }
        }
开发者ID:psautomationteam,项目名称:manufacturingmanager,代码行数:43,代码来源:AddOrder.cs

示例3: MoveEncodersDown

    private void MoveEncodersDown(DataGridView grid, BindingList<DisplaySoftwareEncoder> list)
    {
      DataGridViewSelectedRowCollection srows = grid.SelectedRows;
      List<int> indices = new List<int>();
      if (srows.Count == 0)
      {
        return;
      }

      // Juggle rows...
      for (int i = srows.Count - 1; i >= 0; i--)
      {
        int index = srows[i].Index;
        indices.Add(index);
        if (index < grid.Rows.Count - 1)
        {
          list[index].Priority = (Convert.ToInt32(list[index].Priority) + 1).ToString();
          list[index + 1].Priority = (Convert.ToInt32(list[index + 1].Priority) - 1).ToString();
          DisplaySoftwareEncoder item = list[index + 1];
          list.RemoveAt(index + 1);
          list.Insert(index, item);
        }
      }

      // Maintain selection...
      grid.ClearSelection();
      for (int i = indices.Count - 1; i >= 0; i--)
      {
        int index = indices[i];
        if (index == grid.Rows.Count - 1)
        {
          grid.Rows[index].Selected = true;
        }
        else
        {
          grid.Rows[index + 1].Selected = true;
        }
      }
    }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:39,代码来源:ScanSettings.cs

示例4: MovePositionRow

        public void MovePositionRow(CBatch_detail_aa_twofold row_ini, CBatch_detail_aa_twofold row_end)
        {
            CBatch_detail_aa_twofoldFactory faBatch_detail_aa_twofold = new CBatch_detail_aa_twofoldFactory();
            BindingList<CBatch_detail_aa_twofold> lst = new BindingList<CBatch_detail_aa_twofold>(ListSamples);

            // --- copiar muestra drag como temporal
            CBatch_detail_aa_twofold tmp_row_ini = lst.Single(c => c.Cod_interno == row_ini.Cod_interno);
            CBatch_detail_aa_twofold tmp_row_end = lst.Single(c => c.Cod_interno == row_end.Cod_interno);

            // --- quitar muestra drag de la lista
            lst.Remove(tmp_row_ini);

            // --- obetener indice o posición a donde será movido
            int new_index_end = lst.IndexOf(tmp_row_end);

            // --- insertar la muestra que fue removida
            lst.Insert(new_index_end, tmp_row_ini);

            // --- reset orden de las muestras
            short count = 1;
            foreach (CBatch_detail_aa_twofold item in lst)
            {
                item.Order_sample_batch = count;
                count++;

                faBatch_detail_aa_twofold.Update(item);
            }

            // --- get source data
            dtPivotBatch =
                new BindingList<CBatch_detail_aa_twofold>(
                    faBatch_detail_aa_twofold
                    .GetAll()
                    .Where(c => c.Idbatch == Idbatch && c.Idtemplate_method == Idtemplate_method).ToList());
        }
开发者ID:khoattn,项目名称:LimsProject,代码行数:35,代码来源:CDataBatch.cs

示例5: LoadDesignData

        protected void LoadDesignData()
        {
            this.DataContext = new DesignEditorDataContext();

            this.View.ShowWaitCursor();

            try
            {
                //initialize sale
                DataContext.Sale = Database.From<SaleVM>()
                    .Read().FirstOrDefault() ?? new SaleVM(Database);

                //initialize cuttingunits
                var units = Database.From<CuttingUnitDO>()
                    .Read().ToList();

                foreach (CuttingUnitDO cu in units)
                {
                    cu.Strata.Populate();
                }
                DataContext.AllCuttingUnits = new BindingList<CuttingUnitDO>(units);
                DataContext.CuttingUnits = new BindingList<CuttingUnitDO>(units);

                BindingList<CuttingUnitDO> filterUnits = new BindingList<CuttingUnitDO>(units.ToList());
                _anyUnitOption = new CuttingUnitDO();
                _anyUnitOption.Code = "ANY";
                filterUnits.Insert(0, _anyUnitOption);
                DataContext.CuttingUnitFilterSelectionList = filterUnits;

                //initialize strata
                var strata = Database.From<DesignEditorStratum>()
                    .Read().ToList();

                foreach (StratumDO st in strata)
                {
                    st.CuttingUnits.Populate();
                }
                DataContext.AllStrata = new BindingList<DesignEditorStratum>(strata);
                DataContext.Strata = new BindingList<DesignEditorStratum>(strata);

                BindingList<DesignEditorStratum> filterStrata = new BindingList<DesignEditorStratum>(strata.ToList());
                _anyStratumOption = new DesignEditorStratum();
                _anyStratumOption.Code = "ANY";
                filterStrata.Insert(0, _anyStratumOption);
                DataContext.StrataFilterSelectionList = filterStrata;

                //initialize TreeDefault
                var tdvList = Database.From<TreeDefaultValueDO>()
                    .Read().ToList();

                DataContext.AllTreeDefaults = new BindingList<TreeDefaultValueDO>(tdvList);

                //initialize sample groups
                List<SampleGroupDO> sampleGroups = Database.From<SampleGroupDO>()
                    .Read().ToList();

                DataContext.AllSampleGroups = new BindingList<SampleGroupDO>(sampleGroups);
                DataContext.SampleGroups = new BindingList<SampleGroupDO>(sampleGroups);

                foreach (SampleGroupDO sg in DataContext.AllSampleGroups)
                {
                    sg.TreeDefaultValues.Populate();
                }

                DataContext.HasUnsavedChanges = false;
            }
            finally
            {
                this.View.ShowDefaultCursor();
            }
        }
开发者ID:FMSC-Measurements,项目名称:CruiseManager,代码行数:71,代码来源:DesignEditorPresentor.cs


注:本文中的BindingList.Insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。