本文整理汇总了C#中Aurora.Framework.IUserProfileInfo.ToKeyValuePairs方法的典型用法代码示例。如果您正苦于以下问题:C# IUserProfileInfo.ToKeyValuePairs方法的具体用法?C# IUserProfileInfo.ToKeyValuePairs怎么用?C# IUserProfileInfo.ToKeyValuePairs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Framework.IUserProfileInfo
的用法示例。
在下文中一共展示了IUserProfileInfo.ToKeyValuePairs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateUserProfile
public bool UpdateUserProfile(IUserProfileInfo Profile)
{
NameValueCollection requestArgs = new NameValueCollection
{
{ "RequestMethod", "AddUserData" },
{ "AgentID", Profile.PrincipalID.ToString() },
{ "Profile", OSDParser.SerializeJsonString(Util.DictionaryToOSD(Profile.ToKeyValuePairs())) }
};
OSDMap result = PostData(Profile.PrincipalID, requestArgs);
if (result == null)
return false;
bool success = result["Success"].AsBoolean();
return success;
}
示例2: CreateNewProfile
public void CreateNewProfile(UUID AgentID)
{
List<object> values = new List<object>();
values.Add(AgentID.ToString()); //ID
values.Add("LLProfile"); //Key
IUserProfileInfo profile = new IUserProfileInfo();
profile.PrincipalID = AgentID;
values.Add(OSDParser.SerializeLLSDXmlString(Util.DictionaryToOSD(profile.ToKeyValuePairs()))); //Value which is a default Profile
GD.Insert("userdata", values.ToArray());
}
示例3: UpdateUserProfile
public bool UpdateUserProfile(IUserProfileInfo Profile)
{
Dictionary<string, object> sendData = Profile.ToKeyValuePairs();
sendData["PRINCIPALID"] = Profile.PrincipalID.ToString();
sendData["METHOD"] = "updateprofile";
string reqString = WebUtils.BuildXmlResponse(sendData);
try
{
foreach (string m_ServerURI in m_ServerURIs)
{
string reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/auroradata",
reqString);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);
if (replyData != null)
{
if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
{
m_log.DebugFormat("[AuroraRemoteProfileConnector]: UpdateProfile {0} received null response",
Profile.PrincipalID);
return false;
}
}
else
{
m_log.DebugFormat("[AuroraRemoteProfileConnector]: UpdateProfile {0} received null response",
Profile.PrincipalID);
return false;
}
}
}
return true;
}
catch (Exception e)
{
m_log.DebugFormat("[AuroraRemoteProfileConnector]: Exception when contacting server: {0}", e.ToString());
}
return false;
}