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