Exemplo 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
            //
        }
Exemplo n.º 2
0
			m_bGCBeforeOC=bGCBeforeOC;	
			
		}
		public ObjectData(ObjectData oObject)
		{
			if(oObject!=null)
			{
				this.m_iObjectsFlag=oObject.m_iObjectsFlag;
				this.m_strObjectClassFilter=oObject.m_strObjectClassFilter;
				this.m_bObjectClassPassthrough =oObject.m_bObjectClassPassthrough;
Exemplo n.º 3
0
        private void objectProc()
        {
            this.Cursor=Cursors.WaitCursor ;
            this.Enabled=false;
            Application.DoEvents();

            ObjectImporter objImporter=null;
            try
            {
                objImporter=new ObjectImporter( 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);
                objImporter.loadSession();
                objImporter.updateObjects();
                this.objObj=new ObjectData( objImporter.getObjectData);

            }
            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(false);
                    ReportsNavigation.ExpandAll();
                    Application.DoEvents();

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

            }
        }
Exemplo 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
			//
		}
Exemplo 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();
                }

            }
        }