Exemplo n.º 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]);
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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;
 }
Exemplo n.º 5
0
Arquivo: Id.cs Projeto: rc153/LTF
 public string GetSymbol(SymbolType type)
 {
     return idService.GetSymbol(this, type);
 }
Exemplo n.º 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;
        }
Exemplo n.º 7
0
 public string GetSymbol(Id id, SymbolType type)
 {
     return txmaps[type][id];
 }
Exemplo n.º 8
0
 public Id GetId(string symbol, SymbolType type)
 {
     return rxmaps[type][symbol];
 }
Exemplo n.º 9
0
 public Id CreateId(string[] symbols, SymbolType[] types)
 {
     Id id = new Id(this);
     Add(id, symbols, types);
     return id;
 }