private static bool IsDeviceEnabled(MatsAudienceType audienceType, string dpti)
 {
     if (audienceType == MatsAudienceType.PreProduction)
     {
         // Pre-production should never be sampled
         return(true);
     }
     return(SampleUtils.ShouldEnableDevice(dpti));
 }
示例#2
0
        public static string AsString(MatsAudienceType audience)
        {
            switch (audience)
            {
            case MatsAudienceType.PreProduction:
                return("preproduction");

            case MatsAudienceType.Production:
                return("production");

            default:
                return("unknown");
            }
        }
 public static ContextStore CreateContextStore(
     MatsAudienceType audienceType,
     string appName,
     string appVersion,
     string dptiInternal,
     string deviceNetworkState,
     string sessionId,
     int platform)
 {
     if (!Guid.TryParse(sessionId, out Guid result))
     {
         sessionId = MatsId.Create();
     }
     return(new ContextStore(audienceType, appName, appVersion, dptiInternal, deviceNetworkState, sessionId, platform));
 }
 private ContextStore(
     MatsAudienceType audienceType,
     string appName,
     string appVersion,
     string dptiInternal,
     string deviceNetworkState,
     string sessionId,
     int platform)
 {
     AudienceType       = audienceType;
     AppName            = appName;
     AppVersion         = appVersion;
     DptiInternal       = dptiInternal;
     DeviceNetworkState = deviceNetworkState;
     SessionId          = sessionId;
     Platform           = platform;
 }