public static void RemoveStandAloneMedia(string mediaId)
        {
            XmlDocument xmlRegister = MediaResolver.EnsureStandaloneMediaRegister();
            XmlNode     oldChild    = xmlRegister.SelectSingleNode("//files/file[@id='" + mediaId + "']");

            if (oldChild == null)
            {
                return;
            }
            oldChild.ParentNode.RemoveChild(oldChild);
            MediaResolver.SaveStandaloneFile(xmlRegister);
        }
        public static string GetStandaloneMediaId(string url)
        {
            XmlDocument xmlRegister = MediaResolver.EnsureStandaloneMediaRegister();
            XmlNode     xmlNode     = xmlRegister.SelectSingleNode("//files/file[@url='" + url + "']");

            if (xmlNode != null)
            {
                return(xmlNode.Attributes["id"].Value);
            }
            XmlNode      node       = xmlRegister.CreateNode(XmlNodeType.Element, "file", string.Empty);
            XmlAttribute attribute1 = xmlRegister.CreateAttribute("url");

            attribute1.Value = url;
            XmlAttribute attribute2 = xmlRegister.CreateAttribute("id");

            attribute2.Value = Guid.NewGuid().ToString();
            node.Attributes.Append(attribute1);
            node.Attributes.Append(attribute2);
            xmlRegister.SelectSingleNode("//files").AppendChild(node);
            MediaResolver.SaveStandaloneFile(xmlRegister);
            return(attribute2.Value);
        }