//HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message);
        public static void o2KernelQueue_onMessages(IO2Message o2Message)
        {
            if (o2Message is IM_O2MdbgAction)
            {
                IM_O2MdbgAction o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch (o2MDbgAction.o2MdbgAction)
                {
                case IM_O2MdbgActions.breakEvent:
                {
                    string filename = o2MDbgAction.filename;
                    int    line     = o2MDbgAction.line;
                    DI.log.info("SOURCECODE REF -> {0} : {1})", new object[] { line, filename });
                    O2.Kernel.CodeUtils.O2Messages.fileOrFolderSelected(filename, line);
                    //HandleO2MessageOnSD.setSelectedLineNumber(filename, line);
                    break;
                }

                case IM_O2MdbgActions.debugProcessRequest:
                    O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename);
                    break;

                case IM_O2MdbgActions.debugMethodInfoRequest:
                    O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom);
                    break;

                case IM_O2MdbgActions.setBreakpointOnFile:
                    O2MDbgUtils.setBreakPointOnFile(o2MDbgAction.filename, o2MDbgAction.line);
                    break;
                }
            }
        }
        static void ascx_Scripts_onMessages(IO2Message o2Message)
        {
            HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message);

            if (o2Message is IM_O2MdbgAction)
            {
                var o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch (o2MDbgAction.o2MdbgAction)
                {
                case IM_O2MdbgActions.breakEvent:

                    var filename = o2MDbgAction.filename;
                    var line     = o2MDbgAction.line;
                    DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename);
                    HandleO2MessageOnSD.setSelectedLineNumber(filename, line);
                    break;

                case IM_O2MdbgActions.debugProcessRequest:
                    O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename);
                    break;

                case IM_O2MdbgActions.debugMethodInfoRequest:
                    O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom);
                    break;
                }
            }
        }
        void ascx_Breakpoints_onMessages(IO2Message o2Message)
        {
            //switch (o2Message.GetType().Name)
            //{
            //    case "IM_SelectedTypeOrMethod":
            //    case "IM_O2MdbgActions":
            //        break;
            if (o2Message is IM_SelectedTypeOrMethod)
            {
                O2Thread.mtaThread(() =>
                                       {
                                           string breakPointSignature =
                                               DI.o2MDbg.BreakPoints.
                                                   getBreakpointSignatureFromO2SelectedTypeOrMethodMessage(
                                                   o2Message);
                                           if (breakPointSignature != "")
                                               O2Forms.setTextBoxValue_ThreadSafeWay(breakPointSignature,
                                                                                     tbBreakPointSignature);
                                       }
                    );
            }
            /*else if (o2Message is IM_O2MdbgAction)
            {
                var o2MdbgAction = (IM_O2MdbgAction)o2Message;
                if (o2MdbgAction.o2MdbgAction == IM_O2MdbgActions.startDebugSession)
                    setOnBreakpointEvent();
            }*/

        }
Exemple #4
0
        private void o2MessageQueue_onMessages(IO2Message o2Message)
        {
            //first thing to do is to make sure we are on the correct thread
            if (InvokeRequired)
            {
                Invoke(new EventHandler(delegate { o2MessageQueue_onMessages(o2Message); }));
            }
            else
            {
                if (o2Message is IM_GUIAction)
                {
                    var mGuiAction = (IM_GUIAction)o2Message;
                    DI.log.info("O2GuiWithDockPanel received IM_GUIAction of action: {0}", mGuiAction.GuiAction);
                    switch (mGuiAction.GuiAction)
                    {
                    case (IM_GUIActions.openControlInGui):
                        O2DockPanel.loadControl(mGuiAction.controlType, mGuiAction.o2DockState,
                                                mGuiAction.controlName);
                        break;

                    case (IM_GUIActions.setAscxDockStateAndOpenIfNotAvailable):
                        // if setDockState fails is because the control is not loaded
                        if (false == O2DockUtils.setDockState(mGuiAction.controlName, mGuiAction.o2DockState))
                        {
                            O2AscxGUI.openAscxASync(mGuiAction.controlTypeString, mGuiAction.o2DockState, mGuiAction.controlName);
                        }
                        break;
                    }
                    return;
                }
            }
        }
        //HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message); 
        public static void o2KernelQueue_onMessages(IO2Message o2Message)
        {            
            if (o2Message is IM_O2MdbgAction)
            {
                IM_O2MdbgAction o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch (o2MDbgAction.o2MdbgAction)
                {
                    case IM_O2MdbgActions.breakEvent:
                        {
                            string filename = o2MDbgAction.filename;
                            int line = o2MDbgAction.line;
                            DI.log.info("SOURCECODE REF -> {0} : {1})", new object[] { line, filename });
                            O2Messages.fileOrFolderSelected(filename, line);
                            //HandleO2MessageOnSD.setSelectedLineNumber(filename, line);
                            break;
                        }
                    case IM_O2MdbgActions.debugProcessRequest:
                        O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename);
                        break;

                    case IM_O2MdbgActions.debugMethodInfoRequest:
                        O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom);
                        break;
                    case IM_O2MdbgActions.setBreakpointOnFile:
                        O2MDbgUtils.setBreakPointOnFile(o2MDbgAction.filename, o2MDbgAction.line);
                        break;
                }

            }
        }
        static void ascx_Scripts_onMessages(IO2Message o2Message)
        {
            HandleO2MessageOnSD.o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message);

            if (o2Message is IM_O2MdbgAction)
            {
                var o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch(o2MDbgAction.o2MdbgAction)
                {
                    case IM_O2MdbgActions.breakEvent:
                
                    var filename = o2MDbgAction.filename;
                    var line = o2MDbgAction.line;
                    DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename);
                    HandleO2MessageOnSD.setSelectedLineNumber(filename, line);
                        break;
                    case IM_O2MdbgActions.debugProcessRequest:
                        O2MDbgUtils.startProcessUnderDebugger(o2MDbgAction.filename);
                        break;
                    case IM_O2MdbgActions.debugMethodInfoRequest:
                        O2MDbgUtils.debugMethod(o2MDbgAction.method, o2MDbgAction.loadDllsFrom);
                        break;
                }
                
                
            }
        }
        private void o2MessageQueue_onMessages(IO2Message o2Message)
        {
            //first thing to do is to make sure we are on the correct thread
            if (InvokeRequired)
                Invoke(new EventHandler(delegate { o2MessageQueue_onMessages(o2Message); }));
            else
            {
                if (o2Message is IM_GUIAction)
                {
                    var mGuiAction = (IM_GUIAction) o2Message;
                    DI.log.info("O2GuiWithDockPanel received IM_GUIAction of action: {0}", mGuiAction.GuiAction);
                    switch (mGuiAction.GuiAction)
                    {
                            
                        case (IM_GUIActions.openControlInGui):
                            O2DockPanel.loadControl(mGuiAction.controlType, mGuiAction.o2DockState,
                                                    mGuiAction.controlName);
                            break;                            
                        case (IM_GUIActions.setAscxDockStateAndOpenIfNotAvailable):                            
                            // if setDockState fails is because the control is not loaded
                            if (false == O2DockUtils.setDockState(mGuiAction.controlName,mGuiAction.o2DockState))
                                O2AscxGUI.openAscxASync(mGuiAction.controlTypeString, mGuiAction.o2DockState,mGuiAction.controlName);                                 
                            break;

                    }
                    return;
                }
            }
        }
        void ascx_Breakpoints_onMessages(IO2Message o2Message)
        {
            //switch (o2Message.GetType().Name)
            //{
            //    case "IM_SelectedTypeOrMethod":
            //    case "IM_O2MdbgActions":
            //        break;
            if (o2Message is IM_SelectedTypeOrMethod)
            {
                O2Thread.mtaThread(() =>
                {
                    string breakPointSignature =
                        DI.o2MDbg.BreakPoints.
                        getBreakpointSignatureFromO2SelectedTypeOrMethodMessage(
                            o2Message);
                    if (breakPointSignature != "")
                    {
                        O2Forms.setTextBoxValue_ThreadSafeWay(breakPointSignature,
                                                              tbBreakPointSignature);
                    }
                }
                                   );
            }

            /*else if (o2Message is IM_O2MdbgAction)
             * {
             *  var o2MdbgAction = (IM_O2MdbgAction)o2Message;
             *  if (o2MdbgAction.o2MdbgAction == IM_O2MdbgActions.startDebugSession)
             *      setOnBreakpointEvent();
             * }*/
        }
 void ascx_AssemblyInvoke_onMessages(IO2Message o2Message)
 {
     if (InvokeRequired)
         Invoke(new EventHandler(delegate { ascx_AssemblyInvoke_onMessages(o2Message); }));
     else
     {
         if (o2Message is IM_DotNetAssemblyAvailable)
             loadAssembly(((IM_DotNetAssemblyAvailable)o2Message).pathToAssembly);
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblly = (IM_DotNetAssemblyAvailable) o2Message;
         var types = DI.reflection.getTypes(DI.reflection.getAssembly(dotNetAssemblly.pathToAssembly));
         if (types.Count() > 0)
             loadFilters(types[0]);
     }
 }
Exemple #11
0
  private static void o2MessageQueue_onMessages(IO2Message o2Message)
  {
      try
      {
          if (o2Message is IM_GUIAction)
          {
              var mGuiAction = (IM_GUIAction) o2Message;
              DI.log.info("O2GuiWithDockPanel received IM_GUIAction of action: {0}", mGuiAction.GuiAction);
              switch (mGuiAction.GuiAction)
              {
                  case IM_GUIActions.isAscxGuiAvailable:
                      isAscxGuiAvailable();
                      break;
                      //   case (IM_GUIActions.openControlInGui): // don't handle these here                     
                  case IM_GUIActions.getGuiAscx:
                      if (mGuiAction.returnDataCallback != null)
                          mGuiAction.returnDataCallback(O2DockUtils.getAscx(mGuiAction.controlName));
                      break;
                  case IM_GUIActions.executeOnAscx:
                      if (mGuiAction.controlName == null || mGuiAction.targetMethod == null ||
                          mGuiAction.methodParameters == null)
                          DI.log.error(
                              "in O2Environment.O2MessagesHandler.o2MessageQueue_onMessages received a O2Message for IM_GUIActions.executeOnAscx, but either the targetMethod or methodParameters are null");
                      else
                      {
                          var ascxControlToExecute = O2AscxGUI.getAscx(mGuiAction.controlName);
                          if (ascxControlToExecute == null)
                              DI.log.error(
                                  "in O2MessagesHandler...IM_GUIActions.executeOnAscx, could not get control: {0}",
                                  mGuiAction.controlName);
                          else
                              o2Message.returnData = DI.reflection.invoke(ascxControlToExecute,
                                                                          mGuiAction.targetMethod,
                                                                          mGuiAction.methodParameters);
                      }
                      break;
                  case IM_GUIActions.closeAscxParent:
                      O2AscxGUI.closeAscxParent(mGuiAction.controlName);
                      break;
                      
                  case IM_GUIActions.openControlInGui:            // this is a special case since we should only handle this if the main GUI is not loaded
                      if (false == O2AscxGUI.isGuiLoaded())                    // this tends to happen on Unit tests where we only have one control loaded
                      {
                          // and if the Gui is not loaded open this control as a stand alone FORM
                          O2AscxGUI.openAscxAsForm(mGuiAction.controlType, mGuiAction.controlName);
                      }
                      break;
              }
          }
      }
      catch (Exception ex)
      {
          DI.log.ex(ex, " in O2MessagesHandler.o2MessageQueue_onMessages");
      }                                        
 }
 void ascx_BreakpointCreator_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MdbgAction = (IM_O2MdbgAction)o2Message;
         if (o2MdbgAction.o2MdbgAction == IM_O2MdbgActions.startDebugSession)
         {
             calculateBreakpoints();
         }
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblyAvailable = (IM_DotNetAssemblyAvailable)o2Message;
         loadFile(dotNetAssemblyAvailable.pathToAssembly);                
         XRulesTreeView_ExpandAll();
         if (cbAutoExecuteUnitTestAfterLoad.Checked)
             executeAllLoadedTests();
     }
 }
Exemple #14
0
 public void sendMessageSync(IO2Message messageToSend)
 {
     var messageSent = new AutoResetEvent(false);
     O2Kernel_O2Thread.mtaThread((() =>
                                                 {
                                                     var messageThread = sendMessage(messageToSend);
                                                     messageThread.Join();
                                                     messageSent.Set();
                                                 }));
     messageSent.WaitOne();
 }
 void o2Kernel_onMessages(IO2Message o2Message)
 {
     // if there is a new assembly check if we need to recompile the current rules
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         if (recompileRulesOnGlobalRecompileEvent)
         // we could add logic here to see if the current dll is a rule (for new, trigger compilation for all IM_DotNetAssemblyAvailable events);                 
             compileXRules();
         //loadAssembly(((IM_DotNetAssemblyAvailable)o2Message).pathToAssembly);
     }
 }
        public void sendMessageSync(IO2Message messageToSend)
        {
            var messageSent = new AutoResetEvent(false);

            O2Thread.mtaThread((() =>
            {
                var messageThread = sendMessage(messageToSend);
                messageThread.Join();
                messageSent.Set();
            }));
            messageSent.WaitOne();
        }
Exemple #17
0
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblly = (IM_DotNetAssemblyAvailable)o2Message;
         var types           = DI.reflection.getTypes(DI.reflection.getAssembly(dotNetAssemblly.pathToAssembly));
         if (types.Count() > 0)
         {
             loadFilters(types[0]);
         }
     }
 }
Exemple #18
0
 void o2Kernel_onMessages(IO2Message o2Message)
 {
     // if there is a new assembly check if we need to recompile the current rules
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         if (recompileRulesOnGlobalRecompileEvent)
         {
             // we could add logic here to see if the current dll is a rule (for new, trigger compilation for all IM_DotNetAssemblyAvailable events);
             compileXRules();
         }
         //loadAssembly(((IM_DotNetAssemblyAvailable)o2Message).pathToAssembly);
     }
 }
Exemple #19
0
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblyAvailable = (IM_DotNetAssemblyAvailable)o2Message;
         loadFile(dotNetAssemblyAvailable.pathToAssembly);
         XRulesTreeView_ExpandAll();
         if (cbAutoExecuteUnitTestAfterLoad.Checked)
         {
             executeAllLoadedTests();
         }
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
             case IM_CirActions.setCirDataAnalysis:
                 setO2CirDataAnalysisObject(cirAction.CirDataAnalysis);
                 break;
         }
     }
 }
 void ascx_CurrentFrameDetails_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MDbgAction = (IM_O2MdbgAction)o2Message;
         switch (o2MDbgAction.o2MdbgAction)
         {
             case IM_O2MdbgActions.breakEvent:
                 showFrameVariables();
                 break;                    
         }
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
         case IM_CirActions.setCirDataAnalysis:
             setO2CirDataAnalysisObject(cirAction.CirDataAnalysis);
             break;
         }
     }
 }
Exemple #23
0
 void ascx_CurrentFrameDetails_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MDbgAction = (IM_O2MdbgAction)o2Message;
         switch (o2MDbgAction.o2MdbgAction)
         {
         case IM_O2MdbgActions.breakEvent:
             showFrameVariables();
             break;
         }
     }
 }
Exemple #24
0
 void ascx_AssemblyInvoke_onMessages(IO2Message o2Message)
 {
     if (InvokeRequired)
     {
         Invoke(new EventHandler(delegate { ascx_AssemblyInvoke_onMessages(o2Message); }));
     }
     else
     {
         if (o2Message is IM_DotNetAssemblyAvailable)
         {
             loadAssembly(((IM_DotNetAssemblyAvailable)o2Message).pathToAssembly);
         }
     }
 }
Exemple #25
0
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
         case IM_CirActions.setCirDataAnalysis:
             cirDataAnalysis = cirAction.CirDataAnalysis;
             LoadClassInfo();
             break;
         }
     }
 }
Exemple #26
0
 void ascx_CurrentFrameDetails_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MDbgAction = (IM_O2MdbgAction)o2Message;
         switch (o2MDbgAction.o2MdbgAction)
         {
         case IM_O2MdbgActions.breakEvent:
             showThreadsWithStackTrace();
             //DI.o2MDbg.executeMDbgCommand(O2MDbgCommands.printLocalVariables());
             //DI.o2MDbg.executeMDbgCommand("w");
             break;
         }
     }
 }
 void ascx_CurrentFrameDetails_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MDbgAction = (IM_O2MdbgAction)o2Message;
         switch (o2MDbgAction.o2MdbgAction)
         {
             case IM_O2MdbgActions.breakEvent:
                 showThreadsWithStackTrace();
                 //DI.o2MDbg.executeMDbgCommand(O2MDbgCommands.printLocalVariables());
                 //DI.o2MDbg.executeMDbgCommand("w");
                 break;
         }
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction) o2Message;
         switch (cirAction.CirAction)
         {
             case IM_CirActions.setCirData:                        
                 CirDataAnalysisUtils.addO2CirDataFile(cirDataAnalysis, cirAction.CirData);
                 raiseSetCirDataAnalysisO2Message();
                 //O2Messages.setCirDataAnalysis(cirDataAnalysis);
                 //DI.cirData = cirAction.CirData;
                 //updateCirDataStats();
                 break;
         }
     }
 }
Exemple #29
0
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
         case IM_CirActions.setCirData:
             CirDataAnalysisUtils.addO2CirDataFile(cirDataAnalysis, cirAction.CirData);
             raiseSetCirDataAnalysisO2Message();
             //O2Messages.setCirDataAnalysis(cirDataAnalysis);
             //DI.cirData = cirAction.CirData;
             //updateCirDataStats();
             break;
         }
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblyAvailable = (IM_DotNetAssemblyAvailable) o2Message;
         if (cbAddAssemblyOnAssemblyCompileEvent.Checked && File.Exists(dotNetAssemblyAvailable.pathToAssembly))
         {
             loadFile(dotNetAssemblyAvailable.pathToAssembly, true);
             mapLoadedAssembliesIntoXRules();
             tvXRules_IfPossibleAutoExpandAll();
             if (cbAutoExecuteUnitTestAfterLoad.Checked)                    
                 executeAllLoadedXRules();                    
         }
         // we could add logic here to see if the current dll is a rule (for new, trigger compilation for all IM_DotNetAssemblyAvailable events);                 
         //    compileXRules();
     }
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
             case IM_CirActions.setCirDataAnalysis:
                 loadCirDataAnalysisObject(cirAction.CirDataAnalysis);
                 updateCirDataStats();
                 break;
             case IM_CirActions.setCirData:  // if there was a CirData file set, then add it into CirDataAnalysis
                 CirDataAnalysisUtils.addO2CirDataFile(cirDataAnalysis, cirAction.CirData);
                 updateCirDataStats();
                 break;
         }
     }
 }
        void o2MessageQueue_onMessages(IO2Message o2Message)
        {
            if (o2Message is IM_CirAction)
            {
                var cirAction = (IM_CirAction)o2Message;
                switch (cirAction.CirAction)
                {
                case IM_CirActions.setCirDataAnalysis:
                    loadCirDataAnalysisObject(cirAction.CirDataAnalysis);
                    updateCirDataStats();
                    break;

                case IM_CirActions.setCirData:      // if there was a CirData file set, then add it into CirDataAnalysis
                    CirDataAnalysisUtils.addO2CirDataFile(cirDataAnalysis, cirAction.CirData);
                    updateCirDataStats();
                    break;
                }
            }
        }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_DotNetAssemblyAvailable)
     {
         var dotNetAssemblyAvailable = (IM_DotNetAssemblyAvailable)o2Message;
         if (cbAddAssemblyOnAssemblyCompileEvent.Checked && File.Exists(dotNetAssemblyAvailable.pathToAssembly))
         {
             loadFile(dotNetAssemblyAvailable.pathToAssembly, true);
             mapLoadedAssembliesIntoXRules();
             tvXRules_IfPossibleAutoExpandAll();
             if (cbAutoExecuteUnitTestAfterLoad.Checked)
             {
                 executeAllLoadedXRules();
             }
         }
         // we could add logic here to see if the current dll is a rule (for new, trigger compilation for all IM_DotNetAssemblyAvailable events);
         //    compileXRules();
     }
 }
Exemple #34
0
        //public void addBreakPointsOnAllMethods()
        // {
        //     add(DI.reflection.getMethods(o2MDbgOLD.pathToMainAssembly));
        // }

        // the format is {Dll}!{Type}.{method}  for example App_Web_vx-ae8ro.dll!HacmeBank_v2_Website.Login.btnSubmit_Click
        public string getBreakpointSignatureFromO2SelectedTypeOrMethodMessage(IO2Message o2Message)
        {
            string breakPointSignature = "";

            if (o2Message is IM_SelectedTypeOrMethod)
            {
                var selectedTypeOrMethod = (IM_SelectedTypeOrMethod)o2Message;
                if (selectedTypeOrMethod.methodInfo != null)
                {
                    var moduleName = selectedTypeOrMethod.methodInfo.Module.FullyQualifiedName;
                    var typeName   = selectedTypeOrMethod.methodInfo.ReflectedType.FullName;
                    var methodName = selectedTypeOrMethod.methodInfo.Name;

                    //    o2MDbg.shell.Debugger.Processes.Active.Breakpoints.CreateBreakpoint(moduleName, typeName, methodName, 0);

                    breakPointSignature = string.Format("{0}!{1}.{2}", moduleName, typeName, methodName);
                }
            }
            return(breakPointSignature);
        }
Exemple #35
0
        public static void o2MessageHelper_Handle_IM_FileOrFolderSelected(IO2Message o2Message, string parentControl)
        {
            // open file in ascx_SourceCodeEditor
            if (o2Message is IM_FileOrFolderSelected)
            {
                var fileOrFolderSelectedMessage = ((IM_FileOrFolderSelected)o2Message);
                //var fileSelected = .pathToFileOrFolder;
                fileOrFolderSelectedMessage.pathToFileOrFolder = tryToResolveFileLocation(fileOrFolderSelectedMessage.pathToFileOrFolder, O2AscxGUI.getGuiWithDockPanelAsControl());
                if (File.Exists(fileOrFolderSelectedMessage.pathToFileOrFolder))
                {
                    // var filename = Path.GetFileName(fileOrFolderSelectedMessage.pathToFileOrFolder);

                    var ascx_ScriptControl = getScriptEditor(fileOrFolderSelectedMessage.pathToFileOrFolder);
                    O2Messages.getAscx(ascx_ScriptControl,
                                       guiControl =>
                    {
                        if (guiControl != null && guiControl is ascx_SourceCodeEditor)
                        {
                            var sourceCodeEditor = (ascx_SourceCodeEditor)guiControl;
                            switch (fileOrFolderSelectedMessage.messageText)
                            {
                            case "KM_Show_Selected_Text":
                                loadFileAndSelectText(sourceCodeEditor, fileOrFolderSelectedMessage);
                                break;

                            default:
                                loadFileAndSelectLine(sourceCodeEditor, fileOrFolderSelectedMessage);
                                break;
                            }

                            if (parentControl != null)
                            {
                                O2DockUtils.setDockContentState(parentControl,
                                                                O2DockState.DockLeft);
                            }
                        }
                    });
                }
            }
        }
        void handleKernelMessage(IO2Message o2Message)
        {
            if (o2Message is IM_O2MdbgAction)
            {
                var o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch (o2MDbgAction.o2MdbgAction)
                {
                    case IM_O2MdbgActions.breakEvent:

                        var filename = o2MDbgAction.filename;
                        var line = o2MDbgAction.line;
                        ///       DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename);
                        addTraceForLine(filename, line);
                        break;
                    case IM_O2MdbgActions.commandExecutionMessage:
                        if (o2MDbgAction.lastCommandExecutionMessage.IndexOf("STOP: Breakpoint") == -1)                            
                            addTrace(null, 0, o2MDbgAction.lastCommandExecutionMessage);
                        break;
                }
            }

        }
        public static void o2MessageHelper_Handle_IM_FileOrFolderSelected(IO2Message o2Message, string parentControl)
        {
            // open file in ascx_SourceCodeEditor
            if (o2Message is IM_FileOrFolderSelected)
            {
                var fileOrFolderSelectedMessage = ((IM_FileOrFolderSelected) o2Message);
                //var fileSelected = .pathToFileOrFolder;
                fileOrFolderSelectedMessage.pathToFileOrFolder = tryToResolveFileLocation(fileOrFolderSelectedMessage.pathToFileOrFolder, O2AscxGUI.getGuiWithDockPanelAsControl());
                if (File.Exists(fileOrFolderSelectedMessage.pathToFileOrFolder))
                {
                    // var filename = Path.GetFileName(fileOrFolderSelectedMessage.pathToFileOrFolder);

                    var ascx_ScriptControl = getScriptEditor(fileOrFolderSelectedMessage.pathToFileOrFolder);
                    O2Messages.getAscx(ascx_ScriptControl,
                                       guiControl =>
                                           {
                                               if (guiControl != null && guiControl is ascx_SourceCodeEditor)
                                               {
                                                   var sourceCodeEditor = (ascx_SourceCodeEditor)guiControl;
                                                   switch (fileOrFolderSelectedMessage.messageText)
                                                   {
                                                       case "KM_Show_Selected_Text":
                                                           loadFileAndSelectText(sourceCodeEditor, fileOrFolderSelectedMessage);   
                                                           break;
                                                       default:
                                                           loadFileAndSelectLine(sourceCodeEditor, fileOrFolderSelectedMessage);   
                                                           break;
                                                   }

                                                   if (parentControl != null)
                                                       O2DockUtils.setDockContentState(parentControl,
                                                                                       O2DockState.DockLeft);
                                               }
                                           });
                }
            }
        }
Exemple #38
0
        void handleKernelMessage(IO2Message o2Message)
        {
            if (o2Message is IM_O2MdbgAction)
            {
                var o2MDbgAction = (IM_O2MdbgAction)o2Message;
                switch (o2MDbgAction.o2MdbgAction)
                {
                case IM_O2MdbgActions.breakEvent:

                    var filename = o2MDbgAction.filename;
                    var line     = o2MDbgAction.line;
                    ///       DI.log.info("SOURCECODE REF -> {0} : {1})", line, filename);
                    addTraceForLine(filename, line);
                    break;

                case IM_O2MdbgActions.commandExecutionMessage:
                    if (o2MDbgAction.lastCommandExecutionMessage.IndexOf("STOP: Breakpoint") == -1)
                    {
                        addTrace(null, 0, o2MDbgAction.lastCommandExecutionMessage);
                    }
                    break;
                }
            }
        }
        //public void addBreakPointsOnAllMethods()
        // {
        //     add(DI.reflection.getMethods(o2MDbgOLD.pathToMainAssembly));
        // }

        // the format is {Dll}!{Type}.{method}  for example App_Web_vx-ae8ro.dll!HacmeBank_v2_Website.Login.btnSubmit_Click
        public string getBreakpointSignatureFromO2SelectedTypeOrMethodMessage(IO2Message o2Message)
        {

            string breakPointSignature = "";
            if (o2Message is IM_SelectedTypeOrMethod)
            {
                var selectedTypeOrMethod = (IM_SelectedTypeOrMethod)o2Message;
                if (selectedTypeOrMethod.methodInfo != null)
                {
                    var moduleName = selectedTypeOrMethod.methodInfo.Module.FullyQualifiedName;
                    var typeName = selectedTypeOrMethod.methodInfo.ReflectedType.FullName;
                    var methodName = selectedTypeOrMethod.methodInfo.Name;

                    //    o2MDbg.shell.Debugger.Processes.Active.Breakpoints.CreateBreakpoint(moduleName, typeName, methodName, 0);

                    breakPointSignature = string.Format("{0}!{1}.{2}", moduleName, typeName, methodName);
                }
            }
            return breakPointSignature;
        }
Exemple #40
0
 public Thread sendMessage(IO2Message messageToSend)
 {
     return Callbacks.raiseRegistedCallbacks(onMessages, new object[] { messageToSend });
 }
 void o2MessageQueue_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_CirAction)
     {
         var cirAction = (IM_CirAction)o2Message;
         switch (cirAction.CirAction)
         {
             case IM_CirActions.setCirDataAnalysis:
                 cirDataAnalysis = cirAction.CirDataAnalysis;
                 LoadClassInfo();                       
                 break;
         }
     }
 }
 public bool sendMessage(IO2Message o2Message)
 {
     throw new System.NotImplementedException();
 }
Exemple #43
0
 public static void o2MessageHelper_Handle_IM_FileOrFolderSelected(IO2Message o2Message)
 {
     o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message, null);
 }
Exemple #44
0
        private static void o2MessageQueue_onMessages(IO2Message o2Message)
        {
            try
            {
                if (o2Message is IM_GUIAction)
                {
                    var mGuiAction = (IM_GUIAction)o2Message;
                    DI.log.info("O2GuiWithDockPanel received IM_GUIAction of action: {0}", mGuiAction.GuiAction);
                    switch (mGuiAction.GuiAction)
                    {
                    case IM_GUIActions.isAscxGuiAvailable:
                        isAscxGuiAvailable();
                        break;

                    //   case (IM_GUIActions.openControlInGui): // don't handle these here
                    case IM_GUIActions.getGuiAscx:
                        if (mGuiAction.returnDataCallback != null)
                        {
                            mGuiAction.returnDataCallback(O2DockUtils.getAscx(mGuiAction.controlName));
                        }
                        break;

                    case IM_GUIActions.executeOnAscx:
                        if (mGuiAction.controlName == null || mGuiAction.targetMethod == null ||
                            mGuiAction.methodParameters == null)
                        {
                            DI.log.error(
                                "in O2Environment.O2MessagesHandler.o2MessageQueue_onMessages received a O2Message for IM_GUIActions.executeOnAscx, but either the targetMethod or methodParameters are null");
                        }
                        else
                        {
                            var ascxControlToExecute = O2AscxGUI.getAscx(mGuiAction.controlName);
                            if (ascxControlToExecute == null)
                            {
                                DI.log.error(
                                    "in O2MessagesHandler...IM_GUIActions.executeOnAscx, could not get control: {0}",
                                    mGuiAction.controlName);
                            }
                            else
                            {
                                o2Message.returnData = DI.reflection.invoke(ascxControlToExecute,
                                                                            mGuiAction.targetMethod,
                                                                            mGuiAction.methodParameters);
                            }
                        }
                        break;

                    case IM_GUIActions.closeAscxParent:
                        O2AscxGUI.closeAscxParent(mGuiAction.controlName);
                        break;

                    case IM_GUIActions.openControlInGui:                // this is a special case since we should only handle this if the main GUI is not loaded
                        if (false == O2AscxGUI.isGuiLoaded())           // this tends to happen on Unit tests where we only have one control loaded
                        {
                            // and if the Gui is not loaded open this control as a stand alone FORM
                            O2AscxGUI.openAscxAsForm(mGuiAction.controlType, mGuiAction.controlName);
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                DI.log.ex(ex, " in O2MessagesHandler.o2MessageQueue_onMessages");
            }
        }
 public static void o2MessageHelper_Handle_IM_FileOrFolderSelected(IO2Message o2Message)
 {
     o2MessageHelper_Handle_IM_FileOrFolderSelected(o2Message, null);
 }
 public bool sendMessage(IO2Message o2Message)
 {
     throw new System.NotImplementedException();
 }
Exemple #47
0
 public bool sendMessage(IO2Message o2Message)
 {
     DI.log.info("Received message of Type:{0}", o2Message.GetType().Name);
     return(true);
 }
 public bool sendMessage(IO2Message o2Message)
 {
     DI.log.info("Received message of Type:{0}", o2Message.GetType().Name);
     return true;
 }
 public Thread sendMessage(IO2Message messageToSend)
 {
     return(Callbacks.raiseRegistedCallbacks(onMessages, new object[] { messageToSend }));
 }
 void ascx_BreakpointCreator_onMessages(IO2Message o2Message)
 {
     if (o2Message is IM_O2MdbgAction)
     {
         var o2MdbgAction = (IM_O2MdbgAction) o2Message;
         if (o2MdbgAction.o2MdbgAction == IM_O2MdbgActions.startDebugSession)
             calculateBreakpoints();
     }
 }