本文整理汇总了C#中Sides类的典型用法代码示例。如果您正苦于以下问题:C# Sides类的具体用法?C# Sides怎么用?C# Sides使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sides类属于命名空间,在下文中一共展示了Sides类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Blecki,项目名称:CCDC,代码行数:33,代码来源:BorderLayout.cs
示例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;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:7,代码来源:Logo.cs
示例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;
}
开发者ID:klockwurk,项目名称:golden_bullet,代码行数:9,代码来源:PickUppable.cs
示例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;
}
开发者ID:sakujyo,项目名称:DanmakuShootingGameSample,代码行数:11,代码来源:Bullet.cs
示例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);
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:9,代码来源:Grip.cs
示例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)
};
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:15,代码来源:Synthetic.cs
示例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);
}
开发者ID:CatSkald,项目名称:Roguelike,代码行数:11,代码来源:SidesTests.cs
示例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();
}
开发者ID:Novaelum,项目名称:CastleKings2.0,代码行数:15,代码来源:Orc.cs
示例9: MoveAllofOneSide
public bool MoveAllofOneSide(Sides side)
{
return true;
}
开发者ID:KellanHiggins,项目名称:BlockGame,代码行数:4,代码来源:MoveSidesProcessor.cs
示例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());
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:17,代码来源:MarketDepthGenerator.cs
示例11: ToStockSharp
public static QuoteChange ToStockSharp(this double[] vp, Sides side)
{
return new QuoteChange(side, (decimal)vp[0], (decimal)vp[1]);
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:4,代码来源:Extensions.cs
示例12: ResetSlicing
public void ResetSlicing()
{
sideStatus = Sides.None;
}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:4,代码来源:Logo.cs
示例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;
}
开发者ID:alexdap83,项目名称:mysampleapplication,代码行数:13,代码来源:MainFormManagement.cs
示例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;
}
}
开发者ID:azturner,项目名称:Rock,代码行数:28,代码来源:ScanningPage.xaml.cs
示例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);
}
开发者ID:RakotVT,项目名称:StockSharp,代码行数:16,代码来源:QuikTrader.cs
示例16: OnTradeReply
private void OnTradeReply(Modes mode, long tradeId, long orderId, string classCode, string secCode, double price, int balance, int volume, Sides side)
{
this.AddDebugLog("Trade: Mode {0} tradeId {1} orderId {2} classCode {3} secCode {4} price {5} balance {6} volume {7} side {8}", mode, tradeId, orderId, classCode, secCode, price, balance, volume, side);
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:4,代码来源:QuikTrans2QuikAdapter.cs
示例17: OnOrderReply
private void OnOrderReply(Modes mode, uint transId, long orderId, string classCode, string secCode, double price, int balance, int volume, Sides side, OrderStates state)
{
this.AddDebugLog("Order: Mode {0} transId {1} orderId {2} classCode {3} secCode {4} price {5} balance {6} volume {7} side {8} state {9}", mode, transId, orderId, classCode, secCode, price, balance, volume, side, state);
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:4,代码来源:QuikTrans2QuikAdapter.cs
示例18: GetCheckImage
/// <summary>
/// Gets the check image.
/// </summary>
/// <param name="side">The side.</param>
/// <returns></returns>
private BitmapImage GetCheckImage( Sides side )
{
ImageColorType colorType = RockConfig.Load().ImageColorType;
int imageByteCount;
imageByteCount = rangerScanner.GetImageByteCount( (int)side, (int)colorType );
byte[] imageBytes = new byte[imageByteCount];
// create the pointer and assign the Ranger image address to it
IntPtr imgAddress = new IntPtr( rangerScanner.GetImageAddress( (int)side, (int)colorType ) );
// Copy the bytes from unmanaged memory to managed memory
Marshal.Copy( imgAddress, imageBytes, 0, imageByteCount );
BitmapImage bitImage = new BitmapImage();
bitImage.BeginInit();
bitImage.StreamSource = new MemoryStream( imageBytes );
bitImage.EndInit();
return bitImage;
}
开发者ID:Ganon11,项目名称:Rock,代码行数:27,代码来源:BatchPage.xaml.cs
示例19: OffsetFrom
/// <summary>
/// Offsets position of component relative to another component.
/// </summary>
/// <param name="component">Component to offset against.</param>
/// <param name="side">The side of the component to offset from.</param>
/// <param name="distance">Distance between offset components.</param>
public void OffsetFrom(BaseScreenComponent component, Sides side, int distance)
{
// Exit if invalid offset
if (component == null || side == Sides.None)
return;
// Get rectangles
Rect myRect = Rectangle;
Rect otherRect = component.Rectangle;
// Offset based on side
switch (side)
{
case Sides.Left:
position.x = otherRect.xMin - distance - myRect.width;
break;
case Sides.Right:
position.x = otherRect.xMax + distance;
break;
case Sides.Top:
position.y = otherRect.yMin - distance - myRect.height;
break;
case Sides.Bottom:
position.y = otherRect.yMax + distance;
break;
}
}
开发者ID:Nystul-the-Magician,项目名称:daggerfall-unity,代码行数:33,代码来源:BaseScreenComponent.cs
示例20: GetQuoteIndex
private int GetQuoteIndex(Sides direction, int depthLevel)
{
var isBidsOnTop = IsBidsOnTop;
if (direction == Sides.Buy)
return isBidsOnTop ? MaxDepth - 1 - depthLevel : MaxDepth + depthLevel;
else
return isBidsOnTop ? MaxDepth + depthLevel : MaxDepth - 1 - depthLevel;
}
开发者ID:vikewoods,项目名称:StockSharp,代码行数:9,代码来源:MarketDepthControl.xaml.cs
注:本文中的Sides类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论