本文整理匯總了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);
}
}