Пример #1
0
 public LicenseRequest(LicenseKey key, LicenseScope span, int num, bool mustMatch)
 {
     Key = key;
     RequestedSpanType = span;
     NumberOfLicenses  = num;
     SpanMustMatch     = mustMatch;
 }
Пример #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="SlickUploadModule" /> class.
        /// </summary>
        public SlickUploadModule()
        {
            _licenseType = LicenseType.Evaluation;
            _licenseScope = LicenseScope.WebSite;
            //_license = (KrystalwareRuntimeLicense)new KrystalwareLicenseProvider().GetLicense(null, typeof(SlickUploadModule), this, false);
            _license = (KrystalwareRuntimeLicense)KrystalwareLicenseProvider.GetLicense(typeof(SlickUploadModule), "<RSAKeyValue><Modulus>tk384UItx23mrOJcdDqipI05NXJKZAbUL0ewFaloFzpUBFV8AQd1hUSZ9XVgNAPqBLej9rUz4v08vi2rQ/fqJXtWieQSdwa7fe+ZjaS2qYGeBWZVpEDXwT5fG63+c2MlLjX0fKMQ7FU0OkZPo76Sj1O5cIjMlX9nvOQnevW0ABM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>");
            
            List<string> licensedUrls = new List<string>();

            if (_license != null)
            {
                foreach (RuntimeLicensedProduct product in _license.LicensedProducts)
                {
                    if (product.AssemblyName.EndsWith(".SlickUpload") && Convert.ToInt32(product.Version) >= 6 && DateTime.Now <= product.ExpirationDate)
                    {
                        // changed to fix obfuscation issue
                        // if (product.Type > _licenseType)
                        if (product.Type != _licenseType)
                            _licenseType = product.Type;

                        // changed to fix obfuscation issue
                        // if (product.Scope > _licenseScope)
                        if (product.Scope != _licenseScope)
                                _licenseScope = product.Scope;

                        if (!string.IsNullOrEmpty(product.LicenseUrl))
                            licensedUrls.Add("." + product.LicenseUrl);
                    }
                }
            }

            _licensedUrls = licensedUrls.ToArray();
        }
Пример #3
0
        public LicensedProduct(XmlElement el)
        {
            _assemblyName = el.GetAttribute("AssemblyName");
            _version      = el.GetAttribute("Version");
            LicenseUrl    = el.GetAttribute("LicenseUrl");

            try
            {
                _expirationDate = DateTime.Parse(el.GetAttribute("ExpirationDate"));
            }
            catch
            {
                _expirationDate = DateTime.MaxValue;
            }

            try
            {
                _type = (LicenseType)Enum.Parse(typeof(LicenseType), el.GetAttribute("Type"));
            }
            catch
            {
                _type = LicenseType.Evaluation;
            }

            try
            {
                _scope = (LicenseScope)Enum.Parse(typeof(LicenseScope), el.GetAttribute("Scope"));
            }
            catch
            {
                _scope = LicenseScope.WebSite;
            }
        }
Пример #4
0
 internal RuntimeLicensedProduct(string assemblyName, string assemblyVersion)
 {
     _assemblyName   = assemblyName;
     _version        = assemblyVersion;
     _type           = LicenseType.Evaluation;
     _scope          = LicenseScope.WebSite;
     _expirationDate = DateTime.MaxValue;
 }
Пример #5
0
        Result IExternalCommand.Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            var uiapp = commandData.Application;
            var uidoc = uiapp.ActiveUIDocument;
            var doc   = uidoc.Document;

            var view = doc.ActiveView as View3D;

            if (null == view)
            {
                ShowMessageBox(Strings.MessageOpen3DViewFirst);
                return(Result.Succeeded);
            }

            Dictionary <int, bool> elementIds;

            var elementSelected = uidoc.Selection.GetElementIds();

            if (elementSelected != null && elementSelected.Count > 0)
            {
                elementIds = new Dictionary <int, bool>(elementSelected.Count);
                foreach (var elementId in elementSelected)
                {
                    if (elementId == ElementId.InvalidElementId)
                    {
                        continue;
                    }
                    elementIds.Add(elementId.IntegerValue, true);
                }
            }
            else
            {
                elementIds = null;
            }

            var appConfig = AppConfigManager.Load();

            using (var licenseScope = new LicenseScope())
            {
                if (licenseScope.IsValid == false)
                {
                    return(Result.Succeeded);
                }

                var dialog = new FormExportSvfzip(licenseScope, view, appConfig, elementIds);
                dialog.ShowDialog();
            }

            return(Result.Succeeded);
        }
Пример #6
0
        /// <summary>
        /// Creates a new instance of the <see cref="SlickUploadModule" /> class.
        /// </summary>
        public SlickUploadModule()
        {
            _licenseType  = LicenseType.Commercial;
            _licenseScope = LicenseScope.WebSite;
            //_license = (KrystalwareRuntimeLicense)new KrystalwareLicenseProvider().GetLicense(null, typeof(SlickUploadModule), this, false);
            _license = (KrystalwareRuntimeLicense)KrystalwareLicenseProvider.GetLicense(typeof(SlickUploadModule), "<RSAKeyValue><Modulus>tk384UItx23mrOJcdDqipI05NXJKZAbUL0ewFaloFzpUBFV8AQd1hUSZ9XVgNAPqBLej9rUz4v08vi2rQ/fqJXtWieQSdwa7fe+ZjaS2qYGeBWZVpEDXwT5fG63+c2MlLjX0fKMQ7FU0OkZPo76Sj1O5cIjMlX9nvOQnevW0ABM=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>");

            List <string> licensedUrls = new List <string>();

            if (_license != null)
            {
                foreach (RuntimeLicensedProduct product in _license.LicensedProducts)
                {
                    if (product.AssemblyName.EndsWith(".SlickUpload") && Convert.ToInt32(product.Version) >= 6 && DateTime.Now <= product.ExpirationDate)
                    {
                        // changed to fix obfuscation issue
                        // if (product.Type > _licenseType)
                        if (product.Type != _licenseType)
                        {
                            _licenseType = product.Type;
                        }

                        // changed to fix obfuscation issue
                        // if (product.Scope > _licenseScope)
                        if (product.Scope != _licenseScope)
                        {
                            _licenseScope = product.Scope;
                        }

                        if (!string.IsNullOrEmpty(product.LicenseUrl))
                        {
                            licensedUrls.Add("." + product.LicenseUrl);
                        }
                    }
                }
            }

            _licensedUrls = licensedUrls.ToArray();
        }
        public FormExportSvfzip(LicenseScope licenseScope, View3D view, AppConfig config, Dictionary <int, bool> elementIds)
            : this()
        {
            _LicenseScope = licenseScope;
            _View         = view;
            _Config       = config;
            _ElementIds   = elementIds;

            _Features = new List <FeatureInfo>
            {
                new FeatureInfo(FeatureType.ExcludeProperties, Strings.FeatureNameExcludeProperties, Strings.FeatureDescriptionExcludeProperties),
                new FeatureInfo(FeatureType.ExcludeTexture, Strings.FeatureNameExcludeTexture, Strings.FeatureDescriptionExcludeTexture),
                new FeatureInfo(FeatureType.ExcludeLines, Strings.FeatureNameExcludeLines, Strings.FeatureDescriptionExcludeLines),
                new FeatureInfo(FeatureType.ExcludePoints, Strings.FeatureNameExcludePoints, Strings.FeatureDescriptionExcludePoints),
                new FeatureInfo(FeatureType.UseLevelCategory, Strings.FeatureNameUseLevelCategory, Strings.FeatureDescriptionUseLevelCategory),
                new FeatureInfo(FeatureType.OnlySelected, Strings.FeatureNameOnlySelected, Strings.FeatureDescriptionOnlySelected),
                new FeatureInfo(FeatureType.GenerateElementData, Strings.FeatureNameGenerateElementData, Strings.FeatureDescriptionGenerateElementData),
                new FeatureInfo(FeatureType.ExportGrids, Strings.FeatureNameExportGrids, Strings.FeatureDescriptionExportGrids),
                new FeatureInfo(FeatureType.ExportRooms, Strings.FeatureNameExportRooms, Strings.FeatureDescriptionExportRooms),
                new FeatureInfo(FeatureType.ConsolidateGroup, Strings.FeatureNameConsolidateGroup, Strings.FeatureDescriptionConsolidateGroup),
            };
        }
Пример #8
0
		internal RuntimeLicensedProduct(XmlElement el)
		{
			_assemblyName = el.GetAttribute("AssemblyName");
			_version = el.GetAttribute("Version");
            _licenseUrl = el.GetAttribute("LicenseUrl");

			try
			{
				_expirationDate = DateTime.Parse(el.GetAttribute("ExpirationDate"));
			}
			catch
			{
				_expirationDate = DateTime.MaxValue;
			}
			
			try
			{
				_type = (LicenseType)Enum.Parse(typeof(LicenseType), el.GetAttribute("Type"));
			}
			catch
			{
				_type = LicenseType.Evaluation; 
			}

			try
			{
				_scope = (LicenseScope)Enum.Parse(typeof(LicenseScope), el.GetAttribute("Scope"));
			}
			catch
			{
				_scope = LicenseScope.WebSite; 
			}
		}
Пример #9
0
		internal RuntimeLicensedProduct(string assemblyName, string assemblyVersion)
		{
			_assemblyName = assemblyName;
			_version = assemblyVersion;
			_type = LicenseType.Evaluation;
			_scope = LicenseScope.WebSite;
			_expirationDate = DateTime.MaxValue;
		}
Пример #10
0
 public HeldLicense(LicenseKey license, LicenseScope scope, int num)
 {
     License     = license;
     Scope       = scope;
     NumLicenses = num;
 }
Пример #11
0
 public UserUsageInfo(UserKey user, LicenseScope span, int num)
 {
     User             = user;
     Span             = span;
     NumberOfLicenses = num;
 }