本文整理汇总了C#中ASCompletion.Model.FileModel.GetPublicClass方法的典型用法代码示例。如果您正苦于以下问题:C# FileModel.GetPublicClass方法的具体用法?C# FileModel.GetPublicClass怎么用?C# FileModel.GetPublicClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASCompletion.Model.FileModel
的用法示例。
在下文中一共展示了FileModel.GetPublicClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitTopLevelElements
/// <summary>
/// Prepare AS2 intrinsic known vars/methods/classes
/// </summary>
protected override void InitTopLevelElements()
{
string filename = "toplevel.as";
topLevel = new FileModel(filename);
// search top-level declaration
foreach(PathModel aPath in classPath)
if (File.Exists(Path.Combine(aPath.Path, filename)))
{
filename = Path.Combine(aPath.Path, filename);
topLevel = GetCachedFileModel(filename);
break;
}
if (File.Exists(filename))
{
// MTASC toplevel-style declaration:
ClassModel tlClass = topLevel.GetPublicClass();
if (!tlClass.IsVoid())
{
topLevel.Members = tlClass.Members;
tlClass.Members = null;
topLevel.Classes = new List<ClassModel>();
}
}
// not found
else
{
//ErrorHandler.ShowInfo("Top-level elements class not found. Please check your Program Settings.");
}
if (topLevel.Members.Search("_root", 0, 0) == null)
topLevel.Members.Add(new MemberModel("_root", docType, FlagType.Variable, Visibility.Public));
if (topLevel.Members.Search("_global", 0, 0) == null)
topLevel.Members.Add(new MemberModel("_global", features.objectKey, FlagType.Variable, Visibility.Public));
if (topLevel.Members.Search("this", 0, 0) == null)
topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable, Visibility.Public));
if (topLevel.Members.Search("super", 0, 0) == null)
topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable, Visibility.Public));
if (topLevel.Members.Search(features.voidKey, 0, 0) == null)
topLevel.Members.Add(new MemberModel(features.voidKey, "", FlagType.Class | FlagType.Intrinsic, Visibility.Public));
topLevel.Members.Sort();
foreach (MemberModel member in topLevel.Members)
member.Flags |= FlagType.Intrinsic;
}
示例2: InitTopLevelElements
/// <summary>
/// Prepare haxe intrinsic known vars/methods/classes
/// </summary>
protected override void InitTopLevelElements()
{
string filename = "toplevel.hx";
topLevel = new FileModel(filename);
// search top-level declaration
foreach (PathModel aPath in classPath)
if (File.Exists(Path.Combine(aPath.Path, filename)))
{
filename = Path.Combine(aPath.Path, filename);
topLevel = GetCachedFileModel(filename);
break;
}
if (File.Exists(filename))
{
// copy declarations as file-level
ClassModel tlClass = topLevel.GetPublicClass();
if (!tlClass.IsVoid())
{
topLevel.Members = tlClass.Members;
tlClass.Members = null;
topLevel.Classes = new List<ClassModel>();
}
}
// not found
else
{
//ErrorHandler.ShowInfo("Top-level elements class not found. Please check your Program Settings.");
}
topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable, Visibility.Public));
topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable, Visibility.Public));
//topLevel.Members.Add(new MemberModel("Void", "", FlagType.Intrinsic, Visibility.Public));
topLevel.Members.Sort();
foreach (MemberModel member in topLevel.Members)
member.Flags |= FlagType.Intrinsic;
}