Exemple #1
0
        public static MxMLParsedData GetRazorString(string path)
        {
            MxMLParsedData mxMLParsed = new MxMLParsedData();

            var xml = ReadFile(path);

            xml = RemovedNamespace(xml);

            mxMLParsed.ActionScript.ActionCode = ParseCDATA(xml);
            mxMLParsed.RazorCode = ParseTags(xml, mxMLParsed.ActionScript.ActionCode);
            mxMLParsed.RazorCode = FilterTransition(mxMLParsed.RazorCode);
            mxMLParsed.RazorCode = FilterStates(mxMLParsed.RazorCode);
            mxMLParsed.RazorCode = FilterRemoteObject(mxMLParsed.RazorCode);
            mxMLParsed.RazorCode = ReplaceColons(mxMLParsed.RazorCode);
            mxMLParsed.RazorCode = FilterExtraWhiteSpace(mxMLParsed.RazorCode);
            mxMLParsed.RazorCode = namespaces + mxMLParsed.RazorCode;


            ///Action Script
            mxMLParsed.ActionScript = ActionScriptSharpify.Parse2Csharp(mxMLParsed.ActionScript);

            mxMLParsed.Path = path;

            WriteFile(mxMLParsed);

            return(mxMLParsed);
        }
Exemple #2
0
        private static void WriteFile(MxMLParsedData data)
        {
            StreamWriter sw = new StreamWriter(NameWithoutExtension(data.Path));

            sw.Write(data.ActionScript.CSImports);
            sw.Write(data.RazorCode);
            sw.Write("\n@code\n{");
            sw.Write(data.ActionScript.ActionCode);
            sw.Write("\n}");
            sw.Close();
        }