Пример #1
0
    public OSEmailSubscriptionState ParseOSEmailSubscriptionState(object stateDict)
    {
        var stateDictCasted = stateDict as Dictionary <string, object>;

        var state = new OSEmailSubscriptionState();

        if (stateDictCasted.ContainsKey("emailUserId"))
        {
            state.emailUserId = stateDictCasted["emailUserId"] as string;
        }
        else
        {
            state.emailUserId = "";
        }

        if (stateDictCasted.ContainsKey("emailAddress"))
        {
            state.emailAddress = stateDictCasted["emailAddress"] as string;
        }
        else
        {
            state.emailAddress = "";
        }

        state.subscribed = stateDictCasted.ContainsKey("emailUserId") && stateDictCasted["emailUserId"] != null;

        return(state);
    }
Пример #2
0
    public OSEmailSubscriptionState ParseOSEmailSubscriptionState(object stateDict)
    {
        var stateDictCasted = stateDict as Dictionary <string, object>;

        var state = new OSEmailSubscriptionState();

        state.subscribed   = Convert.ToBoolean(stateDictCasted ["subscribed"]);
        state.emailUserId  = stateDictCasted ["emailUserId"] as string;
        state.emailAddress = stateDictCasted ["emailAddress"] as string;

        return(state);
    }