예제 #1
0
        public static bool remove_Mapping_VirtualId(this TM_Xml_Database tmXmlDatabase, Guid id)
        {
            var virtualArticles = tmXmlDatabase.getVirtualArticles();

            if (virtualArticles.hasKey(id))
            {
                virtualArticles.Remove(id);
                tmXmlDatabase.saveVirtualArticles();
                return(true);
            }
            return(false);
        }
예제 #2
0
        public static VirtualArticleAction add_Mapping_Redirect(this TM_Xml_Database tmXmlDatabase, Guid id, Uri redirectUri)
        {
            var virtualAction = new VirtualArticleAction
            {
                Id           = id,
                Action       = "Redirect",
                Redirect_Uri = redirectUri.str()
            };

            tmXmlDatabase.getVirtualArticles().add(id, virtualAction);
            tmXmlDatabase.saveVirtualArticles();
            return(virtualAction);
        }
예제 #3
0
        public static VirtualArticleAction add_Mapping_VirtualId(this TM_Xml_Database tmXmlDatabase, Guid id, Guid virtualId)
        {
            var virtualAction = new VirtualArticleAction
            {
                Id        = id,
                Action    = "Virtual_Id",
                Target_Id = virtualId
            };

            tmXmlDatabase.getVirtualArticles().add(id, virtualAction);
            tmXmlDatabase.saveVirtualArticles();
            return(virtualAction);
        }
예제 #4
0
        public static VirtualArticleAction add_Mapping_ExternalService(this TM_Xml_Database tmXmlDatabase, Guid id, string service, string data)
        {
            var virtualAction = new VirtualArticleAction
            {
                Id           = id,
                Action       = "ExternalService",
                Service      = service,
                Service_Data = data,
            };

            tmXmlDatabase.getVirtualArticles().add(id, virtualAction);
            tmXmlDatabase.saveVirtualArticles();
            return(virtualAction);
        }
예제 #5
0
        public static VirtualArticleAction add_Mapping_ExternalArticle(this TM_Xml_Database tmXmlDatabase, Guid id, string tmServer, Guid externalId)
        {
            var virtualAction = new VirtualArticleAction
            {
                Id        = id,
                Action    = "ExternalArticle",
                TM_Server = tmServer,
                Target_Id = externalId,
            };

            tmXmlDatabase.getVirtualArticles().add(id, virtualAction);
            tmXmlDatabase.saveVirtualArticles();
            return(virtualAction);
        }