private void SampleSelected(object sender, TreeNodeMouseClickEventArgs e) { AppItem app = e.Node.Tag as AppItem; if (app == null) { return; } AppDescriptionAttribute att = app.AppAttributes; SetValidPlatforms(att); if (att != null) { samplepic.Image = att.Thumbnail; sampleDescText.Rtf = att.RTFDescription; sourceText.Rtf = att.RTFSource; } else { samplepic.Image = Resources.DefaultImage; sampleDescText.Rtf = Resources.NoDescription; sourceText.Rtf = Resources.NoSourceCode; } }
public AppItem(Type type) { _type = type; object[] atts = type.GetCustomAttributes(true); foreach (Attribute att in atts) { AppDescriptionAttribute appAtt = att as AppDescriptionAttribute; if (appAtt != null) { _att = appAtt; } } }
private void SetValidPlatforms(AppDescriptionAttribute att) { rendererSelection.Items.Clear(); rendererSelection.Text = ""; if (att != null) { PlatformCapabilities flags = att.Platforms; if (flags == PlatformCapabilities.None) { return; } if ((flags & PlatformCapabilities.Direct3D10) == PlatformCapabilities.Direct3D10) { rendererSelection.Items.Add("Direct3D 10"); } if ((flags & PlatformCapabilities.XNA4) == PlatformCapabilities.XNA4) { rendererSelection.Items.Add("XNA 4.0"); } rendererSelection.Text = (String)rendererSelection.Items[0]; } }