Exemplo n.º 1
0
        protected void Load(TextReader conf)
        {
            Settings settings = new Settings(conf);

            //---- load the DEFAULT section
            LinkedList<QuickFix.Dictionary> section = settings.Get("DEFAULT");
            QuickFix.Dictionary def = new QuickFix.Dictionary();
            if (section.Count > 0)
                def = section.First.Value;
            Set(def);

            //---- load each SESSION section
            section = settings.Get("SESSION");
            foreach (QuickFix.Dictionary dict in section)
            {
                dict.Merge(def);

                string sessionQualifier = SessionID.NOT_SET;
                string senderSubID = SessionID.NOT_SET;
                string senderLocID = SessionID.NOT_SET;
                string targetSubID = SessionID.NOT_SET;
                string targetLocID = SessionID.NOT_SET;

                if (dict.Has(SESSION_QUALIFIER))
                    sessionQualifier = dict.GetString(SESSION_QUALIFIER);
                if (dict.Has(SENDERSUBID))
                    senderSubID = dict.GetString(SENDERSUBID);
                if (dict.Has(SENDERLOCID))
                    senderLocID = dict.GetString(SENDERLOCID);
                if (dict.Has(TARGETSUBID))
                    targetSubID = dict.GetString(TARGETSUBID);
                if (dict.Has(TARGETLOCID))
                    targetLocID = dict.GetString(TARGETLOCID);
                SessionID sessionID = new SessionID(dict.GetString(BEGINSTRING), dict.GetString(SENDERCOMPID), senderSubID, senderLocID, dict.GetString(TARGETCOMPID), targetSubID, targetLocID, sessionQualifier);
                Set(sessionID, dict);
            }
        }