Exemple #1
0
    public static AndroidJavaObject ToAndroidUserProfileUpdate(this YandexAppMetricaUserProfileUpdate self)
    {
        AndroidJavaObject userProfileUpdate;
        AndroidJavaObject attribute;

        using (AndroidJavaClass attributeClass = new AndroidJavaClass("com.yandex.metrica.profile.Attribute"))
        {
            if (self.Key != null)
            {
                attribute = attributeClass.CallStatic <AndroidJavaObject>(self.AttributeName, self.Key);
            }
            else
            {
                attribute = attributeClass.CallStatic <AndroidJavaObject>(self.AttributeName);
            }
        }

        if (self.AttributeName == "gender" && self.Values.Length > 0)
        {
            self.Values[0] = (self.Values[0] as string).ToAndroidGender();
        }

        userProfileUpdate = attribute.Call <AndroidJavaObject>(self.MethodName, self.Values);
        return(userProfileUpdate);
    }
Exemple #2
0
    public static AndroidJavaObject ToAndroidUserProfileUpdate(this YandexAppMetricaUserProfileUpdate self)
    {
        AndroidJavaObject androidJavaObject  = null;
        AndroidJavaObject androidJavaObject2 = null;

        using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.yandex.metrica.profile.Attribute"))
        {
            androidJavaObject2 = ((self.Key == null) ? androidJavaClass.CallStatic <AndroidJavaObject>(self.AttributeName, new object[0]) : androidJavaClass.CallStatic <AndroidJavaObject>(self.AttributeName, new object[1]
            {
                self.Key
            }));
        }
        if (self.AttributeName == "gender" && self.Values.Length > 0)
        {
            self.Values[0] = (self.Values[0] as string).ToAndroidGender();
        }
        return(androidJavaObject2.Call <AndroidJavaObject>(self.MethodName, self.Values));
    }
 public YandexAppMetricaUserProfile Apply(YandexAppMetricaUserProfileUpdate update)
 {
     _updates.Add(update);
     return(this);
 }