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


C# FileModel.GetPublicClass方法代码示例

本文整理汇总了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;
        }
开发者ID:thecocce,项目名称:flashdevelop,代码行数:48,代码来源:Context.cs

示例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;
        }
开发者ID:xeronith,项目名称:flashdevelop,代码行数:41,代码来源:Context.cs


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