Ejemplo n.º 1
0
        private void DbGenCommand_Execute(object sender, EventArgs e)
        {
            Debug.Assert(IsDbInitializer || IsDbGenSessionProvider);

            var codeContext = GetCodeContext();

            if (IsDbInitializer)
            {
                var dbInitializerType = codeContext.GetDbInitializerType();
                DbInitWindow.Show(codeContext.Project, dbInitializerType, GetDTE());
            }
            else
            {
                var dbSessionProviderType = codeContext.GetDbGenSessionProviderType();
                DbGenWindow.Show(codeContext.Project, dbSessionProviderType, dbSessionProviderType.GetDbInitInput(codeContext.Compilation), GetDTE());
            }
        }
Ejemplo n.º 2
0
            public Presenter(DbInitWindow window, Project project, INamedTypeSymbol dbInitializerType, EnvDTE.DTE dte)
            {
                _window            = window;
                _project           = project;
                _dbInitializerType = dbInitializerType;
                _dte = dte;

                _dbSessionProvider = NewScalar <TypeSymbolEntry>().AddValidator(ValidateNotEmpty);
                _showLog           = NewScalar <bool>();

                _dbSessionProviderTypes = GetDbSessionProviderTypes().ToArray();
                if (_dbSessionProviderTypes.Length == 1)
                {
                    _dbSessionProvider.Value = _dbSessionProviderTypes[0];
                }
                Show(_window._view);
            }