Exemple #1
0
        private static IOpenAdvanced Deserialize(string text)
        {
            int           idx   = text.IndexOf('*');
            string        type  = text.Substring(0, idx);
            string        token = text.Substring(idx + 1);
            IOpenAdvanced ioa;

            if (type == OpenAdvancedTypes.OpenRom)
            {
                ioa = new OpenAdvanced_OpenRom();
            }
            else if (type == OpenAdvancedTypes.Libretro)
            {
                ioa = new OpenAdvanced_Libretro();
            }
            else if (type == OpenAdvancedTypes.LibretroNoGame)
            {
                ioa = new OpenAdvanced_LibretroNoGame();
            }
            else
            {
                ioa = null;
            }
            if (ioa == null)
            {
                throw new InvalidOperationException("IOpenAdvanced deserialization error");
            }
            ioa.Deserialize(token);
            return(ioa);
        }
Exemple #2
0
		private static IOpenAdvanced Deserialize(string text)
		{
			int idx = text.IndexOf('*');
			string type = text.Substring(0, idx);
			string token = text.Substring(idx + 1);
			IOpenAdvanced ioa;
			if (type == OpenAdvancedTypes.OpenRom) ioa = new OpenAdvanced_OpenRom();
			else if (type == OpenAdvancedTypes.Libretro) ioa = new OpenAdvanced_Libretro();
			else if (type == OpenAdvancedTypes.LibretroNoGame) ioa = new OpenAdvanced_LibretroNoGame();
			else ioa = null;
			if (ioa == null)
				throw new InvalidOperationException("IOpenAdvanced deserialization error");
			ioa.Deserialize(token);
			return ioa;
		}