Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 /// <summary>
 /// Static constructor.
 /// </summary>
 static Globals()
 {
     Sites   = new SiteAuthenticationCollection();
     Tenants = new TenantAuthenticationCollection();
     CustomFeatureDefinitions = new FeatureCollection();
 }
Esempio n. 3
0
 static Globals()
 {
     SiteCollections          = new SiteCollections();
     CustomFeatureDefinitions = new FeatureCollection();
 }