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


C# ObservableCollection.AddIfNotNull方法代码示例

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


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

示例1: RefreshPad

		void RefreshPad()
		{
			Thread thread = WindowsDebugger.CurrentThread;
			if (thread == null) {
				listView.ItemsSource = null;
			} else {
				var items = new ObservableCollection<CallStackItem>();
				bool previousItemIsExternalMethod = false;
				WindowsDebugger.CurrentProcess.EnqueueForEach(
					listView.Dispatcher,
					thread.GetCallstack(100),
					f => items.AddIfNotNull(CreateItem(f, ref previousItemIsExternalMethod))
				);
				listView.ItemsSource = items;
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:16,代码来源:CallStackPad.cs

示例2: RefreshPad

		internal void RefreshPad()
		{
			if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedThread == null) {
				view.ItemsSource = null;
				return;
			}
			
			var items = new ObservableCollection<CallStackItem>();
			using(new PrintTimes("Callstack refresh")) {
				bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods;
				bool previousItemIsExternalMethod = false;
				
				debuggedProcess.EnqueueForEach(
					Dispatcher,
					debuggedProcess.SelectedThread.GetCallstack(100),
					f => items.AddIfNotNull(CreateItem(f, showExternalMethods, ref previousItemIsExternalMethod))
				);
			}
			view.ItemsSource = items;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:20,代码来源:CallStackPad.xaml.cs


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