コード例 #1
0
ファイル: FrmMain.cs プロジェクト: robin-vandaele/Mastermind
		} /*CtrlController*/
		#endregion Properties

		#region Constructor
		public FrmMain() {
			InitializeComponent();
			SgList = new SavedGamesList();
			SClass = new SerializeClass();
			ctrlController = new ControlsController(this);
			clrPicker = new ColorPicker();
			SavedGamesList sg = SClass.deserializeSavedGames(this);
			if (sg != null) SgList = sg;
			CtrlController.giveControlspProperties();
			showOptions();
		} /*FrmMain*/
コード例 #2
0
		} /*serializeSavedGames*/

		public SavedGamesList deserializeSavedGames(FrmMain main) {
			try {
				S = new FileStream("save.dat", FileMode.Open);
				SavedGamesList SgList = (SavedGamesList)F.Deserialize(S);
				S.Close();
				return SgList;
			} catch (IOException) {
				return null;
			} catch (SerializationException) {
				S.Close();
				return null;
			} catch (ArgumentNullException) {
				S.Close();
				return null;
			}
		} /*deserializeSavedGames*/