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


C# BindingList.Select方法代码示例

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


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

示例1: CreateXmlFile

        public static void CreateXmlFile(string fileName, string rootName, BindingList<string> list)
        {
            var array = list.Select(item => item.ToString())
                            .ToList();

            CreateXmlFile(fileName,rootName,array);
        }
开发者ID:servitola,项目名称:WpfBaggage,代码行数:7,代码来源:Xml.cs

示例2: Add

        public void Add(BindingList<Word> input)
        {
            var deepCopy = input.Select(o => (Word)o.Clone()).ToList();

            undoStack.Push(new BindingList<Word> (deepCopy));
            redoStack.Clear();

            Console.WriteLine("UndoStack: {0}\nRedoStack: {1}", UndoSize, RedoSize);
        }
开发者ID:marcin-waszak,项目名称:glossary,代码行数:9,代码来源:ChangesStack.cs

示例3: ListControlGridViewModel

        public ListControlGridViewModel(ObservableCollection<ControlView> properties,
            BindingList<IntWrappper> arrayIndexes,
            Type fieldType,
            ControlView baseTypeProperties
            )
        {
            Properties = properties;
            ArrayIndexes = arrayIndexes;
            FieldType = fieldType;
            _baseTypeProperties = baseTypeProperties;

            int x = 1;
            if (ArrayIndexes.Count == 1) x = 1;
            else if (ArrayIndexes.Count > 1)
            {
                for (var i = 0; i < ArrayIndexes.Count - 1; i++)
                {
                    x = x * ArrayIndexes[i].Int;
                }
            }
            int y = ArrayIndexes[ArrayIndexes.Count - 1].Int;

            _listOfListItemGrid = new List<List<ArrayItem>>();

            int totalElementsInList = arrayIndexes.Aggregate(1, (current, iw) => current * iw.Int);
            if (Properties.Count < totalElementsInList)
            {
                for (int i = Properties.Count; i < totalElementsInList; i++)
                {
                    Properties.Add(Controller.DeepCopy(_baseTypeProperties));
                }
            }

            var indexCount = 0;
            List<ArrayItem> l = new List<ArrayItem>();
            List<int> arrayIndexesInt = arrayIndexes.Select(o => o.Int).ToList();
            for (var j = 0; j < x * y; j++)
            {
                if (j % y == 0)
                {
                    l = new List<ArrayItem>();
                    _listOfListItemGrid.Add(l);
                }

                List<int> indexes = new List<int>();

                for (int ir = 0; ir < arrayIndexesInt.Count; ir++)
                {
                    TestHelper.GetArrayIndexesFromLinearIndex(arrayIndexesInt, ir, indexes, j);
                }

                l.Add(new ArrayItem()
                {
                    Index = Convert.ToString(indexCount),
                    DisplayIndex = string.Join(",", indexes.ToArray())
                });
                indexCount++;
            }

            NotifyOfPropertyChange(() => ListOfListItemGrid);
        }
开发者ID:huoxudong125,项目名称:WCFLoadUI,代码行数:61,代码来源:ListControlGridViewModel.cs

示例4: PasteFillsSelection

        public void PasteFillsSelection()
        {
            var list = new BindingList<Person>()
                           {
                               new Person {Name = "jan", Age = 25},
                               new Person {Name = "fon", Age = 33},
                               new Person {Name = "peer", Age = 25},
                               new Person {Name = "fo", Age = 33}
                           };

            var tableView = new TableView {Data = list};

            //select all cells in first column 
            tableView.SelectCells(0, 0, 3, 0);

            //hook up a copy paste controller
            var tableViewCopyPasteController = new TableViewPasteController(tableView);
            //this should set the first column to kees,anton,kees,anton
            tableViewCopyPasteController.PasteLines(new[] {"kees", "anton"});

            //asert the names are now like this
            Assert.AreEqual(new[] {"kees", "anton", "kees", "anton"}, list.Select(p => p.Name).ToArray());
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:23,代码来源:TableViewPasteControllerTest.cs

示例5: CopyPasteEnumInBindingList

        public void CopyPasteEnumInBindingList()
        {
            var list = new BindingList<ClassWithEnum>
                           {
                               new ClassWithEnum{Type = FruitType.Banaan},
                               new ClassWithEnum{Type = FruitType.Peer}
                           };
            var tableView = new TableView { Data = list };
            tableView.SetEnumComboboxEditor(typeof(FruitType),0);
            
            var tableViewCopyPasteController = new TableViewPasteController(tableView);
            //select 2nd row
            tableView.SelectCells(1,0,1,0);

            //paste twee bananen en een peer ;)
            tableViewCopyPasteController.PasteLines(new[]{"Banaan","Banaan","Peer" });
            
            //we should have 3 bananas and a pear
            Assert.AreEqual("Banaan","Banaan","Banaan","Peer",list.Select(c=>c.Type).ToArray());
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:20,代码来源:TableViewPasteControllerTest.cs

示例6: SaveList

 public static void SaveList(BindingList<AForgeFunction> list, string filename)
 {
     File.WriteAllLines(filename, list.Select(x => x.ToString()).ToArray());
 }
开发者ID:jkuusama,项目名称:LitePlacer-ver2,代码行数:4,代码来源:AForgeFunction.cs

示例7: SpostamentoTestata

        public string SpostamentoTestata(BindingList<int> idTestate, int idEsercizio, DateTime dataRegistrazione, UserInfo userinfo)
		{
			var windsorRep = new WindsorConfigRepository();
			try
			{
				windsorRep.BeginTransaction(userinfo);
                var message = new StringBuilder();
                var movimentiService = windsorRep.GetContainer(userinfo.Azienda).Resolve<IMovimentiContabiliService>();
				foreach (var singleMessage in idTestate.Select(idTestata => movimentiService.CambioEsercizio(idTestata, idEsercizio, dataRegistrazione)).Where(singleMessage => !string.IsNullOrEmpty(singleMessage)))
				    message.Append(singleMessage + Environment.NewLine);

				windsorRep.Commit(); 
				return message.ToString();
			}
			catch (Exception ex)
			{
                _log.ErrorFormat("Errore nello spostamento di una testata contabile - {0} - idEsercizioNuovo:{1} - dataRegistrazione:{2}", ex, Utility.GetMethodDescription(), idEsercizio, dataRegistrazione);
				windsorRep.Rollback();
				throw;
			}
		}
开发者ID:gipasoft,项目名称:Sfera,代码行数:21,代码来源:SferaService.cs


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