Пример #1
0
 private void processAdded(object sender, CollectionItemEventArgs <Process> e)
 {
     if (Process.DebugMode == DebugModeFlag.Enc)
     {
         managers.Add(e.Item, new EnCManager(e.Item));
     }
 }
Пример #2
0
 private void Entities_EntityRemoved(Entity entity, CollectionItemEventArgs <Entity> e)
 {
     if (entity.GivesOffLight)
     {
         DirtyLighting();
     }
 }
Пример #3
0
 /// <summary>
 /// Callback for adding any module to debugged process.
 /// </summary>
 /// <param name="sender">Paramters for callback, not used here.</param>
 /// <param name="args">Arguments with description of module.</param>
 public void ProcessModuleAdded(object sender, CollectionItemEventArgs <Module> args)
 {
     if (resource.TryToCatchModule(args.Item))
     {
         eventCreator.Attach();
     }
 }
Пример #4
0
        protected override void RemoveItem(int index)
        {
            var item = this[index];
            var args = new CollectionItemEventArgs <T>(item);

            OnItemRemoving(args);
            base.RemoveItem(index);
            OnItemRemoved(args);
            OnChanged();
        }
Пример #5
0
        private void processRemoved(object sender, CollectionItemEventArgs <Process> e)
        {
            EnCManager manager;

            if (managers.TryGetValue(e.Item, out manager))
            {
                manager.StopEnC();
            }
            managers.Remove(e.Item);
        }
Пример #6
0
        protected override void InsertItem(int index, T item)
        {
            ValidateItem(item);
            var args = new CollectionItemEventArgs <T>(item);

            OnItemAdding(args);
            base.InsertItem(index, item);
            OnItemAdded(args);
            OnChanged();
        }
Пример #7
0
 void debugger_ProcessStarted(object sender, CollectionItemEventArgs <Process> e)
 {
     if (debugger.Processes.Count == 1)
     {
         if (DebugEvent != null)
         {
             DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.Started));
         }
     }
     e.Item.LogMessage += LogMessage;
 }
        void process_Modules_Added(object sender, CollectionItemEventArgs <Module> e)
        {
            if (ProjectService.OpenSolution == null)
            {
                return;
            }

            ProjectService.OpenSolution.Projects
            .Where(p => e.Item.Name.IndexOf(p.Name) >= 0)
            .ForEach(p => e.Item.LoadSymbolsFromDisk(new [] { Path.GetDirectoryName(p.OutputAssemblyFullPath) }));
        }
Пример #9
0
 void debugger_ProcessStarted(object sender, CollectionItemEventArgs <Process> e)
 {
     if (debugger.Processes.Count == 1)
     {
         if (DebugStarted != null)
         {
             DebugStarted(this, EventArgs.Empty);
         }
     }
     e.Item.LogMessage += LogMessage;
 }
Пример #10
0
 void debugger_ProcessExited(object sender, CollectionItemEventArgs <Process> e)
 {
     if (debugger.Processes.Count == 0)
     {
         SelectProcess(null, e);
     }
     else
     {
         SelectProcess(debugger.Processes[0]);
     }
 }
Пример #11
0
 void debugger_ProcessExited(object sender, CollectionItemEventArgs <Process> e)
 {
     if (debugger.Processes.Count == 0)
     {
         if (DebugStopped != null)
         {
             DebugStopped(this, e);
         }
         SelectProcess(null);
     }
     else
     {
         SelectProcess(debugger.Processes[0]);
     }
 }
Пример #12
0
        protected override void SetItem(int index, T item)
        {
            ValidateItem(item);
            var oldItem = this[index];

            var removeArgs = new CollectionItemEventArgs <T>(oldItem);

            OnItemRemoving(removeArgs);

            var addArgs = new CollectionItemEventArgs <T>(item);

            OnItemAdding(addArgs);

            base.SetItem(index, item);

            OnItemRemoved(removeArgs);
            OnItemAdded(addArgs);
            OnChanged();
        }
Пример #13
0
        public void SelectProcess(Process process, CollectionItemEventArgs <Process> e = null)
        {
            if (debuggedProcess != null)
            {
                debuggedProcess.Paused          -= debuggedProcess_DebuggingPaused;
                debuggedProcess.ExceptionThrown -= debuggedProcess_ExceptionThrown;
                debuggedProcess.Resumed         -= debuggedProcess_DebuggingResumed;
                debuggedProcess.ModulesAdded    -= debuggedProcess_ModulesAdded;
            }
            debuggedProcess = process;
            if (debuggedProcess != null)
            {
                debuggedProcess.Paused          += debuggedProcess_DebuggingPaused;
                debuggedProcess.ExceptionThrown += debuggedProcess_ExceptionThrown;
                debuggedProcess.Resumed         += debuggedProcess_DebuggingResumed;
                debuggedProcess.ModulesAdded    += debuggedProcess_ModulesAdded;

                debuggedProcess.BreakAtBeginning = BreakAtBeginning;
                if (DebugEvent != null)
                {
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.ProcessSelected));
                }
            }
            else
            {
                if (DebugEvent != null)
                {
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.ProcessSelected));
                }
                if (DebugEvent != null)
                {
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.Stopped));
                }
            }
            BreakAtBeginning = false;
        }
Пример #14
0
 private void OnRowAdded(object sender, CollectionItemEventArgs<DynamicListRow> e)
 {
     e.Item.HeightChanged += new EventHandler(this.RowHeightChanged);
     e.Item.ItemChanged += new EventHandler(this.RowItemChanged);
     if (base.Visible && (base.Parent != null))
     {
         e.Item.NotifyListVisibilityChange(this, true);
     }
 }
Пример #15
0
 protected void OnItemAdding(CollectionItemEventArgs <T> args)
 {
     Fire(ItemAdding, args);
 }
Пример #16
0
 private void OnColumnRemoved(object sender, CollectionItemEventArgs<DynamicListColumn> e)
 {
     e.Item.MinimumWidthChanged -= new EventHandler(this.ColumnMinimumWidthChanged);
     e.Item.WidthChanged -= new EventHandler(this.ColumnWidthChanged);
     this.RecalculateColumnWidths();
 }
Пример #17
0
		void debugger_ProcessStarted(object sender, CollectionItemEventArgs<Process> e)
		{
			e.Item.Threads.Added += delegate(object sender2, CollectionItemEventArgs<Thread> f) {
				ObjectDump("ThreadStartedEvent", f.Item);
			};
		}
Пример #18
0
		void debugger_ProcessStarted(object sender, CollectionItemEventArgs<Process> e)
		{
			if (debugger.Processes.Count == 1) {
				if (DebugStarted != null) {
					DebugStarted(this, EventArgs.Empty);
				}
			}
			e.Item.LogMessage += LogMessage;
		}
Пример #19
0
		void OnRowAdded(object sender, CollectionItemEventArgs<DynamicListRow> e)
		{
			e.Item.HeightChanged += RowHeightChanged;
			e.Item.ItemChanged   += RowItemChanged;
			if (Visible && Parent != null)
				e.Item.NotifyListVisibilityChange(this, true);
		}
Пример #20
0
 void debuggedProcess_ThreadStarted(object sender, CollectionItemEventArgs <Thread> e)
 {
     AddThread(e.Item);
 }
Пример #21
0
		void debuggedProcess_ModuleUnloaded(object sender, CollectionItemEventArgs<Module> e)
		{
			RemoveModule(e.Item);
		}
Пример #22
0
 /// <summary>
 /// Callback for adding any module to debugged process.
 /// </summary>
 /// <param name="sender">Paramters for callback, not used here.</param>
 /// <param name="args">Arguments with description of module.</param>
 public void ProcessModuleAdded(object sender, CollectionItemEventArgs<Module> args)
 {
     if (resource.TryToCatchModule(args.Item))
         eventCreator.Attach();
 }
Пример #23
0
        public void SelectProcess(Process process, CollectionItemEventArgs<Process> e = null)
        {
            if (debuggedProcess != null) {
                debuggedProcess.Paused          -= debuggedProcess_DebuggingPaused;
                debuggedProcess.ExceptionThrown -= debuggedProcess_ExceptionThrown;
                debuggedProcess.Resumed         -= debuggedProcess_DebuggingResumed;
                debuggedProcess.ModulesAdded 	-= debuggedProcess_ModulesAdded;
            }
            debuggedProcess = process;
            if (debuggedProcess != null) {
                debuggedProcess.Paused          += debuggedProcess_DebuggingPaused;
                debuggedProcess.ExceptionThrown += debuggedProcess_ExceptionThrown;
                debuggedProcess.Resumed         += debuggedProcess_DebuggingResumed;
                debuggedProcess.ModulesAdded 	+= debuggedProcess_ModulesAdded;

                debuggedProcess.BreakAtBeginning = BreakAtBeginning;
                if (DebugEvent != null)
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.ProcessSelected));
            }
            else {
                if (DebugEvent != null)
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.ProcessSelected));
                if (DebugEvent != null)
                    DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.Stopped));
            }
            BreakAtBeginning = false;
        }
Пример #24
0
		void debuggedProcess_ThreadStarted(object sender, CollectionItemEventArgs<Thread> e)
		{
			AddThread(e.Item);
		}
Пример #25
0
 void debugger_ProcessStarted(object sender, CollectionItemEventArgs <Process> e)
 {
     e.Item.Threads.Added += delegate(object sender2, CollectionItemEventArgs <Thread> f) {
         ObjectDump("ThreadStartedEvent", f.Item);
     };
 }
Пример #26
0
 void debugger_ProcessExited(object sender, CollectionItemEventArgs<Process> e)
 {
     if (debugger.Processes.Count == 0) {
         SelectProcess(null, e);
     } else {
         SelectProcess(debugger.Processes[0]);
     }
 }
Пример #27
0
 void debugger_ProcessStarted(object sender, CollectionItemEventArgs<Process> e)
 {
     if (debugger.Processes.Count == 1) {
         if (DebugEvent != null)
             DebugEvent(this, new DebuggerEventArgs(DebuggerEvent.Started));
     }
     e.Item.LogMessage += LogMessage;
 }
Пример #28
0
 private void OnRowRemoved(object sender, CollectionItemEventArgs<DynamicListRow> e)
 {
     e.Item.HeightChanged -= new EventHandler(this.RowHeightChanged);
     e.Item.ItemChanged -= new EventHandler(this.RowItemChanged);
     if (base.Visible)
     {
         e.Item.NotifyListVisibilityChange(this, false);
     }
 }
Пример #29
0
 void debuggedProcess_ModuleLoaded(object sender, CollectionItemEventArgs <Module> e)
 {
     AddModule(e.Item);
 }
Пример #30
0
		void OnColumnRemoved(object sender, CollectionItemEventArgs<DynamicListColumn> e)
		{
			e.Item.MinimumWidthChanged -= ColumnMinimumWidthChanged;
			e.Item.WidthChanged -= ColumnWidthChanged;
			RecalculateColumnWidths();
		}
Пример #31
0
 void debuggedProcess_ModuleUnloaded(object sender, CollectionItemEventArgs <Module> e)
 {
     RemoveModule(e.Item);
 }
Пример #32
0
		void OnRowRemoved(object sender, CollectionItemEventArgs<DynamicListRow> e)
		{
			e.Item.HeightChanged -= RowHeightChanged;
			e.Item.ItemChanged   -= RowItemChanged;
			if (Visible)
				e.Item.NotifyListVisibilityChange(this, false);
		}
Пример #33
0
		void debuggedProcess_ModuleLoaded(object sender, CollectionItemEventArgs<Module> e)
		{
			AddModule(e.Item);
		}
Пример #34
0
        private static void HandleItemAdded(IHCollection <string> sender, CollectionItemEventArgs <string> args)
        {
            var state = (EventState)args.State;

            Interlocked.Increment(ref state.EventsCount);
        }
Пример #35
0
 private void processAdded(object sender, CollectionItemEventArgs<Process> e)
 {
     if(Process.DebugMode == DebugModeFlag.Enc){
         managers.Add(e.Item,new EnCManager(e.Item));
     }
 }
Пример #36
0
		void process_Modules_Added(object sender, CollectionItemEventArgs<Module> e)
		{
			if (ProjectService.OpenSolution == null)
				return;
			
			ProjectService.OpenSolution.Projects
				.Where(p => e.Item.Name.IndexOf(p.Name) >= 0)
				.ForEach(p => e.Item.LoadSymbolsFromDisk(new []{ Path.GetDirectoryName(p.OutputAssemblyFullPath) }));
		}
Пример #37
0
 private void processRemoved(object sender, CollectionItemEventArgs<Process> e)
 {
     EnCManager manager;
     if(managers.TryGetValue(e.Item,out manager)){
        	manager.StopEnC();
     }
     managers.Remove(e.Item);
 }
Пример #38
0
		void debugger_ProcessExited(object sender, CollectionItemEventArgs<Process> e)
		{
			if (debugger.Processes.Count == 0) {
				if (DebugStopped != null) {
					DebugStopped(this, e);
				}
				SelectProcess(null);
			} else {
				SelectProcess(debugger.Processes[0]);
			}
		}
Пример #39
0
 protected void OnItemRemoved(CollectionItemEventArgs <T> args)
 {
     Fire(ItemRemoved, args);
 }
Пример #40
0
		private void OnModulesAdded(object sender, CollectionItemEventArgs<Module> e)
		{
			if (BreakAtBeginning) {
				if (e.Item.SymReader == null) return; // No symbols
				
				try {
					// create a BP at entry point
					uint entryPoint = e.Item.SymReader.GetUserEntryPoint();
					if (entryPoint == 0) return; // no EP
					var mainFunction = e.Item.CorModule.GetFunctionFromToken(entryPoint);
					var corBreakpoint = mainFunction.CreateBreakpoint();
					corBreakpoint.Activate(1);
					
					// create a SD BP
					var breakpoint = new Breakpoint(this.debugger, corBreakpoint);
					this.debugger.Breakpoints.Add(breakpoint);
					breakpoint.Hit += delegate {
						if (breakpoint != null)
							breakpoint.Remove();
						breakpoint = null;
					};
				} catch { 
					// the app does not have an entry point - COM exception
				}
				BreakAtBeginning = false;
			}
		}
Пример #41
0
 private Unit Switch(CollectionItemEventArgs args)
 {
     switch (args)
     {
     case { EventType: EventType.Add } :