Beispiel #1
0
		protected internal Parts(Feature feature):base(MiApi.mitab_c_get_parts(feature.Handle)) {
			this.Feature = feature;
		}
Beispiel #2
0
		/// <summary>
		/// Override this to support descendants of the Parts class.
		/// </summary>
		/// <returns>This layers fields</returns>
		protected internal virtual Parts CreateParts(Feature feature) {
			return new Parts(this);
		}
Beispiel #3
0
		/// <summary>
		/// Returns a double representation of this fields value for the given feature.
		/// </summary>
		/// <param name="feature">The feature to find the fields value for.</param>
		/// <returns>A double representation of this fields value for the given feature</returns>
		public double GetValueAsDouble(Feature feature) {
			return MiApi.mitab_c_get_field_as_double(feature.Handle, this.Index);
		}
Beispiel #4
0
		protected internal Part(Feature feature, int partIdx) {
			this.Index = partIdx;
			this.Feature = feature;
			this.Vertices = CreateVertices(this);
		}
		protected internal DataValues(Feature feature):base(MiApi.mitab_c_get_field_count(feature.Layer.Handle)) 
        {
			Values = new object[Count];
			for (int i = 0; i < Count; i++)
			{
				switch (feature.Layer.Fields[i].Type)
				{
					case FieldType.TABFT_Char:
						Values[i] = MiApi.mitab_c_get_field_as_string(feature.Handle, i);
						break;
					case FieldType.TABFT_Date:
						double d = MiApi.mitab_c_get_field_as_double(feature.Handle, i);
						if (d == 0)
							Values[i] = null;
						else
						{
							int year = (int)(d / 10000);
							int month = (int)((d - year * 10000) / 100);
							int day = (int)(d - year * 10000 - month * 100);
							Values[i] = new DateTime(year, month, day);
						}	
						break;
					case FieldType.TABFT_Decimal:
						Values[i] = MiApi.mitab_c_get_field_as_double(feature.Handle, i);
						break;
					case FieldType.TABFT_Float:
						Values[i] = (float)MiApi.mitab_c_get_field_as_double(feature.Handle, i);
						break;
					case FieldType.TABFT_Integer:
						Values[i] = (int)MiApi.mitab_c_get_field_as_double(feature.Handle, i);
						break;
					case FieldType.TABFT_Logical:
						Values[i] = MiApi.mitab_c_get_field_as_string(feature.Handle, i) == "T"? true : false;
						break;
					case FieldType.TABFT_SmallInt:
						Values[i] = (short)MiApi.mitab_c_get_field_as_double(feature.Handle, i);
						break;
				}
			}
		}
Beispiel #6
0
		/// <summary>
		/// Returns a string representation of this fields value for the given feature.
		/// </summary>
		/// <param name="feature">The feature to find the fields value for.</param>
		/// <returns>A string representation of this fields value for the given feature</returns>
		public string GetValueAsString(Feature feature) {
			return MiApi.mitab_c_get_field_as_string(feature.Handle, this.Index);
		}
Beispiel #7
0
 /// <summary>
 /// Override this to support descendants of the Parts class.
 /// </summary>
 /// <returns>This layers fields</returns>
 protected internal virtual Parts CreateParts(Feature feature)
 {
     return(new Parts(this));
 }
Beispiel #8
0
 protected internal Parts(Feature feature) : base(MiApi.mitab_c_get_parts(feature.Handle))
 {
     this.Feature = feature;
 }
Beispiel #9
0
 protected internal Part(Feature feature, int partIdx)
 {
     this.Index    = partIdx;
     this.Feature  = feature;
     this.Vertices = CreateVertices(this);
 }
Beispiel #10
0
 /// <summary>
 /// Returns a double representation of this fields value for the given feature.
 /// </summary>
 /// <param name="feature">The feature to find the fields value for.</param>
 /// <returns>A double representation of this fields value for the given feature</returns>
 public double GetValueAsDouble(Feature feature)
 {
     return(MiApi.mitab_c_get_field_as_double(feature.Handle, this.Index));
 }
Beispiel #11
0
 /// <summary>
 /// Returns a string representation of this fields value for the given feature.
 /// </summary>
 /// <param name="feature">The feature to find the fields value for.</param>
 /// <returns>A string representation of this fields value for the given feature</returns>
 public string GetValueAsString(Feature feature)
 {
     return(MiApi.mitab_c_get_field_as_string(feature.Handle, this.Index));
 }