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


C# ILoader.GetAssemblyVersionNumber方法代码示例

本文整理汇总了C#中ILoader.GetAssemblyVersionNumber方法的典型用法代码示例。如果您正苦于以下问题:C# ILoader.GetAssemblyVersionNumber方法的具体用法?C# ILoader.GetAssemblyVersionNumber怎么用?C# ILoader.GetAssemblyVersionNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILoader的用法示例。


在下文中一共展示了ILoader.GetAssemblyVersionNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateAllFiles

        /// <summary>
        /// Runs through a project and generates the files in it.
        /// </summary>
        /// <param name="progressHelper">The TaskProgressHelper to use to report progress and cancel the operation.</param>
        /// <param name="projectInfo">The Project we are generating files from.</param>
        /// <param name="folderName">The name of the root folder to generate into. Not the full path, just the relative path to the 
        /// current folder.</param>
        /// <param name="folder"></param>
        /// <param name="parentNode"></param>
        /// <param name="thisLevelRootObject"></param>
        /// <returns></returns>
        /// <param name="loader"></param>
        /// <param name="controller"></param>
        public int GenerateAllFiles(ITaskProgressHelper<GenerateFilesProgress> progressHelper, IProjectHelper projectInfo, string folderName, IFolder folder, ProjectFileTreeNode parentNode, IScriptBaseObject thisLevelRootObject, ILoader loader, IController controller)
        {
            if (parentNode is ProjectFileTree)
            {
                ((ProjectFileTree)parentNode).TreeRestructuring = true;
                ((ProjectFileTree)parentNode).Clear();
            }
            int fileCount = 0;

            try
            {
                _Controller = controller;
                _Loader = loader;
                _ProgressHelper = progressHelper;
                project = projectInfo;
                CurrentRootObject = thisLevelRootObject;
                absoluteBasePath = controller.GetTempFilePathForComponent(ComponentKey.WorkbenchFileGenerator);

                {
                    Version version = new Version(loader.GetAssemblyVersionNumber());
                    Version expectedVersion = new Version(1, 1, 9, 49);
                    if (version < expectedVersion)
                    {
                        throw new OldVersionException("The template was compiled with an old version of ArchAngel, and cannot be used in this version of Workbench");
                    }
                }

                foreach (IFolder subFolder in folder.SubFolders)
                {
                    if (progressHelper.IsCancellationPending())
                    {
                        progressHelper.Cancel();
                        return fileCount;
                    }

                    ProjectFileTreeNode folderNode = null;

                    if (parentNode != null && subFolder.Name != "ROOT")
                    {
                        folderNode = parentNode.AddChildNode(subFolder.Name);
                        folderNode.IsFolder = true;
                    }

                    if (!string.IsNullOrEmpty(subFolder.IteratorName))
                    {
                        // The folder has an iterator
                        ProviderInfo provider;
                        Type iteratorType = project.GetTypeFromProviders(subFolder.IteratorName, out provider);

                        if (progressHelper.IsCancellationPending())
                        {
                            progressHelper.Cancel();
                            return fileCount;
                        }

                        if (iteratorType != null)
                        {
                            IEnumerable<IScriptBaseObject> iteratorObjects;

                            if (thisLevelRootObject == null)
                            {
                                iteratorObjects = provider.GetAllObjectsOfType(iteratorType.FullName);
                            }
                            else if (iteratorType.IsInstanceOfType(thisLevelRootObject))
                            {
                                iteratorObjects = new[] { thisLevelRootObject };
                            }
                            else
                            {
                                iteratorObjects = provider.GetAllObjectsOfType(iteratorType.FullName, thisLevelRootObject);
                            }
                            if (iteratorObjects != null)
                            {
                                foreach (IScriptBaseObject iteratorObject in iteratorObjects)
                                {
                                    if (progressHelper.IsCancellationPending())
                                    {
                                        progressHelper.Cancel();
                                        return fileCount;
                                    }

                                    CurrentRootObject = iteratorObject;

                                    string subFolderName = UpdateScriptName(iteratorObject, subFolder);

                                    if (folderNode != null)
                                    {
//.........这里部分代码省略.........
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:101,代码来源:GenerationHelper.cs


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