Exemplo n.º 1
0
        public void Init()
        {
            string path = Platform.Instance.NormalizePath(Engine.Instance.GetPathResources() + "/providers");

            if (Platform.Instance.DirectoryExists(path) == false)             // TOCLEAN, Compatibility <3.0
            {
                LoadDefinition(ResourcesFiles.GetString("AirVPN.xml"));
                LoadDefinition(ResourcesFiles.GetString("OpenVPN.xml"));
                return;
            }

            FileInfo[] files = new System.IO.DirectoryInfo(path).GetFiles("*.xml");
            foreach (FileInfo fi in files)
            {
                string xml = Platform.Instance.FileContentsReadText(fi.FullName);
                LoadDefinition(xml);
            }
        }
Exemplo n.º 2
0
        public void Init()
        {
            string path = GetProvidersPath();

            if (Directory.Exists(path) == false) // TOCLEAN, Compatibility <3.0
            {
                LoadDefinition(ResourcesFiles.GetString("AirVPN.xml"));
                LoadDefinition(ResourcesFiles.GetString("OpenVPN.xml"));
                return;
            }

            FileInfo[] files = new System.IO.DirectoryInfo(path).GetFiles("*.xml");
            foreach (FileInfo fi in files)
            {
                string xml = File.ReadAllText(fi.FullName);
                LoadDefinition(xml);
            }
        }