protected override void OnClick() { string feature = GetFeatureName(); if (!string.IsNullOrEmpty(feature)) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(feature, "Toolbar"); } base.OnClick(); }
protected override void OnClick() { base.OnClick(); string feature = GetFeatureName(); if (!string.IsNullOrEmpty(feature)) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(feature, ActivationMethod); } }
void InitializeServices() { SD.InitializeForUnitTests(); var container = ServiceSingleton.GetRequiredService <IServiceContainer>(); // Replace IPropertyService initialized by InitializeForUnitServices() with our own PropertyService container.RemoveService(typeof(IPropertyService)); container.AddService(typeof(IPropertyService), new PropertyService()); container.AddService(typeof(ICSharpCode.Core.IResourceService), new ResourceServiceImpl( GetResourceDirectory(), SD.PropertyService)); }
protected override void OnClick(EventArgs e) { base.OnClick(e); if (menuCommand == null) { menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]); } if (menuCommand != null) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(menuCommand.GetType().FullName, "Toolbar"); menuCommand.Execute(caller); } }
void ExecuteCommand(ICommand command, object caller) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>() .TrackFeature(command.GetType().FullName, "Menu"); var routedCommand = command as RoutedCommand; if (routedCommand != null) { var target = FocusManager.GetFocusedElement(this); if (routedCommand.CanExecute(caller, target)) { routedCommand.Execute(caller, target); } } else { if (command.CanExecute(caller)) { command.Execute(caller); } } }
static PresentationResourceService() { resourceService = ServiceSingleton.GetRequiredService <IResourceService>(); resourceService.LanguageChanged += OnLanguageChanged; }
static WinFormsResourceService() { resourceService = ServiceSingleton.GetRequiredService <IResourceService>(); resourceService.LanguageChanged += OnLanguageChanged; }
public void Execute(object parameter) { ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(featureName, "Shortcut"); baseCommand.Execute(parameter); }