using System;
using System.Diagnostics;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
[assembly: CommandClass(typeof(TestStartScreen.MyCommands))]
namespace TestStartScreen
{
public class MyCommands
{
[CommandMethod("SetDocReactor")]
public void SetDocReactor()
{
DocumentWindowCollection docs = Application.DocumentWindowCollection;
docs.DocumentWindowActivated += docs_DocumentWindowActivated;
}
void docs_DocumentWindowActivated(object sender, DocumentWindowActivatedEventArgs e)
{
if ((e.DocumentWindow.Title.ToUpper().CompareTo("START") == 0 ||
e.DocumentWindow.Title.ToUpper().CompareTo("НАЧАЛО") == 0)
&& e.DocumentWindow.Document == null)
{
Debug.WriteLine("Это окно Start/Начало");
}
}
}
}