Beispiel #1
0
        public void NavigatePanelTo(NodeModel node, bool supressHistory)
        {
            if (!supressHistory)
            {
                // remove anything after current node, add this node to top
                while (Current != null && Current.Next != null)
                {
                    History.RemoveLast();
                }

                Current = History.AddLast(node);
            }

            if (node.ObjType == XObjType.Method)
            {
                CodeTab.NavigateTo(node);
                ShowDetailsPanel(CodeTab);
            }

            else if (node.ObjType == XObjType.Class ||
                     node.ObjType == XObjType.Field)
            {
                InstanceTab.NavigateTo(node);
                ShowDetailsPanel(InstanceTab);
            }

            else
            {
                NamespaceTab.NavigateTo(node);
                ShowDetailsPanel(NamespaceTab);
            }
        }
Beispiel #2
0
        public MainForm()
        {
            InitializeComponent();

            Model = new ViewModel(this, new BrightColorProfile());

            InitRenderers();
            SetRenderer(typeof(GdiRenderer));

            Model.SetRoot(Model.CurrentRoot); // init first node in history


            RedrawTimer.Interval = 1000 / XRay.TargetFps;
            RedrawTimer.Enabled  = true;

            RevalueTimer.Interval = 1000;
            RevalueTimer.Enabled  = true;

            InstanceTab.Init(this);
            DisplayTab.Init(this);
            ConsoleTab.Init(this);
            CodeTab.Init(this);
            NamespaceTab.Init(this);
            SettingsTab.Init(this);

            CodeTab.Visible      = false;
            InstanceTab.Visible  = false;
            NamespaceTab.Visible = false;

            //var x = Assembly.GetEntryAssembly();
            //Text = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location) + " Code Perspective";
            //Text = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) + " Code Perspective";

            Text = "Code Perspective";

            if (XRay.Remote != null && XRay.Remote.RemoteDatHash != null)
            {
                Text = "Remote " + Text;
            }

            if (Pro.Verified)
            {
                Text += " Pro";
            }

            Show();
            WindowState = FormWindowState.Normal;
            BringToFront();
        }