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


C# Component.setName方法代码示例

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


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

示例1: resolveLinkInstruction

        /*
         * Given:
         *   A Link instruction- a single instruction that has been parsed before, and a CustomComponent that has this link instruction
         * Output:
         *   A Component that can be used to generate a project for this .dll
         *  Note that we want to point to source files (.c, .h) instead of linking against things that are not in our current project.
         * */
        public static Component resolveLinkInstruction(LinkInstruction linkInstr, CustomComponent rule, Makefile mkfile)
        {
            Component component = new Component(mkfile);
            string componentName = "";
            componentName = rule.Name;
            component.setName(componentName);
            linkInstr.convertToLink(mkfile, component);

            //If the link instruction shares objs with the makefile's, then use its cflags. Otherwise, we assume that the link instruction has an accompanying compile instruction somewhere
            if (rule.contextSensitiveProps.Contains("OBJ_LIST_C_OBJS"))
            {
                component.CompilerFlags = new CompileFlags(mkfile);
                component.CompilerFlags.ParseString(mkfile.ResolveVariables(mkfile.CompilerFlagsStr, Makefile.VarType.RegularVariable | Makefile.VarType.PropSheetVariable, false));
            }

            string extension = Path.GetExtension(rule.Output).Replace(".", "");
            component.Type = extension;
            component.IsCustomLinkStep = true;

            return component;
        }
开发者ID:mheise,项目名称:Unmake,代码行数:28,代码来源:CustomActions.cs

示例2: resolveClInstructionIntoComponent

        /*
         * Given:
         *   A Cl (command line compile) instruction with a /link flag- a single instruction that has been parsed before, and a CustomComponent that has this compile instruction
         * Output:
         *   A Component that can generate a project.
         *  Note that we want to point to source files (.c, .h) instead of linking against things that are not in our current project.
         * */
        public static Component resolveClInstructionIntoComponent(ClInstruction clInstruction, CustomComponent rule, Makefile mkfile)
        {
            Component result = new Component(rule.Output);
            result.IsCustomLinkStep = true;
            string target = "";
            //If the compile instruction has a /link flag, then it should ultimately become its own project.
            if (clInstruction.hasLinkFlags())
            {
                foreach (string file in clInstruction.clFiles)
                {
                    if (file.EndsWith(".c", StringComparison.CurrentCultureIgnoreCase) || file.EndsWith(".cpp", StringComparison.CurrentCultureIgnoreCase))
                    {
                        result.SourceFiles.Add(Path.GetFileNameWithoutExtension(file));
                    }
                    else if (file.Contains("lib"))
                    {
                        result.Link.Libs.Add(file);
                    }
                    else if (file.Contains("obj"))
                    {
                        result.Link.Objs.Add(file);
                        target = file;
                    }
                }
                CompileFlags flags = new CompileFlags(mkfile);
                flags.ParseString(clInstruction.clOptionsLiteral);
                result.CompilerFlags = flags;

                if (clInstruction.LinkOptionsLiteral_Words.Count > 0)
                {
                    MakefileUtil.ParseLinkFlags(mkfile, clInstruction.LinkOptionsLiteral_Words, result);
                }

            }

            string extension = Path.GetExtension(rule.Output).Replace(".", "");
            result.Type = extension;

            if (result.Name == "")
                result.setName(rule.Output);

            if (result.Link.Output == "")
                result.Link.Output = Path.GetFileName(rule.Output);
            return result;
        }
开发者ID:mheise,项目名称:Unmake,代码行数:52,代码来源:CustomActions.cs


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