本文整理汇总了C#中Security类的典型用法代码示例。如果您正苦于以下问题:C# Security类的具体用法?C# Security怎么用?C# Security使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Security类属于命名空间,在下文中一共展示了Security类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGroup
public override void CreateGroup(EngineRequest request, Security.Group group)
{
CheckInitialization();
Logger.Storage.Debug("Creating group: " + group.GroupName + "...");
EngineMethods.CreateGroup act = new EngineMethods.CreateGroup(request, group);
act.Execute();
}
示例2: DownloadGroup
public DownloadGroup(IDatabase db, Security.Group group,
int sendTimeout, int receiveTimeout, int sendBufferSize, int receiveBufferSize)
: base(sendTimeout, receiveTimeout, sendBufferSize, receiveBufferSize)
{
_db = db;
_group = group;
}
示例3: OpenMarketDepthCommand
public OpenMarketDepthCommand(Security security)
{
if (security == null)
throw new ArgumentNullException(nameof(security));
Security = security;
}
示例4: Pips
/// <summary>
/// To create from <see cref="Decimal"/> the pips values.
/// </summary>
/// <param name="value"><see cref="Decimal"/> value.</param>
/// <param name="security">The instrument from which information about the price increment is taken .</param>
/// <returns>Pips.</returns>
public static Unit Pips(this decimal value, Security security)
{
if (security == null)
throw new ArgumentNullException(nameof(security));
return new Unit(value, UnitTypes.Step, type => GetTypeValue(security, type));
}
示例5: TestSecure
protected override void TestSecure(Security config)
{
base.TestSecure(config);
var full = new[] { Operation.Read, Operation.Write, Operation.Execute };
config.GrantAdministrator(this.ObjectType, full);
}
示例6: PublishMarketDataNullSecurityTest
public bool PublishMarketDataNullSecurityTest(Security data)
{
DataReceived = null;
base._onNewSecurityTicksEvent = DataProcessingHandler;
PublishMarketData(data);
return (null == DataReceived);
}
示例7: GenerateMarginCallOrder
/// <summary>
/// Generates a new order for the specified security taking into account the total margin
/// used by the account. Returns null when no margin call is to be issued.
/// </summary>
/// <param name="security">The security to generate a margin call order for</param>
/// <param name="netLiquidationValue">The net liquidation value for the entire account</param>
/// <param name="totalMargin">The totl margin used by the account in units of base currency</param>
/// <returns>An order object representing a liquidation order to be executed to bring the account within margin requirements</returns>
public override SubmitOrderRequest GenerateMarginCallOrder(Security security, decimal netLiquidationValue, decimal totalMargin)
{
if (totalMargin <= netLiquidationValue)
{
return null;
}
var forex = (Forex)security;
// we haven't begun receiving data for this yet
if (forex.Price == 0m || forex.QuoteCurrency.ConversionRate == 0m)
{
return null;
}
// compute the amount of quote currency we need to liquidate in order to get within margin requirements
decimal delta = (totalMargin - netLiquidationValue)/forex.QuoteCurrency.ConversionRate;
// compute the number of shares required for the order, rounding up
int quantity = (int) Math.Round(delta/security.Price, MidpointRounding.AwayFromZero);
// don't try and liquidate more share than we currently hold
quantity = Math.Min((int)security.Holdings.AbsoluteQuantity, quantity);
if (security.Holdings.IsLong)
{
// adjust to a sell for long positions
quantity *= -1;
}
return new SubmitOrderRequest(OrderType.Market, security.Type, security.Symbol, quantity, 0, 0, security.LocalTime.ConvertToUtc(security.Exchange.TimeZone), "Margin Call");
}
示例8: acceptButton_Click
protected void acceptButton_Click(object sender, EventArgs e)
{
try
{
if (this.IsValid)
{
List<string> persAdded = new List<string>();
foreach (ListItem it in permisos_CBList.Items)
{
if (it.Selected == true)
{
persAdded.Add(it.Text);
it.Selected = false;
}
}
AdministradordeSistema admin = new AdministradordeSistema();//tmp-> deberia ser quien este logeado!
Security sec = new Security();
long centro = sec.getCentroId(centros.Text);
admin.crearRol(descripcion_TB.Text, persAdded, centro);
Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", "alert('Rol Guardado')", true);
LimpiarPage();
}
}
catch (Exception err)
{
Session["Error_Msg"] = err.Message;
Response.Redirect("~/Error.aspx", true);
}
}
示例9: HistoryCandlesWindow
public HistoryCandlesWindow(Security security)
{
if (security == null)
throw new ArgumentNullException("security");
_security = security;
InitializeComponent();
Title = _security.Code + LocalizedStrings.Str3747;
TimeFramePicker.ItemsSource = new[]
{
TimeSpan.FromMinutes(1),
TimeSpan.FromMinutes(5),
TimeSpan.FromMinutes(15),
TimeSpan.FromMinutes(60),
TimeSpan.FromDays(1),
TimeSpan.FromDays(7),
TimeSpan.FromTicks(TimeHelper.TicksPerMonth)
};
TimeFramePicker.SelectedIndex = 1;
DateFromPicker.Value = DateTime.Today.AddDays(-7);
DateToPicker.Value = DateTime.Today;
var area = new ChartArea();
_candlesElem = new ChartCandleElement();
area.Elements.Add(_candlesElem);
Chart.Areas.Add(area);
}
示例10: Points
/// <summary>
/// To create from <see cref="Decimal"/> the points values.
/// </summary>
/// <param name="value"><see cref="Decimal"/> value.</param>
/// <param name="security">The instrument from which information about the price increment cost is taken .</param>
/// <returns>Points.</returns>
public static Unit Points(this decimal value, Security security)
{
if (security == null)
throw new ArgumentNullException("security");
return new Unit(value, UnitTypes.Point, type => GetTypeValue(security, type));
}
示例11: Fill
/********************************************************
* CLASS PROPERTIES
*********************************************************/
/********************************************************
* CLASS METHODS
*********************************************************/
/// <summary>
/// Perform neccessary check to see if the model has been filled, appoximate the best we can.
/// </summary>
/// <param name="vehicle">Asset we're working with</param>
/// <param name="order">Order class to check if filled.</param>
/// <returns>OrderEvent packet with the full or partial fill information</returns>
/// <seealso cref="OrderEvent"/>
/// <seealso cref="Order"/>
public virtual OrderEvent Fill(Security vehicle, Order order)
{
var fill = new OrderEvent(order);
try
{
switch (order.Type)
{
case OrderType.Limit:
fill = LimitFill(vehicle, order);
break;
case OrderType.StopMarket:
fill = StopFill(vehicle, order);
break;
case OrderType.Market:
fill = MarketFill(vehicle, order);
break;
}
}
catch (Exception err)
{
Log.Error("Forex.ForexTransactionModel.Fill(): " + err.Message);
}
return fill;
}
示例12: ProcessSecurity
public bool ProcessSecurity(Security data)
{
// See FR5 for more info
if (EnableThirdPartyDelay)
Thread.Sleep(ProcessDelayInMilliseconds);
return true;
}
示例13: GXDLMSChipperingStream
/// <summary>
/// Constructor.
/// </summary>
/// <param name="security">Used security level.</param>
/// <param name="encrypt"></param>
/// <param name="blockCipherKey"></param>
/// <param name="aad"></param>
/// <param name="iv"></param>
/// <param name="tag"></param>
public GXDLMSChipperingStream(Security security, bool encrypt, byte[] blockCipherKey, byte[] aad, byte[] iv, byte[] tag)
{
this.Security = security;
const int TagSize = 0x10;
this.Tag = tag;
if (this.Tag == null)//Tag size is 12 bytes.
{
this.Tag = new byte[12];
}
else if (this.Tag.Length != 12)
{
throw new ArgumentOutOfRangeException("Invalid tag.");
}
Encrypt = encrypt;
WorkingKey = GenerateKey(true, blockCipherKey);
int bufLength = Encrypt ? BlockSize : (BlockSize + TagSize);
this.bufBlock = new byte[bufLength];
Aad = aad;
this.H = new byte[BlockSize];
ProcessBlock(H, 0, H, 0);
Init(H);
this.J0 = new byte[16];
Array.Copy(iv, 0, J0, 0, iv.Length);
this.J0[15] = 0x01;
this.S = GetGHash(Aad);
this.counter = (byte[]) J0.Clone();
this.BytesRemaining = 0;
this.totalLength = 0;
}
示例14: LookupSecuritiesCommand
public LookupSecuritiesCommand(Security criteria)
{
if (criteria == null)
throw new ArgumentNullException(nameof(criteria));
Criteria = criteria;
}
示例15: Updateuerpwd
/// <summary>
/// 更新登入者密碼
/// </summary>
/// <returns>bool</returns>
private bool Updateuerpwd(string pwd)
{
bool success = false;
Security sec = new Security();
success = sec.Updateuserpwd(Session["UserID"].ToString(), pwd);
return success;
}