示例#1
0
        public void Save(IPersistStream stream)
        {
            if (_application == null) return;

            PlugInManager compMan=new PlugInManager();
            foreach (XmlNode comp in compMan.GetPluginNodes(Plugins.Type.IMapApplicationModule))
            {
                IMapApplicationModule module = _application.IMapApplicationModule(PlugInManager.Guid(comp));
                if (module is IPersistable)
                {
                    stream.Save("Module", new ModulePersist(module));
                }
            }
        }
示例#2
0
        public void Load(IPersistStream stream)
        {
            if (_app == null) return;

            try
            {
                Guid guid = new Guid(stream.Load("GUID") as string);
                IMapApplicationModule module = _app.IMapApplicationModule(guid);

                if (!(module is IPersistable)) return;
                ((IPersistable)module).Load(stream);
            }
            catch { }
        }
示例#3
0
        public void Save(IPersistStream stream)
        {
            if (_application == null)
            {
                return;
            }

            PlugInManager compMan = new PlugInManager();

            foreach (Type compType in compMan.GetPlugins(Plugins.Type.IMapApplicationModule))
            {
                IMapApplicationModule module = _application.IMapApplicationModule(PlugInManager.PluginIDFromType(compType));
                if (module is IPersistable)
                {
                    stream.Save("Module", new ModulePersist(module));
                }
            }
        }
示例#4
0
        private void OnSnappingLauncherClick(object sender, RoutedEventArgs e)
        {
            if (e is RibbonGroupBox.LauncherClickEventArgs && ((RibbonGroupBox.LauncherClickEventArgs)e).Hook is IMapDocument)
            {
                IMapDocument    mapDocument    = (IMapDocument)((RibbonGroupBox.LauncherClickEventArgs)e).Hook;
                IMapApplication mapApplication = mapDocument.Application as IMapApplication;
                if (mapApplication != null)
                {
                    Module module = mapApplication.IMapApplicationModule(new Guid(gView.Framework.Snapping.Core.Globals.ModuleGuidString)) as Module;

                    if (!AppUIGlobals.IsAppReadOnly(mapDocument.Application))
                    {
                        FormSnappingLauncher dlg = new FormSnappingLauncher(module);
                        dlg.ShowDialog();
                    }
                }
            }
        }
示例#5
0
        private void OnEditLauncherClick(object sender, RoutedEventArgs e)
        {
            if (e is RibbonGroupBox.LauncherClickEventArgs && ((RibbonGroupBox.LauncherClickEventArgs)e).Hook is IMapDocument)
            {
                IMapDocument    mapDocument    = (IMapDocument)((RibbonGroupBox.LauncherClickEventArgs)e).Hook;
                IMapApplication mapApplication = mapDocument.Application as IMapApplication;
                if (mapApplication != null)
                {
                    Module module = mapApplication.IMapApplicationModule(Globals.ModuleGuid) as Module;

                    if (!AppUIGlobals.IsAppReadOnly(mapDocument.Application))
                    {
                        FormEditLauncher dlg = new FormEditLauncher(module);
                        dlg.ShowDialog();
                    }
                }
            }
        }