Esempio n. 1
0
        static FacebookDatum()
        {
            JSON_FIELD_DATUM_PROPERTY = new Dictionary <string, PropertyInfo>();

            foreach (PropertyInfo property in typeof(FacebookDatum).GetProperties())
            {
                FacebookPermission permission = property.GetCustomAttribute <FacebookPermission>();
                if (permission != null)
                {
                    JSON_FIELD_DATUM_PROPERTY.Add(permission.Edge ?? permission.Field, property);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the required Facebook permissions, as determined by the Facebook probe's configuration and
        /// anonymization setup.
        /// </summary>
        /// <returns>The required Facebook permissions.</returns>
        public ICollection <FacebookPermission> GetRequiredFacebookPermissions()
        {
            List <FacebookPermission> requiredFacebookPermissions = new List <FacebookPermission>();

            foreach (PropertyInfo facebookDatumProperty in typeof(FacebookDatum).GetProperties())
            {
                FacebookPermission permission         = facebookDatumProperty.GetCustomAttribute <FacebookPermission>();
                Anonymizer         propertyAnonymizer = Protocol.JsonAnonymizer.GetAnonymizer(facebookDatumProperty);
                if (permission != null && (propertyAnonymizer == null || !(propertyAnonymizer is ValueOmittingAnonymizer)))
                {
                    requiredFacebookPermissions.Add(permission);
                }
            }

            return(requiredFacebookPermissions);
        }