using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using SP = OpenOptions.SoftwareProtection; class T { static void Main(){ try { var lic = new SP.DNAFusion(); var feats = new List { new SP.Feature { Name = "Flex", Value = "true" }, new SP.Feature { Name = "FlexMobile", Value = "1000000" }, new SP.Feature { Name = "WebUsers", Value = "1000000" }, }; var fld = typeof(SP.License).GetFields(BindingFlags.NonPublic|BindingFlags.Instance) .First(f => f.FieldType == typeof(List)); fld.SetValue(lic, feats); Console.WriteLine("Features field: " + fld.Name); Console.WriteLine("Flex AsBool = " + lic["Flex"].AsBool); Console.WriteLine("FlexMobile AsInt32 = " + lic["FlexMobile"].AsInt32); Console.WriteLine("WebUsers AsInt32 = " + lic["WebUsers"].AsInt32); Console.WriteLine("missing (null?) = " + (lic["Nope"] == null)); lic.Holder = new SP.Holder { HaspKey = "", SoftKey = "TESTKEY" }; string key = string.IsNullOrEmpty(lic.Holder.HaspKey) ? lic.Holder.SoftKey : lic.Holder.HaspKey; Console.WriteLine("BroadcastEvent key = " + key + " match=" + key.Equals("TESTKEY", StringComparison.OrdinalIgnoreCase)); Console.WriteLine("ALL OK"); } catch (Exception ex) { Console.WriteLine("FAIL: " + ex.GetType().Name + ": " + ex.Message); } } }