protected override bool PreConfiguration(Binding.IBuild build)
 {
     Platform.Application application = build.Application;
     if (application.NotNull())
     {
         Platform.Module module = application["License"];
         if (module is Icop.Client.Module)
         {
             string value = (module as Icop.Client.Module)["media.directshow.elecard." + this.identifier] as string;
             if (value.NotEmpty())
             {
                 this.OnPreConfigure += configurator =>
                 {
                     byte[] key     = Convert.FromBase64String(value.Replace('-', '/'));
                     byte[] correct = new byte[16];
                     byte[] secret  = new byte[] { 89, 254, 202, 212, 234, 216, 54, 120, 194, 196, 150, 207, 127, 96, 54, 189 };
                     for (int i = 0; i < 16; i++)
                     {
                         correct[i] = (byte)(secret[i] ^ key[i]);
                     }
                     Guid activationKey = new Guid(correct);
                     //Console.WriteLine(activationKey);
                     configurator.SetParamValue(ref activationKey, null);
                 }
             }
             ;
         }
     }
     if (this.OnPreConfigure.NotNull())
     {
         global::Elecard.Utilities.ModuleConfig moduleConfigurator = this.backend.GetConfigInterface();
         if (moduleConfigurator.NotNull())
         {
             this.OnPreConfigure(moduleConfigurator);
             moduleConfigurator.Dispose();
         }
     }
     return(base.PreConfiguration(build));
 }
Exemplo n.º 2
0
 public Graph(Platform.Application application)
 {
     this.Application = application;
 }