/// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// <returns> /// A new object that is a copy of this instance. /// </returns> object ICloneable.Clone() { AxisInfo info = new AxisInfo(); if (this.resizableSet) { info.Resizable = this.Resizable; info.resizableSet = this.resizableSet; } if (this.sizeSet) { info.Size = this.Size; info.sizeSet = this.sizeSet; } if (this.visibleSet) { info.Visible = this.Visible; info.visibleSet = this.visibleSet; } if (this.tagSet) { info.Tag = Worksheet.CloneObject(this.Tag); info.tagSet = this.tagSet; } return(info); }
/// <summary> /// Composes the specified source. /// </summary> /// <param name="source">The source.</param> public void Compose(AxisInfo source) { if (source != null) { if (source.sizeSet) { this.size = source.size; this.sizeSet = true; } if (source.visibleSet) { this.visible = source.visible; this.visibleSet = true; } if (source.resizableSet) { this.resizable = source.resizable; this.resizableSet = true; } if (source.tagSet) { this.tag = Worksheet.CloneObject(source.tag); this.tagSet = true; } } }
/// <summary> /// Copies properties from another instance. /// </summary> /// <param name="info">The axis information source to copy.</param> public void CopyFrom(AxisInfo info) { if (info != null) { this.size = info.size; this.visible = info.visible; this.resizable = info.resizable; this.tag = Worksheet.CloneObject(info.tag); this.sizeSet = info.sizeSet; this.visibleSet = info.visibleSet; this.resizableSet = info.resizableSet; this.tagSet = info.tagSet; } }
void IRangeSupport.Copy(int fromRow, int fromColumn, int toRow, int toColumn, int rowCount, int columnCount) { if (!this.isLoadingData && this.IsBound) { if (fromRow < 0) { fromRow = 0; rowCount = this.rowIndexes.Count; } if (fromRow > this.rowIndexes.Count) { fromRow = this.rowIndexes.Count; rowCount = 0; } if (fromColumn < 0) { fromColumn = 0; columnCount = this.fields.Length; } if (fromColumn > this.fields.Length) { fromColumn = this.fields.Length; columnCount = 0; } if (toRow < 0) { toRow = 0; } if (toRow > this.rowIndexes.Count) { toRow = this.rowIndexes.Count; } if (toColumn < 0) { toColumn = 0; } if (toColumn > this.fields.Length) { toColumn = this.fields.Length; } DataMatrix <object> matrix = new DataMatrix <object>(rowCount, columnCount); for (int i = 0; i < rowCount; i++) { for (int k = 0; k < columnCount; k++) { object obj2 = this.GetValue(fromRow + i, fromColumn + k); if (obj2 != null) { matrix.SetValue(i, k, Worksheet.CloneObject(obj2)); } } } for (int j = 0; j < rowCount; j++) { for (int m = 0; m < columnCount; m++) { this.SetValue(toRow + j, toColumn + m, matrix.GetValue(j, m)); } } } }