Пример #1
0
 /// <summary>
 /// For JSON deserialization
 /// </summary>
 private Protocol()
 {
     _running = false;
     _forceProtocolReportsToRemoteDataStore = false;
     _lockPasswordHash = "";
     _jsonAnonymizer = new AnonymizedJsonContractResolver(this);
     _shareable = false;
     _pointsOfInterest = new List<PointOfInterest>();
     _participationHorizonDays = 1;
     _healthTestTimes = new List<DateTime>();
 }
 public AnonymizedMemberValueProvider(PropertyInfo property, IValueProvider defaultMemberValueProvider, AnonymizedJsonContractResolver contractResolver)
 {
     _property = property;
     _defaultMemberValueProvider = defaultMemberValueProvider;
     _contractResolver = contractResolver;
 }
 public AnonymizedMemberValueProvider(PropertyInfo property, IValueProvider defaultMemberValueProvider, AnonymizedJsonContractResolver contractResolver)
 {
     _property = property;
     _defaultMemberValueProvider = defaultMemberValueProvider;
     _contractResolver           = contractResolver;
 }
Пример #4
0
 public string GetJSON(AnonymizedJsonContractResolver anonymizationContractResolver)
 {
     JSON_SERIALIZER_SETTINGS.ContractResolver = anonymizationContractResolver;
                
     return JsonConvert.SerializeObject(this, Formatting.None, JSON_SERIALIZER_SETTINGS).Replace('\n', ' ').Replace('\r', ' ');
 }
Пример #5
0
 /// <summary>
 /// For JSON deserialization
 /// </summary>
 private Protocol()
 {
     _running = false;
     _forceProtocolReportsToRemoteDataStore = false;
     _lockPasswordHash = "";
     _jsonAnonymizer = new AnonymizedJsonContractResolver(this);
     _shareable = false;
     _pointsOfInterest = new List<PointOfInterest>();
     _participationHorizonDays = 1;   
     _groupable = false;
     _groupedProtocols = new List<Protocol>();
     _rewardThreshold = null;
 }
Пример #6
0
 /// <summary>
 /// For JSON deserialization
 /// </summary>
 private Protocol()
 {
     _running = false;
     _forceProtocolReportsToRemoteDataStore = false;
     _lockPasswordHash = "";
     _jsonAnonymizer = new AnonymizedJsonContractResolver(this);
     _shareable = false;
     _pointsOfInterest = new List<PointOfInterest>();
 }
Пример #7
0
        public string GetJSON(AnonymizedJsonContractResolver anonymizationContractResolver, bool indented)
        {
            JSON_SERIALIZER_SETTINGS.ContractResolver = anonymizationContractResolver;

            string json = JsonConvert.SerializeObject(this, indented ? Formatting.Indented : Formatting.None, JSON_SERIALIZER_SETTINGS);

            // if the json should not be indented, replace all newlines with white space
            if (!indented)
                json = json.Replace('\n', ' ').Replace('\r', ' ');

            return json;
        }
Пример #8
0
 /// <summary>
 /// For JSON deserialization
 /// </summary>
 private Protocol()
 {
     _running = false;
     _forceProtocolReportsToRemoteDataStore = false;
     _lockPasswordHash = "";
     _jsonAnonymizer = new AnonymizedJsonContractResolver(this);
     _shareable = false;
     _pointsOfInterest = new List<PointOfInterest>();
     _participationHorizonDays = 1;   
     _groupable = false;
     _groupedProtocols = new List<Protocol>();
     _rewardThreshold = null;
     _gpsDesiredAccuracyMeters = GPS_DEFAULT_ACCURACY_METERS;
     _gpsMinTimeDelayMS = GPS_DEFAULT_MIN_TIME_DELAY_MS;
     _gpsMinDistanceDelayMeters = GPS_DEFAULT_MIN_DISTANCE_DELAY_METERS;
 }