Ejemplo n.º 1
0
        public ConfiguratorForm(string config,FunctionData funcObj,ObjectData objObj,bool exceptionTracing,bool bConfigRequired,bool bInteractive)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.Icon=SharpClientForm.scInstance.Icon;
            try
            {
                cnfg=new Configurator(config,funcObj,objObj,exceptionTracing,bConfigRequired,bInteractive);
            }
            catch(Exception ex)
            {
                this.Text="ProfileSharp Exception!" ;
                this.Size=new Size(this.Width/2,this.Height/2);
                this.errorLabel.Text="\nAn exception has occured while trying to initialize profiling environment on your system.\n"
                    +"\n Exception details are :- \n\""+ex.Message+"\"\n\n Please contact SoftProdigy for support on this issue.";
                Application.DoEvents();
                this.Resize+=new EventHandler(ConfiguratorForm_Resize);
                Application.DoEvents();
                return;
            }

            this.Controls.Clear();
            Application.DoEvents();
            cnfg.Parent =this;
            this.Controls.Add(cnfg);
            cnfg.Dock =DockStyle.Fill ;
            this.ControlRemoved+=new ControlEventHandler(ConfiguratorForm_ControlRemoved);
            this.Resize+=new EventHandler(ConfiguratorForm_Resize);

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
Ejemplo n.º 2
0
		public FunctionData(FunctionData fObject)
		{
			if(fObject!=null)
			{
				this.m_iFunctionFlag=fObject.m_iFunctionFlag;
				this.m_strFunctionClassFilter=fObject.m_strFunctionClassFilter;
				this.m_strFunctionModuleFilter =fObject.m_strFunctionModuleFilter;
				this.m_bFunctionClassPassthrough=fObject.m_bFunctionClassPassthrough ;
				this.m_bFunctionModulePassthrough=fObject.m_bFunctionModulePassthrough;
				this.m_iTRFlag=fObject.m_iTRFlag;	
			}
Ejemplo n.º 3
0
        private void functionProc()
        {
            this.Cursor=Cursors.WaitCursor ;
            this.Enabled=false;
            Application.DoEvents();

            FunctionImporter funImporter=null;
            try
            {
                funImporter=new FunctionImporter( m_fileName,true,"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\SharpBase.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;",true);
                funImporter.loadSession();
                funImporter.updateFunctions();
                this.funcObj=new FunctionData(funImporter.getFunctionData);
            }

            catch(Exception ex)
            {
                this.Cursor=Cursors.Arrow;
                Application.DoEvents() ;
                MessageBox.Show("Session could not be loaded.\n"+ex.Message,"Error!",MessageBoxButtons.OK,MessageBoxIcon.Error);
                this.Title ="Error!";
                try
                {
                    SharpClientForm.scInstance.sharpClientMDITab.TabPages.Remove(this);
                }
                catch{}
            }
            finally
            {
                if(this.Cursor==Cursors.WaitCursor)
                {
                    this.Cursor=Cursors.Arrow;
                    this.Enabled=true;
                    PruneReportTree(true);
                    ReportsNavigation.ExpandAll();
                    Application.DoEvents();

                }
                if(funImporter!=null)
                {
                    this.Title =funImporter.profileeName+":"+ funImporter.profileeSessionName;
                    m_Session=funImporter.profileeSessionName;
                    funImporter.Dispose();
                    funImporter=null;
                }

            }
        }
Ejemplo n.º 4
0
		public Configurator(string config,FunctionData funcObj,ObjectData objObj,bool bExceptionTracing,bool bConfigRequired,bool bDeskTopApp)
		{
			//
			// Required for Windows Form Designer support
			//
			
			WANT_FUNCTION_NAME=false;
			WANT_FUNCTION_SIGNATURE =false;
			WANT_NUMBER_OF_FUNCTION_CALLS =false;
			WANT_FUNCTION_TOTAL_CPU_TIME =false;
			WANT_FUNCTION_MODULE =false;
			WANT_FUNCTION_EXCEPTIONS  =false;
			WANT_FUNCTION_EXCEPTIONS_STACKTRACE  =false;
			WANT_FUNCTION_CALLEE_ID  =false;

			WANT_FUNCTION_CODE_VIEW=false;			
			WANT_FUNCTION_CALLEE_NUMBER_OF_CALLS  =false;
			WANT_FUNCTION_CALLEE_TOTAL_CPU_TIME  =false;
			WANT_FUNCTION_THREAD_ID  =false;
			WANT_FUNCTION_MANAGED_ONLY  =false;
			WANT_NO_FUNCTION_CALLEE_INFORMATION  =false;


			WANT_OBJECT_NAME_ONLY =false;
			WANT_OBJECT_COUNT =false;
			WANT_OBJECT_SIZE =false;
			WANT_REFERENCED_OBJECTS =false;
			WANT_OBJECT_ALLOCATION_DATA=false;
			WANT_SRC_ANALYSIS_ONLY=false;
			WANT_OBJECT_ALL_DATA =false;	

			///////////////////////
			///
			configString=config;	
			IsDesktopApp	=bDeskTopApp;	
			m_bExceptionTracing=bExceptionTracing;

			InitializeComponent();			

			if(IsDesktopApp)
			{
				profileeInteractive.Checked=true;  
				profileeView.Visible=false;  
				newProfileeGroupBox.Visible=true; 
				groupBox10.Visible=false; 
			}
			else
			{
				profileeAlreadyRunning.Checked=true;
				profileeView.Visible=true;  
				groupBox10.Visible=true;
				newProfileeGroupBox.Visible=false; 
			}
			Application.DoEvents();		
			
			if(configString=="MEMORY_ANALYSIS")
			{
				try
				{
					//if(!IsDesktopApp)
					{
						InstallProfilingEnvironment();
					}
				}
				catch(Exception ex)
				{
					HandleInstallMessage(ex.Message); 
					return;
				}

				this.tabConfig.TabPages.RemoveAt(1);  
				objectDataObj =new ObjectData(); 
				try
				{
					this.funcRuntimeCodeView.Checked=false;					 
					foreach(TreeNode node in calleeFunctionTree.Nodes )
					{
						node.Checked=false;
						foreach	(TreeNode subnode in node.Nodes)
						{
							subnode.Checked=false; 
						}
					}
					funcRuntimeCalleeFunctions.Checked=false;
				}catch{}
			}
			else if(configString=="PERFORMANCE_ANALYSIS")
			{
				try
				{
					//if(!IsDesktopApp)
					{
						InstallProfilingEnvironment();
					}
				}
				catch(Exception ex)
				{
					HandleInstallMessage(ex.Message); 
					return;									
				}

				this.tabConfig.TabPages.RemoveAt(0); 
				functionDataObj =new FunctionData(); 				
				if(bExceptionTracing)
				{					
					this.funcRuntimeExceptions.Checked=true;
					this.funcRuntimeExceptionStackTrace.Checked=true;					
					try
					{
						this.funcRuntimeCodeView.Checked=false;
						foreach(TreeNode node in calleeFunctionTree.Nodes )
						{
							node.Checked=false;
							foreach	(TreeNode subnode in node.Nodes)
							{
								subnode.Checked=false; 
							}
						}
						funcRuntimeCalleeFunctions.Checked=false;
					}
					catch{}
					
				}
				else
				{
					this.funcRuntimeCodeView.Checked=true;					
					this.funcRuntimeExceptions.Checked=false;
					this.funcRuntimeExceptionStackTrace.Checked=false;					
					foreach(TreeNode node in calleeFunctionTree.Nodes )
					{
						node.Checked=true;
						foreach	(TreeNode subnode in node.Nodes)
						{
							subnode.Checked=true; 
						}
					}
					funcRuntimeCalleeFunctions.Checked=true; 
				}
				
				try
				{
					objRuntimeSrcCodeAnalysis.Checked=false;
					objRuntimeObjectAllocation.Checked=false;
					objRuntimeReferencedObjectData.Checked=false; 
				}
				catch{}
				
			}			
			else if(configString=="READONLY")
			{
				this.Height -= (this.rejectSettings.Height+1) ;
				this.Controls.Remove(this.rejectSettings);
				this.Controls.Remove(this.acceptSettings);				
				this.tabConfig.TabPages.RemoveAt(2);

				if(funcObj!=null)
				{
					functionDataObj =new FunctionData(funcObj);					
				}
				else
				{
					this.tabConfig.TabPages.RemoveAt(1);   
				}
				if(objObj!=null)
				{
					objectDataObj =new ObjectData(objObj); 
				}
				else
				{
					this.tabConfig.TabPages.RemoveAt(0);
				}
				foreach(Control control in this.Controls)
				{
					StepDisable(control);
				}
			}
			else
			{
				try
				{
					//if(!IsDesktopApp)
					{
						InstallProfilingEnvironment();
					}
				}
				catch(Exception ex)
				{
					HandleInstallMessage(ex.Message); 
					return;
				}
				objectDataObj =new ObjectData(); 
				functionDataObj =new FunctionData(); 
			}	

			if(bConfigRequired==false)
			{				
				this.tabConfig.SelectedTab = profileeTab;			
				acceptSettings.Text="Accept";  
				Application.DoEvents();
				selectNewTab();
			}
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
Ejemplo n.º 5
0
        private void SharpClientTabPage_EnabledChanged(object sender, EventArgs e)
        {
            if(this.Enabled==true)
            {
                if(funcObj!=null)
                {
                    cnfgSettings.functionDataObj.Fill(funcObj);
                    cnfgSettings.SyncUI();
                    funcObj=null;
                    cnfgSettings.Dock =DockStyle.Fill ;
                    cnfgSettings.Visible =true;
                    cnfgSettings.Show();
                }
                else if(objObj!=null)
                {
                    cnfgSettings.objectDataObj.Fill(objObj);
                    cnfgSettings.SyncUI();
                    objObj=null;
                    if(cnfgSettings.Parent!= settingsPanel)
                    {
                        settingsPanel.Controls.Add(cnfgSettings);
                    }
                    cnfgSettings.Dock =DockStyle.Fill ;
                    cnfgSettings.Visible =true;
                    cnfgSettings.Show();
                }

            }
        }