mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-10 09:07:32 +00:00
* ExampleBrowser.cs: Worked around RichTextBox crash with empty text on Mono 2.0.
This commit is contained in:
parent
4eb5af7ef7
commit
5c633fef8b
|
@ -60,16 +60,28 @@ namespace Examples
|
||||||
|
|
||||||
private void treeViewSamples_AfterSelect(object sender, TreeViewEventArgs e)
|
private void treeViewSamples_AfterSelect(object sender, TreeViewEventArgs e)
|
||||||
{
|
{
|
||||||
|
const string no_docs = "Documentation has not been entered.";
|
||||||
|
const string no_source = "Source code has not been entered.";
|
||||||
|
|
||||||
if (e.Node.Tag != null && !String.IsNullOrEmpty(((ExampleInfo)e.Node.Tag).Attribute.Documentation))
|
if (e.Node.Tag != null && !String.IsNullOrEmpty(((ExampleInfo)e.Node.Tag).Attribute.Documentation))
|
||||||
{
|
{
|
||||||
richTextBoxDescription.Rtf = (string)Resources.ResourceManager.GetObject(((ExampleInfo)e.Node.Tag).Attribute.Documentation + "Doc");
|
string docs = (string)Resources.ResourceManager.GetObject(((ExampleInfo)e.Node.Tag).Attribute.Documentation + "Doc");
|
||||||
richTextBoxSource.Text = (string)Resources.ResourceManager.GetObject(((ExampleInfo)e.Node.Tag).Attribute.Documentation);
|
string source = (string)Resources.ResourceManager.GetObject(((ExampleInfo)e.Node.Tag).Attribute.Documentation);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(docs))
|
||||||
|
richTextBoxDescription.Text = no_docs;
|
||||||
|
else
|
||||||
|
richTextBoxDescription.Rtf = docs;
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(source))
|
||||||
|
richTextBoxSource.Text = no_source;
|
||||||
|
else
|
||||||
|
richTextBoxSource.Text = source;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
richTextBoxDescription.Rtf = String.Empty;
|
richTextBoxDescription.Text = no_docs;
|
||||||
richTextBoxDescription.Text = "Documentation has not been entered.";
|
richTextBoxSource.Text = no_source;
|
||||||
richTextBoxSource.Rtf = String.Empty;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue