工具,比如Reflector做出相当简单。你甚至可以使用.NET Framework的一部分附带的ILDASM。
您可以使用这两种工具之一加载主互操作程序集。反射器示出了C#源为:
public enum WdCollapseDirection
{
wdCollapseEnd,
wdCollapseStart
}
由于它们没有明确的值,wdCollapseEnd
是0和wdCollapseStart
是1.我们可以与IL视图确认:
.class public auto ansi sealed WdCollapseDirection
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseEnd = int32(0)
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseStart = int32(1)
}
ILDASM示出了这一点:
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseEnd = int32(0x00000000)
如果您有像Resharper这样的工具,请按照以下步骤操作:Ctrl + 上。问从Visual Studio中直接显示了这一点:
你可以有一个虚拟的项目,你可以用它来查找值。
作为附加选项,如果你使用LINQPad你可以引用字主Interop大会(的Microsoft.Office.Interop.Word - 应在GAC),并运行此:
void Main()
{
var value = (int) Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseStart;
Console.Out.WriteLine("value = {0}", value);
}
谢谢,看起来像这比我想象的要容易。 – ollifant