本文整理汇总了C#中PackageDescriptor.GetActiveMethods方法的典型用法代码示例。如果您正苦于以下问题:C# PackageDescriptor.GetActiveMethods方法的具体用法?C# PackageDescriptor.GetActiveMethods怎么用?C# PackageDescriptor.GetActiveMethods使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageDescriptor
的用法示例。
在下文中一共展示了PackageDescriptor.GetActiveMethods方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneratePackage
public void GeneratePackage(IProject project, PackageDescriptor pd)
{
string name = MakeIDName(pd.PackageName, pd);
string fname = MakeVHDSourceFileName(name);
string path = project.AddFile(fname);
project.AddFileAttribute(fname, pd);
if (pd.Library != null)
project.SetFileLibrary(fname, pd.Library);
MemoryStream ms = new MemoryStream();
StreamWriter sw = new StreamWriter(ms);
IndentedTextWriter tw = new IndentedTextWriter(sw, " ");
ClearDependencies();
tw.WriteLine("package " + name + " is");
tw.Indent++;
GenerateTypeDecls(pd, tw);
foreach (MethodDescriptor md in pd.GetActiveMethods())
{
GenerateMethodDecl(md, tw);
}
foreach (FieldDescriptor fd in pd.GetConstants())
{
DeclareField(fd, tw);
}
tw.Indent--;
tw.WriteLine("end;");
tw.WriteLine();
tw.WriteLine("package body " + name + " is");
tw.Indent++;
foreach (MethodDescriptor md in pd.GetActiveMethods())
{
GenerateMethodImpl(md, tw);
tw.WriteLine();
}
tw.Indent--;
tw.WriteLine("end package body;");
tw.Flush();
sw = new StreamWriter(path);
tw = new IndentedTextWriter(sw, " ");
CreateFileHeader(new GeneratorInfo(name), tw);
GenerateDependencies(pd, tw);
tw.Flush();
ms.Seek(0, SeekOrigin.Begin);
ms.CopyTo(sw.BaseStream);
ms.Close();
tw.Close();
sw.Close();
}