21
21
22
22
using System ;
23
23
24
- namespace UnitsNet
24
+ namespace UnitsNet . Attributes
25
25
{
26
- //[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
27
- //public class FooAttribute : UnitAttribute
28
- //{
29
- // public override Unit BaseUnit { get { return Unit.Meter; } }
30
- // public override string XmlDocSummary { get { return "Foo description"; } }
31
-
32
- // public FooAttribute(double ratio, string pluralName = (string)null) : base(pluralName, ratio)
33
- // {
34
- // }
35
- //}
36
-
37
26
[ AttributeUsage ( AttributeTargets . Field , AllowMultiple = false ) ]
38
27
public class AngleAttribute : UnitAttribute
39
28
{
@@ -145,37 +134,4 @@ public VolumeAttribute(double ratio, string pluralName = (string)null) : base(pl
145
134
{
146
135
}
147
136
}
148
-
149
- [ AttributeUsage ( AttributeTargets . Field , AllowMultiple = false ) ]
150
- public abstract class UnitAttribute : Attribute
151
- {
152
- /// <summary>
153
- /// Base unit of unit class. This is the unit that unit classes store their value as internally.
154
- /// Conversions between two units go via the base unit to simplify defining the constants, requiring only N constants
155
- /// instead of N².
156
- /// </summary>
157
- public abstract Unit BaseUnit { get ; }
158
-
159
- /// <summary>
160
- /// Name of unit in plural form. Will be used as property name such as Force.FromNewtonmeters().
161
- /// </summary>
162
- public readonly string PluralName ;
163
-
164
- /// <summary>
165
- /// Ratio of unit to base unit. For example, <see cref="Unit.Kilometer" /> is 1000:1 of the base unit
166
- /// <see cref="Unit.Meter" />.
167
- /// </summary>
168
- public readonly double Ratio ;
169
-
170
- /// <summary>
171
- /// XML doc summary for unit class. Will be inserted when generating the class from T4 template.
172
- /// </summary>
173
- public abstract string XmlDocSummary { get ; }
174
-
175
- public UnitAttribute ( string pluralName , double ratio )
176
- {
177
- Ratio = ratio ;
178
- PluralName = pluralName ;
179
- }
180
- }
181
137
}
0 commit comments