コード例 #1
0
		public ToolTip Tt { get; private set; } /*Tt*/
		#endregion Autoproperties

		#region Constructor
		public ControlsController(FrmMain main) {
			Tt = new ToolTip();
			Main = main;
			LblArrayAvailable = new Label[Main.MaxNrAvailableColors];
			LblArrayFeedBackPins = new Label[Main.MaxNrOfTries, Main.MaxNrOfPins];
			LblArrayPlayer = new Label[Main.MaxNrOfTries, Main.MaxNrOfPins];
			LblArraySecret = new Label[Main.MaxNrOfPins];
		} /*ControlsController*/
コード例 #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*/
コード例 #3
0
		} /*add*/

		public Mastermind load(int i, FrmMain main) {
			return new Mastermind(SavedGames.ElementAt(i).Game);
		} /*load*/
コード例 #4
0
		} /*SavedGames*/
		#endregion Properties

		#region Behavior
		public void add(FrmMain main) {
			try {
				SavedGames.Add(new SavedGame(main.Mastermind.GameState));
			} catch (NullReferenceException) {
			}
		} /*add*/
コード例 #5
0
		} /*F*/
		#endregion Properties

		#region Behavior
		public void serializeSavedGames(FrmMain main) {
			S = new FileStream("save.dat", FileMode.Create);
			F.Serialize(S, main.SgList);
			S.Close();
			main.CtrlController.filltsLoad();
		} /*serializeSavedGames*/