Ejemplo n.º 1
0
            public override AccessibleObject GetFocused()
            {
                DataGridRelationshipRow owner = (DataGridRelationshipRow)base.Owner;
                int focusedRelation           = owner.dgTable.FocusedRelation;

                if (focusedRelation == -1)
                {
                    return(base.GetFocused());
                }
                return(this.GetChild((this.GetChildCount() - owner.dgTable.RelationsList.Count) + focusedRelation));
            }
Ejemplo n.º 2
0
            protected override void AddChildAccessibleObjects(IList children)
            {
                base.AddChildAccessibleObjects(children);
                DataGridRelationshipRow owner = (DataGridRelationshipRow)base.Owner;

                if (owner.dgTable.RelationsList != null)
                {
                    for (int i = 0; i < owner.dgTable.RelationsList.Count; i++)
                    {
                        children.Add(new DataGridRelationshipRow.DataGridRelationshipAccessibleObject(owner, i));
                    }
                }
            }
Ejemplo n.º 3
0
            public override AccessibleObject GetFocused()
            {
                DataGridRelationshipRow row = (DataGridRelationshipRow)Owner;
                int focusRel = row.dgTable.FocusedRelation;

                if (focusRel == -1)
                {
                    return(base.GetFocused());
                }
                else
                {
                    return(GetChild(GetChildCount() - row.dgTable.RelationsList.Count + focusRel));
                }
            }
Ejemplo n.º 4
0
		internal void UpdateRowsFrom (DataGridRelationshipRow row)
		{
			int start_index = Array.IndexOf (rows, row);
			if (start_index == -1)
				return;

			for (int i = start_index + 1; i < rows.Length; i ++)
				rows[i].VerticalOffset = rows[i-1].VerticalOffset + rows[i-1].Height;

			CalcAreasAndInvalidate ();
		}
Ejemplo n.º 5
0
		void RecreateDataGridRows (bool recalc)
		{
			DataGridRelationshipRow[] new_rows = new DataGridRelationshipRow[RowsCount + (ShowEditRow ? 1 : 0)];
			int start_index = 0;
			if (rows != null) {
				start_index = rows.Length;
				Array.Copy (rows, 0, new_rows, 0, rows.Length < new_rows.Length ? rows.Length : new_rows.Length);
			}

			for (int i = start_index; i < new_rows.Length; i ++) {
				new_rows[i] = new DataGridRelationshipRow (this);
				new_rows[i].height = RowHeight;
				if (i > 0)
					new_rows[i].VerticalOffset = new_rows[i-1].VerticalOffset + new_rows[i-1].Height;
			}

			// UIA Framework event: Updates collection list depending on binding
			CollectionChangeAction action = CollectionChangeAction.Refresh;
			if (rows != null) {
				if (new_rows.Length - rows.Length > 0)
					action = CollectionChangeAction.Add;
				else
					action = CollectionChangeAction.Remove;
			}
			rows = new_rows;

			if (recalc)
				CalcAreasAndInvalidate ();
			// UIA Framework event: Row added/removed 
			OnUIACollectionChangedEvent (new CollectionChangeEventArgs (action, -1));
		}
Ejemplo n.º 6
0
 public DataGridRelationshipAccessibleObject(DataGridRelationshipRow owner, int relationship)
 {
     this.owner        = owner;
     this.relationship = relationship;
 }
Ejemplo n.º 7
0
 public DataGridRelationshipAccessibleObject(DataGridRelationshipRow owner, int relationship) : base()
 {
     Debug.Assert(owner != null, "DataGridRelationshipAccessibleObject must have a valid owner DataGridRow");
     this.owner        = owner;
     this.relationship = relationship;
 }
 public DataGridRelationshipAccessibleObject(DataGridRelationshipRow owner, int relationship)
 {
     this.owner = owner;
     this.relationship = relationship;
 }
 public DataGridRelationshipAccessibleObject(DataGridRelationshipRow owner, int relationship) : base() {
     Debug.Assert(owner != null, "DataGridRelationshipAccessibleObject must have a valid owner DataGridRow");
     this.owner = owner;
     this.relationship = relationship;
 }
 private DataGridRelationshipRow[] GetExpandableRows()
 {
     int dataGridRowsLength = this.DataGridRowsLength;
     DataGridRow[] dataGridRows = this.DataGridRows;
     if (this.policy.AllowAdd)
     {
         dataGridRowsLength = Math.Max(dataGridRowsLength - 1, 0);
     }
     DataGridRelationshipRow[] rowArray2 = new DataGridRelationshipRow[dataGridRowsLength];
     for (int i = 0; i < dataGridRowsLength; i++)
     {
         rowArray2[i] = (DataGridRelationshipRow) dataGridRows[i];
     }
     return rowArray2;
 }
 private void DataSource_Changed(object sender, EventArgs ea)
 {
     this.policy.UpdatePolicy(this.ListManager, this.ReadOnly);
     if (this.gridState[0x200])
     {
         DataGridRow[] dataGridRows = this.DataGridRows;
         int dataGridRowsLength = this.DataGridRowsLength;
         dataGridRows[dataGridRowsLength - 1] = new DataGridRelationshipRow(this, this.myGridTable, dataGridRowsLength - 1);
         this.SetDataGridRows(dataGridRows, dataGridRowsLength);
     }
     else if (this.gridState[0x100000] && !this.gridState[0x400])
     {
         this.listManager.CancelCurrentEdit();
         this.gridState[0x100000] = false;
         this.RecreateDataGridRows();
     }
     else if (!this.gridState[0x400])
     {
         this.RecreateDataGridRows();
         this.currentRow = Math.Min(this.currentRow, this.listManager.Count);
     }
     bool listHasErrors = this.ListHasErrors;
     this.ListHasErrors = this.DataGridSourceHasErrors();
     if (listHasErrors == this.ListHasErrors)
     {
         this.InvalidateInside();
     }
 }
 private void CreateDataGridRows()
 {
     CurrencyManager listManager = this.ListManager;
     DataGridTableStyle myGridTable = this.myGridTable;
     this.InitializeColumnWidths();
     if (listManager == null)
     {
         this.SetDataGridRows(new DataGridRow[0], 0);
     }
     else
     {
         int count = listManager.Count;
         if (this.policy.AllowAdd)
         {
             count++;
         }
         DataGridRow[] newRows = new DataGridRow[count];
         for (int i = 0; i < listManager.Count; i++)
         {
             newRows[i] = new DataGridRelationshipRow(this, myGridTable, i);
         }
         if (this.policy.AllowAdd)
         {
             this.addNewRow = new DataGridAddNewRow(this, myGridTable, count - 1);
             newRows[count - 1] = this.addNewRow;
         }
         else
         {
             this.addNewRow = null;
         }
         this.SetDataGridRows(newRows, count);
     }
 }