Ejemplo n.º 1
0
        internal void SaveToView(dappleview.serversType oServers)
        {
            dappleview.builderentryType oVEEntry = oServers.Newbuilderentry();
            dappleview.virtualearthType oVEType  = oVEEntry.Newvirtualearth();

            oVEType.Addname(new Altova.Types.SchemaString("Virtual Earth"));

            oVEEntry.Addvirtualearth(oVEType);
            oServers.Addbuilderentry(oVEEntry);
        }
Ejemplo n.º 2
0
        private ServerModelNode LoadBuilderEntryType(dappleview.builderentryType entry, Uri favouriteServerUri)
        {
            bool            DontUpdateHomeView       = false;
            bool            DontSubmitToDappleSearch = false;
            ServerModelNode result = null;

            if (entry.Hasbuilderdirectory())
            {
                for (int i = 0; i < entry.builderdirectory.builderentryCount; i++)
                {
                    ServerModelNode newServer = LoadBuilderEntryType(entry.builderdirectory.GetbuilderentryAt(i), favouriteServerUri);
                    if (newServer != null)
                    {
                        result = newServer;
                    }
                }
            }
            else if (entry.Haswmscatalog())
            {
                ServerModelNode newServer = AddWMSServer(new WMSServerUri(entry.wmscatalog.capabilitiesurl.Value), entry.wmscatalog.Hasenabled() ? entry.wmscatalog.enabled.Value : true, DontUpdateHomeView, DontSubmitToDappleSearch);
                if (favouriteServerUri != null && newServer.Uri.ToBaseUri().Equals(favouriteServerUri.ToString()))
                {
                    result = newServer;
                }
            }
            else if (entry.Hasarcimscatalog())
            {
                ServerModelNode newServer = AddArcIMSServer(new ArcIMSServerUri(entry.arcimscatalog.capabilitiesurl.Value), entry.arcimscatalog.Hasenabled() ? entry.arcimscatalog.enabled.Value : true, DontUpdateHomeView, DontSubmitToDappleSearch);
                if (favouriteServerUri != null && newServer.Uri.ToBaseUri().Equals(favouriteServerUri.ToString()))
                {
                    result = newServer;
                }
            }
            else if (entry.Hasdapcatalog())
            {
                DapServerUri oUri = new DapServerUri(entry.dapcatalog.url.Value);
                if (!oUri.IsForPersonalDAP)
                {
                    ServerModelNode newServer = AddDAPServer(oUri, entry.dapcatalog.Hasenabled() ? entry.dapcatalog.enabled.Value : true, DontUpdateHomeView, DontSubmitToDappleSearch);
                    if (favouriteServerUri != null && newServer.Uri.ToBaseUri().Equals(favouriteServerUri.ToString()))
                    {
                        result = newServer;
                    }
                }
            }
            else if (entry.Hastileserverset())
            {
                LoadTileServerSet(entry.tileserverset);
            }

            return(result);
        }
Ejemplo n.º 3
0
        internal void LoadFromView(Dapple.DappleView oSource)
        {
            lock (m_oLock)
            {
                ClearModel();

                ServerModelNode oFavouriteServer = null;

                // --- Create favourite server Uri ---

                Uri oFavouriteServerUri = null;
                if (oSource.View.Hasfavouriteserverurl() && !String.IsNullOrEmpty(oSource.View.favouriteserverurl.Value))
                {
                    try
                    {
                        oFavouriteServerUri = new Uri(oSource.View.favouriteserverurl.Value);
                    }
                    catch (UriFormatException)
                    {
                        // --- The favourite server is invalid. Default to no favourite server ---
                    }
                }


                // --- Load the servers ---

                if (oSource.View.Hasservers())
                {
                    for (int i = 0; i < oSource.View.servers.builderentryCount; i++)
                    {
                        dappleview.builderentryType entry = oSource.View.servers.GetbuilderentryAt(i);
                        ServerModelNode             temp  = LoadBuilderEntryType(entry, oFavouriteServerUri);
                        if (temp != null)
                        {
                            oFavouriteServer = temp;
                        }
                    }
                }

                if (oFavouriteServer != null)
                {
                    SetFavouriteServer(oFavouriteServer, false);
                }
                else if (oSource.View.Hasfavouriteserverurl() && PersonalDapServerModelNode.PersonalDapRunning && oSource.View.favouriteserverurl.Value.Equals(Geosoft.GX.DAPGetData.Server.PERSONAL_DAP_URI))
                {
                    SetFavouriteServer(PersonalDapServer, false);
                }

                OnLoaded(EventArgs.Empty);
            }
        }
Ejemplo n.º 4
0
        internal void SaveToView(dappleview.builderdirectoryType oArcDir)
        {
            foreach (ArcIMSServerModelNode oChild in UnfilteredChildren)
            {
                dappleview.builderentryType  oChildEntry   = oArcDir.Newbuilderentry();
                dappleview.arcimscatalogType oChildCatalog = oChildEntry.Newarcimscatalog();

                oChildCatalog.Addcapabilitiesurl(new Altova.Types.SchemaString(oChild.Uri.ToBaseUri()));
                oChildCatalog.Addenabled(new Altova.Types.SchemaBoolean(oChild.Enabled));

                oChildEntry.Addarcimscatalog(oChildCatalog);
                oArcDir.Addbuilderentry(oChildEntry);
            }
        }
Ejemplo n.º 5
0
        internal void SaveToView(dappleview.serversType oServers)
        {
            dappleview.builderentryType     oImageEntry = oServers.Newbuilderentry();
            dappleview.builderdirectoryType oImageDir   = oImageEntry.Newbuilderdirectory();
            oImageDir.Addname(new Altova.Types.SchemaString("Image Tile Servers"));
            oImageDir.Addspecialcontainer(new dappleview.SpecialDirectoryType("ImageServers"));

            foreach (ImageTileSetModelNode oTileSets in UnfilteredChildren)
            {
                oTileSets.SaveToView(oImageDir);
            }

            oImageEntry.Addbuilderdirectory(oImageDir);
            oServers.Addbuilderentry(oImageEntry);
        }
Ejemplo n.º 6
0
        internal void SaveToView(dappleview.builderdirectoryType oDir)
        {
            dappleview.builderentryType  oSetEntry = oDir.Newbuilderentry();
            dappleview.tileserversetType oSet      = oSetEntry.Newtileserverset();
            oSet.Addname(new Altova.Types.SchemaString(m_strName));
            dappleview.tilelayersType oLayers = oSet.Newtilelayers();

            foreach (ImageTileLayerModelNode oTileLayer in UnfilteredChildren)
            {
                oTileLayer.SaveToView(oLayers);
            }

            oSet.Addtilelayers(oLayers);
            oSetEntry.Addtileserverset(oSet);
            oDir.Addbuilderentry(oSetEntry);
        }
Ejemplo n.º 7
0
        internal void SaveToView(Dapple.DappleView oView)
        {
            dappleview.serversType oServers = oView.View.Newservers();

            m_oDAPRootNode.SaveToView(oServers);
            m_oTileRootNode.SaveToView(oServers);
            m_oVERootNode.SaveToView(oServers);

            dappleview.builderentryType     oWMSBuilder = oServers.Newbuilderentry();
            dappleview.builderdirectoryType oWMSDir     = oWMSBuilder.Newbuilderdirectory();
            oWMSDir.Addname(new Altova.Types.SchemaString("WMS Servers"));
            oWMSDir.Addspecialcontainer(new dappleview.SpecialDirectoryType("WMSServers"));

            m_oWMSRootNode.SaveToView(oWMSDir);
            m_oArcIMSRootNode.SaveToView(oWMSDir);


            oWMSBuilder.Addbuilderdirectory(oWMSDir);
            oServers.Addbuilderentry(oWMSBuilder);

            oView.View.Addservers(oServers);
        }
Ejemplo n.º 8
0
        internal void SaveToView(dappleview.serversType oServers)
        {
            dappleview.builderentryType     oDAPBuilder = oServers.Newbuilderentry();
            dappleview.builderdirectoryType oDAPDir     = oDAPBuilder.Newbuilderdirectory();
            oDAPDir.Addname(new Altova.Types.SchemaString("DAP Servers"));
            oDAPDir.Addspecialcontainer(new dappleview.SpecialDirectoryType("DAPServers"));

            foreach (DapServerModelNode oChild in UnfilteredChildren)
            {
                dappleview.builderentryType oChildEntry   = oDAPDir.Newbuilderentry();
                dappleview.dapcatalogType   oChildCatalog = oChildEntry.Newdapcatalog();

                oChildCatalog.Addurl(new Altova.Types.SchemaString(oChild.Uri.ToBaseUri()));
                oChildCatalog.Addenabled(new Altova.Types.SchemaBoolean(oChild.Enabled));

                oChildEntry.Adddapcatalog(oChildCatalog);
                oDAPDir.Addbuilderentry(oChildEntry);
            }

            oDAPBuilder.Addbuilderdirectory(oDAPDir);
            oServers.Addbuilderentry(oDAPBuilder);
        }