Ejemplo n.º 1
0
        public static void LoadPrivateLabelFile()
        {
            try
            {
                string path = PrivateLabelService.GetPrivateLabelFilePath();

                if (System.IO.File.Exists(path))
                {
                    WOSI.Utilities.EncryptedResource er = new WOSI.Utilities.EncryptedResource();

                    er.LoadResourceFile(path);

                    try
                    {
                        productName = (string)er.GetResource <string>("Product Name");
                    }
                    catch
                    {
                    }

                    er.CloseResources();
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        public static void LoadPrivateLabelFile()
        {
            try
            {
                string path = PrivateLabelService.GetPrivateLabelFilePath();

                if (System.IO.File.Exists(path))
                {
                    WOSI.Utilities.EncryptedResource er = new WOSI.Utilities.EncryptedResource();

                    er.LoadResourceFile(path);

                    try
                    {
                        productName = (string)er.GetResource<string>("Product Name");
                    }
                    catch
                    {
                    }

                    er.CloseResources();
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        private void LoadSkin()
        {
            try
            {
                // Get our private label resource file
                byte[] privateLabelData = ManagementInterfaceClient.ManagementInterface.PrivateLabelData;

                if (privateLabelData != null)
                {
                    WOSI.Utilities.EncryptedResource er = new WOSI.Utilities.EncryptedResource();

                    try
                    {
                        er.LoadResourceBytes(privateLabelData);

                        Image mainLogo = er.GetResource<Image>("Main Logo");

                        if (mainLogo != null)
                        {
                            picCallButlerLogo.Image = mainLogo;
                            picCallButlerLogo.Left += er.GetResource<int>("Main Logo Offset X");
                            picCallButlerLogo.Top += er.GetResource<int>("Main Logo Offset Y");
                        }

                        string productName = er.GetResource<string>("Product Name");

                        if (productName != null && productName.Length > 0)
                        {
                            Utils.PrivateLabelUtils.ProductName = productName;
                        }

                        Utils.PrivateLabelUtils.ReplaceProductNameControl(this);
                        Utils.PrivateLabelUtils.ReplaceProductNameControl(mnuMain);
                    }
                    catch(Exception e)
                    {
                    }
                }
                // Check to see if the skin resource file exists
                /*string skinFile = WOSI.Utilities.FileUtils.GetApplicationRelativePath("\\plskin.dat");

                if (File.Exists(skinFile))
                {
                    lblPoweredBy.Visible = true;

                    // Open the skin file
                    byte[] encryptedBytes = File.ReadAllBytes(skinFile);

                    // Decrypt the bytes
                    byte[] decryptedBytes = WOSI.Utilities.CryptoUtils.Decrypt(encryptedBytes, "asdlfa9sd879*Lasldflkajsdf243o8729");

                    MemoryStream memStream = new MemoryStream(decryptedBytes);

                    System.Resources.ResourceReader rr = new System.Resources.ResourceReader(memStream);

                    System.Collections.IDictionaryEnumerator resEnum = rr.GetEnumerator();

                    while (resEnum.MoveNext())
                    {
                        string resourceID = (string)resEnum.Key;

                        if(resourceID == "Main Logo")
                        {
                            picCallButlerLogo.Image = (Image)resEnum.Value;
                        }
                        else if (resourceID == "Main Logo Offset X")
                        {
                            picCallButlerLogo.Left += (int)resEnum.Value;
                        }
                        else if (resourceID == "Main Logo Offset Y")
                        {
                            picCallButlerLogo.Top += (int)resEnum.Value;
                        }
                    }

                    memStream.Close();
                    memStream.Dispose();
                    rr.Close();
                }*/
            }
            catch
            {
            }
        }
        private void LoadSkin()
        {
            try
            {
                // Get our private label resource file
                byte[] privateLabelData = ManagementInterfaceClient.ManagementInterface.PrivateLabelData;

                if (privateLabelData != null)
                {
                    WOSI.Utilities.EncryptedResource er = new WOSI.Utilities.EncryptedResource();

                    try
                    {
                        er.LoadResourceBytes(privateLabelData);

                        Image mainLogo = er.GetResource <Image>("Main Logo");

                        if (mainLogo != null)
                        {
                            picCallButlerLogo.Image = mainLogo;
                            picCallButlerLogo.Left += er.GetResource <int>("Main Logo Offset X");
                            picCallButlerLogo.Top  += er.GetResource <int>("Main Logo Offset Y");
                        }

                        string productName = er.GetResource <string>("Product Name");

                        if (productName != null && productName.Length > 0)
                        {
                            Utils.PrivateLabelUtils.ProductName = productName;
                        }

                        Utils.PrivateLabelUtils.ReplaceProductNameControl(this);
                        Utils.PrivateLabelUtils.ReplaceProductNameControl(mnuMain);
                    }
                    catch (Exception e)
                    {
                    }
                }
                // Check to see if the skin resource file exists

                /*string skinFile = WOSI.Utilities.FileUtils.GetApplicationRelativePath("\\plskin.dat");
                 *
                 * if (File.Exists(skinFile))
                 * {
                 *  lblPoweredBy.Visible = true;
                 *
                 *  // Open the skin file
                 *  byte[] encryptedBytes = File.ReadAllBytes(skinFile);
                 *
                 *  // Decrypt the bytes
                 *  byte[] decryptedBytes = WOSI.Utilities.CryptoUtils.Decrypt(encryptedBytes, "asdlfa9sd879*Lasldflkajsdf243o8729");
                 *
                 *  MemoryStream memStream = new MemoryStream(decryptedBytes);
                 *
                 *  System.Resources.ResourceReader rr = new System.Resources.ResourceReader(memStream);
                 *
                 *  System.Collections.IDictionaryEnumerator resEnum = rr.GetEnumerator();
                 *
                 *  while (resEnum.MoveNext())
                 *  {
                 *      string resourceID = (string)resEnum.Key;
                 *
                 *      if(resourceID == "Main Logo")
                 *      {
                 *          picCallButlerLogo.Image = (Image)resEnum.Value;
                 *      }
                 *      else if (resourceID == "Main Logo Offset X")
                 *      {
                 *          picCallButlerLogo.Left += (int)resEnum.Value;
                 *      }
                 *      else if (resourceID == "Main Logo Offset Y")
                 *      {
                 *          picCallButlerLogo.Top += (int)resEnum.Value;
                 *      }
                 *  }
                 *
                 *  memStream.Close();
                 *  memStream.Dispose();
                 *  rr.Close();
                 * }*/
            }
            catch
            {
            }
        }