OpenSim.Services.Interfaces.UserAccount.ToKeyValuePairs C# (CSharp) Method

ToKeyValuePairs() public method

public ToKeyValuePairs ( ) : object>.Dictionary
return object>.Dictionary
        public Dictionary<string, object> ToKeyValuePairs()
        {
            Dictionary<string, object> result = new Dictionary<string, object>();
            result["FirstName"] = FirstName;
            result["LastName"] = LastName;
            result["Email"] = Email;
            result["PrincipalID"] = PrincipalID.ToString();
            result["ScopeID"] = ScopeID.ToString();
            result["Created"] = Created.ToString();
            result["UserLevel"] = UserLevel.ToString();
            result["UserFlags"] = UserFlags.ToString();
            result["UserTitle"] = UserTitle;

            string str = string.Empty;
            foreach (KeyValuePair<string, object> kvp in ServiceURLs)
            {
                str += kvp.Key + "*" + (kvp.Value == null ? "" : kvp.Value) + ";";
            }
            result["ServiceURLs"] = str;

            return result;
        }

Usage Example

        public virtual bool StoreUserAccount(UserAccount data)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();
            //sendData["SCOPEID"] = scopeID.ToString();
            sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
            sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
            sendData["METHOD"] = "setaccount";

            Dictionary<string, object> structData = data.ToKeyValuePairs();

            foreach (KeyValuePair<string, object> kvp in structData)
            {
                if (kvp.Value == null)
                {
                    m_log.DebugFormat("[ACCOUNTS CONNECTOR]: Null value for {0}", kvp.Key);
                    continue;
                }
                sendData[kvp.Key] = kvp.Value.ToString();
            }

            return SendAndGetBoolReply(sendData);
        }
All Usage Examples Of OpenSim.Services.Interfaces.UserAccount::ToKeyValuePairs