This commit is contained in:
154
PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs
Normal file
154
PROMS/VEPROMS.CSLA.Library/Extension/FolderExt.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
// ========================================================================
|
||||
// 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.Drawing;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public partial class Folder : IVEDrillDown
|
||||
{
|
||||
#region Folder Config
|
||||
[NonSerialized]
|
||||
private FolderConfig _FolderConfig;
|
||||
public FolderConfig FolderConfig
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_FolderConfig == null)
|
||||
{
|
||||
_FolderConfig = new FolderConfig(this);
|
||||
_FolderConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_FolderConfig_PropertyChanged);
|
||||
}
|
||||
return _FolderConfig;
|
||||
}
|
||||
}
|
||||
public void FolderConfigRefresh()
|
||||
{
|
||||
_FolderConfig = null;
|
||||
}
|
||||
private void _FolderConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
Config = _FolderConfig.ToString();
|
||||
}
|
||||
#endregion
|
||||
public override string ToString()
|
||||
{
|
||||
return _Title;
|
||||
}
|
||||
#region IVEReadOnlyItem
|
||||
public System.Collections.IList GetChildren()
|
||||
{
|
||||
if (FolderDocVersionCount != 0) return FolderDocVersions;
|
||||
if (ChildFolderCount != 0) return ChildFolders;
|
||||
return null;
|
||||
}
|
||||
public bool HasChildren
|
||||
{
|
||||
get { return _FolderDocVersionCount > 0 || _ChildFolderCount > 0; }
|
||||
}
|
||||
public IVEDrillDown ActiveParent
|
||||
{
|
||||
get
|
||||
{
|
||||
return MyParent;
|
||||
}
|
||||
}
|
||||
public Format ActiveFormat
|
||||
{
|
||||
get { return LocalFormat != null ? LocalFormat : (ActiveParent != null ? ActiveParent.ActiveFormat : null); }
|
||||
}
|
||||
public Format LocalFormat
|
||||
{
|
||||
get { return MyFormat; }
|
||||
}
|
||||
public DynamicTypeDescriptor MyConfig
|
||||
{
|
||||
get { return FolderConfig; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public partial class FolderInfo:IVEDrillDownReadOnly
|
||||
{
|
||||
#region Folder Config (Read-Only)
|
||||
[NonSerialized]
|
||||
private FolderConfig _FolderConfig;
|
||||
public FolderConfig FolderConfig
|
||||
{ get {
|
||||
return (_FolderConfig != null ? _FolderConfig : _FolderConfig = new FolderConfig(this));
|
||||
} }
|
||||
private void FolderConfigRefresh()
|
||||
{
|
||||
_FolderConfig = null;
|
||||
}
|
||||
#endregion
|
||||
#region IVEReadOnlyItem
|
||||
public System.Collections.IList GetChildren()
|
||||
{
|
||||
if(FolderDocVersionCount != 0)return FolderDocVersions;
|
||||
if (ChildFolderCount != 0) return ChildFolders;
|
||||
return null;
|
||||
}
|
||||
//public bool ChildrenAreLoaded
|
||||
//{
|
||||
// get { return _FolderDocVersions != null || _ChildFolders != null; }
|
||||
//}
|
||||
public bool HasChildren
|
||||
{
|
||||
get { return _FolderDocVersionCount > 0 || _ChildFolderCount > 0; }
|
||||
}
|
||||
public IVEDrillDownReadOnly ActiveParent
|
||||
{
|
||||
get
|
||||
{
|
||||
return MyParent;
|
||||
}
|
||||
}
|
||||
public FormatInfo ActiveFormat
|
||||
{
|
||||
get { return LocalFormat != null ? LocalFormat : ( ActiveParent != null ? ActiveParent.ActiveFormat : null); }
|
||||
}
|
||||
public FormatInfo LocalFormat
|
||||
{
|
||||
get { return MyFormat; }
|
||||
}
|
||||
public DynamicTypeDescriptor MyConfig
|
||||
{
|
||||
get { return Get().FolderConfig; }
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} - {1}", Name, Title);
|
||||
}
|
||||
//public string ToString(string str, System.IFormatProvider ifp)
|
||||
//{
|
||||
// return ToString();
|
||||
//}
|
||||
#endregion
|
||||
public Color BackColor
|
||||
{ get { return FolderConfig.Default_BkColor; } }
|
||||
#region Extension
|
||||
partial class FolderInfoExtension : extensionBase
|
||||
{
|
||||
public override void Refresh(FolderInfo tmp)
|
||||
{
|
||||
tmp.FolderConfigRefresh();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user