Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private Config CreateConfig()
        {
            string filename = Path.Combine(Application.StartupPath, "PS6216Import.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);
        }
Exemple #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param deviceType="nm"></param>
 /// <returns></returns>
 public static TransItem Create(NameMap nm, FromDBI fromDBI, ToDBIForPs toDBI)
 {
     TransItem item = new TransItem();
     item.FromDevice = CreateFromDevice(nm.FromName, fromDBI, nm.TotalHeight);
     item.ToDevice = CreateToDevice(nm.ToName, toDBI, nm.Elvation);
     return item;
 }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param deviceType="nm"></param>
        /// <returns></returns>
        static public TransItem Create(NameMap nm, FromDBI fromDBI, ToDBIForPs toDBI)
        {
            TransItem item = new TransItem();

            item.FromDevice = CreateFromDevice(nm.FromName, fromDBI, nm.TotalHeight);
            item.ToDevice   = CreateToDevice(nm.ToName, toDBI, nm.Elvation);
            return(item);
        }
Exemple #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private Config CreateConfig()
        {
            string filename = Path.Combine(Application.StartupPath, "PS6216Import.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;
        }