本文整理汇总了C#中Sides类的典型用法代码示例。如果您正苦于以下问题:C# Sides类的具体用法?C# Sides怎么用?C# Sides使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sides类属于命名空间,在下文中一共展示了Sides类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PositionItem
public Rectangle PositionItem(Sides side, int dim)
{
Rectangle R;
switch (side)
{
case Sides.North:
R = new Rectangle(CoverageArea.X, CoverageArea.Y, CoverageArea.Width, dim);
CoverageArea.Y += dim + Padding; CoverageArea.Height -= dim + Padding;
break;
case Sides.East:
R = new Rectangle(CoverageArea.X + CoverageArea.Width - dim, CoverageArea.Y, dim, CoverageArea.Height);
CoverageArea.Width -= dim + Padding;
break;
case Sides.South:
R = new Rectangle(CoverageArea.X, CoverageArea.Y + CoverageArea.Height - dim, CoverageArea.Width, dim);
CoverageArea.Height -= dim + Padding;
break;
case Sides.West:
R = new Rectangle(CoverageArea.X, CoverageArea.Y, dim, CoverageArea.Height);
CoverageArea.X += dim + Padding; CoverageArea.Width -= dim + Padding;
break;
case Sides.Center:
R = CoverageArea;
CoverageArea = new Rectangle(0, 0, 0, 0);
break;
default :
R = new Rectangle(0, 0, 0, 0);
break;
}
return R;
}
示例2: CheckForSlicing
public void CheckForSlicing(Vector2D start, Vector2D end)
{
if (!sideStatus.HasFlag(Sides.Top) && CheckIfLineIntersectsLine(start, end, DrawArea.TopLeft, DrawArea.TopRight)) sideStatus |= Sides.Top;
if (!sideStatus.HasFlag(Sides.Left) && CheckIfLineIntersectsLine(start, end, DrawArea.TopLeft, DrawArea.BottomLeft)) sideStatus |= Sides.Left;
if (!sideStatus.HasFlag(Sides.Bottom) && CheckIfLineIntersectsLine(start, end, DrawArea.BottomLeft, DrawArea.BottomRight)) sideStatus |= Sides.Bottom;
if (!sideStatus.HasFlag(Sides.Right) && CheckIfLineIntersectsLine(start, end, DrawArea.TopRight, DrawArea.BottomRight)) sideStatus |= Sides.Right;
}
示例3: PickupPackage
// Constructors
public PickupPackage(GameObject body, GameObject brain, string text, bool attachNow, Sides who)
{
Body = body;
Brain = brain;
MessageText = text;
AttachesImmediately = attachNow;
WhoCanPickUp = who;
}
示例4: Bullet
//public Bullet(double x, double y, double vx, double vy) : this(Side.teki, x, y, vx, vy)
//{
//}
public Bullet(Sides side, double x, double y, double vx, double vy)
{
this.side = side; // teki, mikataの区別
this.x = x;
this.y = y;
this.vx = vx;
this.vy = vy;
}
示例5: Grip
internal Grip(int value, int width, int height, Sides side, System.Func<int> getCenterValue, System.Func<int> getMinValue , System.Func<int> getMaxValue)
{
Side = side;
_getCenterValue = getCenterValue;
_getMinValue = getMinValue;
_getMaxValue = getMaxValue;
/*not VALUE property!*/_value = value;
Rectangle = new Rectangle(value, value, width, height);
}
示例6: Position
/// <summary>
/// To get the synthetic position for the option.
/// </summary>
/// <param name="side">The main position direction.</param>
/// <returns>The synthetic position.</returns>
public KeyValuePair<Security, Sides>[] Position(Sides side)
{
var asset = Option.GetUnderlyingAsset(_provider);
return new[]
{
new KeyValuePair<Security, Sides>(asset, Option.OptionType == OptionTypes.Call ? side : side.Invert()),
new KeyValuePair<Security, Sides>(Option.GetOppositeOption(_provider), side)
};
}
示例7: IEquatableMembers_WorksCorrect_IfOneHasSomeDifferentSides
public void IEquatableMembers_WorksCorrect_IfOneHasSomeDifferentSides(params Dir[] emptyDirs)
{
var other = new Sides();
foreach (var dir in emptyDirs)
{
_sides[dir] = Side.Empty;
}
CustomAssert.IEquatableMembersWorkForDifferentObjects(_sides, other);
}
示例8: Start
// Use this for initialization
void Start () {
m_healthTimer = 0;
m_isHealing = true;
m_hasAttacked = false;
m_currentSide = Sides.FRONT;
m_lastSide = Sides.FRONT;
m_animator = GetComponent<Animator>();
m_health = 100;
m_speed = 1.5f;
InitTargetsList();
SelectTarget();
}
示例9: MoveAllofOneSide
public bool MoveAllofOneSide(Sides side)
{
return true;
}
示例10: CreateQuote
/// <summary>
/// To create the quote using random method.
/// </summary>
/// <param name="startPrice">The initial price, based on which a quote price shall be got using random method.</param>
/// <param name="side">The quote direction.</param>
/// <returns>The random quote.</returns>
protected QuoteChange CreateQuote(decimal startPrice, Sides side)
{
var priceStep = SecurityDefinition.PriceStep ?? 0.01m;
var price = startPrice + (side == Sides.Sell ? 1 : -1) * Steps.Next() * priceStep;
if (price <= 0)
price = priceStep;
return new QuoteChange(side, price, Volumes.Next());
}
示例11: ToStockSharp
public static QuoteChange ToStockSharp(this double[] vp, Sides side)
{
return new QuoteChange(side, (decimal)vp[0], (decimal)vp[1]);
}
示例12: ResetSlicing
public void ResetSlicing()
{
sideStatus = Sides.None;
}
示例13: SetSides
private void SetSides(Sides mode, bool autoSave)
{
if (mode == Sides.OneSide && scanProfile.CurrentFeeder == FeederMode.Flatbed &&
scanProfile.CurrentSides == Sides.BothSides)
tempSides = Sides.BothSides;
else
tempSides = null;
SetChecked(barButtonItemOneSide, mode == Sides.OneSide);
SetChecked(barButtonItemBothSides, mode == Sides.BothSides);
SetVisible(barButtonItemBack, mode == Sides.BothSides);
if (autoSave)
scanProfile.CurrentSides = mode;
}
示例14: GetImageBytesFromRanger
/// <summary>
/// Gets the doc image.
/// </summary>
/// <param name="side">The side.</param>
/// <returns></returns>
private byte[] GetImageBytesFromRanger( Sides side )
{
ImageColorType colorType = RockConfig.Load().ImageColorType;
int imageByteCount;
imageByteCount = batchPage.rangerScanner.GetImageByteCount( (int)side, (int)colorType );
if ( imageByteCount > 0 )
{
byte[] imageBytes = new byte[imageByteCount];
// create the pointer and assign the Ranger image address to it
IntPtr imgAddress = new IntPtr( batchPage.rangerScanner.GetImageAddress( (int)side, (int)colorType ) );
// Copy the bytes from unmanaged memory to managed memory
Marshal.Copy( imgAddress, imageBytes, 0, imageByteCount );
return imageBytes;
}
else
{
return null;
}
}
示例15: OnCancelOrders
/// <summary>
/// Отменить группу заявок на бирже по фильтру.
/// </summary>
/// <param name="transactionId">Идентификатор транзакции отмены.</param>
/// <param name="isStopOrder"><see langword="true"/>, если нужно отменить только стоп-заявки, <see langword="false"/> - если только обычный и <see langword="null"/> - если оба типа.</param>
/// <param name="portfolio">Портфель. Если значение равно <see langword="null"/>, то портфель не попадает в фильтр снятия заявок.</param>
/// <param name="direction">Направление заявки. Если значение равно <see langword="null"/>, то направление не попадает в фильтр снятия заявок.</param>
/// <param name="board">Торговая площадка. Если значение равно <see langword="null"/>, то площадка не попадает в фильтр снятия заявок.</param>
/// <param name="security">Инструмент. Если значение равно <see langword="null"/>, то инструмент не попадает в фильтр снятия заявок.</param>
protected override void OnCancelOrders(long transactionId, bool? isStopOrder = null, Portfolio portfolio = null, Sides? direction = null, ExchangeBoard board = null, Security security = null)
{
if (security != null && portfolio != null && security.Type == SecurityTypes.Future && !security.UnderlyingSecurityId.IsEmpty())
base.OnCancelOrders(transactionId, isStopOrder, portfolio, direction, board, security);
else
this.CancelOrders(Orders, isStopOrder, portfolio, direction, board);
}