本文整理汇总了C#中ObservableEventListener.LogToWindowsForm方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableEventListener.LogToWindowsForm方法的具体用法?C# ObservableEventListener.LogToWindowsForm怎么用?C# ObservableEventListener.LogToWindowsForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableEventListener
的用法示例。
在下文中一共展示了ObservableEventListener.LogToWindowsForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1
public Form1()
{
InitializeComponent();
var listener1 = new ObservableEventListener();
var listener2 = new ObservableEventListener();
listener1.EnableEvents(ApplicationInsightsEventSource.Log, EventLevel.LogAlways, Keywords.All);
cont = 0;
listener2.EnableEvents(ApplicationInsightsEventSource.Log, EventLevel.LogAlways, Keywords.All);
MyTimer.Start();
OsVersionContextInitializer os = new OsVersionContextInitializer("Windows 8.1");
ApplicationVersionContextInitializer version = new ApplicationVersionContextInitializer("2.1");
listener1.LogToApplicationInsights("c9ce96c4-8be1-4368-87d4-1dedd72aaa71",os,version);
listener2.LogToWindowsForm(this);
ApplicationInsightsEventSource.Log.Startup();
}
示例2: CreateListener
/// <summary>
/// Creates an event listener that logs using a <see cref="ApplicationInsightsSink" />.
/// </summary>
/// <param name="InstrumentationKey">The ID that determines the application component under which your data appears in Application Insights.</param>
/// <param name="contextInitializers">The (optional) Application Insights context initializers.</param>
/// <returns>
/// An event listener that uses <see cref="ApplicationInsightsSink" /> to log events.
/// </returns>
public static EventListener CreateListener(Form1 form1)
{
var listener = new ObservableEventListener();
listener.LogToWindowsForm(form1);
return listener;
}