示例#1
0
        private void PopulateConnections()
        {
            connectionsSettings = ConnectionsSettings.Load();

            cboConnection.DataSource    = connectionsSettings.Connections;
            cboConnection.DisplayMember = "Name";
        }
示例#2
0
        public static ConnectionsSettings Load()
        {
            ConnectionsSettings connectionsSettings = new ConnectionsSettings();

            if (File.Exists(pathFile))
            {
                using (var fileStream = new FileStream(pathFile, FileMode.Open))
                {
                    connectionsSettings = (ConnectionsSettings) new BinaryFormatter().Deserialize(fileStream);
                }
            }

            return(connectionsSettings);
        }
示例#3
0
        public ConnectionDialog()
        {
            InitializeComponent();

            connectionsSettings = ConnectionsSettings.Load();

            PopulateConnections();

            PopulateServerTypes();

            serverTypeComboBox.SelectedIndexChanged += OnServerTypeSelectedIndexChanged;

            Load += OnConnectionDialogLoad;
        }
示例#4
0
        public static ConnectionsSettings Load()
        {
            ConnectionsSettings connectionsSettings = new ConnectionsSettings();

            var xmlSerializer = new XmlSerializer(typeof(ConnectionsSettings));
            var fi            = new FileInfo(Application.StartupPath + @"\Connections\connections.xml");

            if (fi.Exists)
            {
                using (FileStream fileStream = fi.OpenRead())
                {
                    connectionsSettings = (ConnectionsSettings)xmlSerializer.Deserialize(fileStream);
                }
            }

            return(connectionsSettings);
        }
示例#5
0
        public ConnectionDialog()
        {
            InitializeComponent();

            connectionsSettings = ConnectionsSettings.Load();

            PopulateConnections();

            PopulateServerTypes();

            serverTypeComboBox.SelectedIndexChanged += OnServerTypeSelectedIndexChanged;

            chkNHibernateMapping.Checked             = CodeGenerator.Settings.Default.GenerateNHibernateMapping;
            cboDefaultIdGenerator.DataSource         = Enum.GetValues(typeof(CodeGenerator.IdentityGeneratorType));
            cboDefaultIdGenerator.SelectedItem       = CodeGenerator.Settings.Default.DefaultIdentityGenerator;
            chkDefaultFetching.Checked               = CodeGenerator.Settings.Default.DefaultLazyFetching;
            chkUseUnderscoreAndLowercaseInDB.Checked = CodeGenerator.Settings.Default.UseUnderscoreAndLowercaseInDB;

            Load += OnConnectionDialogLoad;
        }