public void LoadPresentation(GCEPresentation presentation) { Workspace.Children.Clear(); Connections.Clear(); Statement statement; Property property; foreach (GSPresentation statementPresentation in presentation.Statements) { statement = Project.Quest.GetStatement(conversation, statementPresentation.Type, statementPresentation.StatementID); AddStatementPanel(statementPresentation.PointPresentation.ToPoint(), statementPresentation.Type, false, statement); } foreach (GPPresentation propertyPresentation in presentation.Properties) { property = Project.Quest.GetProperty(propertyPresentation.PropertyType, propertyPresentation.PropertyID); AddPropertyPanel(propertyPresentation.PointPresentation.ToPoint(), propertyPresentation.PropertyType, property); } foreach (PanelConnectionPresentation connection in presentation.PanelConnections) { GStatement first = presentation.GetGStatement(connection.First as GSPresentation); if (connection.Second is GSPresentation) { Connections.Add(new PanelConnection(first, presentation.GetGStatement(connection.Second as GSPresentation), true, BreakConnectionItem_Click)); } else { Connections.Add(new PanelConnection(first, presentation.GetGProperty(connection.Second as GPPresentation), false, BreakConnectionItem_Click)); } } }
public GraphicalConversationEditor(Conversation conversation, GCEPresentation presentation) { InitializeComponent(); this.conversation = conversation; Connections = new List <PanelConnection>(); PanelConnection.SetWorkspace(Workspace); GCEPresentation.Workspace = Workspace; LoadPresentation(presentation); ScrollViewer.ScrollToVerticalOffset(Workspace.Height / 2); ScrollViewer.ScrollToHorizontalOffset(Workspace.Width / 2); WelcomeText.Visibility = Visibility.Collapsed; UpdateStartStatementsSequence(); }