/// <summary>If license is trial license enabled all application features</summary> /// <param name="features">Features - object</param> /// <param name="license">SelfSignedLicense - license object</param> public static void InitializeTrialFeatures(Features features, SampleLicense license) { features.ListFeatures.Clear(); Enum e = LicenseFeatures.Copy; foreach (object name in Enum.GetValues(e.GetType())) { features.AddFeature(new Feature(name.ToString(), true, Features.GetDisplayName((LicenseFeatures)name))); } }
/// <summary>Initializes application features</summary> /// <param name="features">Features - object</param> /// <param name="license">SelfSignedLicense - license object</param> /// <param name="successful">Whether license is reloaded successfully or not</param> public static void InitializeFeatures(Features features, SampleLicense license, bool successful) { XmlNode optionsNode = null; features.ListFeatures.Clear(); Enum e = LicenseFeatures.Copy; //Get the SimpleTextEditorOptions node from License custom data string if (!string.IsNullOrEmpty(license.LicenseCustomData)) { optionsNode = GetCustomDataXml(license.LicenseCustomData); } //If LicenseCustomData does not contains settings for SimpleTextEditor Options then fall back to Product Option CustomData if (optionsNode == null && !string.IsNullOrEmpty(license.ProductOption.CustomData)) { //Get the SimpleTextEditorOptions node from Product option custom data string optionsNode = GetCustomDataXml(license.ProductOption.CustomData); } foreach (object name in Enum.GetValues(e.GetType())) { features.AddFeature(new Feature(name.ToString(), !successful ? false : Features.GetFeatureEnabled(optionsNode, (LicenseFeatures)name), Features.GetDisplayName((LicenseFeatures)name))); } }