コード例 #1
0
 protected override string ReadValue(XmlReader reader)
 {
     return(Transformations.FolderNames(reader.Value));
 }
コード例 #2
0
        private const string PASSWORD_KEY = "MPExtended Password Key"; // And here all our security goes out of the window: the key is on the internet.

        internal static void Install()
        {
            Transformations.RegisterCallback(Transformations.Transformation.FolderNames, FolderSubstitution);
            Transformations.RegisterCallback(Transformations.Transformation.Encrypt, Encrypt);
            Transformations.RegisterCallback(Transformations.Transformation.Decrypt, Decrypt);
        }
コード例 #3
0
 public void SetPasswordFromPlaintext(string password)
 {
     EncryptedPassword = password == String.Empty ? String.Empty : Transformations.Encrypt(password);
 }
コード例 #4
0
 public void ReadXml(XmlReader reader)
 {
     XElement document = XElement.Load(reader.ReadSubtree(), LoadOptions.None);
     foreach (XElement plugin in document.Elements(XName.Get("Plugin", document.Name.NamespaceName)))
     {
         this[plugin.Attribute("name").Value] = new List<PluginConfigItem>();
         foreach (var configItem in plugin.Elements())
         {
             ConfigType type = (ConfigType)Enum.Parse(typeof(ConfigType), configItem.Attribute("type").Value, true);
             string value = type == ConfigType.File || type == ConfigType.Folder ? Transformations.FolderNames(configItem.Value) : configItem.Value;
             this[plugin.Attribute("name").Value].Add(new PluginConfigItem()
             {
                 DisplayName = configItem.Attribute("displayname").Value,
                 Name = configItem.Name.LocalName,
                 Type = type,
                 Value = value
             });
         }
     }
 }
コード例 #5
0
 public string GetPassword()
 {
     return(EncryptedPassword == String.Empty ? String.Empty : Transformations.Decrypt(EncryptedPassword));
 }
コード例 #6
0
 public string GetAbsoluteTVLogoDirectory()
 {
     return(Transformations.FolderNames(TVLogoDirectory));
 }
コード例 #7
0
 public void SetPasswordFromPlaintext(string password)
 {
     EncryptedPassword = Transformations.Encrypt(password);
 }
コード例 #8
0
 public string GetPassword()
 {
     return(Transformations.Decrypt(EncryptedPassword));
 }
コード例 #9
0
        private List <PluginConfigItem> ReadPluginConfig(XElement plugin)
        {
            var list = new List <PluginConfigItem>();

            foreach (var x in plugin.Elements())
            {
                ConfigType type  = (ConfigType)Enum.Parse(typeof(ConfigType), x.Attribute("type").Value, true);
                string     value = type == ConfigType.File || type == ConfigType.Folder ? Transformations.FolderNames(x.Value) : x.Value;
                list.Add(new PluginConfigItem()
                {
                    DisplayName = x.Attribute("displayname").Value,
                    Name        = x.Name.LocalName,
                    Type        = type,
                    Value       = value
                });
            }
            return(list);
        }