本文整理汇总了C#中ObservableCollection.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableCollection.Clone方法的具体用法?C# ObservableCollection.Clone怎么用?C# ObservableCollection.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableCollection
的用法示例。
在下文中一共展示了ObservableCollection.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: client_GetDistributeDataCompleted
void client_GetDistributeDataCompleted(object sender, GetDistributeDataCompletedEventArgs e)
{
RefreshUI(RefreshedTypes.HideProgressBar);
if (e.Error != null)
{
ShowMessage(true, "ERROR", "GETDATAFAILED", "");
return;
}
if (e.Result == null)
{
ShowMessage(false, "NODATA", "DIDNOTFINDRELEVANT", "");
}
distributeView = e.Result;
this.contextInfo.DataContext = distributeView.requiredistributeEntity;
distributeuserList = distributeView.distributeuserList;
distributeView.oldDistributeuserList = distributeuserList.Clone();
ConvertByGetData(distributeuserList);
BindingDataGrid();
ShowAuditControl();
}
示例2: SelectData
/// <summary>
/// 获取选择的数据并进行填充
/// </summary>
private ObservableCollection<T_OA_DISTRIBUTEUSER> SelectData()
{
ObservableCollection<T_OA_DISTRIBUTEUSER> _hanerList = new ObservableCollection<T_OA_DISTRIBUTEUSER>();
ObservableCollection<T_OA_DISTRIBUTEUSER> _cloneList = new ObservableCollection<T_OA_DISTRIBUTEUSER>();
foreach (object hander in this.dgDistributeusers.SelectedItems)
{
if (hander as T_OA_DISTRIBUTEUSER == null)
{
ShowMessage(true, "ERROR", "ERROR", "");
return null;
}
_hanerList.Add(hander as T_OA_DISTRIBUTEUSER);
}
_cloneList = _hanerList.Clone();//克隆一份数据传递,以免转换数据改变UI显示
return _cloneList;
}