예제 #1
0
        /// <summary>
        ///     加载(反序列化)指定对象类型的配置对象
        /// </summary>
        protected static void LoadConfig()
        {
            //不存在则自动接创建
            if (!File.Exists(FilePath + FileName))
            {
                SaveConfig(new T());
            }

            LoadAt = File.GetLastWriteTime(FilePath + FileName);

            lock (m_LockHelper)
            {
                m_ConfigInfo = Serialized <T> .Load(FilePath + FileName);
            }
        }
예제 #2
0
 public static AnimatedTextSurface Load(string file)
 {
     return(Serialized.Load(file));
 }
예제 #3
0
 public static Entity Load(string file)
 {
     //return SadConsole.Serializer.Load<Entity>(file, new System.Type[] { typeof(List<Frame>) });
     return(Serialized.Load(file));
 }
예제 #4
0
 /// <summary>
 /// Loads a <see cref="Console"/> from a file.
 /// </summary>
 /// <param name="file">The source file.</param>
 /// <param name="knownTypes">Types to provide if the <see cref="SurfaceEditor.TextSurface"/> and <see cref="Renderer" /> types are custom and unknown to the serializer.</param>
 /// <returns>The <see cref="Console"/>.</returns>
 public static Console Load(string file, params Type[] knownTypes)
 {
     //return Serializer.Load<Console>(file, new Type[] { typeof(CellAppearance) });
     return(Serialized.Load(file, knownTypes.Union(Serializer.ConsoleTypes).ToArray()));
 }
예제 #5
0
 /// <summary>
 /// Loads a <see cref="GameObject"/> from a file.
 /// </summary>
 /// <param name="file">The file to load.</param>
 /// <returns></returns>
 public static GameObject Load(string file)
 {
     return(Serialized.Load(file));
 }
예제 #6
0
 /// <summary>
 /// Loads a <see cref="TextSurfaceView"/> from a file.
 /// </summary>
 /// <param name="file">The source file.</param>
 /// <param name="surfaceBase">The surface this view was created from.</param>
 /// <returns></returns>
 public static TextSurfaceView Load(string file, ITextSurfaceRendered surfaceBase)
 {
     return(Serialized.Load(file, surfaceBase));
 }