Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 11
0
 public virtual bool GetModifiedFlag(ScreenContent ScreenContent)
 {
     return(this.ModifiedFlag);
 }
Ejemplo n.º 12
0
 public override int GetItemLength(ScreenContent ScreenContent)
 {
     return(this.LL_Length);
 }
Ejemplo n.º 13
0
        public void LoadContents(ScreenContent Content)
        {
            var ix = Content.ToContentIndex(this.RowCol);

            this.AttrByte = Content.ContentArray[ix];
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 15
0
 public virtual string ToString(ScreenContent ScreenContent)
 {
     return(this.ToString());
 }
Ejemplo n.º 16
0
 public virtual string GetFieldShowText(ScreenContent ScreenContent)
 {
     return(this.GetShowText(ScreenContent));
 }
Ejemplo n.º 17
0
 public override string ToString(ScreenContent ScreenContent)
 {
     return(this.ToString( ) +
            " " + this.GetShowText(ScreenContent));
 }
Ejemplo n.º 18
0
 public override int GetItemLength(ScreenContent ScreenContent)
 {
     return(this.GetShowText(ScreenContent).Length);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 20
0
        public override byte[] GetTextBytes(ScreenContent ScreenContent)
        {
            var ix = ScreenContent.ToContentIndex(this.RowCol, 1);

            return(ScreenContent.ContentArray.SubArray(ix, this.LL_Length));
        }
Ejemplo n.º 21
0
 public abstract byte[] GetTextBytes(ScreenContent ScreenContent);
Ejemplo n.º 22
0
 public abstract int GetItemLength(ScreenContent ScreenContent);