Пример #1
0
        public void Load()
        {
            foreach (XmlElement xmlProvider in Engine.Instance.Storage.Providers)
            {
                string providerCode = xmlProvider.Name;
                AddProvider(providerCode, xmlProvider);
            }

            if (Providers.Count == 0)
            {
                AddProvider("AirVPN", null);
            }

            // Hack Eddie 2.x
            {
                string specialOvpnDirectory = Engine.Instance.Storage.GetPath("ovpn");

                // First, find OpenVPN provider if already exists and match {data}/ovpn
                Core.Providers.OpenVPN providerSpecialOpenVPN = null;
                foreach (Provider p in Providers)
                {
                    if (p is Providers.OpenVPN)
                    {
                        if ((p as Providers.OpenVPN).GetPathScan() == specialOvpnDirectory)
                        {
                            providerSpecialOpenVPN = p as Providers.OpenVPN;
                        }
                    }
                }

                // Remove if directory don't exists
                if (providerSpecialOpenVPN != null)
                {
                    if (Platform.Instance.DirectoryExists(specialOvpnDirectory) == false)
                    {
                        Providers.Remove(providerSpecialOpenVPN);
                    }
                }

                // Add if directory exists
                if (providerSpecialOpenVPN == null)
                {
                    if (Platform.Instance.DirectoryExists(specialOvpnDirectory))
                    {
                        providerSpecialOpenVPN = AddProvider("OpenVPN", null) as Providers.OpenVPN;
                        Utils.XmlSetAttributeString(providerSpecialOpenVPN.Storage.DocumentElement, "path", specialOvpnDirectory);
                    }
                }
            }
        }
Пример #2
0
 public void WriteXML(XmlElement node)
 {
     Utils.XmlSetAttributeInt64(node, "timestamp", Conversions.ToUnixTime(Date));
     Utils.XmlSetAttributeString(node, "level", GetTypeString());
     Utils.XmlSetAttributeString(node, "message", Message);
 }
Пример #3
0
 public virtual void ClearCredentials()
 {
     m_runCredentials = null;
     Utils.XmlSetAttributeString(Storage.DocumentElement, "login", "");
     Utils.XmlSetAttributeString(Storage.DocumentElement, "password", "");
 }