Ejemplo n.º 1
0
        private void Open(string AFileName)
        {
            // Display the ProgressBar control.
            pBar1.Visible = true;
            // Set Minimum to 0 to represent the first file being copied.
            pBar1.Minimum = 0;
            // Set Maximum to the total number of files to copy.
            pBar1.Maximum = 100;
            // Set the initial value of the ProgressBar.
            pBar1.Value = 1;

            cache.UpdateProgress += UpdateProgress;
            cache.Load(AFileName, false);
            cache.ReAnalyze();
            config.HideFastFuncs = false;
            config.HideLibFuncs  = false;
            config.FastThreshold = 100;
            config.TimeDisplay   = TTimeDisplay.tdPercent;
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(AFileName);
            config.WorkingDir = fileInfo.DirectoryName;
            //now that configs are set, refresh
            RefreshExplorer();

            //new stuff
            FDoc    fDoc = new FDoc(cache, config);
            TabPage tp   = new TabPage();

            System.IO.FileInfo fileInfo2 = new System.IO.FileInfo(cache.Cmd);
            tp.Text       = fileInfo2.Name;
            tp.ImageIndex = (int)tForm1ImageIndex.imgClose;
            tp.Controls.Add(fDoc);
            this.tabControl2.TabPages.Add(tp);
            pBar1.Visible = false;
        }
Ejemplo n.º 2
0
        private void _toolStripMenuItemClick(string _event, object sender, EventArgs e)
        {
            TabPage tp = tabControl2.SelectedTab;

            if (tp == null)
            {
            }
            else
            {
                foreach (Control control in tp.Controls)
                {
                    if (control.ToString() == "WinCacheGrind2.FDoc")
                    {
                        FDoc fDoc = (FDoc)control;
                        switch (_event)
                        {
                        case "aTreeGoToRoot_Click":
                            fDoc.aTreeGoToRoot_Click(sender, e);
                            break;

                        case "aViewGoToUpOneLevel_Click":
                            fDoc.aViewGoToUpOneLevel_Click(sender, e);
                            break;

                        case "aViewHideLibFuncs_Click":
                            fDoc.aViewHideLibFuncs_Click(sender, e);
                            break;

                        case "aViewHideFastFuncs_Click":
                            fDoc.aViewHideFastFuncs_Click(sender, e);
                            break;

                        case "aViewFullPath_Click":
                            fDoc.aViewFullPath_Click(sender, e);
                            break;

                        case "aViewPercent_Click":
                            fDoc.aViewPercent_Click(sender, e);
                            break;

                        case "aViewMS_Click":
                            fDoc.aViewMS_Click(sender, e);
                            break;
                        }
                    }
                }
            }
        }