public FrmRuntime() { FrmLoging frmLogin = null; bool flag = true; ThreadStart t = delegate { frmLogin = new FrmLoging(); flag = false; frmLogin.ShowDialog(); }; Thread thread = new Thread(t); thread.Start(); while (flag) { Thread.Sleep(10); } frmLogin.SetMessage("正在加载框架界面方案..."); InitializeComponent(); frmLogin.SetMessage("正在创建三维控件对象..."); this.Text = ConfigManager.AppName; splitControlMain.PanelVisibility = SplitPanelVisibility.Panel1; TerraExplorerX.SGWorld61 sgwTopLeft; TerraExplorerX.SGWorld61 sgwTopRight; TerraExplorerX.SGWorld61 sgwBottomLeft; TerraExplorerX.SGWorld61 sgwBottomRight; this.uC3DWindow1.CreateHooker(out sgwTopLeft, out sgwTopRight, out sgwBottomLeft, out sgwBottomRight); frmLogin.SetMessage("正在创建绑定对象..."); FrameHook hook = new FrameHook(this, new TerraExplorerX.TerraExplorerClass(), sgwTopLeft, this.axMapControl1.Object as ESRI.ArcGIS.Controls.IMapControl4, this.dockPanelRight); // 测试 // // Dictionary<string, Utility.enumCommandType> d = Utility.CommandFactory.GetCommandClasses(@"C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet\ESRI.ArcGIS.Controls.dll"); // Dictionary<string, enumResourceType> dic = Utility.ResourceFactory.GetResources(@"C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet\ESRI.ArcGIS.Controls.dll"); // int count = dic.Count; //// List<Utility.RibbonCommandInfo> // infoList = new List<RibbonCommandInfo>(); // for (int i = 0; i < count; i++) // { // RibbonCommandInfo info = new RibbonCommandInfo(); // ClassInfo cInfo = new ClassInfo(); // cInfo.DllName = "ESRI.ArcGIS.Controls.dll"; // cInfo.ClassName = dic.Keys.ElementAt(i);// +", ESRI.ArcGIS.Controls"; // info.CommandClass = cInfo; // info.Page = "ESRI"; // info.PageGroup = "ESRI命令测试"; // infoList.Add(info); // } IList listPlugin = Environment.NHibernateHelper.GetObjectByCondition("from ClassInfo cInfo where cInfo.Type=1"); foreach (object cInfo in listPlugin) { IPlugin plugin = Utility.ResourceFactory.CreatePlugin(cInfo as ClassInfo); if (plugin != null) { plugin.Logger = Environment.Logger; plugin.NhibernateHelper = Environment.NHibernateHelper; plugin.SysConnection = Environment.SysDbConnection; plugin.GisWorkspace = Environment.Workspace; } } frmLogin.SetMessage("正在读取界面配置..."); IList listCommand = Environment.NHibernateHelper.GetObjectByCondition("from RibbonCommandInfo rcInfo order by Order asc");; infoList = new List <RibbonCommandInfo>(); int count = listCommand.Count; for (int i = 0; i < count; i++) { infoList.Add(listCommand[i] as RibbonCommandInfo); } frmLogin.SetMessage("正在创建资源..."); cmdEngine = new RibbonEngine(); cmdEngine.CommandInfoList = infoList; cmdEngine.Ribbon = this.ribbon; cmdEngine.OnMessageChanged += delegate(string strMsg) { Utility.Log.AppendMessage(enumLogType.Operate, strMsg); frmLogin.SetMessage(strMsg); }; //List<ICommand> cmdList = new List <ICommand>(); //cmdList.Add(new Commands.CommandLinkage()); //cmdList.Add(new Utility.EsriCommandProxy(new ESRI.ArcGIS.Controls.ControlsAddDataCommandClass())); //cmdEngine.LoadFromCommand(new Commands.CommandLinkage(), "ESRI", "ESRI命令In Frame",null,null); //cmdEngine.LoadFromCommand(new Utility.EsriCommandProxy(new ESRI.ArcGIS.Controls.ControlsAddDataCommandClass()), "ESRI", "ESRI命令In Frame",null,null); cmdEngine.Load(ref cmdList); frmLogin.SetMessage("正在绑定资源..."); //RibbonCommandAdapter cmdAdapter = new RibbonCommandAdapter(hook); cmdAdapter.OnMessageChanged += delegate(string strMsg) { //this.statusBarMessage.Caption = strMsg; frmLogin.SetMessage(strMsg); }; cmdAdapter.Adapter(this.ribbon); cmdAdapter.AddCommands(cmdList.ToArray()); axTOCControl1.SetBuddyControl(this.axMapControl1); frmLogin.SetMessage("正在绘制界面..."); Thread.Sleep(1000); thread.Abort(); }
protected void OnFrameHook(byte[] e) { FrameHook?.Invoke(this, e); }
public FrmRuntime() { FrmLoging frmLogin = null; bool flag = true; ThreadStart t = delegate { frmLogin= new FrmLoging(); flag = false; frmLogin.ShowDialog(); }; Thread thread = new Thread(t); thread.Start(); while (flag) { Thread.Sleep(10); } frmLogin.SetMessage("正在加载框架界面方案..."); InitializeComponent(); frmLogin.SetMessage("正在创建三维控件对象..."); this.Text = ConfigManager.AppName; splitControlMain.PanelVisibility = SplitPanelVisibility.Panel1; TerraExplorerX.SGWorld61 sgwTopLeft; TerraExplorerX.SGWorld61 sgwTopRight; TerraExplorerX.SGWorld61 sgwBottomLeft; TerraExplorerX.SGWorld61 sgwBottomRight; this.uC3DWindow1.CreateHooker(out sgwTopLeft, out sgwTopRight, out sgwBottomLeft, out sgwBottomRight); frmLogin.SetMessage("正在创建绑定对象..."); FrameHook hook = new FrameHook(this, new TerraExplorerX.TerraExplorerClass(), sgwTopLeft, this.axMapControl1.Object as ESRI.ArcGIS.Controls.IMapControl4, this.dockPanelRight); // 测试 // // Dictionary<string, Utility.enumCommandType> d = Utility.CommandFactory.GetCommandClasses(@"C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet\ESRI.ArcGIS.Controls.dll"); // Dictionary<string, enumResourceType> dic = Utility.ResourceFactory.GetResources(@"C:\Program Files (x86)\ArcGIS\DeveloperKit10.0\DotNet\ESRI.ArcGIS.Controls.dll"); // int count = dic.Count; //// List<Utility.RibbonCommandInfo> // infoList = new List<RibbonCommandInfo>(); // for (int i = 0; i < count; i++) // { // RibbonCommandInfo info = new RibbonCommandInfo(); // ClassInfo cInfo = new ClassInfo(); // cInfo.DllName = "ESRI.ArcGIS.Controls.dll"; // cInfo.ClassName = dic.Keys.ElementAt(i);// +", ESRI.ArcGIS.Controls"; // info.CommandClass = cInfo; // info.Page = "ESRI"; // info.PageGroup = "ESRI命令测试"; // infoList.Add(info); // } IList listPlugin = Environment.NHibernateHelper.GetObjectByCondition("from ClassInfo cInfo where cInfo.Type=1"); foreach (object cInfo in listPlugin) { IPlugin plugin= Utility.ResourceFactory.CreatePlugin(cInfo as ClassInfo); if (plugin != null) { plugin.Logger = Environment.Logger; plugin.NhibernateHelper = Environment.NHibernateHelper; plugin.SysConnection = Environment.SysDbConnection; plugin.GisWorkspace = Environment.Workspace; } } frmLogin.SetMessage("正在读取界面配置..."); IList listCommand = Environment.NHibernateHelper. GetObjectByCondition("from RibbonCommandInfo rcInfo order by Order asc"); ; infoList = new List<RibbonCommandInfo>(); int count = listCommand.Count; for (int i = 0; i < count; i++) { infoList.Add(listCommand[i] as RibbonCommandInfo); } frmLogin.SetMessage("正在创建资源..."); cmdEngine = new RibbonEngine(); cmdEngine.CommandInfoList = infoList; cmdEngine.Ribbon = this.ribbon; cmdEngine.OnMessageChanged += delegate(string strMsg) { Utility.Log.AppendMessage(enumLogType.Operate, strMsg); frmLogin.SetMessage(strMsg); }; //List<ICommand> cmdList=new List<ICommand>(); //cmdList.Add(new Commands.CommandLinkage()); //cmdList.Add(new Utility.EsriCommandProxy(new ESRI.ArcGIS.Controls.ControlsAddDataCommandClass())); //cmdEngine.LoadFromCommand(new Commands.CommandLinkage(), "ESRI", "ESRI命令In Frame",null,null); //cmdEngine.LoadFromCommand(new Utility.EsriCommandProxy(new ESRI.ArcGIS.Controls.ControlsAddDataCommandClass()), "ESRI", "ESRI命令In Frame",null,null); cmdEngine.Load(ref cmdList); frmLogin.SetMessage("正在绑定资源..."); //RibbonCommandAdapter cmdAdapter = new RibbonCommandAdapter(hook); cmdAdapter.OnMessageChanged += delegate(string strMsg) { //this.statusBarMessage.Caption = strMsg; frmLogin.SetMessage(strMsg); }; cmdAdapter.Adapter(this.ribbon); cmdAdapter.AddCommands(cmdList.ToArray()); axTOCControl1.SetBuddyControl(this.axMapControl1); frmLogin.SetMessage("正在绘制界面..."); Thread.Sleep(1000); thread.Abort(); }