Beispiel #1
0
        private static Schema.Model.VersionSchema LoadVersion(string MessageType, string MessageEvent)
        {
            LoadDataType();
            //Must load segments first then Fields
            LoadSegment();
            LoadField();
            var oVersionSchema = new Schema.Model.VersionSchema();

            oVersionSchema.Version              = _VersionCurrent;
            oVersionSchema.CompositeList        = oDataTypeList.OfType <Schema.Model.Composite>();
            oVersionSchema.PrimitiveList        = oDataTypeList.OfType <Schema.Model.Primitive>();
            oVersionSchema.SegmentDictionary    = oSegmentDictionary;
            oVersionSchema.MessageStructureList = LoadMessageList(MessageType, MessageEvent);

            return(oVersionSchema);
        }
Beispiel #2
0
        private static Schema.Model.VersionSchema LoadAnotherMessageForSameVersion(Schema.Model.VersionSchema VersionSchema, string MessageType, string MessageEvent)
        {
            if (null == VersionSchema.MessageStructureList.SingleOrDefault(x => x.MessageType == MessageType && x.MessageEvent == MessageEvent))
            {
                //LoadDataType();
                oDataTypeList.Clear();
                oDataTypeList.AddRange(VersionSchema.PrimitiveList);
                oDataTypeList.AddRange(VersionSchema.CompositeList);

                //Must load segments first then Fields
                //LoadSegment();
                //oSegmentDictionary.Clear();
                oSegmentDictionary = VersionSchema.SegmentDictionary;

                //LoadField();
                // No need to load fields as they are already loaed from the first call

                VersionSchema.MessageStructureList.AddRange(LoadMessageList(MessageType, MessageEvent));
            }
            return(VersionSchema);
        }
Beispiel #3
0
        public void LoadSchema(string MessageVersion, string MessageType, string MessageTrigger)
        {
            var oMessageVersion = Model.Version.GetVersionFromString(MessageVersion);

            if (oMessageVersion != Model.VersionsSupported.NotSupported)
            {
                if (_CurrentSchema == null)
                {
                    _CurrentSchema = V2.Schema.XmlParser.SchemaParser.LoadSingleMessage(V2.Schema.Model.Version.GetVersionFromString(MessageVersion), MessageType.ToUpper(), MessageTrigger.ToUpper());
                }
                else
                {
                    if (_CurrentSchema.Version == Model.Version.GetVersionFromString(MessageVersion))
                    {
                        V2.Schema.XmlParser.SchemaParser.LoadAnotherMessage(_CurrentSchema, MessageType.ToUpper(), MessageTrigger.ToUpper());
                    }
                    else
                    {
                        _CurrentSchema = V2.Schema.XmlParser.SchemaParser.LoadSingleMessage(V2.Schema.Model.Version.GetVersionFromString(MessageVersion), MessageType.ToUpper(), MessageTrigger.ToUpper());
                    }
                }
            }
        }
Beispiel #4
0
 public static void LoadAnotherMessage(Schema.Model.VersionSchema VersionSchema, string MessageType, string MessageEvent)
 {
     _VersionCurrent = VersionSchema.Version;
     LoadAnotherMessageForSameVersion(VersionSchema, MessageType, MessageEvent);
 }