コード例 #1
0
        private void CreateInitialView()
        {
            string fname = mFilename;
            mFilter = "";
			// Now Create initial view
			PopulateLabelList();
			PopulateHW();
			PopulateGraphicalView();
            PopulateFromSnapshot(mLog, mLogSnap, mFilter, 0, false);
			mMenuItemSave.Enabled = true;		// Enable save button
			
			// Update window title - enable view menu / callstack and graphical view
			this.Text = "Mem Visualizer - " + fname;
			mMenuItemView.Enabled = true;
//			mMenuItemCallstack.Enabled = mLog.FindFieldName("StackTrace");
			mMenuItemGV.Enabled = (mLog.GetAllocatorList().Count == 0) ? false : true;
			mMenuItemMG.Enabled = (mLog.GetFormat() == "MetricsMemoryLog");
			if (mMemoryGraph != null)
			{
				mMemoryGraph.Close();
				mMemoryGraph = null;
			}
			if (mGraphicalView != null)
			{
				mGraphicalView.Close();
				mGraphicalView = null;
			}
		}
コード例 #2
0
		//------------------------------------------------------------------
		private void GVClicked(object sender, System.EventArgs e)
		{
			MenuItem mi = (MenuItem) sender;
            checkSelectedItem(mi);
            string displayMode = LoadFromRegistry("displayMode", "category");

            GVstruct infoToGraph = new GVstruct();
            bool resizeGV = false;
            int[] dim = new int[4];
            if (mGraphicalView == null)
            {
                mGraphicalView = new GraphicalView(this);
                //resizeGV = true;                
               // mGraphicalView.Close();
               // mGraphicalView = null;
            }

            int catIndex = 0;
			if (mi != null)
			{
				string item = mi.ToString();
                catIndex = mLog.GetIndexForCategory(mi.Text);
                if (displayMode == "heap")
                    catIndex = 0;  // 0 means no category, or i.e. all categories
                mLogSnap = new MemManager.Log.SnapShot(mLog, mLog.FindHWIndexForCategory(catIndex), true);
                infoToGraph.PopulateGVStructFromSnapshot(mLog, mLogSnap, catIndex);
			}
            mGraphicalView.CopyGvInfo(infoToGraph, mLog, mLogSnap, mAllocators, catIndex);
            if (resizeGV)
                mGraphicalView.SetWindowSize(dim[0], dim[1]);
            
            mGraphicalView.Show();

            //the following goes after show to work correctly
            if (resizeGV)
                mGraphicalView.SetWindowLocation(new Point(dim[2], dim[3]));
        }
コード例 #3
0
		public void CloseGraphicalView()
		{
			mGraphicalView = null;
		}