本文整理汇总了C#中ExceptionlessConfiguration.RemovePlugin方法的典型用法代码示例。如果您正苦于以下问题:C# ExceptionlessConfiguration.RemovePlugin方法的具体用法?C# ExceptionlessConfiguration.RemovePlugin怎么用?C# ExceptionlessConfiguration.RemovePlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExceptionlessConfiguration
的用法示例。
在下文中一共展示了ExceptionlessConfiguration.RemovePlugin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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());
}
示例3: 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>();
}