예제 #1
0
        protected override void OnClick()
        {
            string feature = GetFeatureName();

            if (!string.IsNullOrEmpty(feature))
            {
                ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(feature, "Toolbar");
            }
            base.OnClick();
        }
예제 #2
0
        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));
        }
예제 #4
0
 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);
     }
 }
예제 #5
0
        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;
 }
예제 #8
0
 public void Execute(object parameter)
 {
     ServiceSingleton.GetRequiredService <IAnalyticsMonitor>().TrackFeature(featureName, "Shortcut");
     baseCommand.Execute(parameter);
 }