Ejemplo n.º 1
0
        public FindEventGenerator(IRSEnv env, IMessageBus messageBus, IDateUtils dateUtils, IThreading threading)
            : base(env, messageBus, dateUtils, threading)
        {
            _findEvents = DTE.Events.FindEvents;

            _findEvents.FindDone += _findEvents_FindDone;
        }
Ejemplo n.º 2
0
 public CommandBarEventGenerator([NotNull] IRSEnv env,
                                 [NotNull] IMessageBus messageBus,
                                 [NotNull] IDateUtils dateUtils,
                                 [NotNull] IThreading threading) : base(env, messageBus, dateUtils, threading)
 {
     AttachToCommandBars((CommandBars)DTE.CommandBars);
 }
Ejemplo n.º 3
0
 public ActionEventGenerator([NotNull] IRSEnv env,
                             [NotNull] IMessageBus messageBus,
                             [NotNull] IDateUtils dateUtils,
                             [NotNull] IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
 }
Ejemplo n.º 4
0
        public void SetUp()
        {
            _now       = DateTimeOffset.MinValue;
            _dateUtils = Mock.Of <IDateUtils>();
            Mock.Get(_dateUtils).Setup(u => u.Now).Returns(() => _now);

            _sut = new ConsoleLogger(_dateUtils);
        }
 public TestGitEventGenerator([NotNull] IRSEnv env,
                              [NotNull] IMessageBus messageBus,
                              [NotNull] IDateUtils dateUtils,
                              [NotNull] IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     Content = Lists.NewList <string>();
 }
Ejemplo n.º 6
0
 public CodeCompletionEventHandler(IRSEnv env,
                                   IMessageBus messageBus,
                                   IDateUtils dateUtils,
                                   IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _context = new Context();
 }
Ejemplo n.º 7
0
 public TaskEventGenerator(IRSEnv env,
                           IMessageBus messageBus,
                           IDateUtils dateUtils,
                           IThreading threading,
                           TasksVersionUtil versionUtil) : base(env, messageBus, dateUtils, threading)
 {
     _versionUtil = versionUtil;
 }
Ejemplo n.º 8
0
 public GitEventGenerator([NotNull] IRSEnv env,
                          [NotNull] IMessageBus messageBus,
                          [NotNull] IDateUtils dateUtils,
                          [NotNull] IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _oldActions = Lists.NewList <VersionControlAction>();
 }
 public DTECommandEventGenerator(IRSEnv env, IMessageBus messageBus, IDateUtils dateUtils, IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _eventQueue    = new Dictionary <string, CommandEvent>();
     _commandEvents = DTE.Events.CommandEvents;
     _commandEvents.BeforeExecute += HandleCommandStarts;
     _commandEvents.AfterExecute  += HandleCommandEnded;
 }
 public UserProfileEventGenerator([NotNull] IRSEnv env,
                                  [NotNull] IMessageBus messageBus,
                                  [NotNull] IDateUtils dateUtils,
                                  [NotNull] ISettingsStore settingsStore,
                                  [NotNull] IThreading threading) : base(env, messageBus, dateUtils, threading)
 {
     _settingsStore = settingsStore;
 }
Ejemplo n.º 11
0
 public BuildEventGenerator(IRSEnv env, IMessageBus messageBus, IDateUtils dateUtils, IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _buildEvents = DTE.Events.BuildEvents;
     _buildEvents.OnBuildBegin           += _buildEvents_OnBuildBegin;
     _buildEvents.OnBuildDone            += _buildEvents_OnBuildDone;
     _buildEvents.OnBuildProjConfigBegin += _buildEvents_OnBuildProjConfigBegin;
     _buildEvents.OnBuildProjConfigDone  += _buildEvents_OnBuildProjConfigDone;
 }
Ejemplo n.º 12
0
 public SystemEventGenerator([NotNull] IRSEnv env,
                             [NotNull] IMessageBus messageBus,
                             [NotNull] IDateUtils dateUtils,
                             [NotNull] IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
     SystemEvents.SessionSwitch    += SystemEvents_SessionSwitch;
 }
Ejemplo n.º 13
0
 public NavigationEventGenerator([NotNull] IRSEnv env,
                                 [NotNull] IMessageBus messageBus,
                                 [NotNull] IDateUtils dateUtils,
                                 [NotNull] ITextControlManager textControlManager,
                                 [NotNull] INavigationUtils navigationUtils,
                                 [NotNull] Lifetime lifetime,
                                 [NotNull] IThreading threading) : base(env, messageBus, dateUtils, textControlManager, lifetime, threading)
 {
     _navigationUtils = navigationUtils;
 }
Ejemplo n.º 14
0
 protected EventGeneratorBase([NotNull] IRSEnv env,
                              [NotNull] IMessageBus messageBus,
                              [NotNull] IDateUtils dateUtils,
                              IThreading threading)
 {
     _env        = env;
     _messageBus = messageBus;
     _dateUtils  = dateUtils;
     _threading  = threading;
 }
Ejemplo n.º 15
0
 public DebuggerEventGenerator(IRSEnv env, IMessageBus messageBus, IDateUtils dateUtils, IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _debuggerEvents = DTE.Events.DebuggerEvents;
     _debuggerEvents.OnEnterBreakMode      += _debuggerEvents_OnEnterBreakMode;
     _debuggerEvents.OnEnterDesignMode     += _debuggerEvents_OnEnterDesignMode;
     _debuggerEvents.OnEnterRunMode        += _debuggerEvents_OnEnterRunMode;
     _debuggerEvents.OnExceptionNotHandled += _debuggerEvents_OnExceptionNotHandled;
     _debuggerEvents.OnExceptionThrown     += _debuggerEvents_OnExceptionThrown;
 }
        public void SetUp()
        {
            CultureUtils.SetDefaultCultureForThisThread();

            _now       = DateTimeOffset.MinValue;
            _dateUtils = Mock.Of <IDateUtils>();
            Mock.Get(_dateUtils).Setup(u => u.Now).Returns(() => _now);

            _dirTmp = CreateTempDir();
            _sut    = Create(Log("a.log"));
        }
Ejemplo n.º 17
0
 public DocumentEventGenerator(IRSEnv env,
                               IMessageBus messageBus,
                               IDateUtils dateUtils,
                               IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _documentEvents = DTE.Events.DocumentEvents;
     _documentEvents.DocumentOpened  += HandleDocumentOpened;
     _documentEvents.DocumentSaved   += HandleDocumentSaved;
     _documentEvents.DocumentClosing += HandleDocumentClosing;
 }
Ejemplo n.º 18
0
 public EditEventGenerator(IRSEnv env,
                           IMessageBus messageBus,
                           IDateUtils dateUtils,
                           IContextProvider contextProvider,
                           IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _dateUtils                     = dateUtils;
     _contextProvider               = contextProvider;
     _textEditorEvents              = DTE.Events.TextEditorEvents;
     _textEditorEvents.LineChanged += TextEditorEvents_LineChanged;
 }
        public VsWindowButtonClickEventGenerator(Window window,
                                                 [NotNull] IRSEnv env,
                                                 [NotNull] IMessageBus messageBus,
                                                 [NotNull] IDateUtils dateUtils,
                                                 [NotNull] ILogger logger,
                                                 [NotNull] IThreading threading)
            : base(env, messageBus, dateUtils, threading)
        {
            _frame  = GetFrame(window);
            _logger = logger;

            RegisterToFrameEvents();
        }
Ejemplo n.º 20
0
 public IDEStateEventGenerator(IRSEnv env,
                               IMessageBus messageBus,
                               Lifetime lifetime,
                               IDateUtils dateUtils,
                               IEventLogger logger,
                               IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _env    = env;
     _logger = logger;
     FireIDEStateEvent(IDELifecyclePhase.Startup);
     lifetime.AddAction(FireShutdownEvent);
 }
Ejemplo n.º 21
0
        protected NavigationEventGeneratorEventSubscriber([NotNull] IRSEnv env,
                                                          [NotNull] IMessageBus messageBus,
                                                          [NotNull] IDateUtils dateUtils,
                                                          [NotNull] ITextControlManager textControlManager,
                                                          [NotNull] Lifetime lifetime,
                                                          [NotNull] IThreading threading) : base(env, messageBus, dateUtils, threading)
        {
            _myLifetime         = lifetime;
            _textControlManager = textControlManager;

            AdviceOnAllTextControls();
            UnsubscribeOnTerminate();
        }
Ejemplo n.º 22
0
 public VsWindowButtonInstrumentationComponent([NotNull] IRSEnv env,
                                               [NotNull] IMessageBus messageBus,
                                               [NotNull] IDateUtils dateUtils,
                                               [NotNull] ILogger logger,
                                               [NotNull] IThreading threading)
 {
     _env        = env;
     _messageBus = messageBus;
     _dateUtils  = dateUtils;
     _logger     = logger;
     _threading  = threading;
     Initialize(env);
 }
Ejemplo n.º 23
0
        public VsFocusEventGenerator(IRSEnv env,
                                     IMessageBus messageBus,
                                     IDateUtils dateUtils,
                                     IFocusHelper focusHelper,
                                     IThreading threading)
            : base(env, messageBus, dateUtils, threading)
        {
            _focusHelper = focusHelper;

            _timer          = new Timer();
            _timer.Elapsed += OnTimerElapsed;
            _timer.Interval = TimerIntervalSize;
            _timer.Enabled  = true;
        }
Ejemplo n.º 24
0
        public UploadReminder(ISettingsStore settingsStore,
                              NotifyTrayIcon notify,
                              ICallbackManager callbackManager,
                              IDateUtils dateUtils,
                              ILogManager logManager)
        {
            _taskbarIcon     = notify;
            _settingsStore   = settingsStore;
            _callbackManager = callbackManager;
            _dateUtils       = dateUtils;
            _logManager      = logManager;

            EnsureUploadSettingsInitialized();
            RegisterCallback();
        }
        public MouseActivityEventGenerator([NotNull] IRSEnv env,
                                           [NotNull] IMessageBus messageBus,
                                           [NotNull] IDateUtils dateUtils,
                                           [NotNull] IKaVEMouseEvents mouseEvents,
                                           IFocusHelper focusHelper,
                                           IThreading threading) : base(env, messageBus, dateUtils, threading)
        {
            _dateUtils              = dateUtils;
            _focusHelper            = focusHelper;
            mouseEvents.MouseMove  += FireMouseActivity;
            mouseEvents.MouseClick += FireMouseActivity;
            mouseEvents.MouseWheel += FireMouseActivity;

            _lastActivity = dateUtils.Now;
        }
Ejemplo n.º 26
0
 public EditEventGenerator(IRSEnv env,
                           IMessageBus messageBus,
                           IDateUtils dateUtils,
                           ContextGenerator contextGenerator,
                           IThreading threading)
     : base(env, messageBus, dateUtils, threading)
 {
     _dateUtils                     = dateUtils;
     _contextGenerator              = contextGenerator;
     _textEditorEvents              = DTE.Events.TextEditorEvents;
     _textEditorEvents.LineChanged += TextEditorEvents_LineChanged;
     // TODO event happens before change is reflected... think about how to capture the
     // state *after* the change, e.g., by scheduling an artificial event or by attaching
     // this generator also to file save/close events
 }
Ejemplo n.º 27
0
 public UploadWizardWindowCreator(ISettingsStore settingsStore,
                                  IExporter exporter,
                                  ILogManager logManager,
                                  ILogger logger,
                                  IDateUtils dateUtils,
                                  ActionExecutor actionExecutor,
                                  IUserProfileSettingsUtils userSettingsUtil)
 {
     _settingsStore    = settingsStore;
     _exporter         = exporter;
     _logManager       = logManager;
     _logger           = logger;
     _dateUtils        = dateUtils;
     _actionExecutor   = actionExecutor;
     _userSettingsUtil = userSettingsUtil;
 }
Ejemplo n.º 28
0
        public AppendingFileLogger(string logFile, IDateUtils dateUtils)
        {
            _logFile   = logFile;
            _dateUtils = dateUtils;

            Asserts.NotNull(dateUtils);
            Asserts.Not(string.IsNullOrEmpty(_logFile));
            _isFirstLine = !File.Exists(logFile);

            var parentDir = Path.GetDirectoryName(logFile);

            Asserts.NotNull(parentDir);
            Asserts.That(Directory.Exists(parentDir));

            _fs = new FileStream(logFile, FileMode.Append, FileAccess.Write);
            _sw = new StreamWriter(_fs);
        }
Ejemplo n.º 29
0
        public WindowEventGenerator(IRSEnv env,
                                    IMessageBus messageBus,
                                    ICallbackManager callbackManager,
                                    IDateUtils dateUtils,
                                    IThreading threading)
            : base(env, messageBus, dateUtils, threading)
        {
            _callbackManager             = callbackManager;
            _knownWindows                = new Dictionary <Window, WindowDescriptor>();
            _delayedMoveEvents           = new Dictionary <Window, WindowEvent>();
            _delayedMoveEventFireActions =
                new ThreadSafeDictionary <Window, ScheduledAction>(name => ScheduledAction.NoOp);
            _dateUtils = dateUtils;

            _windowEvents = DTE.Events.WindowEvents;
            _windowEvents.WindowCreated   += OnWindowCreated;
            _windowEvents.WindowActivated += OnWindowActivated;
            _windowEvents.WindowMoved     += OnWindowMoved;
            _windowEvents.WindowClosing   += OnWindowClosed;
        }
Ejemplo n.º 30
0
        public UploadWizardContext(IExporter exporter,
                                   ILogManager logManager,
                                   ISettingsStore settingsStore,
                                   IDateUtils dateUtils,
                                   ILogger logger)
        {
            _exporter                   = exporter;
            _logManager                 = logManager;
            _settingsStore              = settingsStore;
            _dateUtils                  = dateUtils;
            _logger                     = logger;
            _errorNotificationRequest   = new InteractionRequest <Notification>();
            _successNotificationRequest = new InteractionRequest <LinkNotification>();
            _exportWorker               = new BackgroundWorker {
                WorkerSupportsCancellation = false, WorkerReportsProgress = true
            };
            _exportWorker.DoWork             += OnExport;
            _exportWorker.ProgressChanged    += OnProgressChanged;
            _exportWorker.RunWorkerCompleted += OnExportCompleted;

            UserProfileSettings = _settingsStore.GetSettings <UserProfileSettings>();
        }