📄 buddymatchchannel.cs
字号:
namespace Imps.Client.Pc.Channel
{
using Imps.Client;
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Utils;
using Imps.Common;
using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
[ComVisible(true), PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class BuddyMatchChannel : WebPageChannel
{
public BuddyMatchChannel(IFrameworkWindow host) : base(host)
{
}
private byte[] CreatePostData(User user)
{
string s = this.getUrlArguments(user);
return Encoding.UTF8.GetBytes(s);
}
private string getUrlArguments(User user)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat("c={0}", user.SsicUrlEncoded);
builder.AppendFormat("&gender={0}", ((int) user.PersonalInfo.Gender.Value).ToString());
builder.AppendFormat("&province={0}", user.PersonalInfo.Province.Value);
builder.AppendFormat("&city={0}", user.PersonalInfo.City.Value);
builder.AppendFormat("&avatarUrlBase={0}", user.Configuration.SystemSetting.PortraitSetting.UriDownloadPortrait);
builder.AppendFormat("&t={0}", new Random().Next().ToString());
return builder.ToString();
}
public override bool Load(string strUri, string args)
{
string detail = this.BaseUrl;
if (string.IsNullOrEmpty(detail))
{
base.NavigateToBlankPage();
}
else
{
if (!string.IsNullOrEmpty(args))
{
detail = detail + "?" + args + "&";
}
else
{
detail = detail + "?";
}
base.InitUrl = detail + "t=" + new Random().Next().ToString();
ClientLogger.WriteBizOperation("速配", detail);
byte[] postData = this.CreatePostData(base.FrameworkWnd.AccountManager.CurrentUser);
base.InnerWebBrowser.ObjectForScripting = this;
base.InnerWebBrowser.Navigate(base.InitUrl, postData);
}
return true;
}
public void ShowAddBuddyWindow(string sidText)
{
long num = 0;
long.TryParse(sidText, ref num);
base.FrameworkWnd.ContactManager.ShowAddBuddyWindow(null, null, new long?(num), "", null, ContactType.ImpsContact);
}
public void ShowContactDetail(string contactUri)
{
base.FrameworkWnd.ContactManager.ShowContactDetail(contactUri);
}
public void StartConversation(string contactUri)
{
base.FrameworkWnd.ConversationManager.StartConversation(base.FrameworkWnd.MainWindow, ConversationOperation.ImChat, new string[] { contactUri });
}
public void StartIVR(string contactUri)
{
base.FrameworkWnd.IVRManager.StartIVR(base.FrameworkWnd.MainWindow, new string[] { contactUri });
}
private string BaseUrl
{
get
{
return base.FrameworkWnd.AccountManager.CurrentUser.Configuration.SystemSetting.ServerUriSetting.MatchingPortal;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -