예제 #1
0
        private void UpdateComment(ElementComment elementComment, Stack <IAbstractMarkupDataContainer> containers)
        {
            var comments      = Comments.FirstOrDefault(a => a.Key == elementComment.Id);
            var newestComment = comments.Value.LastOrDefault();

            if (newestComment != null)
            {
                if (elementComment.Type == Element.TagType.OpeningTag)
                {
                    var comment = _segmentBuilder.CreateCommentContainer(newestComment.Text,
                                                                         newestComment.Author, newestComment.Severity,
                                                                         newestComment.Date, newestComment.Version);

                    if (comment is IAbstractMarkupDataContainer commentContainer)
                    {
                        commentContainer.Clear();

                        var container = containers.Peek();
                        container.Add(comment);

                        containers.Push(commentContainer);
                    }
                }
                else if (elementComment.Type == Element.TagType.ClosingTag)
                {
                    containers.Pop();
                }
            }
        }
예제 #2
0
        public void VisitCommentMarker(ICommentMarker commentMarker)
        {
            var id       = Guid.NewGuid().ToString();
            var comments = new List <IComment>();

            foreach (var comment in commentMarker.Comments.Comments)
            {
                comments.Add(comment);
                //The severity level has not been specified
                //Undefined = 0,

                //Informational purpose
                //Low = 1,

                //Warning, likely an important issue
                //Medium = 2,

                //Error, a severe issue
                //High = 3,

                //Sentinel, not used
                //Invalid = 100
            }

            Comments.Add(id, comments);

            var commentOpen = new ElementComment
            {
                Type = Element.TagType.OpeningTag,
                Id   = id
            };

            Elements.Add(commentOpen);

            VisitChilderen(commentMarker);

            var commentClose = new ElementComment
            {
                Type = Element.TagType.ClosingTag,
                Id   = id
            };

            Elements.Add(commentClose);
        }
예제 #3
0
        private static IReportElement BuildTestGroup()
        {
            ElementGroupDynamic testGroup = new ElementGroupDynamic("TestGroup");

            IReportElement bool1 = new FieldBoolean("bool1", false);
            IReportElement bool2 = new FieldBoolean("bool2", true);
            IReportElement bool3 = new FieldBoolean("bool3", false);

            IReportElement specialBool  = new FieldBoolean("specialBool", false, "tooltip!");
            IReportElement specialBool2 = new FieldBoolean("specialBool2", false, "tooltip!");

            IReportField textField = new FieldString("textField");

            textField.SetData("This is some text for the text field!");

            IReportElement comment = new ElementComment("comment1", "This is a comment text block!");

            IReportField intField1 = new FieldInteger("intField1", "int field description");

            intField1.SetData(5);

            IReportElement specialString = new FieldString("specialString", "field Description");

            ElementGroupDynamic row = new ElementGroupDynamic("testRow");

            row.AddElement(new FieldBoolean("boolField", false));
            row.AddElement(new FieldInteger("intField"));

            FieldRows fieldRow = new FieldRows("fieldRows", row);

            fieldRow.AddRow();
            fieldRow.AddRow();


            IReportField intField2 = new FieldInteger("intField2");

            intField2.SetData("41");

            string[]   radioOptions = { "op1", "op2", "op3", "op3" };
            FieldRadio radioTest    = new FieldRadio("radioTest", radioOptions);

            radioTest.SetData("op3");

            string[]  listOptions = { "li1", "li2", "li3", "li4" };
            FieldList listTest    = new FieldList("listTest", listOptions);

            listTest.SetData("li2");



            //testGroup.AddElement(specialBool);
            //testGroup.AddElement(specialBool2);

            //testGroup.AddElement(textField);
            //testGroup.AddElement(comment);

            //testGroup.AddElement(intField1);
            //testGroup.AddElement(intField2);

            //testGroup.AddElement(specialString);

            //testGroup.AddElement(radioTest);

            //testGroup.AddElement(listTest);

            testGroup.AddElement(fieldRow);

            testGroup.AddElement(bool1);
            testGroup.AddElement(bool2);
            testGroup.AddElement(bool3);

            return(testGroup);
        }