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

            _findEvents.FindDone += _findEvents_FindDone;
        }
 public DTEEventSource(Events2 events)
 {
     _buildEvents           = events.BuildEvents;
     _dteEvents             = events.DTEEvents;
     _debuggerEvents        = events.DebuggerEvents;
     _debuggerProcessEvents = events.DebuggerProcessEvents;
     _debuggerExpressionEvaluationEvents = events.DebuggerExpressionEvaluationEvents;
     _findEvents         = events.FindEvents;
     _miscFileEvents     = events.MiscFilesEvents;
     _projectItemsEvents = events.ProjectItemsEvents;
     _projectEvents      = events.ProjectsEvents;
     _publishEvents      = events.PublishEvents;
     _selectionEvents    = events.SelectionEvents;
     _solutionEvents     = events.SolutionEvents;
     _solutionItemEvents = events.SolutionItemsEvents;
 }
Exemple #3
0
 public DTEEventSource( Events2 events)
 {
     _buildEvents = events.BuildEvents;
     _dteEvents = events.DTEEvents;
     _debuggerEvents = events.DebuggerEvents;
     _debuggerProcessEvents = events.DebuggerProcessEvents;
     _debuggerExpressionEvaluationEvents = events.DebuggerExpressionEvaluationEvents;
     _findEvents = events.FindEvents;
     _miscFileEvents = events.MiscFilesEvents;
     _projectItemsEvents = events.ProjectItemsEvents;
     _projectEvents = events.ProjectsEvents;
     _publishEvents = events.PublishEvents;
     _selectionEvents = events.SelectionEvents;
     _solutionEvents = events.SolutionEvents;
     _solutionItemEvents = events.SolutionItemsEvents;            
 }
Exemple #4
0
        protected string FindEvents(SearchScope scope, EventFilter searchFilter,
                                    DateTime startPoint, DateTime?endPoint, bool includeStartState,
                                    int?maxMatches, string keepAliveTime, string stepName)
        {
            string     response = null;
            FindEvents request  = new FindEvents();

            request.Scope               = scope;
            request.SearchFilter        = searchFilter;
            request.StartPoint          = startPoint;
            request.EndPointSpecified   = endPoint.HasValue;
            request.EndPoint            = endPoint.GetValueOrDefault();
            request.IncludeStartState   = includeStartState;
            request.KeepAliveTime       = keepAliveTime;
            request.MaxMatchesSpecified = maxMatches.HasValue;
            request.MaxMatches          = maxMatches.GetValueOrDefault();
            RunStep(() => { response = Client.FindEvents(request).SearchToken; }, stepName);
            DoRequestDelay();
            return(response);
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FindGroupByFunction"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private FindGroupByFunction(Package package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new MenuCommand(this.MenuItemCallback, menuCommandID);
                commandService.AddCommand(menuItem);
            }

            DTE2       dte = ServiceProvider.GetService(typeof(EnvDTE.DTE)) as DTE2;
            FindEvents e   = dte.Events.FindEvents;

            e.FindDone += Fe_FindDone;
        }
 public List<VEVENT> Post(FindEvents request)
 {
     try
     {
         return request.Page != null && request.Size != null
             ? eventRepository.FindAll(request.EventIds, (request.Page.Value - 1)*request.Size.Value,
                 request.Size.Value).ToList()
             : eventRepository.FindAll(request.EventIds).ToList();
     }
     catch (InvalidOperationException ex)
     {
         logger.Error(ex.ToString());
         throw;
     }
     catch (ApplicationException ex)
     {
         logger.Error(ex.ToString());
         throw;
     }
     catch (Exception ex)
     {
         logger.Error(ex.ToString()); throw;
     }
 }
Exemple #7
0
        public EventHandlerBase(IServiceProvider serviceProvider, IOsbideEventGenerator osbideEvents)
        {
            if (serviceProvider == null)
            {
                throw new Exception("Service provider is null");
            }

            ServiceProvider = serviceProvider;

            //save references to dte events
            buildEvents          = dte.Events.BuildEvents;
            genericCommandEvents = dte.Events.CommandEvents;
            menuCommandEvents    = dte.Events.get_CommandEvents(MenuEventGuid);
            debuggerEvents       = dte.Events.DebuggerEvents;
            documentEvents       = dte.Events.DocumentEvents;
            findEvents           = dte.Events.FindEvents;
            miscFileEvents       = dte.Events.MiscFilesEvents;
            outputWindowEvents   = dte.Events.OutputWindowEvents;
            selectionEvents      = dte.Events.SelectionEvents;
            solutionEvents       = dte.Events.SolutionEvents;
            solutionItemsEvents  = dte.Events.SolutionItemsEvents;
            textEditorEvents     = dte.Events.TextEditorEvents;

            //attach osbide requests
            _osbideEvents = osbideEvents;
            _osbideEvents.SolutionSubmitRequest += new EventHandler <SubmitAssignmentArgs>(OsbideSolutionSubmitted);
            _osbideEvents.SolutionDownloaded    += new EventHandler <SolutionDownloadedEventArgs>(OsbideSolutionDownloaded);
            _osbideEvents.SubmitEventRequested  += new EventHandler <SubmitEventArgs>(SubmitEventRequested);

            //attach listeners for dte events
            //build events
            buildEvents.OnBuildBegin += new _dispBuildEvents_OnBuildBeginEventHandler(OnBuildBegin);
            buildEvents.OnBuildDone  += new _dispBuildEvents_OnBuildDoneEventHandler(OnBuildDone);

            //generic command events
            genericCommandEvents.AfterExecute  += new _dispCommandEvents_AfterExecuteEventHandler(GenericCommand_AfterCommandExecute);
            genericCommandEvents.BeforeExecute += new _dispCommandEvents_BeforeExecuteEventHandler(GenericCommand_BeforeCommandExecute);

            //menu-related command command
            menuCommandEvents.AfterExecute  += new _dispCommandEvents_AfterExecuteEventHandler(MenuCommand_AfterExecute);
            menuCommandEvents.BeforeExecute += new _dispCommandEvents_BeforeExecuteEventHandler(MenuCommand_BeforeExecute);

            //debugger events
            debuggerEvents.OnContextChanged      += new _dispDebuggerEvents_OnContextChangedEventHandler(OnContextChanged);
            debuggerEvents.OnEnterBreakMode      += new _dispDebuggerEvents_OnEnterBreakModeEventHandler(OnEnterBreakMode);
            debuggerEvents.OnEnterDesignMode     += new _dispDebuggerEvents_OnEnterDesignModeEventHandler(OnEnterDesignMode);
            debuggerEvents.OnEnterRunMode        += new _dispDebuggerEvents_OnEnterRunModeEventHandler(OnEnterRunMode);
            debuggerEvents.OnExceptionNotHandled += new _dispDebuggerEvents_OnExceptionNotHandledEventHandler(OnExceptionNotHandled);
            debuggerEvents.OnExceptionThrown     += new _dispDebuggerEvents_OnExceptionThrownEventHandler(OnExceptionThrown);

            //document events
            documentEvents.DocumentClosing += new _dispDocumentEvents_DocumentClosingEventHandler(DocumentClosing);
            documentEvents.DocumentOpened  += new _dispDocumentEvents_DocumentOpenedEventHandler(DocumentOpened);
            documentEvents.DocumentSaved   += new _dispDocumentEvents_DocumentSavedEventHandler(DocumentSaved);

            //find events
            findEvents.FindDone += new _dispFindEvents_FindDoneEventHandler(FindDone);

            //misc file events
            miscFileEvents.ItemAdded   += new _dispProjectItemsEvents_ItemAddedEventHandler(ProjectItemAdded);
            miscFileEvents.ItemRemoved += new _dispProjectItemsEvents_ItemRemovedEventHandler(ProjectItemRemoved);
            miscFileEvents.ItemRenamed += new _dispProjectItemsEvents_ItemRenamedEventHandler(ProjectItemRenamed);

            //output window events
            outputWindowEvents.PaneUpdated += new _dispOutputWindowEvents_PaneUpdatedEventHandler(OutputPaneUpdated);

            //selection events
            selectionEvents.OnChange += new _dispSelectionEvents_OnChangeEventHandler(SelectionChange);

            //solution events
            solutionEvents.BeforeClosing += new _dispSolutionEvents_BeforeClosingEventHandler(SolutionBeforeClosing);
            solutionEvents.Opened        += new _dispSolutionEvents_OpenedEventHandler(SolutionOpened);
            solutionEvents.ProjectAdded  += new _dispSolutionEvents_ProjectAddedEventHandler(ProjectAdded);
            solutionEvents.Renamed       += new _dispSolutionEvents_RenamedEventHandler(SolutionRenamed);

            //solution item events
            solutionItemsEvents.ItemAdded   += new _dispProjectItemsEvents_ItemAddedEventHandler(SolutionItemAdded);
            solutionItemsEvents.ItemRemoved += new _dispProjectItemsEvents_ItemRemovedEventHandler(SolutionItemRemoved);
            solutionItemsEvents.ItemRenamed += new _dispProjectItemsEvents_ItemRenamedEventHandler(SolutionItemRenamed);

            //text editor events
            textEditorEvents.LineChanged += new _dispTextEditorEvents_LineChangedEventHandler(EditorLineChanged);
        }
        public EventHandlerBase(IServiceProvider serviceProvider, IEventGenerator osbideEvents)
        {
            if (serviceProvider == null)
            {
                throw new Exception("Service provider is null");
            }

            ServiceProvider = serviceProvider;

            //attach osbide requests
            _osbideEvents = osbideEvents;
            _osbideEvents.SolutionSubmitRequest += SolutionSubmitted;
            _osbideEvents.SubmitEventRequested  += SubmitEventRequested;

            //save references to dte events
            buildEvents          = Dte.Events.BuildEvents;
            genericCommandEvents = Dte.Events.CommandEvents;
            menuCommandEvents    = Dte.Events.CommandEvents[MenuEventGuid];
            debuggerEvents       = Dte.Events.DebuggerEvents;
            documentEvents       = Dte.Events.DocumentEvents;
            findEvents           = Dte.Events.FindEvents;
            miscFileEvents       = Dte.Events.MiscFilesEvents;
            outputWindowEvents   = Dte.Events.OutputWindowEvents;
            selectionEvents      = Dte.Events.SelectionEvents;
            solutionEvents       = Dte.Events.SolutionEvents;
            solutionItemsEvents  = Dte.Events.SolutionItemsEvents;
            textEditorEvents     = Dte.Events.TextEditorEvents;

            //attach osbide requests
            //var osbideEventGenerator = osbideEvents;
            //osbideEventGenerator.SolutionSubmitRequest += SolutionSubmitted;
            //osbideEventGenerator.SubmitEventRequested += SubmitEventRequested;

            //attach listeners for dte events
            //build events
            buildEvents.OnBuildBegin += OnBuildBegin;
            buildEvents.OnBuildDone  += OnBuildDone;

            //generic command events
            genericCommandEvents.AfterExecute  += GenericCommand_AfterCommandExecute;
            genericCommandEvents.BeforeExecute += GenericCommand_BeforeCommandExecute;

            //menu-related command command
            menuCommandEvents.AfterExecute  += MenuCommand_AfterExecute;
            menuCommandEvents.BeforeExecute += MenuCommand_BeforeExecute;

            //debugger events
            debuggerEvents.OnContextChanged      += OnContextChanged;
            debuggerEvents.OnEnterBreakMode      += OnEnterBreakMode;
            debuggerEvents.OnEnterDesignMode     += OnEnterDesignMode;
            debuggerEvents.OnEnterRunMode        += OnEnterRunMode;
            debuggerEvents.OnExceptionNotHandled += OnExceptionNotHandled;
            debuggerEvents.OnExceptionThrown     += OnExceptionThrown;

            //document events
            documentEvents.DocumentClosing += DocumentClosing;
            documentEvents.DocumentOpened  += DocumentOpened;
            documentEvents.DocumentSaved   += DocumentSaved;

            //find events
            findEvents.FindDone += FindDone;

            //misc file events
            miscFileEvents.ItemAdded   += ProjectItemAdded;
            miscFileEvents.ItemRemoved += ProjectItemRemoved;
            miscFileEvents.ItemRenamed += ProjectItemRenamed;

            //output window events
            outputWindowEvents.PaneUpdated += OutputPaneUpdated;

            //selection events
            selectionEvents.OnChange += SelectionChange;

            //solution events
            solutionEvents.BeforeClosing += SolutionBeforeClosing;
            solutionEvents.Opened        += SolutionOpened;
            solutionEvents.ProjectAdded  += ProjectAdded;
            solutionEvents.Renamed       += SolutionRenamed;

            //solution item events
            solutionItemsEvents.ItemAdded   += SolutionItemAdded;
            solutionItemsEvents.ItemRemoved += SolutionItemRemoved;
            solutionItemsEvents.ItemRenamed += SolutionItemRenamed;

            //text editor events
            textEditorEvents.LineChanged += EditorLineChanged;

            // Create an event log watcher that will notify us if any windows event logs
            // of type Error are created in the "Application" log file. This is so we can
            // tell if a user experiences a runtime exception while running their code
            // outside debug mode.
            string        queryStr = "*[System/Level=2]";
            EventLogQuery query    = new EventLogQuery("Application", PathType.LogName, queryStr);

            eventLogWatcher = new EventLogWatcher(query);

            // subscribe to it's event (Note: it is not enabled yet, it will be enabled if the
            // user runs without debuging)
            eventLogWatcher.EventRecordWritten += NETErrorEventRecordWritten;
        }