2007-11-20 20:12:45 +00:00

96 lines
3.2 KiB
C#

// ========================================================================
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
// ------------------------------------------------------------------------
// $Workfile: $ $Revision: $
// $Author: $ $Date: $
//
// $History: $
// ========================================================================
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
using System.Configuration;
using System.IO;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections;
namespace VEPROMS.CSLA.Library
{
public partial class ChildFoldersPropertyDescriptor
{
public override string DisplayName
{ get { return Item.Name; } }
public override string Description
{ get { return Item.Title; } }
public override string Name
{ get { return Item.Name; } }
}
public partial class FolderDocVersionsPropertyDescriptor
{
public override string DisplayName
{ get { return Item.Name; } }
public override string Description
{ get { return Item.Name; } }
public override string Name
{ get { return Item.Name; } }
}
public class FormatList : System.ComponentModel.StringConverter
{
private static SortedList<string,FormatInfo> _FormatInfoList;
private static void LoadSortedList()
{
if (_FormatInfoList == null)
{
_FormatInfoList = new SortedList<string, FormatInfo>();
foreach (FormatInfo formatInfo in FormatInfoList.Get())
{
_FormatInfoList.Add(formatInfo.Name, formatInfo);
}
_FormatInfoList.Add("", null);
}
}
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
LoadSortedList();
return new StandardValuesCollection((ICollection)_FormatInfoList.Values);
}
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
public static int? ToInt(string formatName)
{
if (formatName == null || formatName == string.Empty) return null;
LoadSortedList();
foreach (FormatInfo formatInfo in _FormatInfoList.Values)
if (formatInfo != null && formatInfo.Name == formatName) return formatInfo.FormatID;
return null;
}
public static string ToString(int? formatID)
{
if (formatID == null) return null;
LoadSortedList();
foreach (FormatInfo formatInfo in _FormatInfoList.Values)
if (formatInfo != null && formatInfo.FormatID == formatID) return formatInfo.ToString();
return null;
}
public static Format ToFormat(string formatName)
{
if (formatName == null || formatName == string.Empty) return null;
LoadSortedList();
foreach (FormatInfo formatInfo in _FormatInfoList.Values)
if (formatInfo != null && formatInfo.ToString() == formatName) return formatInfo.Get();
return null;
}
}
}