public static FeatureCollection OpenAndRead(string fileName) { FeatureCollection features = new FeatureCollection(); if (!string.IsNullOrEmpty(fileName) && System.IO.File.Exists(fileName)) { // Create the serializer var serializer = new XmlSerializer(typeof(FeatureCollection)); // Open config file using (var stream = new System.IO.StreamReader(fileName)) { // De-serialize the XML features = serializer.Deserialize(stream) as FeatureCollection; } } foreach (SPFeature feature in features) { feature.IsCustomDefinition = true; } return(features); }
/// <summary> /// Static constructor. /// </summary> static Globals() { Sites = new SiteAuthenticationCollection(); Tenants = new TenantAuthenticationCollection(); CustomFeatureDefinitions = new FeatureCollection(); }
static Globals() { SiteCollections = new SiteCollections(); CustomFeatureDefinitions = new FeatureCollection(); }