- mysql.chm.zip
- MySQL.chm
- bse.platten_en.zip
- BSE.Platten
- BSE.CoverFlow.WPFLib
- BSE.Platten.Admin.WinApp
- BSE.Platten.Admin
- BSE.Platten.Audio
- BSE.Platten.BO
- BSE.Platten.Common
- BSE.Platten.Covers
- BSE.Platten.FreeDb
- BSE.Platten.Ripper
- BSE.Platten.sln
- BSE.Platten.Statistik
- BSE.Platten.Tunes
- BSEadminSetup
- BSEadminSetup.vdproj
- Debug
- Release
- BSEtunesSetup
- BSEtunesSetup.vdproj
- Debug
- Release
- dll
- BSE.CDDrives.DLL
- BSE.Charts.DLL
- BSE.Configuration.DLL
- BSE.RemovableDrives.DLL
- BSE.Shell.DLL
- BSE.ThreadedShell.DLL
- BSE.Windows.Forms.DLL
- Lame
- lame_enc.dll
- lame-3.97
- mysqlcreatedatabase5x.sql.zip
- BSE.Platten.zip
|
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Globalization;
using BSE.Platten.Admin.Properties;
namespace BSE.Platten.Admin
{
public partial class TreeViewAdministration : TreeView
{
#region Events
public event EventHandler<TreeNodeActivateEventArgs> TreeNodeActivated;
#endregion
#region FieldsPrivate
private TreeNodeAdministration m_treeNodeTools;
private TreeNodeAdministration m_treeNodeSystem;
private Image m_imgTools;
private Image m_imgSystem;
#endregion
#region MethodsPublic
public TreeViewAdministration()
{
InitializeComponent();
}
public void InitializeTreeView()
{
if (DesignMode)
{
return;
}
this.ShowRootLines = false;
this.ShowPlusMinus = false;
this.m_imgTools = global::BSE.Platten.Admin.Properties.Resources.tools_16;
this.m_imgSystem = global::BSE.Platten.Admin.Properties.Resources.system;
this.ImageList = new ImageList();
this.ImageList.Images.AddRange(new Image[] {
this.m_imgTools,
this.m_imgSystem});
// Tools
this.m_treeNodeTools = new TreeNodeAdministration();
this.m_treeNodeTools.Parentchild = ParentChild.Parent;
this.m_treeNodeTools.TreeNodeMode = TreeNodeMode.Tools;
this.m_treeNodeTools.CanExecute = false;
this.m_treeNodeTools.Text = string.Format(CultureInfo.CurrentUICulture, Resources.IDS_TreeViewAdministrationToolsText);;
this.m_treeNodeTools.ImageIndex = 0;
this.m_treeNodeTools.Nodes.Clear();
// System
this.m_treeNodeSystem = new TreeNodeAdministration();
this.m_treeNodeSystem.Parentchild = ParentChild.Parent;
this.m_treeNodeSystem.TreeNodeMode = TreeNodeMode.Statistic;
this.m_treeNodeSystem.CanExecute = false;
this.m_treeNodeSystem.Text = string.Format(CultureInfo.CurrentUICulture,Resources.IDS_TreeViewAdministrationSystemText);
this.m_treeNodeSystem.ImageIndex = 1;
this.m_treeNodeSystem.SelectedImageIndex = 1;
this.m_treeNodeSystem.Nodes.Clear();
this.Nodes.AddRange(new TreeNode[] {
this.m_treeNodeTools,
this.m_treeNodeSystem});
Type typeOfInterface = typeof(IIsInAdminForm);
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
Type[] types = assembly.GetTypes();
int iImageIndex = 2;
foreach (Type type in types)
{
if (type.IsClass &&
typeOfInterface.IsAssignableFrom(type))
{
System.Reflection.PropertyInfo propertyInfo = type.GetProperty("ShowInTreeView");
if (propertyInfo != null)
{
using (BaseForm baseForm = Activator.CreateInstance(type) as BaseForm)
{
if ((bool)propertyInfo.GetValue(baseForm, null))
{
TreeNodeAdministration treeNode = new TreeNodeAdministration(baseForm.Text);
treeNode.Tag = type;
if (baseForm.TreeNodeImage != null)
{
this.ImageList.Images.Add(baseForm.TreeNodeImage);
treeNode.ImageIndex = iImageIndex;
treeNode.SelectedImageIndex = iImageIndex;
iImageIndex++;
}
if (baseForm.ShowInToolsNode == true)
{
treeNode.TreeNodeMode = TreeNodeMode.Tools;
treeNode.Parentchild = ParentChild.Child;
treeNode.CanExpand = false;
treeNode.CanExecute = true;
this.m_treeNodeTools.Nodes.Add(treeNode);
}
if (baseForm.ShowInStatisticNode == true)
{
treeNode.TreeNodeMode = TreeNodeMode.Statistic;
treeNode.Parentchild = ParentChild.Child;
treeNode.CanExpand = false;
treeNode.CanExecute = true;
this.m_treeNodeSystem.Nodes.Add(treeNode);
}
}
}
}
}
}
this.ExpandAll();
}
#endregion
#region MethodsProtected
protected override void OnMouseUp(MouseEventArgs e)
{
base.OnMouseDown(e);
TreeNodeAdministration treeNode = this.GetNodeAt(e.X, e.Y) as TreeNodeAdministration;
if (treeNode != null)
{
if (treeNode.IsSelected == false)
{
this.SelectedNode = treeNode;
}
else
{
if (treeNode.Parentchild == ParentChild.Child)
{
if (TreeNodeActivated != null)
{
Type type = treeNode.Tag as Type;
TreeNodeActivated(this, new TreeNodeActivateEventArgs(type));
}
}
}
}
}
protected override void OnAfterSelect(TreeViewEventArgs e)
{
base.OnAfterSelect(e);
TreeNodeAdministration treeNode = e.Node as TreeNodeAdministration;
if (treeNode != null)
{
if (treeNode.Parentchild == ParentChild.Child)
{
Type type = (Type)treeNode.Tag;
if (TreeNodeActivated != null)
{
TreeNodeActivated(this, new TreeNodeActivateEventArgs(type));
}
}
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.