private void s13_Click(object sender, EventArgs e) { try { TextBox_chat.SelectionAlignment = HorizontalAlignment.Right; string whole = "Sticker!" + "\n"; byte[] data = Encoding.UTF8.GetBytes("--sticker--s13"); string title = Aliases[0] + "(" + members[0] + ")" + " " + DateTime.Now.ToString() + "\n"; TextBox_chat.AppendText(title); TextBox_chat.AppendText(whole); //Clipboard.Clear(); btm = new Bitmap(s13.BackgroundImage); //Clipboard.SetImage(btm); TextBox_chat.SelectionAlignment = HorizontalAlignment.Right; //TextBox_chat.Paste(); foreach (Socket sc in all_sockets) { AsynSend(sc, whole); } foreach (Socket sc in all_sockets) { sc.Send(data); } Sticker s = new Sticker(start_sticker); Invoke(s, new object[] { }); StickerList.Hide(); } catch (Exception) { MessageBox.Show("连接失效", "网络错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
public Form3(string ids, string nics, Socket[] connections, int membernum, string title) { InitializeComponent(); StickerList.Hide(); members = ids.Split(','); Aliases = nics.Split(','); Text = "instachat"; // 聊天对象列表 if (members.Length == 2) { TextBox_memebers.AppendText(title + "\n"); TextBox_memebers.AppendText(Aliases[1] + "(" + members[1] + ")" + "\n"); } else { TextBox_memebers.AppendText("Group Name:\n"); TextBox_memebers.ForeColor = Color.Lime; TextBox_memebers.AppendText(title + "\n" + "\n"); TextBox_memebers.ForeColor = Color.Black; TextBox_memebers.AppendText("Members are:\n"); for (int i = 0; i < members.Length; i++) { TextBox_memebers.AppendText(Aliases[i] + "(" + members[i] + ")" + "\n"); } } all_sockets = connections; socket_num = membernum; AsynReceive(all_sockets); }
public override void OnInspectorGUI() { DrawDefaultInspector(); StickerList stickerList = (StickerList)target; parentObject = (GameObject)EditorGUILayout.ObjectField("Parent Object:", parentObject, typeof(GameObject), true); if (GUILayout.Button("Create list from Parent")) { GenerateList(stickerList); } }
void GenerateList(StickerList stickerList) { if (parentObject != null) { List <GameObject> gList = new List <GameObject>(); foreach (Transform t in parentObject.transform) { gList.Add(t.gameObject); } stickerList.stickers = gList; } }
// 为了发表情 private void button_sticker_Click(object sender, EventArgs e) { StickerList.Show(); }
public async Task GetStickerPacks() { IsLoading = true; try { var stickerList = await _stickersDatabase.GetStickers(); if (stickerList.Any()) { foreach (var item in stickerList) { StickerList.Add(item); } IsLoading = false; return; } var initialResult = await _stickerManager.GetStickerPackList(Locator.ViewModels.MainPageVm.CurrentUser.Region); var resultCheck = await ResultChecker.CheckSuccess(initialResult); if (!resultCheck) { return; } var packageList = JsonConvert.DeserializeObject <StickerPresetPackageListResponse>(initialResult.ResultJson); foreach (var item in packageList.PresetPackageList) { var manifestResult = await _stickerManager.GetStickerAndManifestPack(item.ManifestUrl); resultCheck = await ResultChecker.CheckSuccess(manifestResult); if (!resultCheck) { return; } var manifest = JsonConvert.DeserializeObject <StickerResponse>(manifestResult.ResultJson); var metadataResponse = await _stickerManager.GetStickerAndManifestPack(manifest.MetadataUrl); resultCheck = await ResultChecker.CheckSuccess(metadataResponse); if (!resultCheck) { return; } var metadata = JsonConvert.DeserializeObject <MetadataResponse>(metadataResponse.ResultJson); manifest.Copyright = metadata.Copyright; manifest.Description = metadata.Description; manifest.Publisher = metadata.Publisher; manifest.Title = metadata.Title; manifest.ManifestUrl = item.ManifestUrl; stickerList.Add(manifest); } foreach (var item in stickerList) { StickerList.Add(item); } await _stickersDatabase.InsertStickers(stickerList); } catch (Exception ex) { // TODO: Throw error to user. } IsLoading = false; }