// PUBLIC METHODS
        Loader <T> ILoaderAdapter <T> .FormToLoaderAdapt(eLoaderFactoryContext i_LoaderFactoryContext, FacebookObjectCollection <T> i_FacebookObjectCollection, ListView i_ListView)
        {
            this.r_ParamsList.Add(i_FacebookObjectCollection);
            this.r_ParamsList.Add(i_ListView);

            return(LoaderFactory <T> .CreateLoader(i_LoaderFactoryContext, this.r_ParamsList));
        }
Exemplo n.º 2
0
        public void CreateTest()
        {
            LoaderFactory loaderFactory = new LoaderFactory();
            ILoader       loader        = loaderFactory.CreateLoader();

            Assert.IsNotNull(loader);
            Assert.IsInstanceOfType(loader, typeof(Loader));
            Assert.IsNotNull(((Loader)loader).Components);
            Assert.AreEqual(12, ((Loader)loader).Components.Count);
        }
        Loader <T> ILoaderAdapter <T> .FormToLoaderAdapt(eLoaderFactoryContext i_LoaderFactoryContext, FacebookObjectCollection <T> i_FacebookObjectCollection, List <PropertyCounter> i_PropertyCounterList, Chart i_PieChart, string i_PieChartTitle, string i_PieChartID)
        {
            this.r_ParamsList.Add(i_FacebookObjectCollection);
            this.r_ParamsList.Add(i_PropertyCounterList);
            this.r_ParamsList.Add(i_PieChart);
            this.r_ParamsList.Add(i_PieChartTitle);
            this.r_ParamsList.Add(i_PieChartID);

            return(LoaderFactory <T> .CreateLoader(i_LoaderFactoryContext, this.r_ParamsList));
        }
Exemplo n.º 4
0
        public void LoadTest()
        {
            TestModel     model         = new TestModel();
            LoaderFactory loaderFactory = new LoaderFactory();
            ILoader       loader        = loaderFactory.CreateLoader();

            Assert.IsInstanceOfType(loader, typeof(Loader));
            using (DbDataReader reader = CreateReader())
            {
                Assert.IsTrue(reader.Read());
                loader.Load(model, reader);
                reader.Close();
            }
            Assert.AreEqual(TEST_ID, model.Id);
            Assert.AreEqual(TEST_NAME.TrimEnd(), model.Name);
            Assert.AreEqual(TEST_TIMESTAMP, model.Timestamp);
        }
Exemplo n.º 5
0
 private KeyboardModel LoadKeyboardModel(string path)
 {
     try
     {
         Loader ldr = LoaderFactory.CreateLoader();
         return(ldr.LoadKeyboard(path));
     }
     catch (LoaderException e)
     {
         string msg = e.Message;
         if (e.InnerException != null)
         {
             msg += "\n" + e.InnerException.Message;
         }
         logger.Warn("Exception occurred while loading keyboard!\n{0}", msg);
         throw new Exception(msg);
     }
     catch (Exception e)
     {
         string msg = "Unrecognized exception occurred while loading keyboard!";
         logger.Error(ExceptionUtil.Format(msg, e));
         throw new Exception(msg);
     }
 }