static public QtTranslation LoadTranslation(string path)
 {
     try
     {
         return(new QtTranslation(XmlDocumentCreate.Document(path)));
     }
     catch (Exception ex)
     {
         throw new QtTranslationException(ex);
     }
 }
Exemple #2
0
 static public Xliff LoadXliff(string path)
 {
     try
     {
         return(new Xliff(XmlDocumentCreate.Document(path)));
     }
     catch (Exception ex)
     {
         throw new XliffException(ex);
     }
 }
Exemple #3
0
        /// <summary>
        /// Get a minified svg picture
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="indent"></param>
        static public void File(string filePath, bool indent)
        {
            if (System.IO.File.Exists(filePath))
            {
                XmlDocument load = XmlDocumentCreate.Document(filePath);

                if (load != null && load.FirstElement("svg") != null)
                {
                    string svg_minifed = Path.GetDirectoryName(filePath) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(filePath) + "-minifed.svg";

                    XmlDocumentWriter.Document(svg_minifed, Document(load), WriterSetting(indent));

                    string text = System.IO.File.ReadAllText(svg_minifed).ReplaceLoop(" />", "/>");
                    if (!indent)
                    {
                        text = text.Regex("(\r|\n)", "");
                    }
                    System.IO.File.WriteAllText(svg_minifed, text, Encoding.UTF8);
                }
            }
        }