private void SaveRequested(IPluginChildWindow sender) { if (changedCheckBox.Checked) { PutScripture(); } }
private void SaveRequested(IPluginChildWindow sender) { if (m_writeLock == null) { m_writeLock = m_project.RequestWriteLock(this, ReleaseRequested, savedDataId); } if (m_writeLock == null) { MessageBox.Show("Cannot get write lock; aborting loading data"); m_savedText = ""; m_currentText = ""; textBox.Text = ""; textBox.ReadOnly = true; return; } m_currentText = textBox.Text; ProjectTextData data = new ProjectTextData { Lines = m_currentText.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries) }; try { m_project.PutPluginData(m_writeLock, this, savedDataId, writer => m_Serializer.Serialize(writer, data)); } catch (Exception e) { MessageBox.Show($"Unable to save data:\n{e.Message}"); } m_savedText = m_currentText; }
private void Parent_SaveRequested(IPluginChildWindow sender) { if (lastSavedValue != EditText) { SaveText(); } }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { m_parent = parent; if (parent.CurrentState == null) { m_project = null; m_verseRef = null; } else { m_project = parent.CurrentState.Project; m_verseRef = parent.CurrentState.VerseRef; } parent.SetTitle(PluginG.pluginName); parent.WindowClosing += WindowClosing; parent.ProjectChanged += ProjectChanged; parent.VerseRefChanged += VerseRefChanged; if (m_project != null) { m_project.ProjectDataChanged += ProjectDataChanged; } m_UpdateThread = new Thread(UpdateTimeWorker); m_UpdateThread.Start(); }
private void ProjectChanged(IPluginChildWindow sender, IProject newProject) { // Save the old project first: PromptSaveAndUnlock(); // Then remember the new project SetProject(newProject); }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { m_project = parent.CurrentState.Project; parent.SetTitle(PluginF.pluginName); parent.SaveRequested += SaveRequested; parent.WindowClosing += WindowClosing; parent.ProjectChanged += ProjectChanged; }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginJ.pluginName); SetProject(parent.CurrentState.Project); host.ActiveWindowSelectionChanged += ActiveWindowSelectionChanged; parent.ProjectChanged += ProjectChanged; }
private void ProjectChanged(IPluginChildWindow sender, IProject newProject) { // Save the old project first: PromptSaveAndDispose(sender); // Then load the new project m_project = newProject; LoadSavedText(); }
private void Parent_VerseRefChanged(IPluginChildWindow sender, IVerseRef oldReference, IVerseRef newReference) { Debug.Assert(oldReference.Equals(m_reference)); m_reference = newReference; if (oldReference.BookNum != newReference.BookNum || oldReference.ChapterNum != newReference.ChapterNum) { UpdateWordleAsync(); } }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginE.pluginName); m_Project = parent.CurrentState.Project; m_Reference = parent.CurrentState.VerseRef; parent.ProjectChanged += ProjectChanged; parent.VerseRefChanged += VerseRefChanged; }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.Icon = Resources.icon; parent.SetTitle(ProjectTextEditorPlugin.pluginName, false); UpdateProject(parent.CurrentState.Project); parent.SaveRequested += Parent_SaveRequested; parent.WindowClosing += Parent_WindowClosing; parent.ProjectChanged += Parent_ProjectChanged; parent.MegaMenuShowing += Parent_MegaMenuShowing; }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { m_host = host; parent.SetTitle(ChapterWordCloudPlugin.pluginName); parent.VerseRefChanged += Parent_VerseRefChanged; parent.ProjectChanged += Parent_ProjectChanged; SetProject(parent.CurrentState.Project); m_reference = parent.CurrentState.VerseRef; m_selectedText = state; selectedTextToolStripMenuItem.Checked = state != null; }
private void ReferenceChanged(IPluginChildWindow sender, IVerseRef oldReference, IVerseRef newReference) { if ((m_Reference.BookNum != newReference.BookNum) || (m_Reference.ChapterNum != newReference.ChapterNum)) { PromptSaveAndUnlock(); m_Reference = newReference; chapterText.Text = "Click 'Get Chapter'"; chapterText.BringToFront(); bookName.Text = m_Reference.BookCode; chapterNumber.Text = m_Reference.ChapterNum.ToString(); changedCheckBox.Checked = false; } }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginH.pluginName); m_Host = host; m_Project = parent.CurrentState.Project; m_Reference = parent.CurrentState.VerseRef; IReferenceListWindow refList = host.ReferenceList; refList.ListChanged += ListChanged; refList.SelectedItemChanged += SelectedItemChanged; refList.ItemDoubleClicked += ItemDoubleClicked; }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginL.pluginName); parent.ProjectChanged += ProjectChanged; parent.VerseRefChanged += VerseRefChanged; SetProject(parent.CurrentState.Project); m_verseRef = parent.CurrentState.VerseRef; RowStyle rowStyle = new RowStyle(SizeType.AutoSize); m_tableLayoutPanel.RowStyles.Add(rowStyle); AddHeaderRow(); }
public void ProjectChanged(IPluginChildWindow sender, IProject newProject) { if (m_project != null) { m_project.ProjectDataChanged -= ProjectDataChanged; } m_project = newProject; if (m_project != null) { m_project.ProjectDataChanged += ProjectDataChanged; } m_verseRef = sender.CurrentState.VerseRef; ShowProjectInfo(); }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginK.pluginName); m_host = host; m_project = parent.CurrentState.Project; m_parent = parent; m_whichListListBox.BeginUpdate(); m_whichListListBox.Items.Add(ProjectList); m_whichListListBox.Items.Add(AllList); m_whichListListBox.Items.Add(MajorList); m_whichListListBox.SetSelected(0, true); m_whichListListBox.EndUpdate(); }
private void PromptSaveAndDispose(IPluginChildWindow sender) { if (textBox.Text != m_savedText) { var response = MessageBox.Show("Save changed data?", "Plugin F", MessageBoxButtons.YesNo); if (response == DialogResult.Yes) { SaveRequested(sender); } } if (m_writeLock != null) { m_writeLock.Dispose(); m_writeLock = null; } }
public override void OnAddedToParent(IPluginChildWindow parent, IWindowPluginHost host, string state) { parent.SetTitle(PluginI.pluginName); SetProject(parent.CurrentState.Project); m_Reference = parent.CurrentState.VerseRef; chapterText.Text = "Click 'Get Chapter'"; bookName.Text = m_Reference.BookCode; chapterNumber.Text = m_Reference.ChapterNum.ToString(); chapterText.Text = ""; chapterText.BringToFront(); changedCheckBox.Checked = false; EnableRadioButtons(); UsfmRadioButton.Checked = true; UsfmTokensRadioButton.Checked = false; UsxRadioButton.Checked = false; m_WriteLock = null; lockedCheckBox.Checked = false; parent.VerseRefChanged += ReferenceChanged; parent.WindowClosing += WindowClosing; parent.SaveRequested += SaveRequested; parent.ProjectChanged += ProjectChanged; }
private void Parent_MegaMenuShowing(IPluginChildWindow sender) { undoToolStripMenuItem.Enabled = textChanged; }
public void VerseRefChanged(IPluginChildWindow sender, IVerseRef oldReference, IVerseRef newReference) { m_project = sender.CurrentState.Project; m_verseRef = newReference; ShowProjectInfo(); }
private void Parent_ProjectChanged(IPluginChildWindow sender, IProject newProject) { UpdateProject(newProject); }
public void WindowClosing(IPluginChildWindow sender, CancelEventArgs args) { s_exists = false; }
private void Parent_WindowClosing(IPluginChildWindow sender, System.ComponentModel.CancelEventArgs args) { PromptAndSave(args); }
private void WindowClosing(IPluginChildWindow sender, CancelEventArgs args) { PromptSaveAndDispose(sender); }
private void WindowClosing(IPluginChildWindow sender, CancelEventArgs args) { PromptSaveAndUnlock(); }
private void ProjectChanged(IPluginChildWindow sender, IProject newProject) { SetProject(newProject); }
public void ProjectChanged(IPluginChildWindow sender, IProject newProject) { m_Project = newProject; m_Reference = sender.CurrentState.VerseRef; ShowScripture(); }
public void VerseRefChanged(IPluginChildWindow sender, IVerseRef oldReference, IVerseRef newReference) { m_Reference = newReference; ShowScripture(); }
private void VerseRefChanged(IPluginChildWindow sender, IVerseRef oldReference, IVerseRef newReference) { m_verseRef = newReference; }