Exemplo n.º 1
0
        protected override void OnClick()
        {
            string feature = GetFeatureName();

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