Beispiel #1
0
        private void UpdateGui(object sender, EventArgs e)
        {
            string message;

            while (_telnetHandler.InQueue.TryDequeue(out message))
            {
                if (message.StartsWith("<Sound>"))
                {
                    _soundHandler?.HandleSounds(message);
                }
                else if (message.StartsWith("<Map>"))
                {
                    if (_mapWindow != null && !_mapWindow.IsDisposed)
                    {
                        _mapWindow.Update(message);
                    }
                }
                else if (message.StartsWith("<Data>"))
                {
                    SaveFile(message);
                }
                else if (message.StartsWith("<FileValidation>"))
                {
                    ValidateAssets.Validate(message);
                }
                else
                {
                    List <ParsedMessage> parsedMessage = Parser.Parse(message);
                    myRichTextBox_MainText.AddFormatedText(parsedMessage);
                    ProcessTriggers(parsedMessage);

                    foreach (var item in parsedMessage)
                    {
                        _previousCommands.AddOnScreenWords(item.Message);
                    }
                }
            }

            if (myRichTextBox_MainText.Lines.Length > Settings.MaxLines)
            {
                myRichTextBox_MainText.BeginUpdate();

                myRichTextBox_MainText.SelectionStart  = 0;
                myRichTextBox_MainText.SelectionLength = myRichTextBox_MainText.GetFirstCharIndexFromLine(myRichTextBox_MainText.Lines.Length - Settings.MaxLines);
                myRichTextBox_MainText.SelectedText    = "";

                myRichTextBox_MainText.SelectionStart = myRichTextBox_MainText.Text.Length;
                myRichTextBox_MainText.ScrollToCaret();
                myRichTextBox_MainText.EndUpdate();
            }
        }
Beispiel #2
0
        private List <Assets> Load(List <List <string> > InputListString)
        {
            List <Assets> modelList = new List <Assets>();

            for (int i = 0; i < InputListString.Count; i++)
            {
                var Current = new ValidateAssets();
                Current.ValidatePegasId(InputListString[i][0]);
                Current.Name = InputListString[i][1];
                Current.ValidateDateForCreaton(InputListString[i][2]);
                Current.ValidateDateForOutFromExploatation(InputListString[i][3]);
                Current.ReasonForOutFromExploatation = InputListString[i][4];
                Current.Category = InputListString[i][5];
                Current.ValidateLevel(InputListString[i][6]);
                Current.Notes      = InputListString[i][7];
                Current.CategoryBP = InputListString[i][8];
                modelList.Add(Current);
            }
            return(modelList);
        }