예제 #1
0
        //------------------------------------------------------------
        // CinputSet.AddSourceFile (2)
        //
        /// <summary>
        /// <para>Register FileInfo instance.</para>
        /// <para>If already registered. return false.</para>
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        virtual internal bool AddSourceFile(FileInfo info)
        {
            if (info == null || String.IsNullOrEmpty(info.FullName))
            {
                return(false);
            }

            CSourceFileInfo si = new CSourceFileInfo(info);

            return(sourceFileDictionary.Add(si.SearchName, si));
        }
예제 #2
0
        //------------------------------------------------------------
        // 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));
        }