Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param deviceType="nm"></param>
 /// <returns></returns>
 public static TransItem Create(NameMap nm, FromDBI fromDBI, ToDBI toDBI, WriteDelegate writeDelegate)
 {
     TransItem item = new TransItem(writeDelegate);
     item.FromDevice = CreateFromDevice(nm.FromName, fromDBI);
     item.ToDevice = CreateToDevice(nm.ToName, toDBI, nm.Elvation, writeDelegate);
     return item;
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private Config CreateConfig()
        {
            string filename = Path.Combine(Application.StartupPath, "xd2206import.xml");
            Config config   = null;

            try
            {
                config = (Config)Config.Load(typeof(Config), filename);
            }
            catch (Exception ex)
            {
                config = new Config();
                config.FromConnectionString = "f";
                config.ToConnectionString   = "t";
                config.ImportInterval       = TimeSpan.Parse("00:00:10");

                NameMap nm = new NameMap();
                nm.FromName = "FN";
                nm.ToName   = "TN";

                config.NameMapCollection.Add(nm);

                config.Save(filename);
                NUnit.UiKit.UserMessage.DisplayFailure(ex.Message);
                Environment.Exit(1);
            }
            return(config);
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param deviceType="nm"></param>
        /// <returns></returns>
        static public TransItem Create(NameMap nm, FromDBI fromDBI, ToDBI toDBI, WriteDelegate writeDelegate)
        {
            TransItem item = new TransItem(writeDelegate);

            item.FromDevice = CreateFromDevice(nm.FromName, fromDBI);
            item.ToDevice   = CreateToDevice(nm.ToName, toDBI, nm.Elvation, writeDelegate);
            return(item);
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private Config CreateConfig()
        {
            string filename = Path.Combine(Application.StartupPath, "xd2206import.xml");
            Config config = null;
            try
            {
                config = (Config)Config.Load(typeof(Config), filename);
            }
            catch (Exception ex)
            {
                config = new Config();
                config.FromConnectionString = "f";
                config.ToConnectionString = "t";
                config.ImportInterval = TimeSpan .Parse ("00:00:10");

                NameMap nm = new NameMap();
                nm.FromName = "FN";
                nm.ToName = "TN";

                config.NameMapCollection.Add(nm);

                config.Save(filename);
                NUnit.UiKit.UserMessage.DisplayFailure(ex.Message);
                Environment.Exit(1);
            }
            return config;
        }