public void OnFocus() { if (AddCharacterWindow.Active) { AddCharacterWindow.Refocus(); } }
private void AddObject() { AddCharacterWindow AddingWindow = new AddCharacterWindow(); AddingWindow.Closing += new CancelEventHandler(Add_Closing); AddingWindow.ShowInTaskbar = false; AddingWindow.Owner = Application.Current.MainWindow; AddingWindow.Show(); }
void Add_Closing(object sender, System.ComponentModel.CancelEventArgs e) { AddCharacterWindow AddingWindow = sender as AddCharacterWindow; string Name = AddingWindow.NewChar.Text; string Server = AddingWindow.NewServer.Text; if (Name == "" | Server == "") { return; } AddCharacter(Name, Server); }
private void OnAddCharacter() { if (AddCharacterWindow.Active) { return; } int selectedConversation = ConversationScroller.SelectedElement; if (selectedConversation < 0 || selectedConversation >= projectConversations.Length) { return; } SerializedObject currentConversation = new SerializedObject(projectConversations[selectedConversation]); AddCharacterWindow.Open((DS_Conversation)currentConversation.targetObject); }
/// <summary> /// This function create the AddCharacterWindow and modify the database if needed (adding a character) /// </summary> public void OnFire() { //Show the window var w = new AddCharacterWindow(m_wd); w.ShowDialog(); //Commit the Dialog if (w.Datas.CharacterAdded) { m_wd.CommitDB.AddCharacter(w.Datas.NewCharacters.ToArray()); //Add the icon as a new resources. //TODO only one icon currently is added... if (w.Datas.IconDefined) { using (FileStream fs = new FileStream(w.Datas.IconPath, FileMode.Open)) m_wd.AddResource(fs, w.Datas.NewCharacters[0].Icon); } } }