Ejemplo n.º 1
0
        /// <summary>
        /// assign segment number key of a new ContentField. See ContentFieldKey class
        /// for usage.
        /// </summary>
        /// <param name="SegCode"></param>
        /// <returns></returns>
        public ContentFieldKey AssignFieldKey(ContinuedFieldSegmentCode?SegCode)
        {
            ContentFieldKey key      = null;
            int             segNum   = 0;
            int             fieldNum = 0;

            if (SegCode == null)
            {
                fieldNum = this.NextFieldNum();
                segNum   = 0;
            }
            else if (SegCode.Value == ContinuedFieldSegmentCode.First)
            {
                fieldNum = this.NextFieldNum();
                segNum   = 1;
            }
            else
            {
                fieldNum = this.CurrentFieldKey.FieldNum;
                segNum   = this.CurrentFieldKey.SegNum + 1;
            }

            key = new ContentFieldKey(fieldNum, segNum);
            this.CurrentFieldKey = key;

            return(key);
        }
Ejemplo n.º 2
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);
        }