コード例 #1
0
		protected void LoadConnectionGroups(
			ConnectionType     connectionType,
			ConnectionsManager connectionsManager)
		{
			List<ConnectionGroupInfo> groups = connectionsManager
				.GetDirectGroups(connectionType.Id);

			foreach (ConnectionGroupInfo groupInfo in groups)
			{
				List<InstanceInfo> instances     = groupInfo.Connections;
				InstanceInfo       firstInstance = instances.FirstOrDefault();

				if (firstInstance != null)
				{
					if (instances.Count == 1 && firstInstance.GetConnectionString().Equals(groupInfo.Name))
					{
						continue;
					}

					if (!instances.TrueForAll(i => i.IsDynamicConnection))
					{
						this.cmbConnection.Items.Add(groupInfo);
					}
				}
			}
		}
コード例 #2
0
		public InternalSqliteConnectionDialog(MsSqlAuditorModel model)
		{
			this._model              = model;
			this._storage            = model.DefaultVaultProcessor.CurrentStorage;
			this._connectionsManager = new ConnectionsManager(model);
			this._loginManager       = new LoginManager(this._storage);
			this._templateManager    = new TemplateManager(this._storage);
			this._templates          = TemplateNodesLoader.GetTemplates();

			InitializeComponent();

			List<BindingWrapper<ConnectionType>> connectionTypes = this._model.ConnectionTypes;

			this.dataTypeBindingSource.DataSource = connectionTypes;
			this.dataTypeBindingSource.DataMember = "Item";
			this.cmbDataType.DataSource           = dataTypeBindingSource.DataSource;

			this.cmbDataType.SelectionChangeCommitted += this.cmbDataType_SelectedIndexChanged;

			this.cmbConnectionGroup.SelectionChangeCommitted += this.cmbConnectionGroup_SelectedIndexChanged;
			this.cmbServerInstance.SelectionChangeCommitted  += this.cmbServerInstance_SelectedIndexChanged;
			this.cmbTemplate.SelectionChangeCommitted        += this.cmbTemplate_SelectedIndexChanged;
			this.cmbLogin.SelectionChangeCommitted           += this.cmbLogin_SelectedIndexChanged;

			if (connectionTypes.Count > 0)
			{
				UpdateConnectionGroupList();
			}

			UpdateButtonsState();
		}
コード例 #3
0
		public CreateDirectConnectionDialog(MsSqlAuditorModel model)
		{
			this._model              = model;
			this._storage            = this._model.DefaultVaultProcessor.CurrentStorage;
			this._connectionsManager = new ConnectionsManager(model);

			SetLocale();

			InitializeComponent();
			InitializeEventHandlers();
			InitializeBindings();
		}
コード例 #4
0
		public EditDirectConnectionDialog(
			MsSqlAuditorModel   model,
			ConnectionGroupInfo connectionGroup
		)
		{
			this._model = model;

			CurrentStorage storage   = this._model.DefaultVaultProcessor.CurrentStorage;
			this._connectionsManager = new ConnectionsManager(model);

			this._connectionGroup = connectionGroup;
			this._updatesMade     = false;

			SetLocale();

			InitializeComponent();
			InitializeEventHandlers();
			InitializeBindings();

			UpdateControlsState();
		}
コード例 #5
0
		protected void LoadConnectionInstances(
			ConnectionType     connectionType,
			ConnectionsManager connectionsManager
		)
		{
			// get distinct instances from sqlite database
			List<InstanceInfo> instances = connectionsManager
				.GetDistinctInstances(connectionType.Id);

			foreach (InstanceInfo instance in instances)
			{
				this.cmbConnection.Items.Add(instance);
			}
		}