本文整理汇总了C#中Dev2.Studio.ViewModels.DataList.DataListViewModel.RemoveDataListItem方法的典型用法代码示例。如果您正苦于以下问题:C# DataListViewModel.RemoveDataListItem方法的具体用法?C# DataListViewModel.RemoveDataListItem怎么用?C# DataListViewModel.RemoveDataListItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.ViewModels.DataList.DataListViewModel
的用法示例。
在下文中一共展示了DataListViewModel.RemoveDataListItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataListViewModel_RemoveDataListItem_WithRecsetItem_ShouldRemoveFromRecsetCollection
public void DataListViewModel_RemoveDataListItem_WithRecsetItem_ShouldRemoveFromRecsetCollection()
{
//------------Setup for test--------------------------
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
const string recsetName = "recset";
const string firstFieldName = "f1";
var recSetDataModel = CreateRecsetDataListModelWithTwoFields(recsetName, firstFieldName, "f2");
dataListViewModel.RecsetCollection.Add(recSetDataModel);
var dataListParts = new List<IDataListVerifyPart>();
var part = CreateRecsetPart(recsetName, firstFieldName);
dataListParts.Add(part.Object);
//----------------------Precondition----------------------------
Assert.AreEqual(1, dataListViewModel.RecsetCollection.Count);
//------------Execute Test---------------------------
dataListViewModel.RemoveDataListItem(recSetDataModel);
//------------Assert Results-------------------------
Assert.AreEqual(0, dataListViewModel.RecsetCollection.Count);
}
示例2: DataListViewModel_RemoveDataListItem_WithRecsetFieldItem_ShouldRemoveFromRecsetChildrenCollection
public void DataListViewModel_RemoveDataListItem_WithRecsetFieldItem_ShouldRemoveFromRecsetChildrenCollection()
{
//------------Setup for test--------------------------
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
const string recsetName = "recset";
const string firstFieldName = "f1";
IDataListItemModel recSetDataModel = DataListItemModelFactory.CreateDataListModel(recsetName, "A recordset of information about a car", enDev2ColumnArgumentDirection.Both);
IDataListItemModel firstFieldDataListItemModel = CreateFieldDataListModel(firstFieldName, recSetDataModel);
recSetDataModel.Children.Add(firstFieldDataListItemModel);
recSetDataModel.Children.Add(CreateFieldDataListModel("f2", recSetDataModel));
dataListViewModel.RecsetCollection.Add(recSetDataModel);
var dataListParts = new List<IDataListVerifyPart>();
var part = CreateRecsetPart(recsetName, firstFieldName);
dataListParts.Add(part.Object);
//----------------------Precondition----------------------------
Assert.AreEqual(2, dataListViewModel.RecsetCollection[0].Children.Count);
//------------Execute Test---------------------------
dataListViewModel.RemoveDataListItem(firstFieldDataListItemModel);
//------------Assert Results-------------------------
Assert.AreEqual(1, dataListViewModel.RecsetCollection[0].Children.Count);
}
示例3: DataListViewModel_RemoveDataListItem_WithScalarItem_ShouldRemoveFromScalarCollection
public void DataListViewModel_RemoveDataListItem_WithScalarItem_ShouldRemoveFromScalarCollection()
{
//------------Setup for test--------------------------
var dataListViewModel = new DataListViewModel(new Mock<IEventAggregator>().Object);
var scalarItem = new DataListItemModel("scalar");
dataListViewModel.ScalarCollection.Add(scalarItem);
//----------------------Precondition----------------------------
Assert.AreEqual(1, dataListViewModel.ScalarCollection.Count);
//------------Execute Test---------------------------
dataListViewModel.RemoveDataListItem(scalarItem);
//------------Assert Results-------------------------
Assert.AreEqual(0, dataListViewModel.ScalarCollection.Count);
}