本文整理汇总了C#中ExceptionlessConfiguration.AddPlugin方法的典型用法代码示例。如果您正苦于以下问题:C# ExceptionlessConfiguration.AddPlugin方法的具体用法?C# ExceptionlessConfiguration.AddPlugin怎么用?C# ExceptionlessConfiguration.AddPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExceptionlessConfiguration
的用法示例。
在下文中一共展示了ExceptionlessConfiguration.AddPlugin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDefaultPlugins
public static void AddDefaultPlugins(ExceptionlessConfiguration config) {
config.AddPlugin<ConfigurationDefaultsPlugin>();
config.AddPlugin<SimpleErrorPlugin>();
config.AddPlugin<DuplicateCheckerPlugin>();
config.AddPlugin<EnvironmentInfoPlugin>();
config.AddPlugin<SubmissionMethodPlugin>();
}
示例2: AddDefaultPlugins
public static void AddDefaultPlugins(ExceptionlessConfiguration config) {
config.AddPlugin<HandleAggregateExceptionsPlugin>();
config.AddPlugin<EventExclusionPlugin>();
config.AddPlugin<ConfigurationDefaultsPlugin>();
#if !PORTABLE && !NETSTANDARD1_2
config.AddPlugin<ErrorPlugin>();
#else
config.AddPlugin<SimpleErrorPlugin>();
#endif
config.AddPlugin<DuplicateCheckerPlugin>();
config.AddPlugin<EnvironmentInfoPlugin>();
#if !PORTABLE && !NETSTANDARD1_2
config.AddPlugin<VersionPlugin>();
#endif
config.AddPlugin<SubmissionMethodPlugin>();
config.AddPlugin<CancelSessionsWithNoUserPlugin>();
}
示例3: AddDefaultPlugins
public static void AddDefaultPlugins(ExceptionlessConfiguration config) {
config.AddPlugin<ConfigurationDefaultsPlugin>();
config.AddPlugin<HandleAggregateExceptionsPlugin>();
config.AddPlugin<SimpleErrorPlugin>();
config.AddPlugin<DuplicateCheckerPlugin>();
config.AddPlugin<EnvironmentInfoPlugin>();
config.AddPlugin<SubmissionMethodPlugin>();
config.AddPlugin<CancelSessionsWithNoUserPlugin>();
}
示例4: VerifyPriority
public void VerifyPriority() {
var config = new ExceptionlessConfiguration(DependencyResolver.CreateDefault());
foreach (var plugin in config.Plugins)
config.RemovePlugin(plugin.Key);
Assert.Equal(0, config.Plugins.Count());
config.AddPlugin<EnvironmentInfoPlugin>();
config.AddPlugin<PluginWithPriority11>();
config.AddPlugin<PluginWithNoPriority>();
config.AddPlugin("version", 1, ctx => ctx.Event.SetVersion("1.0.0.0"));
config.AddPlugin("version2", 2, ctx => ctx.Event.SetVersion("1.0.0.0"));
config.AddPlugin("version3", 3, ctx => ctx.Event.SetVersion("1.0.0.0"));
var plugins = config.Plugins.ToArray();
Assert.Equal(typeof(PluginWithNoPriority), plugins[0].Plugin.GetType());
Assert.Equal("version", plugins[1].Key);
Assert.Equal("version2", plugins[2].Key);
Assert.Equal("version3", plugins[3].Key);
Assert.Equal(typeof(PluginWithPriority11), plugins[4].Plugin.GetType());
Assert.Equal(typeof(EnvironmentInfoPlugin), plugins[5].Plugin.GetType());
}
示例5: CanDisposePlugin
public void CanDisposePlugin() {
var configuration = new ExceptionlessConfiguration(DependencyResolver.Default);
foreach (var plugin in configuration.Plugins)
configuration.RemovePlugin(plugin.Key);
Assert.Equal(0, CounterTestPlugin.ConstructorCount);
Assert.Equal(0, CounterTestPlugin.RunCount);
Assert.Equal(0, CounterTestPlugin.DisposeCount);
configuration.AddPlugin<CounterTestPlugin>();
configuration.AddPlugin<CounterTestPlugin>();
for (int i = 0; i < 2; i++) {
foreach (var pluginRegistration in configuration.Plugins)
pluginRegistration.Plugin.Run(new EventPluginContext(new ExceptionlessClient(), new Event()));
}
configuration.RemovePlugin<CounterTestPlugin>();
configuration.RemovePlugin<CounterTestPlugin>();
Assert.Equal(1, CounterTestPlugin.ConstructorCount);
Assert.Equal(2, CounterTestPlugin.RunCount);
Assert.Equal(1, CounterTestPlugin.DisposeCount);
}
示例6: LazyLoadAndRemovePlugin
public void LazyLoadAndRemovePlugin() {
var configuration = new ExceptionlessConfiguration(DependencyResolver.Default);
foreach (var plugin in configuration.Plugins)
configuration.RemovePlugin(plugin.Key);
configuration.AddPlugin<ThrowIfInitializedTestPlugin>();
configuration.RemovePlugin<ThrowIfInitializedTestPlugin>();
}