//------------------------------------------------------------ // CinputSet.AddSourceFile (1) // /// <summary> /// <para>Create a CSourceFileInfo instance and register it.</para> /// <para>If its file name is already registerd, return false.</para> /// </summary> /// <param name="fileName"></param> /// <returns></returns> //------------------------------------------------------------ virtual internal bool AddSourceFile(string fileName) { FileInfo fi = null; Exception excp = null; if (!IOUtil.CreateFileInfo(fileName, out fi, out excp) || fi == null || String.IsNullOrEmpty(fi.FullName)) { if (excp != null) { this.Controller.ReportError(ERRORKIND.ERROR, excp); } return(false); } CSourceFileInfo si = new CSourceFileInfo(fi); return(sourceFileDictionary.Add(si.SearchName, si)); }
//------------------------------------------------------------ // CinputSet.AddResourceFile (1) // /// <summary> /// <para>Regisger the pair of id and Info.</para> /// <para>If id is already registerd, do not register.</para> /// </summary> /// <param name="fi"></param> /// <param name="id"></param> /// <param name="embed"></param> /// <param name="pub"></param> //------------------------------------------------------------ virtual internal void AddResourceFile(FileInfo fi, string id, bool embed, bool pub) { if (fi == null || String.IsNullOrEmpty(fi.Name)) { return; } if (String.IsNullOrEmpty(id) || resourceFileDictionary.Contains(id)) { return; } CResourceFileInfo resfInfo = new CResourceFileInfo(fi, id, embed, pub); resourceFileDictionary.Add(resfInfo.LogicalName, resfInfo); }