Subtext.Providers.BlogEntryEditor.FCKeditor.FileBrowserConnector.CreateBaseXml C# (CSharp) Method

CreateBaseXml() private static method

private static CreateBaseXml ( XmlDocument xml, string command, string resourceType, string currentFolder ) : XmlNode
xml System.Xml.XmlDocument
command string
resourceType string
currentFolder string
return System.Xml.XmlNode
        private static XmlNode CreateBaseXml( XmlDocument xml, string command, string resourceType, string currentFolder )
        {
            // Create the XML document header.
            xml.AppendChild( xml.CreateXmlDeclaration( "1.0", "utf-8", null ) ) ;

            // Create the main "Connector" node.
            XmlNode oConnectorNode = XmlUtil.AppendElement( xml, "Connector" ) ;
            XmlUtil.SetAttribute( oConnectorNode, "command", command ) ;
            XmlUtil.SetAttribute( oConnectorNode, "resourceType", resourceType ) ;

            // Add the current folder node.
            if(!resourceType.Equals("Posts"))
            {
                XmlNode oCurrentNode = XmlUtil.AppendElement( oConnectorNode, "CurrentFolder" ) ;
                XmlUtil.SetAttribute( oCurrentNode, "path", currentFolder ) ;
                XmlUtil.SetAttribute( oCurrentNode, "url", GetUrlFromPath(currentFolder) ) ;
            }
            else
            {
                XmlNode oCurrentNode = XmlUtil.AppendElement( oConnectorNode, "CurrentFolder" ) ;
                XmlUtil.SetAttribute( oCurrentNode, "path", currentFolder ) ;
                XmlUtil.SetAttribute( oCurrentNode, "url", "") ;
            }

            return oConnectorNode ;
        }