Пример #1
0
        /// <summary>
        /// Make sure this asset is MOG Compliant
        /// </summary>
        private bool CheckName(string filename)
        {
            MOG_Filename assetName;

            try
            {
                assetName = new MOG_Filename(filename);
            }
            catch
            {
                throw new Exception("Unable to convert filename, '" + filename + "' to a valid MOG Filename.");
            }

            // No asset is valid if it has the '[' character
            // Original string == "[]'`,$^:?*<>/\\%#!|="
            // glk:  Kier and I changed this so that ONLY Windows, MOG-Specific, and INI chars are filtered
            if (assetName.GetAssetLabel().Split(ImportFilter_String.ToCharArray()).Length > 1)
            {
                throw new Exception("Non-valid character in import file: \n\n\t " + ImportFilter_String);
            }

            // Make sure the asset name is valid
            if (assetName.GetFilenameType() == MOG_FILENAME_TYPE.MOG_FILENAME_Unknown && MOG_ControllerProject.ValidateAssetFilename(assetName) == false)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }