public IAssembler <DerivedXmlUserDTO, DerivedUser> CreateXmlAssembler()
        {
            Configuration cfg = new Configuration();

            cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(DerivedXmlUserDTO)), "otis.xml");
            return(cfg.GetAssembler <DerivedXmlUserDTO, DerivedUser>());
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();

            grdRecords.AutoGenerateColumns = false;
            // configure assembler using mapping in mapping.otis.xml
            m_cfg.AddAssemblyResources(Assembly.GetExecutingAssembly(), "otis.xml");

            // retrieve list of users from somewhere
            IMusicService svc = new MusicService();

            Artist[] artists = svc.GetAllArtists();

            // get the assembler for User->UserInfo transformation
            IAssembler <ArtistInfo, Artist> asm = m_cfg.GetAssembler <ArtistInfo, Artist>();

            // transform array of User instances to a list of UserInfo instances
            // and initialize BindingList with it
            m_userData = new BindingList <ArtistInfo>(asm.ToList(artists));

            // setup data source for combo box
            cboUsers.DataSource    = m_userData;
            cboUsers.DisplayMember = "Description";
            cboUsers.ValueMember   = "Id";
        }
Пример #3
0
        public void Initialize_From_Assembly_Resource_Xml()
        {
            Configuration cfg = new Configuration();

            cfg.AddAssemblyResources(Assembly.GetExecutingAssembly(), "otis.xml");
            TestXmlConfiguration(cfg);
        }
 public void CodeGen()
 {
     Configuration cfg = new Configuration();
     cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(DerivedXmlUserDTO)), "otis.xml");
     cfg.GenerationOptions.OutputType = OutputType.SourceCode;
     cfg.GenerationOptions.OutputFile = "nixonAssembler.cs";
     cfg.BuildAssemblers();
 }
Пример #5
0
        public IAssembler <XmlGenericEntityDTO, GenericEntity <int> > CreateXmlAssembler()
        {
            Configuration cfg = new Configuration();

            cfg.AddAssemblyReference(Assembly.GetAssembly(typeof(GenericsMappingTests)));
            cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(XmlGenericEntityDTO)), "otis.xml");
            return(cfg.GetAssembler <XmlGenericEntityDTO, GenericEntity <int> >());
        }
        public void CodeGen()
        {
            Configuration cfg = new Configuration();

            cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(DerivedXmlUserDTO)), "otis.xml");
            cfg.GenerationOptions.OutputType = OutputType.SourceCode;
            cfg.GenerationOptions.OutputFile = "nixonAssembler.cs";
            cfg.BuildAssemblers();
        }
Пример #7
0
        public IAssembler <AttributedGenericEntityDTO, GenericEntity <int> > CreateAttributedAssembler()
        {
            Configuration cfg = new Configuration();

            cfg.AddType(typeof(AttributedGenericEntityDTO));
            // the following 2 lines are there to init Nullable transformation
            cfg.AddAssemblyReference(Assembly.GetAssembly(typeof(GenericsMappingTests)));
            cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(XmlGenericEntityDTO)), "otis.xml");

            return(cfg.GetAssembler <AttributedGenericEntityDTO, GenericEntity <int> >());
        }
 public IAssembler<DerivedXmlUserDTO, DerivedUser> CreateXmlAssembler()
 {
     Configuration cfg = new Configuration();
     cfg.AddAssemblyResources(Assembly.GetAssembly(typeof(DerivedXmlUserDTO)),"otis.xml");
     return cfg.GetAssembler<DerivedXmlUserDTO, DerivedUser>();
 }
Пример #9
0
        //private static void Test001()
        //{
        //    CLIS2015U04GetProtocolItemArgs args = new CLIS2015U04GetProtocolItemArgs();
        //    CLIS2015U04GetProtocolItemResult result = CloudService.Instance.Submit<CLIS2015U04GetProtocolItemResult, CLIS2015U04GetProtocolItemArgs>(args);
        //}
        //private static void Test002()
        //{
        //    List<CloudConnector.Contracts.Models.Bass.BAS0212U00GrdItemInfo> inputList = new List<CloudConnector.Contracts.Models.Bass.BAS0212U00GrdItemInfo>();
        //    BAS0212U00TransactionalArgs args = new BAS0212U00TransactionalArgs(inputList, "1");
        //    UpdateResult result = CloudService.Instance.Submit<UpdateResult, BAS0212U00TransactionalArgs>(args);
        //}
        private static void GenerateOtisMapping()
        {
            Configuration _cfg = new Configuration();

            _cfg.GenerationOptions.Namespace = "IHIS.CloudConnector";
            _cfg.GenerationOptions.OutputFile = Application.StartupPath + "..\\..\\..\\Mappings\\Assembler.cs";
            _cfg.GenerationOptions.OutputType = OutputType.SourceCode;
            _cfg.GenerationOptions.MOneFilePerClass = true;
            _cfg.AddAssemblyResources(Assembly.GetExecutingAssembly(), "otis.xml");

            _cfg.BuildAssemblers();
        }