Beispiel #1
0
        private void JsonViewerForm_Load(object sender, EventArgs e)
        {
            if (DesignMode)
            {
                return;
            }

            Icon          = settings.GetIcon();
            _jsonTreeView = new JsonTreeView();
            _jsonTreeView.OnNodeChanged += (s, e) => meSelected.Text = e;
            splitContainerControl2.Panel1.Controls.Add(_jsonTreeView);
            _jsonTreeView.Dock = DockStyle.Fill;
            if (string.IsNullOrEmpty(JsonData) && Message != null)
            {
                memoEdit1.Text = _useRawField ? Message.RawText : Message.Text;
                JsonData       = Utils.ExtractJsonObject(_useRawField ? Message.RawText : Message.Text);
                if (!string.IsNullOrEmpty(JsonData))
                {
                    _jsonTreeView.ShowJson(JsonData);
                }
                return;
            }
            if (!string.IsNullOrEmpty(JsonData))
            {
                memoEdit1.Text = JsonData;
                _jsonTreeView.ShowJson(JsonData);
            }
        }
Beispiel #2
0
        private void FastColoredTextBox1_TextChangedDelayed(object sender, TextChangedEventArgs e)
        {
            SudoC_Lexxer    sudoC_Lexxer    = new SudoC_Lexxer();
            SudoC_Assembler sudoC_Assembler = new SudoC_Assembler();
            CompilerStats   compilerStats   = new CompilerStats();

            try
            {
                Statics.reset();
                var CurrentTime0 = DateTime.Now;
                var Lexxed       = sudoC_Lexxer.Lex(fctbMainEditor.Text);
                var CurrentTime1 = DateTime.Now;

                var CurrentTime2 = DateTime.Now;
                var Assembled    = sudoC_Assembler.Assemble(Lexxed);
                var CurrentTime3 = DateTime.Now;
                compilerStats.LexxerStartTime    = CurrentTime0;
                compilerStats.LexxerEndTime      = CurrentTime1;
                compilerStats.LexxerTime         = CurrentTime1.Subtract(CurrentTime0);
                compilerStats.AssemblerStartTime = CurrentTime2;
                compilerStats.AssemblerEndTime   = CurrentTime3;
                compilerStats.AssemblerTime      = CurrentTime3.Subtract(CurrentTime2);

                fctbCWindow.Text = Assembled;

                lStatus.Text = ("Finished!");


                BuildAutocompleteMenu();
            }
            catch (Exception ex)
            {
                lStatus.Text = ex.Message;
                if (bThrow)
                {
                    throw;
                }
            }
            var statics = new LocalStatics();

            statics.fVersionNumber     = Statics.fVersionNumber;
            statics.dContexts          = Statics.dContexts;
            statics.dDefines           = Statics.dDefines;
            statics.lImports           = Statics.lImports;
            statics.lVars              = Statics.lVars;
            statics.iStringNameCounter = Statics.iStringNameCounter;
            CompilerValues compilerValues = new CompilerValues();

            compilerValues.LocalStatics    = statics;
            compilerValues.SudoC_Assembler = sudoC_Assembler;
            compilerValues.SudoC_Lexxer    = sudoC_Lexxer;
            fctbCompilerValues.Text        = JsonConvert.SerializeObject(compilerValues, Formatting.Indented);
            fctbCompilerStats.Text         = JsonConvert.SerializeObject(compilerStats, Formatting.Indented);
            jsonTreeView.ShowJson(fctbCompilerValues.Text);
        }
Beispiel #3
0
        public void LoadMessage()
        {
            if (Message == null)
            {
                return;
            }

            xtraTabPageAdditionalInformation.PageVisible =
                Message.AdditionalInformation != null && Message.AdditionalInformation.Any();
            if (Message.AdditionalInformation != null)
            {
                memoAdditionalInformation.Text = string.Join(Environment.NewLine,
                                                             Message.AdditionalInformation.Select(kv => $"{kv.Key}:{kv.Value}"));
            }

            memoText.Text              = Message.Text;
            txtbMachineName.Text       = Message.MachineName;
            txtID.Text                 = Message.Id.ToString();
            txtbDataSource.Text        = DataSource;
            txtbDateValue.Text         = Utils.GetOffsetTime(Message.Date).ToString(UserSettingsManager.UserSettings.DateTimePattern);
            txtbLevelValue.Text        = Message.Level.ToString();
            txtbProcessModuleName.Text = Message.Module;
            txtbProcessId.Text         = Message.ProcessId.ToString();
            txtbThreadId.Text          = Message.ThreadId.ToString();
            txtSourceValue.Text        = Message.Source;
            txtbMethod.Text            = Message.MethodName;
            txtbFileName.Text          = Message.FileName;
            txtbUser.Text              = Message.User;
            txtbLineNumber.Text        = Message.LineNumber.ToString();
            txtbIndex.Text             = $@"{Messages.IndexOf(Message) + 1} of {Messages.Count}";
            recMessageDetails.HtmlText = Markdown.ToHtml(Message.Text, Pipeline);
            var jsonRawData = Message.RawTextType == AnalogyRowTextType.JSON;

            if (jsonRawData)
            {
                var json = Utils.ExtractJsonObject(jsonRawData ? Message.RawText : Message.Text);
                _jsonTreeView.ClearList();
                if (!string.IsNullOrEmpty(json))
                {
                    _jsonTreeView.ShowJson(json);
                }

                splitContainerControl1.PanelVisibility = SplitPanelVisibility.Both;
            }
            else
            {
                splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel1;
            }
        }
Beispiel #4
0
 private void JsonViewerForm_Load(object sender, EventArgs e)
 {
     if (DesignMode)
     {
         return;
     }
     Icon          = settings.GetIcon();
     _jsonTreeView = new JsonTreeView();
     splitContainerControl1.Panel2.Controls.Add(_jsonTreeView);
     _jsonTreeView.Dock = DockStyle.Fill;
     if (message != null)
     {
         memoEdit1.Text = message.Text;
         var json = ExtractJsonObject(message.Text);
         if (!string.IsNullOrEmpty(json))
         {
             _jsonTreeView.ShowJson(json);
         }
     }
 }
Beispiel #5
0
 private void sbtnLoad_Click(object sender, EventArgs e)
 {
     _jsonTreeView.ShowJson(memoEdit1.Text);
 }