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


C# Link.GetAllRequiredObjects方法代码示例

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


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

示例1: m_worker_DoWork

        void m_worker_DoWork(object sender, DoWorkEventArgs e)
        {

            //if (Directory.Exists(uVisionProjectPath)) Directory.Delete(uVisionProjectPath, true);

            OnLogText("start analize");

            //ObjectList.Clear();

            Directory.CreateDirectory(uVisionProjectPath);

            WorkerParams pars = (WorkerParams)e.Argument;

            PKParser.Arg.PKArgParser ArgParser = new PKParser.Arg.PKArgParser();

            //string DefaultWorkingDir = Directory.GetCurrentDirectory();

            //List<UsedItem> LibList = new List<UsedItem>();
            //List<UsedItem> SourceList = new List<UsedItem>();

            Link Link = new Link("Link", null);

            //Собираем дерево проекта

            foreach (LogQueueItem item in pars.messages.Values)
            {
                if (item.Message.ToLower().Contains(ARMLINKPath))
                {
                    Link.ConsoleString = item.Message;
                    ParamCollection par = ArgParser.Add(item.Message);
                    if (par == null) throw new Exception(KeilWizardStrings);
                    Link.ParamCollection = par;

                    ProjectCollection LocalProjColl = new ProjectCollection();
                    Project MSBProj = LocalProjColl.LoadProject(item.ProjectBuildContext[item.ProjectBuildContext.Count - 1]);
                    string LIB_EXT = MSBProj.GetPropertyValue("LIB_EXT");
                    string OBJ_EXT = MSBProj.GetPropertyValue("OBJ_EXT");

                    foreach (ArgCollection arg in par.Values)
                    {
                        if (arg.Name == "--output")
                        {
                            Link.Name = arg[0];
                        }
                    }

                    foreach (string file in par.Files.Values)
                    {
                        RequiredLibrary lib = null;
                        RequiredObject obj = null;
                        if (Path.GetExtension(file).ToLower() == "." + LIB_EXT.ToLower())
                        {
                            lib =new RequiredLibrary(file, Link);
                            Link.InputLibraries.Add(Link.InputLibraries.Count + 1, lib);
                        }

                        if (Path.GetExtension(file).ToLower() == "." + OBJ_EXT.ToLower())
                        {
                            obj = new RequiredObject(file, Link);
                            Link.InputObjects.Add(Link.InputObjects.Count + 1, obj);
                        }
                        if (lib != null) Link.AllInputs.Add(Link.AllInputs.Count + 1, lib);
                        if (obj != null) Link.AllInputs.Add(Link.AllInputs.Count + 1, obj);
                    }
                }
            }
            ArgParser.Clear();
            //Идем по требуемым библиотекам
            this.AnalizeInputLibraries(Link.InputLibraries, pars.messages.Values);

            //Проверка Crypto.Lib
            this.CheckCryptoLib(Link.InputLibraries, pars.messages.Values);

            //Идем по всем требуемым файлам
            SortedList<int, RequiredObject> ReqObjs = Link.GetAllRequiredObjects();
            this.AnalizeInputObjects(ReqObjs, pars.messages.Values);

            if (!Link.CheckItems())
            {
                throw new Exception("Not all Link Items founded");
            }


            //Собираем необходимые для проекта файлы
            List<RequiredLibrary> ReqLib = Link.GetAllSubRequiredLibraries();

            foreach (RequiredObject obj in ReqObjs.Values)
            {
                this.AddObjFile(obj);
            }
            foreach (RequiredLibrary lib in ReqLib)
            {
                uVisionProject.AddFile(lib.OutputFileuVision, Path.GetFileNameWithoutExtension(lib.Parent.Name));
            }

            //Сортируем группы
            uVisionProject.SortGroups();

            foreach (RequiredLibrary lib in Link.InputLibraries.Values)
            {
//.........这里部分代码省略.........
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:101,代码来源:MFuVisionGenerator.cs


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