public override string ToString()
        {
            JSONObject jSONObject = new JSONObject();

            jSONObject.AddField("DataFormatVersion", (int)this.DataFormatVersion);
            jSONObject.AddField("Registered", this.Registered);
            jSONObject.AddField("CustomerID", this.CustomerId);
            jSONObject.AddField("MembershipType", (int)this.MembershipType);
            jSONObject.AddField("MembershipName", (this.MembershipName != null ? this.MembershipName.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("GraceDays", this.GraceDays);
            jSONObject.AddField("NewUnit", this.NewUnit);
            jSONObject.AddField("UnitType", (this.UnitType != null ? this.UnitType.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("QuickAccessCode", (this.QuickAccessCode != null ? this.QuickAccessCode.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("MemberFirstName", (this.MemberFirstName != null ? this.MemberFirstName.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("MemberLastName", (this.MemberLastName != null ? this.MemberLastName.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("MemberPhone", (this.MemberPhone != null ? this.MemberPhone.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("NewSystemGraceDays", this.NewSystemGraceDays);
            jSONObject.AddField("ESNVerificationCode", (this.EsnVerificationCode != null ? this.EsnVerificationCode.Replace("\0", string.Empty) : "null"));
            jSONObject.AddField("TotalShotsTaken", this.TotalShotsTaken);
            jSONObject.AddField("TotalShotsTakenLastUpdatedDate", this.TotalShotsTakenLastUpdatedDate.ToString("G"));
            jSONObject.AddField("FirstUseDate", this.FirstUseDate.ToString("G"));
            jSONObject.AddField("MembershipPackDate", this.MembershipPackDate.ToString("G"));
            jSONObject.AddField("MembershipExpireDate", this.MembershipExpireDate.ToString("G"));
            jSONObject.AddField("InitialRegistrationDate", this.InitialRegistrationDate.ToString("G"));
            jSONObject.AddField("DeviceStatusFlag", (int)this.DeviceStatusFlag);
            for (int i = 0; i < Enum.GetValues(typeof(STSWMMSFeatureFlagType)).Length; i++)
            {
                STSWMMSFeatureFlagType sTSWMMSFeatureFlagType = (STSWMMSFeatureFlagType)i;
                bool flagValue = this.GetFlagValue(sTSWMMSFeatureFlagType);
                jSONObject.AddField(sTSWMMSFeatureFlagType.ToString(), flagValue);
            }
            return(jSONObject.ToString());
        }
 public void SetBitArray(BitArray arr)
 {
     for (int i = 0; i < 256; i++)
     {
         STSWMMSFeatureFlagType sTSWMMSFeatureFlagType = (STSWMMSFeatureFlagType)i;
         this.GetType().GetField(sTSWMMSFeatureFlagType.ToString()).SetValue(this, arr[i]);
     }
 }
 private bool GetFlagValue(STSWMMSFeatureFlagType flag)
 {
     if (this.FeatureFlags == null || this.FeatureFlags.Count < (int)flag + (int)STSWMMSFeatureFlagType.Module_Challenges)
     {
         return(false);
     }
     return(this.FeatureFlags.Get((int)flag));
 }
 private void RemoveItemFromPopup(List <Dropdown.OptionData> dropdownOptions, STSWMMSFeatureFlagType flag, string cmpString)
 {
     if (!MembershipManager.GetAccess(flag))
     {
         int num = dropdownOptions.FindIndex(0, (Dropdown.OptionData s) => s.text.Equals(cmpString));
         if (dropdownOptions.Count > num && num >= 0)
         {
             dropdownOptions.RemoveAt(num);
         }
     }
 }
    public BitArray GetBitArray()
    {
        BitArray bitArrays = new BitArray(256, false);

        for (int i = 0; i < 256; i++)
        {
            STSWMMSFeatureFlagType sTSWMMSFeatureFlagType = (STSWMMSFeatureFlagType)i;
            FieldInfo field = this.GetType().GetField(sTSWMMSFeatureFlagType.ToString());
            bitArrays[i] = (bool)this.GetType().InvokeMember(field.Name, BindingFlags.GetField, null, this, null);
        }
        return(bitArrays);
    }
Example #6
0
 public static bool GetAccess(STSWMMSFeatureFlagType flag)
 {
     //if (MonoSingleton<UIData>.Singleton.UpgradeRequiredWindowData.Ui.Root.activeSelf)
     //{
     //	MonoSingleton<UIData>.Singleton.UpgradeRequiredWindowData.Hide();
     //}
     if (SecurityWrapperService.Instance.IsConnected)
     {
         return(MembershipManager._hasAccess.GetPermission(flag));
     }
     if (flag == STSWMMSFeatureFlagType.Profile_History)
     {
         return(MembershipManager._lastHistoryFlag);
     }
     if (flag == STSWMMSFeatureFlagType.Profile_Stats)
     {
         return(MembershipManager._lastStatsFlag);
     }
     return(false);
 }
Example #7
0
 public bool GetPermission(STSWMMSFeatureFlagType flag)
 {
     return(this._flags.Get((int)flag));
 }