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

C# Handle类代码示例

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

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



Handle类属于命名空间,在下文中一共展示了Handle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AsyncRead

		private void AsyncRead (Handle handle, Result result, byte[] buf,
					ulong bytesRequested, ulong bytesRead)
		{
			if (result == Result.Ok) {
				Array.Copy (buf, 0, buffer, offset + count - bytesRemaining, (int)bytesRead);
				bytesRemaining -= (int)bytesRead;
				if (bytesRemaining > 0) {
					buf = new byte[bytesRemaining];
					Async.Read (handle, out buf[0], (uint)bytesRemaining,
						    new AsyncReadCallback (AsyncRead));
				} else if (cback != null) {
					asyncResult.SetComplete (null, count);
					cback (asyncResult);
				}
			} else if (result == Result.ErrorEof) {
				Array.Copy (buf, 0, buffer, offset + count - bytesRemaining, (int)bytesRead);
				bytesRemaining -= (int)bytesRead;
				asyncResult.SetComplete (null, count - bytesRemaining);
				
				if (cback != null)
					cback (asyncResult);
			} else if (cback != null) {
				Exception e = new IOException (Vfs.ResultToString (result));
				asyncResult.SetComplete (e, -1);
				cback (asyncResult);
			}
		}
开发者ID:directhex,项目名称:xamarin-gnome-sharp2,代码行数:27,代码来源:VfsStream.cs


示例2: CallableBondConstantVolatility

 public CallableBondConstantVolatility(int settlementDays, Calendar calendar, double volatility, DayCounter dayCounter)
    :base(settlementDays, calendar)
 {
    volatility_ = new Handle<Quote>(new SimpleQuote(volatility));
    dayCounter_ = dayCounter;
    maxBondTenor_ = new Period(100,TimeUnit.Years);
 }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:7,代码来源:CallableBondConstantVolatility.cs


示例3: BMAIndex

        public BMAIndex(Handle<YieldTermStructure> h)
            : base("BMA", new Period(1, TimeUnit.Weeks), 1, new USDCurrency(),
				   new UnitedStates(UnitedStates.Market.NYSE), new ActualActual(ActualActual.Convention.ISDA))
        {
            termStructure_ = h;
            h.registerWith(update);
        }
开发者ID:ammachado,项目名称:QLNet,代码行数:7,代码来源:bmaindex.cs


示例4: BlackSwaptionEngine

 public BlackSwaptionEngine(Handle<YieldTermStructure> termStructure,
                          double vol, DayCounter dc )
 {
     termStructure_ = termStructure;
     volatility_ = new Handle<SwaptionVolatilityStructure>(new ConstantSwaptionVolatility(0, new NullCalendar(), BusinessDayConvention.Following, vol, dc));
     termStructure_.registerWith(update);
 }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:7,代码来源:blackswaptionengine.cs


示例5: LocalVolCurve

        public LocalVolCurve(Handle<BlackVarianceCurve> curve)
            : base(curve.link.businessDayConvention(), curve.link.dayCounter())
        {
            blackVarianceCurve_ = curve;

            blackVarianceCurve_.registerWith(update);
        }
开发者ID:akasolace,项目名称:qlnet,代码行数:7,代码来源:LocalVolCurve.cs


示例6: SwaptionHelper

        SwaptionHelper( Date exerciseDate,
            Period length,
            Handle<Quote> volatility,
            IborIndex index,
            Period fixedLegTenor,
            DayCounter fixedLegDayCounter,
            DayCounter floatingLegDayCounter,
            Handle<YieldTermStructure> termStructure,
            CalibrationErrorType errorType = CalibrationErrorType.RelativePriceError,
            double? strike = null,
            double nominal = 1.0)
            : base(volatility, termStructure, errorType)
        {
            exerciseDate_ = exerciseDate;
            endDate_ = null;
            maturity_ = new Period(0,TimeUnit.Days);
            length_ = length;
            fixedLegTenor_ = fixedLegTenor;
            index_ = index;
            fixedLegDayCounter_ = fixedLegDayCounter;
            floatingLegDayCounter_ = floatingLegDayCounter;
            strike_ = strike;
            nominal_ = nominal;

            index_.registerWith( update );
        }
开发者ID:Yenyenx,项目名称:qlnet,代码行数:26,代码来源:swaptionhelper.cs


示例7: BlackScholesMertonProcess

 public BlackScholesMertonProcess(Handle<Quote> x0,
                                  Handle<YieldTermStructure> dividendTS,
                                  Handle<YieldTermStructure> riskFreeTS,
                                  Handle<BlackVolTermStructure> blackVolTS)
     : this(x0, dividendTS, riskFreeTS, blackVolTS, new EulerDiscretization())
 {
 }
开发者ID:akasolace,项目名称:qlnet,代码行数:7,代码来源:BlackScholesProcess.cs


示例8: GetAllocatedBlock

 public Block GetAllocatedBlock(Handle handle)
 {
     Block block;
     if (!_allocatedBlocks.TryGetValue(handle, out block))
         throw new Exception("invalid handle");
     return block;
 }
开发者ID:nachocove,项目名称:JetBlack.Caching,代码行数:7,代码来源:LightweightHeapManager.cs


示例9: MoveHandleAction

 public MoveHandleAction(Handle handle, Session session, PointD oldLocation)
 {
     this.handle = handle;
       this.session = session;
       this.oldLocation = oldLocation;
       this.newLocation = handle.Location;
 }
开发者ID:romanbdev,项目名称:quickroute-gps,代码行数:7,代码来源:MoveHandleAction.cs


示例10: BlackConstantVol

        public BlackConstantVol(int settlementDays, Calendar cal, Handle<Quote> volatility, DayCounter dc)
            : base(settlementDays, cal, BusinessDayConvention.Following, dc)
        {
            volatility_ = volatility;

            volatility_.registerWith(update);
        }
开发者ID:akasolace,项目名称:qlnet,代码行数:7,代码来源:BlackConstantVol.cs


示例11: SetXDataForMainDescription

 public void SetXDataForMainDescription(Handle handle)
 {
     XDataCollection descriptionSignXData = new XDataCollection()
     {
         new XData("skd", 1040, 0),
         new XData("l2p", 1040, barLength),
         new XData("l1p", 1040, barLength),
         new XData("g_d", 1000, signType),
         new XData("kom", 1000, "\u0020"),
         new XData("dds", 1040, scale),
         new XData("typ", 1070, 1),
         new XData("ilp", 1070, barsAmount),
         new XData("ilw", 1070, tiersAmount),
         new XData("sko", 1040, spanStep),
         new XData("sre", 1040, barDiameter),
         new XData(barNumberRecordName, 1000, "bw"),
         new XData(opNumberRecordName, 1000, "bw"),
         new XData("pro", 1000, "sys01-v4"),
         new XData("nop", 1070, operationNumber),
         new XData("npo", 1070, barNumber),
         new XData("zn1", 1000, "bw"),
         new XData("zna", 1000, "zn1")
     };
     SetXData(handle, descriptionSignXData);
 }
开发者ID:anielii,项目名称:Acommands,代码行数:25,代码来源:XDataAdderForReinfBars.cs


示例12: GetHandleOffset

        /// <summary>
        /// Gets the Offset of the text when applying a relativeHandle to a text
        /// </summary>
        /// <param name="relativeHandle">The applied handle.</param>
        /// <param name="text">The given text.</param>
        /// <returns>A Vector2 representing the offset of the handle.</returns>
        /// <remarks>When used on a text, the negative value needs to be used.</remarks>
        public Vector2 GetHandleOffset(Handle relativeHandle, string text)
        {
            Vector2 offset = this.GetDimension(text);

            switch (relativeHandle)
            {
                case Handle.BottomCenter:
                    return new Vector2(offset.X/2, offset.Y);
                case Handle.BottomLeft:
                    return new Vector2(0, offset.Y);
                case Handle.BottomRight:
                    return offset;
                case Handle.MiddleCenter:
                    return offset/2;
                case Handle.MiddleLeft:
                    return new Vector2(0, offset.Y/2);
                case Handle.MiddleRight:
                    return new Vector2(offset.X, offset.Y/2);
                case Handle.TopCenter:
                    return new Vector2(offset.X/2, 0);
                case Handle.TopRight:
                    return new Vector2(offset.X, 0);
                default:
                    return new Vector2();
            }
        }
开发者ID:MaxPlay,项目名称:GameEngine,代码行数:33,代码来源:Font.cs


示例13: ForwardRateAgreement

      // Handle<YieldTermStructure> discountCurve = Handle<YieldTermStructure>());
      public ForwardRateAgreement(Date valueDate, Date maturityDate, Position.Type type, double strikeForwardRate,
                                  double notionalAmount, IborIndex index, Handle<YieldTermStructure> discountCurve)
         : base(index.dayCounter(), index.fixingCalendar(), index.businessDayConvention(), index.fixingDays(), new Payoff(),
                 valueDate, maturityDate, discountCurve) {

         fraType_ = type;
         notionalAmount_ = notionalAmount;
         index_ = index;

         if (notionalAmount <= 0.0)
            throw new ApplicationException("notional Amount must be positive");

         // do I adjust this ?
         // valueDate_ = calendar_.adjust(valueDate_,businessDayConvention_);
         Date fixingDate = calendar_.advance(valueDate_, -settlementDays_, TimeUnit.Days);
         forwardRate_ = new InterestRate(index.fixing(fixingDate), index.dayCounter(), Compounding.Simple, Frequency.Once);
         strikeForwardRate_ = new InterestRate(strikeForwardRate, index.dayCounter(), Compounding.Simple, Frequency.Once);
         double strike = notionalAmount_ * strikeForwardRate_.compoundFactor(valueDate_, maturityDate_);
         payoff_ = new ForwardTypePayoff(fraType_, strike);
         // incomeDiscountCurve_ is irrelevant to an FRA
         incomeDiscountCurve_ = discountCurve_;
         // income is irrelevant to FRA - set it to zero
         underlyingIncome_ = 0.0;
         
         index_.registerWith(update);
      }
开发者ID:akasolace,项目名称:qlnet,代码行数:27,代码来源:forwardrateagreement.cs


示例14: clone

        public virtual SwapIndex clone(Handle<YieldTermStructure> forwarding)
        {
            if (exogenousDiscount_)
            {
                return new SwapIndex(familyName(),
                                     tenor(),
                                     fixingDays(),
                                     currency(),
                                     fixingCalendar(),
                                     fixedLegTenor(),
                                     fixedLegConvention(),
                                     dayCounter(),
                                     iborIndex_.clone(forwarding),
                                     discount_);
            }

            return new SwapIndex(familyName(),
                                 tenor(),
                                 fixingDays(),
                                 currency(),
                                 fixingCalendar(),
                                 fixedLegTenor(),
                                 fixedLegConvention(),
                                 dayCounter(),
                                 iborIndex_.clone(forwarding));
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:26,代码来源:Swapindex.cs


示例15: dividendCurve

        public Handle<YieldTermStructure> dividendCurve(Underlying item)
        {
            double riskFreeRate = 0.06;

            var termStructure = new Handle<YieldTermStructure>(new FlatForward(referenceDate_, riskFreeRate, dayCounter_));
            return termStructure;
        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:7,代码来源:CurveSetting.cs


示例16: RuntimeFatMethodParameterInfo

 private RuntimeFatMethodParameterInfo(MethodBase member, MethodHandle methodHandle, int position, ParameterHandle parameterHandle, ReflectionDomain reflectionDomain, MetadataReader reader, Handle typeHandle, TypeContext typeContext)
     : base(member, position, reflectionDomain, reader, typeHandle, typeContext)
 {
     _methodHandle = methodHandle;
     _parameterHandle = parameterHandle;
     _parameter = parameterHandle.GetParameter(reader);
 }
开发者ID:huamichaelchen,项目名称:corert,代码行数:7,代码来源:RuntimeFatMethodParameterInfo.cs


示例17: BlackProcess

 public BlackProcess(Handle<Quote> x0,
                     Handle<YieldTermStructure> riskFreeTS,
                     Handle<BlackVolTermStructure> blackVolTS,
                     IDiscretization1D d)
     : base(x0, riskFreeTS, riskFreeTS, blackVolTS, d)
 {
 }
开发者ID:akasolace,项目名称:qlnet,代码行数:7,代码来源:BlackScholesProcess.cs


示例18: SwapRateHelper

        public SwapRateHelper(Handle<Quote> rate, Period tenor, Calendar calendar,
            Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount,
            IborIndex iborIndex)
            : this(rate, tenor, calendar, fixedFrequency, fixedConvention, fixedDayCount, iborIndex,
		                      	     new Handle<Quote>(), new Period(0, TimeUnit.Days))
        {
        }
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:SwapRateHelper.cs


示例19: DerivedQuote

        public DerivedQuote(Handle<Quote> element, Func<double, double> f)
        {
            element_ = element;
             f_ = f;

             element_.registerWith(this.update);
        }
开发者ID:ammachado,项目名称:QLNet,代码行数:7,代码来源:DerivedQuote.cs


示例20: GetDefaultValueIfAny

        public static bool GetDefaultValueIfAny(MemberType memberType, MetadataReader reader, Handle constantHandle, Type declaredType, IEnumerable<CustomAttributeData> customAttributes, out Object defaultValue)
        {
            if (!(constantHandle.IsNull(reader)))
            {
                defaultValue = ParseMetadataConstant(reader, constantHandle);
                if (declaredType.GetTypeInfo().IsEnum)
                    defaultValue = Enum.ToObject(declaredType, defaultValue);
                return true;
            }

            if (memberType != MemberType.Property)  // the attributes in question cannot be applied to properties.
            {
                // Legacy: If there are multiple default value attribute, the desktop picks one at random (and so do we...)
                foreach (CustomAttributeData cad in customAttributes)
                {
                    Type attributeType = cad.AttributeType;
                    TypeInfo attributeTypeInfo = attributeType.GetTypeInfo();
                    if (attributeTypeInfo.IsSubclassOf(typeof(CustomConstantAttribute)))
                    {
                        CustomConstantAttribute customConstantAttribute = (CustomConstantAttribute)(cad.Instantiate());
                        defaultValue = customConstantAttribute.Value;
                        return true;
                    }
                    if (attributeType.Equals(typeof(DecimalConstantAttribute)))
                    {
                        DecimalConstantAttribute decimalConstantAttribute = (DecimalConstantAttribute)(cad.Instantiate());
                        defaultValue = decimalConstantAttribute.Value;
                        return true;
                    }
                }
            }

            defaultValue = null;
            return false;
        }
开发者ID:tijoytom,项目名称:corert,代码行数:35,代码来源:DefaultValueParser.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# HandleInheritability类代码示例发布时间:2022-05-24
下一篇:
C# HandState类代码示例发布时间: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