Beispiel #1
0
        private void MainForm_DragDrop(object sender, DragEventArgs e)
        {
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            foreach (string file in files)
            {
                if (!File.Exists(file))
                {
                    continue;
                }

                switch (Path.GetExtension(file))
                {
                case ".msb": {
                    SessionForm session = NewSession();
                    session.OpenReadOnly(file);
                    StructureForm.InitEngine(session.Locale, session.Build);
                    session.Show(mDockPanel, DockState.Document);
                    break;
                }

                case ".pcap": {
                    LoadPcapFile(file);
                    break;
                }
                }
            }
        }
Beispiel #2
0
        private void mFileOpenMenu_Click(object pSender, EventArgs pArgs)
        {
            if (mOpenDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            foreach (string path in mOpenDialog.FileNames)
            {
                SessionForm session = NewSession();
                session.OpenReadOnly(path);
                StructureForm.InitEngine(session.Locale, session.Build);
                session.Show(mDockPanel, DockState.Document);
            }
        }
Beispiel #3
0
        private void MainForm_Load(object pSender, EventArgs pArgs)
        {
            mDockPanel.Theme = Config.Instance.Theme.DockSuiteTheme;
            toolStripExtender.DefaultRenderer = new ToolStripProfessionalRenderer();
            toolStripExtender.SetStyle(mMenu, VisualStudioToolStripExtender.VsVersion.Vs2015, mDockPanel.Theme);
            toolStripExtender.SetStyle(toolStrip, VisualStudioToolStripExtender.VsVersion.Vs2015, mDockPanel.Theme);

            try {
                mDockPanel.LoadFromXml(LAYOUT_FILE, GetContentFromPersistString);
            } catch {
                // If we fail to load, it will just use the default layout.
                logger.Debug("Using default layout");
                LogForm.Show(mDockPanel);
                SearchForm.Show(mDockPanel);
                DataForm.Show(mDockPanel);
                StructureForm.Show(mDockPanel);
                PropertyForm.Show(mDockPanel);

                // Docking can only be done after adding to panel.
                StructureForm.DockState = DockState.DockRight;
                PropertyForm.DockState  = DockState.DockRight;
            }

            LogForm.ApplyTheme();
            SearchForm.ApplyTheme();
            DataForm.ApplyTheme();
            StructureForm.ApplyTheme();
            PropertyForm.ApplyTheme();

            SetupAdapter();
            mTimer.Enabled = true;

            foreach (string arg in startupArguments)
            {
                SessionForm session = NewSession();
                session.OpenReadOnly(arg);
                StructureForm.InitEngine(session.Locale, session.Build);
                session.Show(mDockPanel, DockState.Document);
            }
        }