/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (!(obj is IList <Dimension>)) { return(false); } DimensionList dl2 = (DimensionList)this; IList <Dimension> dl1 = (IList <Dimension>)obj; if (dl1.Count != dl2.Count) { return(false); } for (int i = 0; i < dl1.Count; i++) { Dimension d1 = dl1[i]; int j = dl2.FindIndex(d1.Name); if (j < 0) { return(false); } Dimension d2 = dl2[d1.Name]; if (d1.Length != d2.Length) { return(false); } } return(true); }
/// <summary> /// Returns specified version of the dimensions list for the coordinate system. /// </summary> /// <returns></returns> public ReadOnlyDimensionList GetDimensions(SchemaVersion version) { DimensionList dlist = new DimensionList(); IEnumerable <Variable> myAxes = committed ? (IEnumerable <Variable>)roAxes : (IEnumerable <Variable>)axes; foreach (Variable a in myAxes) { dlist.AddRange(a.GetDimensions(version)); } return(new ReadOnlyDimensionList(dlist)); }
/// <summary> /// Returns the dimensions list for the coordinate system base on given changeset. /// </summary> /// <returns></returns> public ReadOnlyDimensionList GetDimensions(DataSet.Changes changeset) { DimensionList dlist = new DimensionList(); IEnumerable <Variable> myAxes = committed ? (IEnumerable <Variable>)roAxes : (IEnumerable <Variable>)axes; foreach (Variable a in myAxes) { var vc = changeset.GetVariableChanges(a.ID); ReadOnlyDimensionList list = vc == null?a.GetDimensions(SchemaVersion.Committed) : vc.GetDimensionList(); dlist.AddRange(list); } return(new ReadOnlyDimensionList(dlist)); }
internal ReadOnlyDimensionList(DimensionList dims) { this.dims = dims; }
/// <summary> /// Makes a copy of the list. /// </summary> /// <returns></returns> public DimensionList Clone() { DimensionList dlist = new DimensionList(this); return(dlist); }
/// <summary> /// /// </summary> /// <param name="list"></param> /// <returns></returns> public bool IsSubsetOf(DimensionList list) { return(false); }