Sha256: 5b4b562bdc4e97e7c9ffc43fbccfa8dbabb083f77226a9be7d8fc5ff9f5094b9

Contents?: true

Size: 1.96 KB

Versions: 23

Compression:

Stored size: 1.96 KB

Contents

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace rho.common
{
    public sealed class CRhoResourceMap
    {
        private static CRhodesApp RHODESAPP() { return CRhodesApp.Instance; }

        private static void clearMap(String strMap)
        {
            string[] files = strMap.Split('\n');

            for (int i = 0; i < files.Length - 1; i++)
            {
                String[] values = files[i].Split('|');

                String strFile = RHODESAPP().canonicalizeRhoPath(values[0]);
                if (CRhoFile.isFileExist(strFile))
                {
                    CRhoFile.deleteFile(strFile);
                }
            } 
        }

        private static void copyMap(String strMap)
        {
            string[] files = strMap.Split('\n');

            for (int i = 0; i < files.Length - 1; i++)
            {
                String[] values = files[i].Split('|');

                String strFile = RHODESAPP().canonicalizeRhoPath(values[0]);
                CRhoFile.recursiveCreateDir(strFile);
                CRhoFile.writeDataToFile(strFile, CRhoFile.readResourceFile(strFile));
            }

            CRhoFile.writeStringToFile(RHODESAPP().canonicalizeRhoPath("RhoBundleMap.txt"), strMap);
        }

        public static void deployContent() 
        {
            String newMap = CRhoFile.readStringFromResourceFile(RHODESAPP().canonicalizeRhoPath("RhoBundleMap.txt"));
            String curMap = CRhoFile.readStringFromFile(RHODESAPP().canonicalizeRhoPath("RhoBundleMap.txt"));

            if (curMap == "")
            {
                copyMap(newMap);
            }
            else if (curMap != newMap)
            {
                clearMap(curMap);
                copyMap(newMap);   
            }
        }


    }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rhodes-3.0.2 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.2.beta.1 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.8 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.7 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.6 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.5 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.4 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.3 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.1.beta.2 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.7 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.6 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.5 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.4 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.3 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.2 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-3.0.0.beta.1 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-2.4.1 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs
rhodes-2.4.1.beta.1 platform/wp7/RhoRubyLib/common/RhoResourceMap.cs