コード例 #1
0
        /// <summary>
        /// Creates new UnitItem object and fills it will all required information that can be used in a project file. Requires valid RelativePath builder and UnitFormFinder.
        /// It finds corresponding form for the unit automatically. Path is always set relatively to the BasePath.
        /// </summary>
        /// <param name="aUnitFileName"></param>
        /// <returns></returns>
        public UnitItem Create(string aUnitFileName)
        {
            UnitItem vResult = new UnitItem();

            vResult.Name    = Path.GetFileNameWithoutExtension(aUnitFileName);
            vResult.UsePath = UsePaths;
            if (!aUnitFileName.Equals(""))
            {
                vResult.Path = Path.GetDirectoryName(aUnitFileName);
            }
            vResult.Path = RelativePath.GetRelativeFileName(BasePath, vResult.Path);
            vResult.Form = UnitFormReader.GetUnitForm(aUnitFileName);

            return(vResult);
        }
コード例 #2
0
        protected void TestGetBinaryFormName(string iTestValue, string iExpected, string iMessage)
        {
            string vActual = UnitFormReader.GetBinaryFormName(iTestValue);

            Assert.AreEqual(iExpected, vActual, iMessage);
        }