• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Security类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Security的典型用法代码示例。如果您正苦于以下问题:C# Security类的具体用法?C# Security怎么用?C# Security使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Security类属于命名空间,在下文中一共展示了Security类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
 }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:7,代码来源:Engine.cs


示例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;
 }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:7,代码来源:DownloadGroup.cs


示例3: OpenMarketDepthCommand

		public OpenMarketDepthCommand(Security security)
		{
			if (security == null)
				throw new ArgumentNullException(nameof(security));

			Security = security;
		}
开发者ID:zjxbetter,项目名称:StockSharp,代码行数:7,代码来源:OpenMarketDepthCommand.cs


示例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));
		}
开发者ID:zjxbetter,项目名称:StockSharp,代码行数:13,代码来源:UnitHelper.cs


示例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);
        }
开发者ID:whesius,项目名称:allors,代码行数:7,代码来源:Organisations.cs


示例6: PublishMarketDataNullSecurityTest

 public bool PublishMarketDataNullSecurityTest(Security data)
 {
     DataReceived = null;
     base._onNewSecurityTicksEvent = DataProcessingHandler;
     PublishMarketData(data);
     return (null == DataReceived);
 }
开发者ID:showtroylove,项目名称:MarketDataConsumer,代码行数:7,代码来源:MarketDataReaderTests.cs


示例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");
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:38,代码来源:ForexMarginModel.cs


示例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);
        }
    }
开发者ID:npvb,项目名称:teleton,代码行数:32,代码来源:Crear_Roles.aspx.cs


示例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);
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:31,代码来源:HistoryCandlesWindow.xaml.cs


示例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));
		}
开发者ID:hbwjz,项目名称:StockSharp,代码行数:13,代码来源:UnitHelper.cs


示例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;
        }
开发者ID:intelliBrain,项目名称:Lean,代码行数:39,代码来源:ForexTransactionModel.cs


示例12: ProcessSecurity

 public bool ProcessSecurity(Security data)
 {
     // See FR5 for more info
     if (EnableThirdPartyDelay)
         Thread.Sleep(ProcessDelayInMilliseconds);
     return true;
 }
开发者ID:showtroylove,项目名称:MarketDataConsumer,代码行数:7,代码来源:ThirdPartyDelayProcessor.cs


示例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;
 }
开发者ID:skycod,项目名称:Gurux.DLMS.Net,代码行数:38,代码来源:GXDLMSChipperingStream.cs


示例14: LookupSecuritiesCommand

		public LookupSecuritiesCommand(Security criteria)
		{
			if (criteria == null)
				throw new ArgumentNullException(nameof(criteria));

			Criteria = criteria;
		}
开发者ID:zjxbetter,项目名称:StockSharp,代码行数:7,代码来源:LookupSecuritiesCommand.cs


示例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;
 }
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:11,代码来源:App_Web_1rj3kqul.1.cs


示例16: OnMarketDataClosedEventUnknownProviderEOFTest

 public void OnMarketDataClosedEventUnknownProviderEOFTest()
 {
     var data = new Security("Mazaya", Miscellaneous.END_OF_FEED, 0D);
     base._onNewSecurityTicksEvent = DataProcessingHandler;
     OnMarketClosedEvent(data);
     Assert.Pass("These test method provide code coverage for the unit being tested.");
 }
开发者ID:showtroylove,项目名称:MarketDataConsumer,代码行数:7,代码来源:MarketDataReaderTests.cs


示例17: loginButton_Click

    protected void loginButton_Click( object sender , EventArgs e )
    {
        dbModule dm = new dbModule();
        pbModule pm = new pbModule();
        string uCode = ucodeTextbox.Text.Trim();
        string uPass = upassTextbox.Text.Trim();
        if ( !pm.isValidString( uCode) || !pm.isValidString( uPass ) )
        {
            errors.Text = Resources.Resource.strNotValidString;
            return;
        }
        int result = dm.adminLogin( uCode , uPass );
        switch ( result )
        {
            case -1 :
                errors.Text = Resources.Resource.strWrongPasswordString;
                break;
            case 0:
                errors.Text = Resources.Resource.strWrongUsernameString;
                break;
            case 1:

                Security s = new Security();
                s.setSecurity( priCode.xtgly );
                s.setUserCode(ucodeTextbox.Text.Trim());
                s.setUserName( dm.getUnameByUcode(uCode, priCode.xtgly ) );
                Session["sec"] = s;
                Session["usercode"] = s.getUserCode();
                Response.Redirect( "adminDefault.aspx" );
                break;
            default:
                errors.Text = Resources.Resource.strDuplicateUserNameString;
                break;
        }
    }
开发者ID:zhouxin262,项目名称:SyxkWebSource,代码行数:35,代码来源:adminlogin.aspx.cs


示例18: TryAddToCache

        private void TryAddToCache(Security security)
        {
            if (security == null)
                throw new ArgumentNullException("security");

            _cacheById.SafeAdd(security.Id, key => security);
        }
开发者ID:KazaiMazai,项目名称:WL-Source-for-StockSharp-Hydra,代码行数:7,代码来源:WLSecurityStorage.cs


示例19: Transition

        public Model.Document Transition(Security.User user)
        {
            Model.Document doc = new Model.Document();
            JArray jarray = null;

            try
            {
                doc.Id = user.Id;
                if (user.Rev != null)
                    doc.Rev = user.Rev;
                doc["Type"] = "user";
                doc["Password"] = user.Password;
                doc["FirstName"] = user.FirstName;
                doc["MiddleName"] = user.MiddleName;
                doc["LastName"] = user.LastName;
                doc["Superuser"] = user.IsSuperuser;

                if (user.Groups != null)
                {
                    jarray = new JArray();
                    for (int i = 0; i < user.Groups.Count; i++)
                        jarray.Add(user.Groups[i]);
                }

                doc["Groups"] = jarray;
            }
            catch (Exception e)
            {
                Logger.Storage.Error("An exception occurred while attempting to parse the user.", e);
                throw;
            }

            return doc;
        }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:34,代码来源:User.cs


示例20: Page_Load

	protected void Page_Load(object sender, EventArgs e)
	{
		if (Request.QueryString["p"] != null)
		{
			Security sec = new Security();
			sec = GetPagePermit(Request.QueryString["p"].Trim());
			if (sec != null)
			{
				authString = "var pagePermit = { " +
							" enableBrowser : " + sec.EnableBrowser.ToString().ToLower() + ", " +
							" enableQuery : " + sec.EnableQuery.ToString().ToLower() + ", " +
							" enableAdd : " + sec.EnableAdd.ToString().ToLower() + ", " +
							" enableEdit : " + sec.EnableEdit.ToString().ToLower() + ", " +
							" enableDelete : " + sec.EnableDelete.ToString().ToLower() + ", " +
							" enablePrint : " + sec.EnablePrint.ToString().ToLower() + ", " +
							" enableEditSave : " + sec.EnableEditSave.ToString().ToLower() + ", " +
							" enableNewSave : " + sec.EnableNewSave.ToString().ToLower() + " };";
			}
			else
			{
				//資料庫不存在權限設定,頁面不限定權限
				authString = "var pagePermit = { " +
							" enableBrowser : true, " +
							" enableQuery : true, " +
							" enableAdd : true, " +
							" enableEdit : true, " +
							" enableDelete : true, " +
							" enablePrint : true, " +
							" enableEditSave : true, " +
							" enableNewSave : true };";
			}
		}

		Response.Write(authString);
	}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:35,代码来源:Authority.aspx.cs



注:本文中的Security类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SecurityAction类代码示例发布时间:2022-05-24
下一篇:
C# SecureString类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap