Пример #1
0
 /// <summary>
 /// Construct a KhronosLogContext.
 /// </summary>
 /// <param name="khronoApiType"></param>
 public KhronosLogContext(Type khronoApiType)
 {
     QueryLogContext(khronoApiType);
     try {
         _LogMap = KhronosLogMap.Load(String.Format("OpenGL.KhronosLogMap{0}.xml", khronoApiType.Name));
     } catch { /* Fail-safe */ }
 }
Пример #2
0
        /// <summary>
        /// Construct a KhronosLogContext.
        /// </summary>
        /// <param name="khronoApiType"></param>
        public KhronosLogContext(Type khronoApiType)
        {
            QueryLogContext(khronoApiType);
#if !NETCORE && !NETSTANDARD1_4
            try {
                _LogMap = KhronosLogMap.Load(String.Format("OpenGL.KhronosLogMap{0}.xml", khronoApiType.Name));
            } catch { /* Fail-safe */ }
#endif
        }
Пример #3
0
        /// <summary>
        /// Load a <see cref="KhronosLogMap"/> from an embedded resource.
        /// </summary>
        /// <param name="resourcePath">
        /// A <see cref="String"/> that specifies the path of the Khronos API log map resource.
        /// </param>
        /// <param name="logMap">
        /// The <see cref="KhronosLogMap"/> to be serialized into <paramref name="resourcePath"/>.
        /// </param>
        public static void Save(string resourcePath, KhronosLogMap logMap)
        {
            if (resourcePath == null)
            {
                throw new ArgumentNullException("resourcePath");
            }
            if (logMap == null)
            {
                throw new ArgumentNullException("logMap");
            }

            using (FileStream fs = new FileStream(resourcePath, FileMode.Create, FileAccess.Write)) {
                _XmlSerializer.Serialize(fs, logMap);
            }
        }