Beispiel #1
0
    slagtool.Filelist convert_inc(string f)
    {
        var fl = new slagtool.Filelist();

        string[] readlist = null;
        try {
            readlist = File.ReadAllLines(f, Encoding.UTF8);
        } catch { return(null); }

        if (readlist == null || readlist.Length == 0)
        {
            return(null);
        }

        fl.root = Path.GetDirectoryName(f);

        foreach (var l in readlist)
        {
            var nl = l.Trim();
            if (string.IsNullOrEmpty(nl) || nl.StartsWith("//"))
            {
                continue;
            }

            fl.filesAdd(nl);
        }
        return(fl);
    }
Beispiel #2
0
        public static slagtool.slag Load(string path, string[] files)
        {
            var file_list = new slagtool.Filelist();//new List<string>();

            file_list.root = path;

            for (var i = 0; i < files.Length; i++)
            {
                var file = files[i];
                if (!file.ToUpper().EndsWith(".JS"))
                {
                    SendWriteLine("ERROR:File is not JS :" + file);
                    return(null);
                }
                file_list.filesAdd(file);
            }

            if (slagtool.sys.USETRY)
            {
                try
                {
                    m_slagunity.LoadJSFiles(file_list);
                }
                catch (SystemException e)
                {
                    SendWriteLine("-- EXCEPTION --");
                    SendWriteLine(e.Message);
                    SendWriteLine("---------------");
                    return(null);
                }
            }
            else
            {
                m_slagunity.LoadJSFiles(file_list);
            }
            SendWriteLine("Loaded.");

            SendWriteLine("Checksum:" + m_slagunity.GetMD5());

            return(m_slagunity.m_slag);
        }