private void UpdateBodyText() { if ((MenuState & QuickActionMenuState.ListPeek) == QuickActionMenuState.ListPeek) { if (textUpdateTick == 0) { peekBuilder.Clear(); quickActionMenu.Target.GetSummary(peekBuilder, bodyFormat, valueFormat); peekBody.TextBoard.SetText(peekBuilder); } } else if (listBody.Collection.Count > 0) { bool isDuplicatingProperties = (MenuState & QuickActionMenuState.PropertyDuplication) > 0; for (int i = 0; i < listBody.Collection.Count; i++) { PropertyListEntry entry = listBody.Collection[i]; if (entry.Enabled && (textUpdateTick == 0 || i == selectionIndex)) { entry.UpdateText(i == selectionIndex, isDuplicatingProperties); } } } }
/// <summary> /// Clears current text and appends a copy of the <see cref="StringBuilder"/> given. /// </summary> public void SetText(StringBuilder text, GlyphFormat?format = null) { if (lastText == null) { lastText = new RichText(); } lastText.Clear(); lastText.Add(text, format ?? Format); SetData(lastText.apiData); }
private void UpdateText() { IPropertyBlock block = propertyWheelMenu.quickActionMenu.Target; summaryBuilder.Clear(); summaryBuilder.Add("Build Vision\n", wheelHeaderFormat); block.GetSummary(summaryBuilder, bodyFormatCenter, bodyValueFormatCenter); ITextBuilder notificationBuidler = notificationText.TextBoard; if (notification != null && notificationTimer.ElapsedMilliseconds < notificationTime) { notificationBuidler.Clear(); notificationBuidler.Append("\n", bodyFormatCenter); notificationBuidler.Append(notification, bodyValueFormatCenter); if (contNotification) { notification = null; contNotification = false; } } else if ((MenuState & QuickActionMenuState.PropertyDuplication) > 0) { textBuf.Clear(); textBuf.Append("Copying "); textBuf.Append(block.Duplicator.GetSelectedEntryCount()); textBuf.Append(" of "); textBuf.Append(block.Duplicator.GetValidEntryCount()); notificationBuidler.SetText(textBuf, bodyValueFormatCenter); } else { notification = null; notificationBuidler.Clear(); var target = propertyWheelMenu.quickActionMenu.Target; if (!target.IsFunctional) { notificationBuidler.SetText("[Incomplete]", blockIncFormat.WithAlignment(TextAlignment.Center)); } } summaryLabel.TextBoard.SetText(summaryBuilder); }
private void LoginButton_Click(object sender, EventArgs e)//"Send"按键,按下发送消息键 { if (RichText.Text.Length == 0) { InfoWindow Mes1 = new InfoWindow("您还未输入信息哦", false); Mes1.StartPosition = FormStartPosition.CenterParent; Mes1.ShowDialog(); return; } else { if (BasicInfo.CurrentFriend == null) { InfoWindow Mes1 = new InfoWindow("您还未添加好友哦", false); Mes1.StartPosition = FormStartPosition.CenterParent; Mes1.ShowDialog(); return; } string filePath = ""; //string if (filePath == string.Empty) { if (SendText(BasicInfo.CurrentFriend, RichText.Text)) { Friend TempFriend = UpdateChatPanel(BasicInfo.CurrentFriend, RichText.Text, DialogueType.MyText); Refresh(TempFriend, true); RichText.Clear(); } else { return; } } else { string file = BasicInfo.CurrentFriend + filePath; Thread SendFile; //发送文件线程 SendFile = new Thread(new ParameterizedThreadStart(sendfile)); SendFile.Start((object)file); //开线程传文件 RichText.Clear(); } } }