Beispiel #1
0
        /// <summary>
        /// return the modified flag of the continued entry field. Examine each of the
        /// segment fields.
        /// </summary>
        /// <param name="ScreenContent"></param>
        /// <returns></returns>
        public override bool GetModifiedFlag(ScreenContent ScreenContent)
        {
            bool isModified = false;

            foreach (var contFld in ScreenContent.ContinuedFieldSegments(this.FieldKey.FieldNum))
            {
                if (contFld.ModifiedFlag == true)
                {
                    isModified = true;
                    break;
                }
            }
            return(isModified);
        }
Beispiel #2
0
        public byte?GetTailAttrByte(ScreenContent ScreenContent)
        {
            var ix = ScreenContent.ToContentIndex(this.RowCol, this.LL_Length + 1);
            var b1 = ScreenContent.ContentArray[ix];

            if (b1.IsAttrByte() == true)
            {
                return(b1);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public static ContentFieldKey AssignFieldKey(ScreenContent ScreenContent, ContentField Field)
        {
            ContinuedFieldSegmentCode?segCode = null;

            if (Field is ContinuedContentField)
            {
                var contField = Field as ContinuedContentField;
                segCode = contField.ContinuedFieldSegmentCode;
            }

            ContentFieldKey fieldKey = ScreenContent.AssignFieldKey(segCode);

            return(fieldKey);
        }
Beispiel #4
0
 public void AddAllContentText(ScreenContent ScreenContent)
 {
     // loop for each item within the content array.
     foreach (var contentItem in ScreenContent.ContentItems())
     {
         if (contentItem is ContentText)
         {
             ContentItemBase item = null;
             var             rc   = this.TryGetValue(contentItem.RowCol, out item);
             if (rc == false)
             {
                 this.Add(contentItem.RowCol, contentItem);
             }
         }
     }
 }
Beispiel #5
0
        public ScreenContent(
            ScreenContent Parent, ScreenDim ScreenDim, ConcurrentOdom ContentOdom)
            : this(ContentOdom)
        {
            this.ScreenDim = ScreenDim;

            this.ContentArray   = new byte[4000];
            this.ContentArrayLx = this.ScreenDim.Width * this.ScreenDim.Height;

            this.FieldDict = new ContentDict();

            // add this ScreenContent as a child of the Parent SCB.
            if (Parent != null)
            {
                Parent.AddChild(this);
            }
        }
Beispiel #6
0
        public static ContentItemBase GetContentItem(this ScreenContent Content, IScreenLoc loc)
        {
            ContentItemBase foundItem = null;

            foreach (var contentItem in Content.ContentItems())
            {
                var itemLoc = contentItem.RowCol as IScreenLoc;
                var range   = new ScreenLocRange(
                    itemLoc, contentItem.GetItemLength(Content), Content.ScreenDim);
                if (range.Contains(loc))
                {
                    foundItem = contentItem;
                    break;
                }
            }
            return(foundItem);
        }
Beispiel #7
0
        /// <summary>
        /// add the Child ScreenContent to Children collection of this parent.
        /// </summary>
        /// <param name="Child"></param>
        private void AddChild(ScreenContent Child)
        {
            // the child points up to this parent.
            Child.Parent = this;

            // add child to end of list of Children.
            if (this.Children == null)
            {
                this.Children    = new ScreenContent[1];
                this.Children[0] = Child;
            }
            else
            {
                var childList = this.Children.ToList();
                childList.Add(Child);
                this.Children = childList.ToArray();
            }
        }
Beispiel #8
0
        public ScreenContent FindScreenContent(int parentContentNum, int childContentNum)
        {
            ScreenContent found = null;

            if (parentContentNum == this.ContentNum)
            {
                if (this.Children != null)
                {
                    foreach (var child in this.Children)
                    {
                        if (child.ContentNum == childContentNum)
                        {
                            found = child;
                            break;
                        }
                    }
                }
            }
            return(found);
        }
Beispiel #9
0
        private static int AssignFieldNum(ScreenContent ScreenContent, ContentField Field)
        {
            var fieldNum = 0;
            ContinuedFieldSegmentCode?segCode = null;

            if (Field is ContinuedContentField)
            {
                var contField = Field as ContinuedContentField;
                segCode = contField.ContinuedFieldSegmentCode;
            }

            if ((segCode == null) || (segCode.Value == ContinuedFieldSegmentCode.First))
            {
                fieldNum = ScreenContent.NextFieldNum();
            }
            else
            {
                fieldNum = ScreenContent.AssignSegNum();
            }

            return(fieldNum);
        }
Beispiel #10
0
        public IEnumerable <string> ToColumnReport(ScreenContent Content, string Title = null)
        {
            var report = new ColumnReport("Content Dictionary", 60);

            DefineReportColumns(report);

            // report.WriteColumnHeading();

            foreach (var item in this)
            {
                var rowkey  = item.Key;
                var content = item.Value;

                var valueList = new List <string>();
                valueList.Add(rowkey.RowNum.ToString());
                valueList.Add(rowkey.ColNum.ToString());
                valueList.Add(content.GetItemLength(Content).ToString());
                valueList.Add(content.GetShowText(Content));

                report.WriteDetail(valueList.ToArray());
            }

            return(report.ToLines());
        }
Beispiel #11
0
 public virtual bool GetModifiedFlag(ScreenContent ScreenContent)
 {
     return(this.ModifiedFlag);
 }
Beispiel #12
0
 public override int GetItemLength(ScreenContent ScreenContent)
 {
     return(this.LL_Length);
 }
Beispiel #13
0
        public void LoadContents(ScreenContent Content)
        {
            var ix = Content.ToContentIndex(this.RowCol);

            this.AttrByte = Content.ContentArray[ix];
        }
Beispiel #14
0
        /// <summary>
        /// return the index into the content array of the field start row/col.
        /// </summary>
        /// <param name="ScreenContent"></param>
        /// <returns></returns>
        public int GetContentIndex(ScreenContent ScreenContent)
        {
            var ix = ScreenContent.ToContentIndex(this.RowCol);

            return(ix);
        }
 public virtual string ToString(ScreenContent ScreenContent)
 {
     return(this.ToString());
 }
 public virtual string GetFieldShowText(ScreenContent ScreenContent)
 {
     return(this.GetShowText(ScreenContent));
 }
 public override string ToString(ScreenContent ScreenContent)
 {
     return(this.ToString( ) +
            " " + this.GetShowText(ScreenContent));
 }
 public override int GetItemLength(ScreenContent ScreenContent)
 {
     return(this.GetShowText(ScreenContent).Length);
 }
Beispiel #19
0
        /// <summary>
        /// return a new ScreenContent object that is copy of this object.
        /// </summary>
        /// <returns></returns>
        public virtual ScreenContent Copy(ScreenContent ToParent = null)
        {
            var sc = new ScreenContent(ToParent, this);

            return(sc);
        }
Beispiel #20
0
        public override byte[] GetTextBytes(ScreenContent ScreenContent)
        {
            var ix = ScreenContent.ToContentIndex(this.RowCol, 1);

            return(ScreenContent.ContentArray.SubArray(ix, this.LL_Length));
        }
 public abstract byte[] GetTextBytes(ScreenContent ScreenContent);
 public abstract int GetItemLength(ScreenContent ScreenContent);