private void NewObjectButton_Click(object sender, System.Windows.RoutedEventArgs e) { TreeViewItem item = ProjectTreeView.SelectedItem as TreeViewItem; if (item == null || item.Tag == null || !(item.Tag is string)) { MessageBox.Show("请先选定你要增加的类型"); return; } string newObjType = item.Tag as string; switch (newObjType) { case "剧本": Story story = new Story(); story.Name = "未命名剧本" + StoryManager.storys.Count.ToString(); StoryManager.storys.Add(story); StoryEditWindow win = new StoryEditWindow(); win.BindData(story); win.Show(); break; default: break; } this.Refresh(); }
private void EditStoryButton_Click(object sender, System.Windows.RoutedEventArgs e) { if (CurrentScriptCombo.SelectedItem != null) { StoryEditWindow win = new StoryEditWindow(); string storyKey = CurrentScriptCombo.SelectedItem.ToString(); win.BindData(StoryManager.GetStory(storyKey)); win.Show(); } else { MessageBox.Show("请先选择要编辑的剧本"); } }
private void ModifyObjectButton_Click(object sender, System.Windows.RoutedEventArgs e) { TreeViewItem item = ProjectTreeView.SelectedItem as TreeViewItem; if (item == null) { return; } if (item.Tag is string) { return; } if (item.Tag is Story) { StoryEditWindow win = new StoryEditWindow(); win.BindData(item.Tag as Story); win.Show(); } this.Refresh(); }
private void NewStoryButton_Click(object sender, System.Windows.RoutedEventArgs e) { StoryEditWindow win = new StoryEditWindow(); win.Show(); }