本文整理汇总了C#中Units类的典型用法代码示例。如果您正苦于以下问题:C# Units类的具体用法?C# Units怎么用?C# Units使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Units类属于命名空间,在下文中一共展示了Units类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LinearGradient
// Methods
internal LinearGradient(string prefix, string localname, string ns, SvgDocument doc)
: base(prefix, localname, ns, doc)
{
this.x1 = 0f;
this.y1 = 0f;
this.x2 = 1f;
this.y2 = 0f;
this.gradientTransform = new Transf();
this.gradientUnit = Units.ObjectBoundingBox;
this.spreadMethod = SpreadMethods.Pad;
this.boundsPath = new GraphicsPath();
this.boundrect = RectangleF.Empty;
this.stops = new SvgElementCollection();
this.gradientstart = PointF.Empty;
this.gradientend = PointF.Empty;
this.rotatepoint = PointF.Empty;
this.translatepoint = PointF.Empty;
this.scalePoint = PointF.Empty;
this.boundsPoints = new PointF[0];
this.ratiomatrix = new Matrix();
this.brush = null;
this.coord = new Matrix();
this.gradientpath = new GraphicsPath();
this.pen = null;
this.GraphMatrix = new Matrix();
}
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:27,代码来源:LinearGradient.cs
示例2: BackendlessGeoQuery
public BackendlessGeoQuery( double NWLat, double NWLon, double SELat, double SWLon, Units units, List<string> categories )
{
ClusterGridSize = CLUSTER_SIZE_DEFAULT_VALUE;
SearchRectangle = new[] { NWLat, NWLon, SELat, SWLon };
Units = units;
Categories = categories;
}
开发者ID:Georotzen,项目名称:.NET-SDK-1,代码行数:7,代码来源:BackendlessGeoQuery.cs
示例3: OnUnitDead
public virtual void OnUnitDead(Units unitDead)
{
if (inRangeUnits.Contains(unitDead))
{
inRangeUnits.Remove(unitDead);
}
}
开发者ID:kthierydezky,项目名称:LTDU,代码行数:7,代码来源:Units.cs
示例4: GetDistance
public int GetDistance(Address origin, Address destination, Mode mode, Units units) {
if (origin == null || destination == null) {
return 0;
}
var request =
(HttpWebRequest)
WebRequest.Create(
new Uri(String.Format(DistanceMatrixUrl,
new object[] {
HttpUtility.JavaScriptStringEncode(origin.PostalCode),
HttpUtility.JavaScriptStringEncode(destination.PostalCode),
Enum.GetName(typeof(Mode), mode),
Enum.GetName(typeof(Units), units)
})));
var response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) return 0;
using (var streamReader = new StreamReader(response.GetResponseStream())) {
var result = streamReader.ReadToEnd();
if (string.IsNullOrEmpty(result)) return 0;
var jsonObject = JObject.Parse(result);
var distance = (int)jsonObject.SelectToken("rows[0].elements[0].distance.value");
return distance / 1000;
}
}
开发者ID:nvdvlies,项目名称:MileageTracker.AspNetWebApi,代码行数:25,代码来源:GoogleDistanceCalculatorService.cs
示例5: PlaceBuilding
public override void PlaceBuilding(Units.Engineer e)
{
this.state = State.Constructing;
this.constructedBy = e;
e.constructing = this;
this.mesh = Game1.GetInstance().map.collisionMap.PlaceBuilding(this.DefineRectangle());
Game1.GetInstance().IsMouseVisible = true;
for( int i = 0; i < p.buildings.Count(); i++){
Building b = p.buildings.ElementAt(i);
if (b != this)
{
if (b.type != Type.Resources && b.type != Type.Sentry)
{
if (b.waypoints.Count() > 0)
{
Point point = b.waypoints.GetLast();
PathfindingProcessor.GetInstance().Push(b, point);
}
}
}
}
if (Game1.GetInstance().IsMultiplayerGame() &&
this.p == Game1.CURRENT_PLAYER)
{
Synchronizer.GetInstance().QueueBuilding(this);
}
p.resources -= Building.GetCost(this.type);
}
开发者ID:Wotuu,项目名称:RTS_XNA_v2,代码行数:31,代码来源:Sentry.cs
示例6: Post
public UnitsResponse Post(Units request)
{
if (request.Unit.Id > 0)
{
Bm2s.Data.Common.BLL.Parameter.Unit item = Datas.Instance.DataStorage.Units[request.Unit.Id];
item.Code = request.Unit.Code;
item.Description = request.Unit.Description;
item.EndingDate = request.Unit.EndingDate;
item.IsCurrency = request.Unit.IsCurrency;
item.IsPeriod = request.Unit.IsPeriod;
item.Name = request.Unit.Name;
item.StartingDate = request.Unit.StartingDate;
Datas.Instance.DataStorage.Units[request.Unit.Id] = item;
}
else
{
Bm2s.Data.Common.BLL.Parameter.Unit item = new Data.Common.BLL.Parameter.Unit()
{
Code = request.Unit.Code,
Description = request.Unit.Description,
EndingDate = request.Unit.EndingDate,
IsCurrency = request.Unit.IsCurrency,
IsPeriod = request.Unit.IsPeriod,
Name = request.Unit.Name,
StartingDate = request.Unit.StartingDate
};
Datas.Instance.DataStorage.Units.Add(item);
request.Unit.Id = item.Id;
}
UnitsResponse response = new UnitsResponse();
response.Units.Add(request.Unit);
return response;
}
开发者ID:Csluikidikilest,项目名称:Bm2sServer,代码行数:35,代码来源:UnitsService.cs
示例7: SetStat
/// <summary>
/// Променя стойност в речника stats по зададените параметри
/// </summary>
/// <param name="unitToSet">В каква мерна единица е зададеното число</param>
/// <param name="value">Самото число което задаваме</param>
public void SetStat(Units unitToSet, double value)
{
foreach (Units unit in UnitS.Array)
{
stats[unit].Value = value * (stats[unitToSet].Modifier / stats[unit].Modifier);
}
}
开发者ID:nikibobi,项目名称:AstroPhysics,代码行数:12,代码来源:Stats.cs
示例8: BackendlessGeoQuery
public BackendlessGeoQuery(double latitude, double longitude, double radius, Units units)
{
Latitude = latitude;
Longitude = longitude;
Radius = radius;
Units = units;
PageSize = 100;
}
开发者ID:fturner19,项目名称:Unity-SDK,代码行数:8,代码来源:BackendlessGeoQuery.cs
示例9: SlamEffect
public SlamEffect(Units.MainCharacter performer)
{
AddChild(new SwordStrikeEffect(performer,
0.3f, 0.47f, new TextureFromFile("Models/Effects/SlamFire1.png"), -10f)
{
OrientationRelation = OrientationRelation.Absolute
});
}
开发者ID:ChristianMarchiori,项目名称:DeadMeetsLead,代码行数:8,代码来源:SlamEffect.cs
示例10: AreaSettings
public AreaSettings(Units units, float top, float left, float bottom, float right)
{
_units = units;
_top = top;
_left = left;
_bottom = bottom;
_right = right;
}
开发者ID:wralex,项目名称:MyRepository,代码行数:8,代码来源:AreaSettings.cs
示例11: BuildGeometry
/// <summary>
/// Builds marble geometry
/// </summary>
private void BuildGeometry( Units.Metres radius )
{
DestroyGeometry( );
Graphics.Draw.StartCache( );
Graphics.Draw.Sphere( null, Point3.Origin, ( float )radius.ToAstroRenderUnits, 20, 20 );
m_Geometry = Graphics.Draw.StopCache( );
m_GeometryRadius = radius;
}
开发者ID:johann-gambolputty,项目名称:robotbastards,代码行数:12,代码来源:AbstractSpherePlanetMarbleRenderer.cs
示例12: Convert
public static Amount Convert(Amount amount, Units toUnit)
{
var ret = new Amount();
ret.Unit = toUnit;
ret.SizeLow = amount.SizeLow.HasValue ? (float?)Convert(amount.SizeLow.Value, amount.Unit, toUnit) : null;
ret.SizeHigh = Convert(amount.SizeHigh, amount.Unit, toUnit);
return ret;
}
开发者ID:Team-Makev-High-Quality-Code,项目名称:TEAM--MAKEB--High-Quality-Code-Team-Project,代码行数:9,代码来源:UnitConverter.cs
示例13: DistanceBetweenPlaces
/// <summary>
/// Calculate the distance between two places.
/// </summary>
/// <param name="lat1"></param>
/// <param name="lon1"></param>
/// <param name="lat2"></param>
/// <param name="lon2"></param>
/// <param name="unit"></param>
/// <returns></returns>
public static double DistanceBetweenPlaces(double lat1, double lon1, double lat2, double lon2, Units unit)
{
double dlon = Radians(lon2 - lon1);
double dlat = Radians(lat2 - lat1);
double a = (Math.Sin(dlat / 2) * Math.Sin(dlat / 2)) + Math.Cos(Radians(lat1)) * Math.Cos(Radians(lat2)) * (Math.Sin(dlon / 2) * Math.Sin(dlon / 2));
double angle = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
double distance = (angle * RADIO) * (unit == Units.Miles ? 0.62137 : 1);
return distance;
}
开发者ID:ankit-defacto,项目名称:PSS,代码行数:19,代码来源:DistanceAlgorithm.cs
示例14: Delete
public UnitsResponse Delete(Units request)
{
Bm2s.Data.Common.BLL.Parameter.Unit item = Datas.Instance.DataStorage.Units[request.Unit.Id];
item.EndingDate = DateTime.Now;
Datas.Instance.DataStorage.Units[item.Id] = item;
UnitsResponse response = new UnitsResponse();
response.Units.Add(request.Unit);
return response;
}
开发者ID:Csluikidikilest,项目名称:Bm2sServer,代码行数:10,代码来源:UnitsService.cs
示例15: IngredientForm
public IngredientForm(Guid formId, Guid ingredientId, Units unitType, string displayName, string unitName, int conversionMultiplier, Amount amount)
{
this.FormId = formId;
this.IngredientId = ingredientId;
this.FormUnitType = unitType;
this.FormDisplayName = displayName;
this.FormUnitName = unitName;
this.ConversionMultiplier = conversionMultiplier;
this.FormAmount = amount;
}
开发者ID:Team-Makev-High-Quality-Code,项目名称:TEAM--MAKEB--High-Quality-Code-Team-Project,代码行数:10,代码来源:IngredientForm.cs
示例16: IngredientForm
public IngredientForm(Guid formid, Guid ingredientid, Units unittype, string displayname, string unitname, int convmultiplier, Amount amount)
{
FormId = formid;
IngredientId = ingredientid;
FormUnitType = unittype;
FormDisplayName = displayname;
FormUnitName = unitname;
ConversionMultiplier = convmultiplier;
FormAmount = amount;
}
开发者ID:relimited,项目名称:core,代码行数:10,代码来源:IngredientForm.cs
示例17: ToSec
public double ToSec(double value, Units unit)
{
switch (unit)
{
case Units.Day:
return value * 60 * 60 * 24;
default:
throw new Exception("Uncorrect cast to SI");
}
}
开发者ID:ReginaGaraeva,项目名称:DiplomaWPF,代码行数:10,代码来源:Converter.cs
示例18: ToKG
public double ToKG(double value, Units unit)
{
switch (unit)
{
case Units.T:
return value * 1000;
default:
throw new Exception("Uncorrect cast to SI");
}
}
开发者ID:ReginaGaraeva,项目名称:DiplomaWPF,代码行数:10,代码来源:Converter.cs
示例19: continuousRotation
public double continuousRotation(double x, Units unit, string indexer)
{
if(!continousRotationStrategies.ContainsKey(indexer))
continousRotationStrategies[indexer] = new ContinuesRotationStrategy(unit);
var strategy = continousRotationStrategies[indexer];
strategy.Update(x);
return strategy.Out;
}
开发者ID:NoxWings,项目名称:FreePIE,代码行数:10,代码来源:FilterHelper.cs
示例20: setAngle
/// <summary>
/// Sets the value and units of the angle.
/// </summary>
/// <param name="angularValue">The value for the angle.</param>
/// <param name="angularUnits">The units for the angle.</param>
public void setAngle(double angularValue, Units.Angular angularUnits)
{
if (angularUnits == Units.Angular.Radians)
{
_angularValue = angularValue * radToDeg;
}
else
{
_angularValue = angularValue;
}
}
开发者ID:everyscape,项目名称:Utilities,代码行数:16,代码来源:Angle.cs
注:本文中的Units类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论