protected override string ReadValue(XmlReader reader)
 {
     return(Transformations.FolderNames(reader.Value));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public void SetPasswordFromPlaintext(string password)
 {
     EncryptedPassword = password == String.Empty ? String.Empty : Transformations.Encrypt(password);
 }
Ejemplo n.º 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
             });
         }
     }
 }
Ejemplo n.º 5
0
 public string GetPassword()
 {
     return(EncryptedPassword == String.Empty ? String.Empty : Transformations.Decrypt(EncryptedPassword));
 }
Ejemplo n.º 6
0
 public string GetAbsoluteTVLogoDirectory()
 {
     return(Transformations.FolderNames(TVLogoDirectory));
 }
Ejemplo n.º 7
0
 public void SetPasswordFromPlaintext(string password)
 {
     EncryptedPassword = Transformations.Encrypt(password);
 }
Ejemplo n.º 8
0
 public string GetPassword()
 {
     return(Transformations.Decrypt(EncryptedPassword));
 }
Ejemplo n.º 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);
        }