Beispiel #1
0
 public void addSADataWorker(string name, SADataWorker data)
 {
     if (!datas.ContainsKey(name))
     {
         datas.Add(name, data);
     }
 }
Beispiel #2
0
        public void joinData(IOCDataWorker workerData)
        {
            string       DotName = workerData.name.Replace("/", ".");
            SADataWorker data    = IOCManager.Instance.getIOCDataWorker(DotName);

            if (data == null)
            {
                Type dataType = Type.GetType(DotName);
                if (null == dataType)
                {
                    string graphName = DotName.Substring(DotName.LastIndexOf(".") + 1);
                    dataType = Type.GetType(SAACollection.GraphsStr + graphName + SAACollection.GraphSuffix);
                }
                if (null == dataType)
                {
                    data = new SADataWorker(workerData.name, workerData.command);
                }
                else
                {
                    data = (SADataWorker)dataType.GetConstructor(new Type[] { typeof(string), typeof(string) }).Invoke(new System.Object[] { workerData.name, workerData.command });//构造;
                }
                IOCManager.Instance.addSADataWorker(DotName, data);
            }
            dataWorkers.Add(data);
            if (_start)
            {
                registerDataWorker(data);
            }
        }