public void Add(IQuest quest) { GameDeskControl doc = new GameDeskControl(quest); doc.Title = quest.Name; doc.InfoTip = "Info tipo for " + doc.Title; doc.ContentTypeDescription = ""; doc.Closing += new EventHandler<CancelEventArgs>(doc_Closing); doc.Closed += new EventHandler(doc_Closed); doc.InfoPanel.SizeChanged+=new SizeChangedEventHandler(doc.ResizeInfoPanel); GameViews.Add(doc); doc.Resize(GamesDocumentPane.ActualWidth, GamesDocumentPane.ActualHeight); }
public GraphicsControl(GameDeskControl gameDeskControl, Canvas canvas, Rectangle gamedesk) { this.canvas = canvas; this.gamedesk = gamedesk; this.gameDeskControl = gameDeskControl; }
public void SetActiveGameChanged(GameDeskControl g) { ActiveGameControl = g; }
public GameDeskControl Add(IQuest quest, GameMode gameMode) { if (GameViews.Count == 1) { if (GameViews[0] is Introduction) { GameViews.RemoveAt(0); } } GameDeskControl doc = new GameDeskControl(quest, gameMode, userInquirer); doc.Title = quest.Name; doc.InfoTip = doc.Title; doc.ContentTypeDescription = ""; doc.Closing += new EventHandler<CancelEventArgs>(doc_Closing); doc.Closed += new EventHandler(doc_Closed); doc.InfoPanel.SizeChanged += new SizeChangedEventHandler(doc.ResizeInfoPanel); doc.SetSounds(this.isSoundOn); GameViews.Add(doc); doc.Resize(GamesDocumentPane.ActualWidth, GamesDocumentPane.ActualHeight); //this.SelectedIndex = GameViews.Count - 1; this.SetActiveGameChanged(doc); return doc; }
private void restartAvaibilityChangeCheck(GameDeskControl oldValue, GameDeskControl newValue) { if (oldValue != newValue) { if (RestartAvaibilityChanged != null) { RestartAvaibilityChanged(newValue != null); } } }
private void doc_Closed(object sender, EventArgs e) { GameDeskControl oldVal = ActiveGameControl; if (sender is GameDeskControl) { GameDeskControl gdc = sender as GameDeskControl; if (gdc == ActiveGameControl) { ActiveGameControl = null; } } if (GameViews.Count == 0) { AddIntroduction(); } restartAvaibilityChangeCheck(oldVal, ActiveGameControl); }
void dm_ActiveDocumentChanged(object sender, EventArgs e) { GameDeskControl oldVal = ActiveGameControl; if (dm.ActiveDocument != null) { GameDeskControl gdc = dm.ActiveDocument as GameDeskControl; if (gdc != null) { ActiveGameControl = gdc; } else { ActiveGameControl = null; } } else { ActiveGameControl = null; } restartAvaibilityChangeCheck(oldVal, ActiveGameControl); }
public void SetActiveGameChanged(GameDeskControl g) { if (dm != null && dm.ActiveDocument != g) { dm.ActiveDocument = g; } restartAvaibilityChangeCheck(g, ActiveGameControl); ActiveGameControl = g; }