コード例 #1
0
ファイル: EXamlOperation.cs プロジェクト: wonrst/TizenFX
        internal static void WriteOpertions(string filePath, EXamlContext eXamlContext)
        {
            var ret = eXamlContext.GenerateEXamlString();

            if (string.IsNullOrEmpty(filePath))
            {
                throw new Exception("filePath is empty or null!");
            }
            /*Avoid the difference of '/' in file path on windows and linux*/
            filePath = filePath.Replace("\\", "/");
            if (filePath.Contains("/"))
            {
                OutputDir = filePath.Substring(0, filePath.LastIndexOf("/"));
            }
            if (!Directory.Exists(OutputDir))
            {
                Directory.CreateDirectory(OutputDir);
            }

            var stream = File.CreateText(filePath);

            stream.Write(ret);
            stream.Close();
        }