/// <summary> /// Entry point for the font loading thread. /// </summary> private void LoadFont() { lock (_fontLock) { _font = GraphicsManager.LoadFont(_loadFontUrl); _fontImage = GraphicsManager.LoadImage(_font.NormalImage.URL, 0); } _loadFontThread = null; }
/// <summary> /// Loads the current image and closes down the window when the user /// clicks the load key. /// </summary> /// <param name="sender">Recent file menu that caused this event.</param> /// <param name="e">Arguments explaining why this event was invoked.</param> private void loadButton_Click(object sender, EventArgs e) { // Check we have selected a node. if (fileTreeView.SelectedNode == null) { MessageBox.Show("Please select a font to load.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } // Work out the path to the node. _loadFontUrl = Engine.GlobalInstance.FontPath + "\\" + fileTreeView.SelectedNode.FullPath; // Check its not a dictionary. if (ResourceManager.ResourceExists(_loadFontUrl) == false) { MessageBox.Show("File could not be accessed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } _font = GraphicsManager.LoadFont(_loadFontUrl); DialogResult = DialogResult.OK; Close(); }
/// <summary> /// Reloads the currently selected font. /// </summary> private void ReloadFont() { // Check we have selected a node. if (fileTreeView.SelectedNode == null || _loadFontThread != null) { return; } // Work out the path to the node. _loadFontUrl = Engine.GlobalInstance.FontPath + "\\" + fileTreeView.SelectedNode.FullPath; // Check its not a dictionary. if (ResourceManager.ResourceExists(_loadFontUrl) == false) { return; } // Start up the loading thread. _font = null; _fontImage = null; _loadFontThread = new Thread(new ThreadStart(LoadFont)); _loadFontThread.IsBackground = true; _loadFontThread.Start(); }
/// <summary> /// Reloads the currently selected font. /// </summary> private void ReloadFont() { // Check we have selected a node. if (fileTreeView.SelectedNode == null || _loadFontThread != null) return; // Work out the path to the node. _loadFontUrl = Engine.GlobalInstance.FontPath + "\\" + fileTreeView.SelectedNode.FullPath; // Check its not a dictionary. if (ResourceManager.ResourceExists(_loadFontUrl) == false) return; // Start up the loading thread. _font = null; _fontImage = null; _loadFontThread = new Thread(new ThreadStart(LoadFont)); _loadFontThread.IsBackground = true; _loadFontThread.Start(); }
/// <summary> /// Entry point for the font loading thread. /// </summary> private void LoadFont() { lock (_fontLock) { _font = GraphicsManager.LoadFont(_loadFontUrl); _fontImage = GraphicsManager.LoadImage(_font.NormalImage.URL, 0); } _loadFontThread = null; }
/// <summary> /// Loads the current image and closes down the window when the user /// clicks the load key. /// </summary> /// <param name="sender">Recent file menu that caused this event.</param> /// <param name="e">Arguments explaining why this event was invoked.</param> private void loadButton_Click(object sender, EventArgs e) { // Check we have selected a node. if (fileTreeView.SelectedNode == null) { MessageBox.Show("Please select a font to load.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } // Work out the path to the node. _loadFontUrl = Engine.GlobalInstance.FontPath + "\\" + fileTreeView.SelectedNode.FullPath; // Check its not a dictionary. if (ResourceManager.ResourceExists(_loadFontUrl) == false) { MessageBox.Show("File could not be accessed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } _font = GraphicsManager.LoadFont(_loadFontUrl); DialogResult = DialogResult.OK; Close(); }