コード例 #1
0
        private static PathDetailBase LoadPathDetailData(ModelBase item)
        {
            PathDetailBase _Info = new PathDetailBase();

            if (item is Content)
            {
                GetContentInfo(item, _Info);
            }
            else if (item is SubComponent)
            {
                GetSubComponentInfo(item, _Info);
            }
            else if (item is Component)
            {
                GetComponentInfo(item, _Info);
            }
            else if (item is Field)
            {
                GetFieldInfo(item, _Info);
            }
            else if (item is Element)
            {
                GetElementInfo(item, _Info);
            }
            else if (item is Segment)
            {
                GetSegmentInfo(item, _Info);
            }
            else if (item is Message)
            {
                GetMessageInfo(item, _Info);
            }
            return(_Info);
        }
コード例 #2
0
        private static void GetMessageInfo(ModelBase item, PathDetailBase _Info)
        {
            var Message = item as Message;

            _Info._MessageType    = Message.MessageType;
            _Info._MessageEvent   = Message.MessageTrigger;
            _Info._MessageVersion = Message.MessageVersion;
        }
コード例 #3
0
        private static void GetSubComponentInfo(ModelBase item, PathDetailBase _Info)
        {
            var SubComponent = item as SubComponent;

            _Info._SubComponentPosition = SubComponent._Index;
            if (item._Parent != null)
            {
                GetComponentInfo(item._Parent, _Info);
            }
        }
コード例 #4
0
        private static void GetElementInfo(ModelBase item, PathDetailBase _Info)
        {
            var Element = item as Element;

            _Info._FieldPosition = Element._Index;
            _Info._RepeatCount   = Element.RepeatCount;
            if (item._Parent != null)
            {
                GetSegmentInfo(item._Parent, _Info);
            }
        }
コード例 #5
0
        private static void GetFieldInfo(ModelBase item, PathDetailBase _Info)
        {
            var Field = item as Field;

            _Info._RepeatPosition = Field._Index;
            _Info._ComponentCount = Field.ComponentCount;
            if (item._Parent != null)
            {
                GetElementInfo(item._Parent, _Info);
            }
        }
コード例 #6
0
        private static void GetComponentInfo(ModelBase item, PathDetailBase _Info)
        {
            var Component = item as Component;

            _Info._ComponentPosition = Component._Index;
            _Info._SubComponentCount = Component.SubComponentCount;
            if (item._Parent != null)
            {
                GetFieldInfo(item._Parent, _Info);
            }
        }
コード例 #7
0
        private static void GetSegmentInfo(ModelBase item, PathDetailBase _Info)
        {
            var Segment      = item as Segment;
            int SegmentCount = 0;

            if (Segment._Parent != null)
            {
                var Msg = Segment._Parent as Message;
                SegmentCount = Msg.SegmentCount(Segment.Code);
            }
            _Info._SegmentPosition     = Segment._Index;
            _Info._SegmentTypePosition = SegmentCount;
            _Info._SegmentCode         = Segment.Code;
            if (item._Parent != null)
            {
                GetMessageInfo(item._Parent, _Info);
            }
        }