void ReleaseDesignerOutlets() { if (MessagesTable != null) { MessagesTable.Dispose(); MessagesTable = null; } if (MessageText != null) { MessageText.Dispose(); MessageText = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (ReconnectButton != null) { ReconnectButton.Dispose(); ReconnectButton = null; } }
public MainWindowVM() { CurrentSign = new PLSign(); EffectCommand = new RelayCommand <SignEffect>(s => { int oldIndex = Window.MessageBoxCaretIndex; MessageText = MessageText.Insert(oldIndex, s.Text); Window.MessageBoxCaretIndex = oldIndex + s.Text.Length; }); SendMessageCommand = new RelayCommand(() => { if (!string.IsNullOrEmpty(msg)) { CurrentSign.SendMessage(msg, SelectedPage); } }); NewGraphicCommand = new RelayCommand(() => { graphicsWindow = new GraphicEditor(); GraphicEditorVM vm = graphicsWindow.DataContext as GraphicEditorVM; vm.CurrentSign = CurrentSign; vm.MainWindow = this; graphicsWindow.Show(); }); RefreshComPortsCommand = new RelayCommand(() => { OpenComPorts = SerialSign.OpenComPorts(); RaisePropertyChanged(""); }); }
protected override void Init() { base.Init(); connectionString = Settings.DS_document; mode = FolderRuleMode.Undefined; optMessageFrom = new MessageFrom("MessageSender"); optMessageTo = new MessageTo("MessageReceiver"); optMessageText = new MessageText("MessageText"); optSignedBy = new SignedBy("DocumentSigner"); optDocumentType = new FolderRuleOptions.DocumentType("DocumentType"); optPerson = new Person("LinkedPerson"); optDocument = new FolderRuleOptions.Document("LinkedDocuments"); optNoMessageText = new NotMessageText("NotMessageText"); optNotSignedBy = new NotSignetBy("NoDocumentSigner"); optNoPerson = new NoPerson("NoLinkedPerson"); optNoDocument = new NoDocument("NoLinkedDocuments"); allOptions = new Option[] { optMessageFrom, optMessageTo, optMessageText, optSignedBy, optDocumentType, optPerson, optDocument, optNoDocument, optNoMessageText, optNoPerson, optNotSignedBy }; }
//overrides the method in the parent class public override void ProcessMessage() { //extract ID and sender this.Id = Message.Header; this.Sender = Message.Body[0].Clean(); if (!this.Sender.ValidateTwitterUser()) { throw new Exception("Invalid twitter username!"); } string text = StringHelper.GetMessageBody(Message.Body, 2); MessageText = text; MessageText.StoreMentions(); MessageText.GetHashTags(); if (text.Length < 141) { this.MessageText = StringHelper.ReplaceTextSpeak(text); } else { throw new ArgumentOutOfRangeException("Tweet text cannot be longer than 140 characters!"); } JSONHelper.WriteTweet(this); }
} = new ObservableCollection <ProgrammsContext>(); // Лист программ на компьютере public UserPanel(Users usr) { InitializeComponent(); user = usr; // Передача данных об авторизованном пользователе switch (user.Role) { case "Student": loadStudent(); break; case "Admin": loadAdmin(); break; } TitleText.Text = user.Login; // Подключение к серверу client = new ServerChat.ServerChatClient(new System.ServiceModel.InstanceContext(this)); // Создаем экземпляр сервиса и инициализируем новый экземпляр класса InstanceContext для заданного обьекта который реализуем экземпляр сервиса ID = client.Connect(user.Login, user.Role); // Подключаемся к сервису и получаем свой ID // Костыль MessageText.AddHandler(System.Windows.Controls.TextBox.DropEvent, new System.Windows.DragEventHandler(MessageText_Drop), true); MessageText.AddHandler(System.Windows.Controls.TextBox.PreviewDropEvent, new System.Windows.DragEventHandler(MessageText_Drop), true); }
private void BookShelfAction() { if (GameTrigger.isFallBookFromShelf && driverGrip.activeSelf == true && isObject) { if (GameTrigger.isPlayerHasDriverTip) { gameController.messageController.SetMessagePanel(MessageText.checkBookShelfText()); driver.SetActive(true); var itemController = driver.GetComponent <ItemController>(); itemController.GetItem(); } else { gameController.messageController.SendMessage(MessageText.GetItemText("ドライバーグリップ")); PlayerStatus.currentHasItem = driverGrip; } driverGrip.SetActive(false); } else { gameController.messageController.SetMessagePanel(MessageText.checkBookShelfText()); } }
//表示する謎を切り替える処理 private void ChangeShowRiddleGimmick() { switch (gimmickType) { case GimmickType.cool: float _temperature = gameController.entranceRoomMonitor.GetRoomtemperature; if (_temperature == changeRiddleTemperature && !onChanged) { ChangeShowRiddle(); } else { base.ItemAction(); } break; case GimmickType.eraser: if (PlayerStatus.currentHasItem && PlayerStatus.currentHasItem.name == "Eraser" && !onChanged) { gameController.messageController.SetMessagePanel(MessageText.TryErase()); ChangeShowRiddle(); } else { base.ItemAction(); } break; default: break; } }
public new void analyseMessage() { String tempCentre = MessageText.Split('\r')[0]; Match match = centrePattern.Match(tempCentre); if (match.Success) { centreCode = tempCentre; MessageText = MessageText.Substring(MessageText.IndexOf('\n') + 1); } else { throw new System.ArgumentOutOfRangeException("SIR centre code", "invalidd"); } String tempIncident = MessageText.Split('\r')[0]; if (INCIDENTS.Contains(tempIncident)) { incident = tempIncident; MessageText = MessageText.Substring(MessageText.IndexOf('\n') + 1); } else { throw new System.ArgumentOutOfRangeException("Sir incident", "invalid"); } String concatSIR = centreCode + ", " + incident; Control.addSIR(concatSIR); }
private void SendButton_Click(object sender, EventArgs e) { if (MachineDropDown.SelectedIndex >= 0) { try { IResult Result = Send(); if (Result.Result == ExecutionResultType.Passed) { ListViewItem SendItem = new ListViewItem("Me : " + MessageText.Text); ChatBoxList.Items.Add(SendItem); MessageText.Clear(); } else { MessageBox.Show("Sending failed due to the following reason : " + Result.FailureException.Message, "Message Sending Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception Ex) { MessageBox.Show("Sending failed due to the following reason : " + Ex.Message, "Message Sending Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Please select a machine and then continue", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void ParseOutput(string output) { List <MessageText> messages = new List <MessageText>(); var split = output.Split(new char[] { '\n', '\r' }).Where(s => s.Length > 0); MessageText message = null; foreach (var line in split) { if (message == null) { message = GetMessage(line); continue; } if (!message.Accept(line)) { if (!message.Note) // todo handle notes { messages.Add(message); } message = GetMessage(line); } } if (message != null && !message.Note) { messages.Add(message); } Failures.AddRange(messages); OutputComplete(); }
/// <summary> /// 发送聊天消息 /// </summary> /// <param name="userID"></param> /// <param name="message"></param> public void SendMessage(string interactionID, string userID, string message) { if (!string.IsNullOrEmpty(message)) { message = Microsoft.JScript.GlobalObject.decodeURIComponent(message); } if (string.IsNullOrEmpty(interactionID)) { if (this.Room != null) { interactionID = this.Room.RoomID; } else { interactionID = this.Room.SessionID; } } try { ChatLog.GetInstance().FormatMessage("发送消息:SessionID:{0},Content:{1}", interactionID, message); MessageText text = MessageText.Create(message); RequestMessage request = RequestMessage.Create(interactionID, Visibility.All, text); ChatLog.GetInstance().FormatMessage("发送消息:SessionID:{0}.begin", interactionID); this.SendMessage(userID, request); } catch (Exception ex) { ChatLog.GetInstance().LogException(ex); } ChatLog.GetInstance().FormatMessage("发送消息:SessionID:{0}.end", interactionID); }
void Start() { try { m_LevelScore = GameObject.FindGameObjectWithTag("LevelScore").GetComponent <LevelScore>(); } catch (NullReferenceException ex) { Debug.LogWarning("Score Manager not found > " + ex.Message); } m_CameraControl = GetComponent <CameraControl>(); m_CharacterControl = GameObject.Find("Katherine").GetComponent <PlayerController>(); m_MessageText = GetComponent <MessageText>(); m_BlackScreenAnimator = m_BlackScreen.GetComponent <Animator>(); m_DialogManager = GameObject.Find("DialogManager").GetComponent <DialogManager>(); m_CharacterControl.SetCanMove(false); m_CharacterControl.SetCanRun(false); m_CameraControl.SetCameraSize(1.5f, false, 0.0f); m_BlackScreenAnimator.Play("BlackScreenFadeOut"); m_ActualEvent = 1; m_Found = false; m_Solved = false; }
private static void Tr_MessageText(object sendr, MessageText <User, Chat> e) { Console.WriteLine("ID сообщения:{0}\nID отправителя:{1}\nНик отправителя:{2}\nИмя:{3} Фамилия:{4}\nДата:{5}\nТекст сообщения:{6}", e.DefaultMessageInfo.MessageId, e.DefaultMessageInfo.From.Id, e.DefaultMessageInfo.From.Username, e.DefaultMessageInfo.From.First_name, e.DefaultMessageInfo.From.Last_name, e.DefaultMessageInfo.DateReveiver, e.Text); }
private void UnLock() { isLock = false; lockObject.SetActive(false); gameController.messageController.SetMessagePanel(MessageText.ComeOffScrew()); }
public override void Write() { _worldPacket.WriteUInt32(ZoneID); _worldPacket.WriteBits(MessageText.GetByteCount(), 12); _worldPacket.FlushBits(); _worldPacket.WriteString(MessageText); }
public override void handFurnitureUIInfo(ref string messageText, ref string actionText, ref KeyCode keyCode, ref Action action) { if (isLock) { actionText = MessageText.Open(); keyCode = KeyCode.Space; if (GameTrigger.isPlayerHasDriver) { action = UnLock; } else { action = ShowLockedMessage; } return; } if (isDoorOpen) { actionText = MessageText.Close(); } else { actionText = MessageText.Open(); } action = OpenOrClose; keyCode = KeyCode.Space; return; }
void Start() { Login("8CF2"); player = GameObject.Find("Player"); playerComponent = player.GetComponent <Player> (); player.SetActive(false); playerComponent.GetComponentInChildren <NavigationTargetRig> ().Target.MountPoint = playerComponent.transform; playerComponent.GetComponentInChildren <NavigationTargetRig> ().Target.TargetName = "NavTarget"; ui.SetActive(true); input.gameObject.SetActive(false); btn.gameObject.SetActive(false); GameObject go = GameObject.Find("SocketIO"); socket = go.GetComponent <SocketIOComponent> (); socket.On("JOIN_RESPONSE", onJoined); socket.On("START_GAME", onStart); socket.On("PLAY_GAME", onPlay); socket.On("EVENT", onEvent); socket.On("USER_DISCONNECTED", onUserDisconnected); socket.On("NEXT_MATCH", onNextMatch); socket.On("DEAD", onDead); socket.On("error", onError); socket.On("connect", onUserConnected); statusGame = CONNECTING; status.text = "CONNECTING TO SERVER..."; msgText = GetComponent <MessageText> (); }
public override ThenResponse Perform(EventInfo eventInfo) { Variables connectionVariables; if (Direction == DataDirection.Origin) { connectionVariables = eventInfo.ProxyConnection.ToOriginConnectionVariables; } else { connectionVariables = eventInfo.ProxyConnection.ToTargetConnectionVariables; } EventInfo newEventInfo = eventInfo.Clone(direction: Direction, type: EventType.Message, message: new Message() { RawText = MessageText.GetText(eventInfo.Variables) + Delimiter, Delimiter = Delimiter, }, variables: connectionVariables); if (InsertAtBeginning) { eventInfo.Engine.Queue.AddFirst(newEventInfo); } else { eventInfo.Engine.Queue.AddLast(newEventInfo); } return(ThenResponse.Continue); }
public override string ToString() { string str = ""; str += "&idserver=\"" + IDServer.ToString() + "\""; if (IDUser != -1) { str += "&iduser=\"" + IDUser.ToString() + "\""; } if (!Title.Equals("")) { str += "&title=\"" + Title + "\""; } if (!MessageText.Equals("")) { str += "&messagetext=\"" + MessageText + "\""; } str += "&seen=\"" + seen.ToString() + "\""; if (InsertDate != null) { str += "&insertdate=\"" + InsertDate.ToString("yyyy-MM-dd HH:mm:ss") + "\""; } if (UpdateDate != null) { str += "&updatedate=\"" + UpdateDate.ToString("yyyy-MM-dd HH:mm:ss") + "\""; } return(str.Substring(1)); }
private bool SetWebPageTemplate(MessageViewModel message, MessageText text, string title) { //var webPageMedia = message.Media as TLMessageMediaWebPage; //if (webPageMedia != null) //{ // var webPage = webPageMedia.WebPage as TLWebPage; // if (webPage != null && webPage.Photo != null && webPage.Type != null) // { // Visibility = Visibility.Visible; // FindName(nameof(ThumbRoot)); // if (ThumbRoot != null) // ThumbRoot.Visibility = Visibility.Visible; // TitleLabel.Text = GetFromLabel(message, title); // ServiceLabel.Text = string.Empty; // MessageLabel.Text = message.Message.Replace("\r\n", "\n").Replace('\n', ' '); // ThumbRoot.CornerRadius = ThumbEllipse.CornerRadius = default(CornerRadius); // ThumbImage.ImageSource = (ImageSource)DefaultPhotoConverter.Convert(webPage.Photo, true); // } // else // { // return SetTextTemplate(message, title); // } //} return(true); }
public bool ExecuteDialog(IList <object> list) { _isModal = true; DataGridView grid = new Squadron.Styling.Widgets.StylingGridView(); grid.Parent = MessageText.Parent; MessageText.Hide(); FormInit(); grid.Dock = DockStyle.Fill; grid.DataSource = list; grid.SelectionMode = DataGridViewSelectionMode.CellSelect; if (IsOverlayRequrired) { ShowOverlayForm(); } try { // Show Form this.ShowDialog(); } finally { if (IsOverlayRequrired) { HideOverlayForm(); } } return(this.DialogResult == DialogResult.OK); }
void HtmlView_OnLoadCompleted(object sender, NavigationEventArgs e) { if (!String.IsNullOrEmpty(MessageText)) { Document.parentWindow.execScript( String.Format("setContent({0})", MessageText.JsEncode()), "javascript"); } }
private void ShowMessage(ButtonSelected buttonSelected) { MessageText = string.Format(TextResources.MessageNoWorkoutVideoFound, ButtonSelected.Beginner == buttonSelected ? TextResources.HealthyPlan : ButtonSelected.Moderate == buttonSelected ? TextResources.ActivePlan : ButtonSelected.Advanced == buttonSelected ? TextResources.ElitePlan : string.Empty); MessageVisible = MessageText != null && MessageText.Trim().Length > 0; }
public static void WriteNotificationMessage(string text, int messageTime) { messageText = new MessageText(); messageText.position = DetermineMessagePosition(text); messageText.text = text; messageText.col = Color.White; messageText.intendedDuration = new TimeSpan(0, 0, messageTime); }
private bool CheckField() { if (MessageText.Equals(string.Empty)) { throw new Exception("Please send a valid message"); } return(true); }
private void GetItem() { PlayerStatus.currentHasItem = tulipObjects[(int)position]; tulipObjects[(int)position].SetActive(false); tulipObjects[(int)position] = null; gameController.messageController.SetMessagePanel(MessageText.GetItemText(PlayerStatus.currentHasItem.name)); }
public static bool UpdateFile(this MessageText text, File file) { if (text.WebPage != null) { return(text.WebPage.UpdateFile(file)); } return(false); }
/// <summary> /// Returns a <see cref="String"/> that represents the current <see cref="FahClientMessage"/>. /// </summary> public override string ToString() { var sb = new StringBuilder(); sb.AppendLine($"{Identifier} - Length: {MessageText.Length}"); sb.AppendLine(MessageText.ToString()); sb.AppendLine(); return(sb.ToString()); }
// Start is called before the first frame update void Start() { player = GameObject.FindWithTag("Player").GetComponent <Player>(); girl = GameObject.FindWithTag("Girl").GetComponent <Girl>(); mt = GameObject.FindWithTag("MessageText").GetComponent <MessageText>(); Maxhp = hp; }
/// <summary> /// Attention on y fait bien référence par reflexion dans la methode précédente. /// </summary> /// <param name="ruleName"></param> /// <param name="result"></param> /// <param name="context"></param> /// <param name="arguments"></param> /// <returns></returns> private static void LogResultException(string ruleName, Exception result, TContext context, string[] names, object[] arguments) { MessageText args = new MessageText(); for (int i = 0; i < names.Length; i++) { var a = arguments[i]; args.Add(names[i], MessageText .Text("type", a == null ? "null" : a.GetType().Name) .Add("value", a.ToString()) ); } MessageText message = MessageText .Text("incomingEvent", context.IncomingEvent.Uuid) .Add("incomingEventDate", context.IncomingEvent.EventDate) .Add("workflowUuid", context.Workflow.Uuid) .Add("workflowName", context.Workflow.WorkflowName) .Add("workflowVersion", context.Workflow.Version) .Add("workflowCreationDate", context.Workflow.CreationDate) .Add("success", "false") .Add("functionalRule", context.CurrentEvaluation.WhenRuleText) .Add("CompiledCode", context.CurrentEvaluation.WhenRuleCode) .Add("value", MessageText .Text("evaluate", ruleName) .Add("arguments", args) .Add("result", result.Message)) .Add("exception", result.ToString()) ; var position = context.CurrentEvaluation.WhenRulePosition; if (position != null && position != RuleSpan.None) { message.Add("positions", MessageText .Text(nameof(position.StartColumn), position.StartColumn) .Add(nameof(position.StartIndex), position.StartIndex) .Add(nameof(position.StartLine), position.StartIndex) .Add(nameof(position.StopColumn), position.StartIndex) .Add(nameof(position.StopIndex), position.StartIndex) .Add(nameof(position.StopLine), position.StartIndex) ); } context.FunctionalLog.Add(message); if (FunctionalLog == null) { Trace.WriteLine(message.ToString()); } else { FunctionalLogException(ruleName, result, context, names, arguments); } }
public void setMessage(string text) { reset(); LastTime = Time.timeSinceLevelLoad; Message = new MessageText(text,OneLineLength); //Debug.Log(string.Format("TotalPage:{0}", TotalPageNum)); //Debug.Log(string.Format("TextLength:{0}", Message.Length)); }