Пример #1
0
 public DocumentSessionLicenseInfo()
 {
     string licensePath = ConfigurationSettings.AppSettings["license.file.path"];
         license = new DocumentSessionLicenseReader(licensePath);
 }
Пример #2
0
        public static ILicenseReader GetLicenseReaderObject(string ciphiredXmlPath, LicenseInfo.LicenseType licenseType)
        {
            ILicenseReader result = null;

            switch (licenseType)
            {

                case LicenseInfo.LicenseType.ByUserCount:
                    result = new UserCountLicenseReader (ciphiredXmlPath);
                    break;

                case LicenseInfo.LicenseType.ByDocumentSessions:
                    result = new DocumentSessionLicenseReader(ciphiredXmlPath);
                    break;

                case LicenseInfo.LicenseType.ByUserCount2:
                    result = new UserCount2LicenseReader(ciphiredXmlPath);
                    break;

                case LicenseInfo.LicenseType.ByActiveConnections:
                    result = new ActiveConnectionsLicenseReader(ciphiredXmlPath);
                    break;
                default:
                    {

                        LicenseReaderSimple simple = new LicenseReaderSimple(ciphiredXmlPath);

                        if (null != simple && simple.isLicenseFound() && simple.isLicenseCorrect())
                        {
                            if (simple._license_type == "ActiveConnections")
                                result = new ActiveConnectionsLicenseReader(ciphiredXmlPath);
                            else if (simple._license_type == "UserCount")
                                result = new UserCountLicenseReader(ciphiredXmlPath);
                            else if (simple._license_type == "UserCount2")
                                result = new UserCount2LicenseReader(ciphiredXmlPath);
                            else if (simple._license_type == "DocumentSessions")
                                result = new DocumentSessionLicenseReader(ciphiredXmlPath);

                        }
                    }
                    break;
            }

            return result;
        }