コード例 #1
0
        /// <summary>
        /// Determines whenever the specified file is a serialized <see cref="HudLayoutInfo"/>
        /// </summary>
        /// <param name="fileName">Path to the specified file</param>
        /// <returns>True if file is a serialized <see cref="HudLayoutInfo"/>, otherwise - false</returns>
        private bool IsHudLayoutInfo(string fileName)
        {
            try
            {
                var canDeserialize = MigrationUtils.CanDeserialize <HudLayoutInfo>(fileName);
                return(canDeserialize);
            }
            catch (Exception e)
            {
                LogProvider.Log.Error("Migration", $"Layout (v1) has not been loaded on the '{fileName}' path.", e);
            }

            return(false);
        }
コード例 #2
0
        /// <summary>
        /// Determines whenever the specified file is a serialized <see cref="HudLayoutMappings"/>
        /// </summary>
        /// <param name="fileName">Path to the specified file</param>
        /// <returns>True if file is a serialized <see cref="HudLayoutMappings"/>, otherwise - false</returns>
        private bool IsMappingsFile(string fileName)
        {
            if (!Path.GetFileName(fileName).Equals(mappingsFile, StringComparison.OrdinalIgnoreCase))
            {
                return(false);
            }

            try
            {
                var canDeserialize = MigrationUtils.CanDeserialize <HudLayoutMappings>(fileName);
                return(canDeserialize);
            }
            catch (Exception e)
            {
                LogProvider.Log.Error("Migration", $"Mappings has not been loaded on the '{fileName}' path.", e);
            }

            return(false);
        }