コード例 #1
0
ファイル: CsProjectItemUtil.cs プロジェクト: tfwio/sd-ext
 /// <summary>
 /// Reformats {tag}, {inc} and {fname}
 /// </summary>
 /// <param name="info">Contains Project, and ProjectItem FileInfo.</param>
 /// <param name="template">template</param>
 /// <param name="vals">a set of attribute values to be placed into the tag.</param>
 /// <returns></returns>
 string ReformatCommon(CsProjectItemInfo info, string template)
 {
     return template
         .Replace("{vals}",info.MetaInfoAsAttributes)
         .Replace("{tag}",info.Item.ItemType.ItemName)
     //                        .Replace("{inc}",p.Include)
         .Replace("{inc}",info.ProjectInclude.FullName
             .Replace(Settings.ProjectPath,string.Empty)  .Trim('\\','/') )
     //                        .Replace("{fname}",p.FileName)
         .Replace("{fname:pre}",Settings.PreIncludePath)
         .Replace("{fname}",info.Item.Include)
     //                        .Replace("{fname}",fn0.Name)
         ;
 }
コード例 #2
0
ファイル: CsProjectItemUtil.cs プロジェクト: tfwio/sd-ext
        List<string> SerializeLinks(params ItemType[] types)
        {
            if (!Settings.HasProject) return null;
            List<ItemType> listtypes = new List<ItemType>(types);
            List<string> itemset = new List<string>();
            string text = string.Empty;

            foreach ( ProjectItem p in Settings.Project.Items )
            {
                if (!listtypes.Contains(p.ItemType)) continue;

                CsProjectItemInfo info = new CsProjectItemInfo(Settings.Project,p);

                if (info.HasLink && !Settings.IncludeLinks) continue;

                string temp = ReformatCommon(info,AnotherThemeTool.Strings.CompileElement2);

                info = null;
                itemset.Add(temp);

            }
            listtypes = null;
            return itemset;
        }