Пример #1
0
        protected void Add(Id id, string[] symbols, SymbolType[] types)
        {
            if (symbols.Length != types.Length)
                throw new ArgumentException("symbols.Length != types.Length");

            for (int i = 0; i < symbols.Length; i++)
                Add(id, symbols[i].Trim(), types[i]);
        }
Пример #2
0
        public void Initialize(IEnvironment env, IConfiguration cfg)
        {
            this.env = env;
            idService = env.GetIdService();
            symbolType = SymbolType.Parse(cfg.getString("symbolType"));

            mainCfg = cfg;
            Read(cfg.getString("source"));
        }
Пример #3
0
        public void Initialize(IEnvironment env, IConfiguration cfg)
        {
            this.env = env;

            idService = env.GetIdService();
            symbolType = SymbolType.Parse(cfg.getString("symbolType"));

            backend = (IMDBackend)env.LoadPlugin(cfg.SubSet("be"));
        }
Пример #4
0
 public static SymbolType Parse(string name)
 {
     SymbolType result;
     if (!all.TryGetValue(name, out result))
     {
         result = new SymbolType(name);
         lock (sync) all = all.Add(name, result);
     }
     return result;
 }
Пример #5
0
Файл: Id.cs Проект: rc153/LTF
 public string GetSymbol(SymbolType type)
 {
     return idService.GetSymbol(this, type);
 }
Пример #6
0
        private void Add(Id id, string symbol, SymbolType type)
        {
            Dictionary<Id, string> txmap = null;
            if (!txmaps.TryGetValue(type, out txmap))
            {
                txmap = new Dictionary<Id, string>();
                txmaps.Add(type, txmap);
            }
            txmap[id] = symbol;

            Dictionary<string, Id> rxmap = null;
            if (!rxmaps.TryGetValue(type, out rxmap))
            {
                rxmap = new Dictionary<string, Id>();
                rxmaps.Add(type, rxmap);
            }
            rxmap[symbol] = id;
        }
Пример #7
0
 public string GetSymbol(Id id, SymbolType type)
 {
     return txmaps[type][id];
 }
Пример #8
0
 public Id GetId(string symbol, SymbolType type)
 {
     return rxmaps[type][symbol];
 }
Пример #9
0
 public Id CreateId(string[] symbols, SymbolType[] types)
 {
     Id id = new Id(this);
     Add(id, symbols, types);
     return id;
 }