Beispiel #1
0
        private void documentActivated(object sender, DocumentCollectionEventArgs e)
        {
            PerDocData perDocDatum = null;

            if (!CMNApplication.mDocDataCollection.Contains(e.Document))
            {
                perDocDatum = new PerDocData(e.Document);
                CMNApplication.mDocDataCollection.Add(e.Document, perDocDatum);
            }
            else
            {
                perDocDatum = (PerDocData)CMNApplication.mDocDataCollection[e.Document];
            }
            if (CMNApplication.ESWCmn != null)
            {
                CMNApplication.ESWCmn.CmnControl.CurrentDocData = perDocDatum;
                CMNApplication.ESWCmn.CmnControl.RestoreFromCurrentData(true);
                if (Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Count == 1 && CMNApplication.ESWCmn.CmnControl.mbShouldRestore)
                {
                    CMNApplication.ESWCmn.ESW.Visible = true;
                    CMNApplication.ESWCmn.CmnControl.mbShouldRestore = false;
                }
            }
            W32Util.SetFocusToAcadMainFrame();
        }