ChobiQ.DoubanFMAPICodePack.StorageManager.LoadLastChannel C# (CSharp) Method

LoadLastChannel() public static method

public static LoadLastChannel ( ) : Channel
return Channel
        public static Channel LoadLastChannel()
        {
            if (!UserStatusExists)
                return Channel.Chinese;

            IFormatter format = new BinaryFormatter();

            Channel ch = (Channel)format.Deserialize(
                s_channelFile.Open(FileMode.Open));

            return ch;
        }

Usage Example

Example #1
0
 /// <summary>
 /// Loads last time played channel from local storage.
 /// </summary>
 /// <remarks>
 /// If no saved channel, a default channel will be applied.
 /// </remarks>
 public void LoadLastChannel()
 {
     CurrentChannel = StorageManager.LoadLastChannel();
 }