Example #1
0
        /// <summary>
        /// Get all the users who are active and the credentials are known.
        /// </summary>
        /// <returns>
        /// A collection of active users if any.
        /// A collection with 0 elements if not active users.
        /// </returns>
        public TDSettings.ConnectionDataTable GetActiveConnections()
        {
            TDSettings.ConnectionDataTable dt = new ConnectionDataTable();


            foreach (TDSettings.ConnectionRow conn in this.Connection.Rows)
            {
                if (conn.ActiveUser == true && conn.RememberPassword == true)
                {
                    dt.Rows.Add(conn.ItemArray);
                }
            }

            return(dt);
        }
Example #2
0
        public void DeleteConnection(int connectionId)
        {
            TDSettings.ConnectionRow[] connRow = this.Connection.Select("ConnectionId=" + connectionId.ToString()) as TDSettings.ConnectionRow[];

            if (connRow != null && connRow.Length == 1)
            {
                this.Connection.RemoveConnectionRow(connRow[0]);

                ConnectionRow delConn = new ConnectionDataTable().NewConnectionRow();

                delConn.ConnectionId = connectionId;

                SavingData sp = new SavingData(OperationType.DeleteConnection, delConn);

                this.SaveXML(sp);
            }
        }
 private void InitClass() {
     this.DataSetName = "TDSettings";
     this.Prefix = "";
     this.Namespace = "http://tempuri.org/TDSettings.xsd";
     this.EnforceConstraints = true;
     this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
     this.tableConnectionType = new ConnectionTypeDataTable();
     base.Tables.Add(this.tableConnectionType);
     this.tableConnection = new ConnectionDataTable();
     base.Tables.Add(this.tableConnection);
     this.tableGlobalSettings = new GlobalSettingsDataTable();
     base.Tables.Add(this.tableGlobalSettings);
     this.tablePreferences = new PreferencesDataTable();
     base.Tables.Add(this.tablePreferences);
     this.tableColumns = new ColumnsDataTable();
     base.Tables.Add(this.tableColumns);
     global::System.Data.ForeignKeyConstraint fkc;
     fkc = new global::System.Data.ForeignKeyConstraint("FK_Connection_Columns", new global::System.Data.DataColumn[] {
                 this.tableConnection.ConnectionIdColumn}, new global::System.Data.DataColumn[] {
                 this.tableColumns.ConnectionIdColumn});
     this.tableColumns.Constraints.Add(fkc);
     fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
     fkc.DeleteRule = global::System.Data.Rule.Cascade;
     fkc.UpdateRule = global::System.Data.Rule.Cascade;
     this.relationRel_ConnectionType = new global::System.Data.DataRelation("Rel_ConnectionType", new global::System.Data.DataColumn[] {
                 this.tableConnectionType.NameColumn}, new global::System.Data.DataColumn[] {
                 this.tableConnection.TypeColumn}, false);
     this.Relations.Add(this.relationRel_ConnectionType);
     this.relationRel_Conn = new global::System.Data.DataRelation("Rel_Conn", new global::System.Data.DataColumn[] {
                 this.tableConnection.ConnectionIdColumn}, new global::System.Data.DataColumn[] {
                 this.tablePreferences.ConnectionIdColumn}, false);
     this.Relations.Add(this.relationRel_Conn);
 }
 internal void InitVars(bool initTable) {
     this.tableConnectionType = ((ConnectionTypeDataTable)(base.Tables["ConnectionType"]));
     if ((initTable == true)) {
         if ((this.tableConnectionType != null)) {
             this.tableConnectionType.InitVars();
         }
     }
     this.tableConnection = ((ConnectionDataTable)(base.Tables["Connection"]));
     if ((initTable == true)) {
         if ((this.tableConnection != null)) {
             this.tableConnection.InitVars();
         }
     }
     this.tableGlobalSettings = ((GlobalSettingsDataTable)(base.Tables["GlobalSettings"]));
     if ((initTable == true)) {
         if ((this.tableGlobalSettings != null)) {
             this.tableGlobalSettings.InitVars();
         }
     }
     this.tablePreferences = ((PreferencesDataTable)(base.Tables["Preferences"]));
     if ((initTable == true)) {
         if ((this.tablePreferences != null)) {
             this.tablePreferences.InitVars();
         }
     }
     this.tableColumns = ((ColumnsDataTable)(base.Tables["Columns"]));
     if ((initTable == true)) {
         if ((this.tableColumns != null)) {
             this.tableColumns.InitVars();
         }
     }
     this.relationRel_ConnectionType = this.Relations["Rel_ConnectionType"];
     this.relationRel_Conn = this.Relations["Rel_Conn"];
 }
 internal ConnectionRow(global::System.Data.DataRowBuilder rb) : 
         base(rb) {
     this.tableConnection = ((ConnectionDataTable)(this.Table));
 }
Example #6
0
        /// <summary>
        /// Get all the users who are active and the credentials are known. 
        /// </summary>
        /// <returns>
        /// A collection of active users if any.
        /// A collection with 0 elements if not active users.
        /// </returns>
        public TDSettings.ConnectionDataTable GetActiveConnections()
        {
            TDSettings.ConnectionDataTable dt = new ConnectionDataTable();

            foreach (TDSettings.ConnectionRow conn in this.Connection.Rows)
            {
                if (conn.ActiveUser == true && conn.RememberPassword == true)
                {
                    dt.Rows.Add(conn.ItemArray);
                }
            }

            return dt;
        }
Example #7
0
        public void DeleteConnection(int connectionId)
        {
            TDSettings.ConnectionRow[] connRow = this.Connection.Select("ConnectionId=" + connectionId.ToString()) as TDSettings.ConnectionRow[];

            if (connRow != null && connRow.Length == 1)
            {
                this.Connection.RemoveConnectionRow(connRow[0]);

                ConnectionRow delConn = new ConnectionDataTable ().NewConnectionRow ();

                delConn.ConnectionId = connectionId;

                SavingData sp = new SavingData (OperationType.DeleteConnection , delConn  );

                this.SaveXML( sp);
            }
        }