///
/// Copyright © 2003-2008 JetBrains s.r.o.
/// You may distribute under the terms of the GNU General Public License, as published by the Free Software Foundation, version 2 (see License.txt in the repository root folder).
///
using System;
using System.Collections;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using JetBrains.Omea.Base;
using JetBrains.Omea.OpenAPI;
namespace JetBrains.Omea
{
///
/// Loads display column configuration from XML files.
///
internal class ColumnConfigurationLoader
{
internal static void LoadXmlConfiguration( Assembly pluginAssembly, XmlNode node )
{
foreach( XmlNode childNode in node.SelectNodes( "columns" ) )
{
string resourceType = XmlTools.GetRequiredAttribute( childNode, "type" );
LoadColumns( resourceType, childNode );
}
}
private static void LoadColumns( string resourceType, XmlNode node )
{
int index = 0;
foreach( XmlNode columnNode in node.SelectNodes( "column" ) )
{
LoadColumn( resourceType, index, columnNode );
index++;
}
}
private static void LoadColumn( string resourceType, int index, XmlNode node )
{
int width = XmlTools.GetRequiredIntAttribute( node, "width" );
XmlNodeList propNameNodes = node.SelectNodes( "prop" );
ArrayList propNameList = new ArrayList();
for( int i=0; i