예제 #1
0
        //TODO On namespace enabled checkbox, reload the dot liquid templates. DotLiquidConfiguration.Configure();
        public PocoGenerator(IRetrieveDbObjectsService retrieveDbObjectsService/*IDataTypeService dataTypeService*/, IGenerateTemplate generateTemplate, IRenderOutputStrategy<TablesWithColumnsDto> renderOutputtable, IRenderOutputStrategy<IEnumerable<TablesWithColumnsDto>> renderOutputtables)
        {
            InitializeComponent();

            //_dataTypeService = dataTypeService;
            _retrieveDbObjectsService = retrieveDbObjectsService;
            _generateTemplate = generateTemplate;
            _renderOutputtable = renderOutputtable;
            _renderOutputtables = renderOutputtables;
            //Test
            //using (var scope = Global.Container.BeginLifetimeScope())
            //{
            //    var templateService = scope.Resolve<IGenerateTemplate>();
            //    templateService.Generate(TemplateType.Class, new SysObjects() {name = "tblAddress",
            //                                Columns = new List<SysColumns>
            //                                {
            //                                    new SysColumns() { id=1, name="FirstName", colorder=1},
            //                                    new SysColumns() { id=1, name="LastName", colorder=2},
            //                                }
            //    });
            //}
            //Endof test

            DisplayConnectToDatabase();

            LoadDatabaseTree();

            SetPanelWidths();

            #region Checkbox

            tvDatabase.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(tvDatabase_DrawNode);

            AssignImagesToTreeView();

            #endregion
        }
예제 #2
0
        //TODO On namespace enabled checkbox, reload the dot liquid templates. DotLiquidConfiguration.Configure();
        public PocoGenerator(IRetrieveDbObjectsService retrieveDbObjectsService /*IDataTypeService dataTypeService*/, IGenerateTemplate generateTemplate, IRenderOutputStrategy <TablesWithColumnsDto> renderOutputtable, IRenderOutputStrategy <IEnumerable <TablesWithColumnsDto> > renderOutputtables)
        {
            InitializeComponent();

            //_dataTypeService = dataTypeService;
            _retrieveDbObjectsService = retrieveDbObjectsService;
            _generateTemplate         = generateTemplate;
            _renderOutputtable        = renderOutputtable;
            _renderOutputtables       = renderOutputtables;
            //Test
            //using (var scope = Global.Container.BeginLifetimeScope())
            //{
            //    var templateService = scope.Resolve<IGenerateTemplate>();
            //    templateService.Generate(TemplateType.Class, new SysObjects() {name = "tblAddress",
            //                                Columns = new List<SysColumns>
            //                                {
            //                                    new SysColumns() { id=1, name="FirstName", colorder=1},
            //                                    new SysColumns() { id=1, name="LastName", colorder=2},
            //                                }
            //    });
            //}
            //Endof test

            DisplayConnectToDatabase();

            LoadDatabaseTree();

            SetPanelWidths();

            #region Checkbox

            tvDatabase.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(tvDatabase_DrawNode);

            AssignImagesToTreeView();

            #endregion
        }
 public RenderOutputUsingTablesWithColumnsService(IGenerateTemplate generateTemplate)
 {
     _generateTemplate = generateTemplate;
 }