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


C# BindingList.IndexOf方法代码示例

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


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

示例1: PopulatePosition

        public static void PopulatePosition(DataRow TeamData, BindingList<string> Position)
        {
            if (TeamData[3].ToString() != "")
                index = Position.IndexOf(TeamData[3].ToString() + ' ' + TeamData[2].ToString());
            else
                index = Position.IndexOf(TeamData[2].ToString());

            if (index >= 0)
            {
            }
            else
            {
                if (TeamData[3].ToString() != "")
                    Position.Add(TeamData[3].ToString() + ' ' + TeamData[2].ToString());
                else
                    Position.Add(TeamData[2].ToString());
                index = Position.IndexOf(TeamData[2].ToString());
            }
        }
开发者ID:DarrenLyne,项目名称:FYP,代码行数:19,代码来源:PopulatePositionLists.cs

示例2: UpdateImagesInfoGrid

        private void UpdateImagesInfoGrid()
        {
            string selectedRowFileName = string.Empty;
            if (ImagesInfoGrid.SelectedRows.Count != 0)
                selectedRowFileName = ((ImageFileData)ImagesInfoGrid.SelectedRows[0].DataBoundItem).FileName;
            IEnumerable<ImageFileData> imagesInfo = manager.GetAllImagesInfo(true);
            if (imagesInfo == null)
                return;
            ImagesInfoGrid.Rows.Clear();
            var bindingList = new BindingList<ImageFileData>(new List<ImageFileData>(imagesInfo));
            ImagesInfoGrid.Invoke(new MethodInvoker(delegate() { ImagesInfoGrid.DataSource = bindingList; }));

            ImageFileData rowObject = bindingList.SingleOrDefault(p => p.FileName.Equals(selectedRowFileName));
            if (rowObject != null)
                ImagesInfoGrid.Rows[bindingList.IndexOf(rowObject)].Selected = true;
        }
开发者ID:duda92,项目名称:ImageService,代码行数:16,代码来源:ImageServiceClientForm.cs

示例3: FormAddPerson_Load

 private void FormAddPerson_Load(object sender, EventArgs e)
 {
     BindingList<Address> addresses = new BindingList<Address>(_repo.GetAddresses());
     comboBoxAddresses.DataSource = addresses;
     var index = (from a in addresses where a.Id == _addressId select addresses.IndexOf(a)).FirstOrDefault();
     comboBoxAddresses.SelectedIndex = index;
 }
开发者ID:vault60,项目名称:DotNetProjects,代码行数:7,代码来源:FormAddPerson.cs

示例4: CheckLabelsListWithXml


//.........这里部分代码省略.........
                            current_label = tokens[5];

                            //filter labels comming from blank rows
                            if (current_label.Trim().CompareTo("") != 0)
                            {

                                //Check if the label is valid according to the Xml protocol list
                                //if not, flag the label as invalid
                                if (List_Current_XML.Contains(current_label))
                                {
                                    //Start Time
                                    str_temp = tokens[3].Split('.');

                                    start_time = DateTime.Parse(StartDate + " " + str_temp[0]);
                                    ts_start = (start_time - new DateTime(1970, 1, 1, 0, 0, 0));

                                    //Stop Time
                                    str_temp = tokens[4].Split('.');

                                    end_time = DateTime.Parse(EndDate + " " + str_temp[0]);
                                    ts_end = (end_time - new DateTime(1970, 1, 1, 0, 0, 0));

                                    ts = ts_end.Subtract(ts_start);

                                    total_time = total_time + ts;

                                        if (!List_Annotated.Contains(current_label))
                                        {
                                            List_Annotated.Add(current_label);
                                            List_Time.Add(ts);
                                        }
                                        else
                                        {
                                            index = List_Annotated.IndexOf(current_label);
                                            //ts_start = List_Time[index];
                                            //ts = ts + ts_start;
                                            List_Time[index] = ts + List_Time[index];
                                        }

                                    //Check if the total time spend on this label makes sense (greater than 0)
                                    //If so, add the label to the annotated list
                                    //Otherwise, highlighted as problematic and don't generate the xml file
                                    if ( ts.TotalSeconds == 0)
                                    {
                                        Is_LabelsList_Valid = false;

                                        #region  highlight label in yellow

                                        int iloop = 0;
                                        int irow = 0;

                                        while(iloop <2)
                                        {
                                           if(iloop == 0)
                                           {   //Highlight Start Row
                                               irow = Int32.Parse(tokens[1]);
                                           }
                                           else if(iloop == 1)
                                           {    //Highlight End Row
                                                irow = Int32.Parse(tokens[2]);
                                           }

                                           iloop++;

                                           if (c == 1)
                                           {
开发者ID:katadam,项目名称:wockets,代码行数:67,代码来源:FormAnnotation.cs

示例5: 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


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