当前位置: 首页>>代码示例>>C#>>正文


C# Variable.GetCodeType方法代码示例

本文整理汇总了C#中Variable.GetCodeType方法的典型用法代码示例。如果您正苦于以下问题:C# Variable.GetCodeType方法的具体用法?C# Variable.GetCodeType怎么用?C# Variable.GetCodeType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Variable的用法示例。


在下文中一共展示了Variable.GetCodeType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WrongCodeTypeException

 /// <summary>
 /// Initializes a new instance of the <see cref="WrongCodeTypeException" /> class.
 /// </summary>
 /// <param name="variable">The variable.</param>
 /// <param name="argumentName">Name of the argument.</param>
 /// <param name="expectedText">The expected text.</param>
 public WrongCodeTypeException(Variable variable, string argumentName, string expectedText)
     : base(string.Format("Wrong code type [{0}] of passed parameter '{1}'. Expected {2}.", variable.GetCodeType().Name, argumentName, expectedText))
 {
     Variable = variable;
     CodeType = variable.GetCodeType();
     ArgumentName = argumentName;
 }
开发者ID:southpolenator,项目名称:WinDbgCs,代码行数:13,代码来源:WrongCodeTypeException.cs

示例2: CodeFunction

 /// <summary>
 /// Initializes a new instance of the <see cref="CodeFunction"/> class.
 /// </summary>
 /// <param name="variable">The variable.</param>
 public CodeFunction(Variable variable)
     : this(variable.GetPointerAddress(), variable.GetCodeType().Module.Process)
 {
     // Verify code type
     if (!VerifyCodeType(variable.GetCodeType()))
     {
         throw new WrongCodeTypeException(variable, nameof(variable), "function");
     }
 }
开发者ID:southpolenator,项目名称:WinDbgCs,代码行数:13,代码来源:CodeFunction.cs

示例3: ClrString

        /// <summary>
        /// Initializes a new instance of the <see cref="ClrString"/> class.
        /// </summary>
        /// <param name="variable">The variable.</param>
        public ClrString(Variable variable)
            : base(variable)
        {
            // Check if code type is string type
            ClrCodeType codeType = variable.GetCodeType() as ClrCodeType;

            if (codeType == null || !codeType.ClrType.IsString)
            {
                throw new WrongCodeTypeException(variable.GetCodeType(), nameof(variable), "System.String");
            }
        }
开发者ID:southpolenator,项目名称:WinDbgCs,代码行数:15,代码来源:ClrString.cs

示例4: ClrException

        /// <summary>
        /// Initializes a new instance of the <see cref="ClrException"/> class.
        /// </summary>
        /// <param name="variable">The variable.</param>
        public ClrException(Variable variable)
            : base(variable)
        {
            // Check if code type is exception type
            ClrCodeType codeType = variable.GetCodeType() as ClrCodeType;
            bool found = false;

            while (!found && codeType != null)
            {
                if (codeType.Name == "System.Exception")
                {
                    found = true;
                }
                else
                {
                    codeType = (ClrCodeType)codeType.InheritedClass;
                }
            }

            if (!found)
            {
                throw new WrongCodeTypeException(variable.GetCodeType(), nameof(variable), "System.Exception");
            }
        }
开发者ID:southpolenator,项目名称:WinDbgCs,代码行数:28,代码来源:ClrException.cs


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