本文整理汇总了C#中Mono.Addins.ExtensionNodeEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ExtensionNodeEventArgs类的具体用法?C# ExtensionNodeEventArgs怎么用?C# ExtensionNodeEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExtensionNodeEventArgs类属于Mono.Addins命名空间,在下文中一共展示了ExtensionNodeEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnExtensionChange
void OnExtensionChange (object s, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add) {
ProjectService ps = MonoDevelop.Projects.Services.ProjectService;
ITestProvider provider = args.ExtensionObject as ITestProvider;
providers.Add (provider);
Type[] types = provider.GetOptionTypes ();
if (types != null) {
foreach (Type t in types) {
if (!typeof(ICloneable).IsAssignableFrom (t)) {
LoggingService.LogError ("Option types must implement ICloneable: " + t);
continue;
}
ps.DataContext.IncludeType (t);
}
}
}
else {
ITestProvider provider = args.ExtensionObject as ITestProvider;
providers.Remove (provider);
// The types returned by provider.GetOptionTypes should probably be unregistered
// from the DataContext, but DataContext does not allow unregisterig.
// This is not a big issue anyway.
}
}
示例2: OnTagExtensionChanged
static void OnTagExtensionChanged (object sender, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add)
tags.Add (args.ExtensionNode.Id);
else
tags.Remove (args.ExtensionNode.Id);
}
示例3: OnExtensionChanged
static void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add)
providers.Add ((IGettingStartedProvider)args.ExtensionObject);
else if (args.Change == ExtensionChange.Remove)
providers.Remove ((IGettingStartedProvider)args.ExtensionObject);
}
示例4: OnSyntaxModeExtensionChanged
static void OnSyntaxModeExtensionChanged (object s, ExtensionNodeEventArgs args)
{
TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
if (args.Change == ExtensionChange.Add) {
Mono.TextEditor.Highlighting.SyntaxModeService.AddSyntaxMode (new StreamProviderWrapper(codon));
}
}
示例5: extensionHandler
static void extensionHandler (object s, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add)
loaders.Add ((IWebBrowserLoader) args.ExtensionObject);
else if (args.Change == ExtensionChange.Remove)
loaders.Remove ((IWebBrowserLoader) args.ExtensionObject);
}
示例6: OnExtensionChanged
static void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add)
templates.Add ((FileTemplateTypeCodon) args.ExtensionNode);
else
templates.Remove ((FileTemplateTypeCodon) args.ExtensionNode);
}
示例7: OnStylesExtensionChanged
static void OnStylesExtensionChanged (object s, ExtensionNodeEventArgs args)
{
TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
if (args.Change == ExtensionChange.Add) {
SyntaxModeService.AddStyle (codon);
} else {
SyntaxModeService.RemoveStyle (codon);
}
}
示例8: OnExtensionChanged
static void OnExtensionChanged (object sender, ExtensionNodeEventArgs args)
{
var node = (TypeExtensionNode)args.ExtensionNode;
var value = (LocaleSetProvider)node.GetInstance (typeof (LocaleSetProvider));
if (args.Change == ExtensionChange.Add)
locales.Add (value.LocaleSet);
else
locales.Remove (value.LocaleSet);
}
示例9: OnTemplateImagesChanged
void OnTemplateImagesChanged (object sender, ExtensionNodeEventArgs args)
{
var codon = args.ExtensionNode as ImageCodon;
if (args.Change == ExtensionChange.Add) {
projectTemplateImages.Add (codon);
} else {
projectTemplateImages.Remove (codon);
}
}
示例10: OnProjectTemplateWizardsChanged
void OnProjectTemplateWizardsChanged (object sender, ExtensionNodeEventArgs args)
{
var wizard = args.ExtensionObject as TemplateWizard;
if (args.Change == ExtensionChange.Add) {
projectTemplateWizards.Add (wizard);
} else {
projectTemplateWizards.Remove (wizard);
}
}
示例11: OnTemplatingProvidersChanged
void OnTemplatingProvidersChanged (object sender, ExtensionNodeEventArgs args)
{
var provider = args.ExtensionObject as IProjectTemplatingProvider;
if (args.Change == ExtensionChange.Add) {
templateProviders.Add (provider);
} else {
templateProviders.Remove (provider);
}
}
示例12: OnTemplateCategoriesChanged
void OnTemplateCategoriesChanged (object sender, ExtensionNodeEventArgs args)
{
var codon = (TemplateCategoryCodon)args.ExtensionNode;
if (args.Change == ExtensionChange.Add) {
projectTemplateCategories.Add (codon.ToTopLevelTemplateCategory ());
} else {
projectTemplateCategories.RemoveAll (category => category.Id == codon.Id);
}
}
示例13: OnSyntaxModeExtensionChanged
static void OnSyntaxModeExtensionChanged (object s, ExtensionNodeEventArgs args)
{
TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
if (args.Change == ExtensionChange.Add) {
Mono.TextEditor.Highlighting.SyntaxModeService.AddSyntaxMode (codon);
} else {
Mono.TextEditor.Highlighting.SyntaxModeService.RemoveSyntaxMode (codon);
}
}
示例14: OnCodeBehindGenerationChanged
/// <summary>
/// Handler for codon addition/removal.
/// </summary>
private static void OnCodeBehindGenerationChanged(object sender, ExtensionNodeEventArgs args)
{
CodeBehindGeneratorCodon codon = (CodeBehindGeneratorCodon)args.ExtensionNode;
if (args.Change == ExtensionChange.Add) {
generators.Add (codon.Id, codon.Generator);
} else {
generators.Remove (codon.Id);
}
}
示例15: HandleInstrumentationHandlerExtension
static void HandleInstrumentationHandlerExtension (object sender, ExtensionNodeEventArgs args)
{
var handler = (InstrumentationConsumer)args.ExtensionObject;
if (args.Change == ExtensionChange.Add) {
RegisterInstrumentationConsumer (handler);
}
else {
UnregisterInstrumentationConsumer (handler);
}
}