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


C# List.IndexOf方法代码示例

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


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

示例1: GetLayoutGroupForEmailParsingRule


//.........这里部分代码省略.........
                    {
                        itemSettings.Caption = CultureHelper.GetStringForCurentCulture("AddNewRuleForDataModel_SaveEmail_Choose_mode");
                        itemSettings.ShowCaption = DefaultBoolean.False;
                        itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.Label;
                        LabelSettings lbSettings = (LabelSettings)itemSettings.NestedExtensionSettings;
                        lbSettings.Text = CultureHelper.GetStringForCurentCulture("AddNewRuleForDataModel_SaveEmail_Choose_mode");
                    });

                    saveEmailGroupItem.Items.AddEmptyItem();
                    saveEmailGroupItem.Items.AddEmptyItem();

                    for (k = 0; k < saveEmailProperties.Count; k++)
                    {
                        saveEmailGroupItem.Items.Add(itemSettings =>
                        {
                            itemSettings.Name = "SaveEmailProperties[" + k + "].Id";
                            itemSettings.ShowCaption = DefaultBoolean.False;
                            itemSettings.ClientVisible = false;
                            itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.TextBox;
                            TextBoxSettings lbSettings = (TextBoxSettings)itemSettings.NestedExtensionSettings;
                            lbSettings.Text = saveEmailProperties[k].Id.ToString();
                        });
                        //saveEmailProperties[0].TableId
                        saveEmailGroupItem.Items.Add(itemSettings =>
                        {
                            itemSettings.Name = "SaveEmailProperties[" + k + "].TableId";
                            itemSettings.Caption = CultureHelper.GetStringForCurentCulture("AddNewRuleModel_TableId_Choose_table_");
                            itemSettings.ShowCaption = DefaultBoolean.False;
                            itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.ComboBox;
                            ComboBoxSettings cbSettings = (ComboBoxSettings)itemSettings.NestedExtensionSettings;
                            cbSettings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            cbSettings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                            cbSettings.Properties.DataSource = tables;
                            cbSettings.SelectedIndex = tables.IndexOf(saveEmailProperties[k].TableId);
                        });
                        //w => saveEmailProperties[0].Worksheet,
                        saveEmailGroupItem.Items.Add(itemSettings =>
                        {
                            itemSettings.Name = "_" + k + "_SaveEmailProperties_Worksheet";
                            itemSettings.Caption = CultureHelper.GetStringForCurentCulture("AddNewRuleForDataModel_Worksheet_Choose_spreadsheet");
                            itemSettings.ShowCaption = DefaultBoolean.False;
                            itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.ComboBox;
                            ComboBoxSettings cbSettings = (ComboBoxSettings)itemSettings.NestedExtensionSettings;
                            cbSettings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            cbSettings.Properties.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                            cbSettings.Properties.DataSource = worksheetsList;
                            cbSettings.SelectedIndex = Convert.ToInt32(saveEmailProperties[k].Worksheet);
                            cbSettings.Properties.ClientSideEvents.SelectedIndexChanged = "function() {SaveEmailProperties_" + k + "__Worksheet.value=_" + k + "_SaveEmailProperties_Worksheet.GetValue();}";
                        });

                        saveEmailGroupItem.Items.Add(itemSettings =>
                        {
                          //  itemSettings.Name = "SaveEmailProperties[" + k + "].Worksheet";
                            itemSettings.ShowCaption = DefaultBoolean.False;
                            itemSettings.ClientVisible = false;
                            //itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.TextBox;
                            //TextBoxSettings lbSettings = (TextBoxSettings)itemSettings.NestedExtensionSettings;
                            //lbSettings.Text = saveEmailProperties[k].Worksheet;
                        }).SetNestedContent("<input data-val=\"true\" data-val-number=\"Значением поля Worksheet должно быть число.\" data-val-required=\"The Worksheet field is required.\"" +
                        "id=\"SaveEmailProperties_"+k+"__Worksheet\"" +
                        "name=\"SaveEmailProperties["+k+"].Worksheet\" type=\"hidden\" value="+saveEmailProperties[k].Worksheet+">");

                        //w => saveEmailProperties[0].Column,
                        saveEmailGroupItem.Items.Add(itemSettings =>
                        {
                            itemSettings.Name = "SaveEmailProperties[" + k + "].Column";
开发者ID:Zowal,项目名称:Oasis,代码行数:67,代码来源:EmailController.cs


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