Exemplo n.º 1
0
            public string NoteHTMLContent(string noteContent, ENCollection noteResources)
            {
                string content = null;

                try
                {
                    content = ENMLtoHTMLConverter.HTMLFromENMLContent(noteContent, noteResources);
                }
                catch (Exception)
                {
                    ENSDKLogger.ENSDKLogError("Unable to convert note content to HTML");
                }
                return(content);
            }
Exemplo n.º 2
0
            public string NoteTextContent(string noteContent)
            {
                string          content       = null;
                List <Resource> edamResources = new List <Resource>();

                try
                {
                    content = ENMLtoHTMLConverter.HTMLToText(ENMLtoHTMLConverter.HTMLFromENMLContent(noteContent, edamResources));
                }
                catch (Exception)
                {
                    ENSDKLogger.ENSDKLogError("Unable to convert note content to Text");
                }
                return(content);
            }
            private Dictionary <string, string> ValidateURLAttribute(string attributekey, Dictionary <string, string> attributes)
            {
                string urlString = attributes[attributekey];

                if (string.IsNullOrEmpty(urlString))
                {
                    return(attributes);
                }

                Uri url = new Uri(urlString);
                Dictionary <string, string> newAttributes = new Dictionary <string, string>(attributes);

                if (ValidateURLComponents(url))
                {
                    newAttributes.Add(attributekey, url.AbsoluteUri);
                }
                else
                {
                    ENSDKLogger.ENSDKLogError(string.Format("Unable to validate URL:{0} in attributes:{1}", urlString, attributes));
                    newAttributes.Remove(attributekey);
                }
                return(newAttributes);
            }