예제 #1
0
        public LevelViewParent()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // Default
            panelShowToolbar.Hide();
            panelToolbar.Show();

            // Easier than creating a resource file?

            System.Reflection.Assembly ass = typeof(LevelViewParent).Module.Assembly;
            Stream stm = ass.GetManifestResourceStream("m.toolstrip.bmp");

            imageList1.Images.AddStrip(new Bitmap(stm));

            TemplateDocTemplate doct = (TemplateDocTemplate)DocManager.FindDocTemplate(typeof(TemplateDoc));

            doct.DocAdded   += new DocTemplate.DocAddedHandler(TemplateDocTemplate_DocAdded);
            doct.DocRemoved += new DocTemplate.DocRemovedHandler(TemplateDocTemplate_DocRemoved);

            // Combo index 0

            FillCombo();
            comboDocs.SelectedIndex = 0;
            UpdateZoomSelection();
            view.ScaleChanged += new EventHandler(View_ScaleChanged);
        }
예제 #2
0
        public LevelFrame(Form frmParent, Document doc, Type typeView)
        {
            InitializeComponent();

            LevelDocTemplate doct = (LevelDocTemplate)DocManager.FindDocTemplate(typeof(LevelDoc));

            doct.DocActive += new LevelDocTemplate.DocActiveHandler(LevelDocTemplate_DocActive);

            m_doc = doc;

            doc.PathChanged             += new Document.PathChangedHandler(Document_PathChanged);
            doc.ModifiedChanged         += new Document.ModifiedChangedHandler(Document_ModifiedChanged);
            doc.OpenCountChanged        += new Document.OpenCountChangedHandler(Document_OpenCountChanged);
            ((LevelDoc)doc).NameChanged += new LevelDoc.NameChangedHandler(LevelDoc_NameChanged);

            // Parent this and create panes

            MdiParent = frmParent;
            ChangePanes(2);

            // See if the top most mdi frame is maximized. If so, maximize this too
            // If no window around, maximize

            bool fMaximize = true;

            if (frmParent.ActiveMdiChild != null)
            {
                if (frmParent.ActiveMdiChild.WindowState != FormWindowState.Maximized)
                {
                    fMaximize = false;
                }
            }
            if (fMaximize)
            {
                WindowState = FormWindowState.Maximized;
            }

            // Set Title

            s_alsFrames.Add(this);
            SetTitle();

            // If this doc is active, this is the new command target

            if (m_doc == DocManager.GetActiveDocument(typeof(LevelDoc)))
            {
                DocManager.SetCommandTarget(this);
            }

            // Show

            Show();
        }
예제 #3
0
        void FillCombo()
        {
            comboDocs.Items.Clear();
            TemplateDocTemplate doct = (TemplateDocTemplate)DocManager.FindDocTemplate(typeof(TemplateDoc));

            Document[] adoc = doct.GetDocuments();
            comboDocs.Items.Add("");
            foreach (Document doc in adoc)
            {
                comboDocs.Items.Add(doc);
            }
        }
예제 #4
0
        public static void ImportExportPdbs(string[] astr)
        {
            // Expand filespecs
            ArrayList alsFiles = new ArrayList();

            for (int n = 1; n < astr.Length; n++)
            {
                string strFileT = Path.GetFileName(astr[n]);
                string strDirT  = Path.GetDirectoryName(astr[n]);
                if (strDirT == "")
                {
                    strDirT = ".";
                }
                string[] astrFiles = Directory.GetFiles(strDirT, strFileT);
                foreach (string filename in astrFiles)
                {
                    if (filename.EndsWith(".pdb"))
                    {
                        alsFiles.Add(filename);
                    }
                }
            }

            // Import, then save each pdb
            foreach (string filename in alsFiles)
            {
                try {
                    if (File.Exists(filename + "_new"))
                    {
                        Console.WriteLine("Exists: " + filename + "_new");
                        continue;
                    }
                    ImportExpansionPdb(filename);
                    LevelDocTemplate doctLevel = (LevelDocTemplate)DocManager.FindDocTemplate(typeof(LevelDoc));
                    Document[]       adoc      = doctLevel.GetDocuments();
                    SaveExpansionPdb(filename + "_new", adoc, "1.1");
                    foreach (Document doc in adoc)
                    {
                        doc.SetModified(false);
                    }
                    doctLevel.CloseAllDocuments();
                } catch {
                    Console.WriteLine("Error loading " + filename + ", skipping");
                }
            }
        }
예제 #5
0
        public TemplatePanel()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            if (Globals.IsKit())
            {
                Controls.Remove(toolBar);
                toolBar.Visible = false;
            }

            // Easier than creating a resource file?

            System.Reflection.Assembly ass = typeof(TemplatePanel).Module.Assembly;
            Stream stm = ass.GetManifestResourceStream("m.toolstrip.bmp");

            imageList1.Images.AddStrip(new Bitmap(stm));

            // We want to know about changes to template docs

            TemplateDocTemplate doctTemplate = (TemplateDocTemplate)DocManager.FindDocTemplate(typeof(TemplateDoc));

            if (doctTemplate != null)
            {
                doctTemplate.DocActive        += new TemplateDocTemplate.DocActiveHandler(TemplateDocTemplate_DocActive);
                doctTemplate.DocAdded         += new TemplateDocTemplate.DocAddedHandler(TemplateDocTemplate_DocAdded);
                doctTemplate.DocRemoved       += new TemplateDocTemplate.DocRemovedHandler(TemplateDocTemplate_DocRemoved);
                doctTemplate.TemplatesAdded   += new TemplateDocTemplate.TemplatesAddedHandler(TemplateDocTemplate_TemplatesAdded);
                doctTemplate.TemplatesRemoved += new TemplateDocTemplate.TemplatesRemovedHandler(TemplateDocTemplate_TemplatesRemoved);
                doctTemplate.TemplateChanged  += new TemplateDocTemplate.TemplateChangedHandler(TemplateDocTemplate_TemplateChanged);
            }

            // We want to know when the active level doc changes

            LevelDocTemplate doctLevel = (LevelDocTemplate)DocManager.FindDocTemplate(typeof(LevelDoc));

            if (doctLevel != null)
            {
                doctLevel.DocActive += new TemplateDocTemplate.DocActiveHandler(LevelDocTemplate_DocActive);
            }
        }
예제 #6
0
        void InitCommon()
        {
            TemplateDocTemplate doct = (TemplateDocTemplate)DocManager.FindDocTemplate(typeof(TemplateDoc));

            doct.TemplateChanged += new TemplateDocTemplate.TemplateChangedHandler(TemplateDocTemplate_TemplateChanged);
        }