Update of /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4652
Modified Files:
DataTableNode.cs FolderNode.cs FormNode.cs HTMLNode.cs
OCXNode.cs
Log Message:
Changed a lot of protected variables that where storage for properties to private
Added i18n support
Method parameter names should use a camel case for their names
Index: DataTableNode.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/DataTableNode.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DataTableNode.cs 1 Sep 2004 12:59:31 -0000 1.3
--- DataTableNode.cs 19 Jan 2005 23:02:46 -0000 1.4
***************
*** 24,43 ****
//
#region
! //Added by Alexander Kachalkov
! /// <summary>
! /// A cached reference to the MMC console
! /// </summary>
! protected IConsole2 m_Console = null;
!
! //Added by Arunjeet Singh
! /// <summary>
! /// Variable to hold the AutoRefresh property
! /// </summary>
! protected bool m_AutoRefresh = false;
!
! /// <summary>
! /// Underlying template for the listview control
! /// </summary>
! protected DataTable m_table = null;
// MAM: the filtersets that are active.
--- 24,30 ----
//
#region
! private IConsole2 _console = null;
! private bool _autoRefresh = false;
! private DataTable _table = null;
// MAM: the filtersets that are active.
***************
*** 47,51 ****
/// by testing if they occur anywhere within the value.
/// </summary>
! protected Hashtable m_filters = null;
#endregion
--- 34,38 ----
/// by testing if they occur anywhere within the value.
/// </summary>
! private Hashtable _filters = null;
#endregion
***************
*** 61,65 ****
public IHeaderCtrl2 HeaderCtrl
{
! get { return (IHeaderCtrl2)m_Console; }
}
--- 48,52 ----
public IHeaderCtrl2 HeaderCtrl
{
! get { return (IHeaderCtrl2)_console; }
}
***************
*** 70,74 ****
public IResultData ResultData
{
! get { return (IResultData)m_Console; }
}
/// <summary>
--- 57,61 ----
public IResultData ResultData
{
! get { return (IResultData)_console; }
}
/// <summary>
***************
*** 77,84 ****
public DataTable Table
{
! get { return m_table; }
set
{
! m_table = value;
if(AutoRefresh)
{
--- 64,71 ----
public DataTable Table
{
! get { return _table; }
set
{
! _table = value;
if(AutoRefresh)
{
***************
*** 97,105 ****
get
{
! return m_AutoRefresh;
}
set
{
! m_AutoRefresh = value;
}
}
--- 84,92 ----
get
{
! return _autoRefresh;
}
set
{
! _autoRefresh = value;
}
}
***************
*** 129,133 ****
public override void OnResultShow()
{
! m_Console = m_Snapin.ResultViewConsole;
// setup the header for the columns we want to show
--- 116,120 ----
public override void OnResultShow()
{
! _console = Snapin.ResultViewConsole;
// setup the header for the columns we want to show
***************
*** 174,180 ****
try
{
! if (m_table != null)
// Let's put in the column titles
! foreach (DataColumn col in m_table.Columns)
{
string name = col.Caption;
--- 161,167 ----
try
{
! if (this.Table != null)
// Let's put in the column titles
! foreach (DataColumn col in this.Table.Columns)
{
string name = col.Caption;
***************
*** 183,187 ****
int nWidth = (int)ColumnHeaderWidth.AUTO_WIDTH;
! foreach(DataColumn prkey in m_table.PrimaryKey)
if (col == prkey)
nWidth = (int)ColumnHeaderWidth.HIDE_COLUMN;
--- 170,174 ----
int nWidth = (int)ColumnHeaderWidth.AUTO_WIDTH;
! foreach(DataColumn prkey in this.Table.PrimaryKey)
if (col == prkey)
nWidth = (int)ColumnHeaderWidth.HIDE_COLUMN;
***************
*** 208,214 ****
/// </summary>
/// <param name="ResultData"></param>
! public virtual void OnShowData(IResultData ResultData)
{
! if (m_table != null)
{
int nRow = 1;
--- 195,201 ----
/// </summary>
/// <param name="ResultData"></param>
! public virtual void OnShowData(IResultData resultData)
{
! if (this.Table != null)
{
int nRow = 1;
***************
*** 216,220 ****
Table.AcceptChanges();
! foreach (DataRow row in m_table.Rows)
{
// MAM: check if the item should be added based on the filtering.
--- 203,207 ----
Table.AcceptChanges();
! foreach (DataRow row in this.Table.Rows)
{
// MAM: check if the item should be added based on the filtering.
***************
*** 310,314 ****
/// <param name="ResultDataItem"></param>
/// <param name="pItemID"></param>
! public virtual void GetItem(out RESULTDATAITEM ResultDataItem, uint pItemID)
{
RESULTDATAITEM rdi = new RESULTDATAITEM();
--- 297,301 ----
/// <param name="ResultDataItem"></param>
/// <param name="pItemID"></param>
! public virtual void GetItem(out RESULTDATAITEM resultDataItem, uint pItemID)
{
RESULTDATAITEM rdi = new RESULTDATAITEM();
***************
*** 320,324 ****
ResultData.GetItem(ref rdi);
! ResultDataItem = rdi;
}
--- 307,311 ----
ResultData.GetItem(ref rdi);
! resultDataItem = rdi;
}
***************
*** 418,422 ****
public virtual int GetItemLParam(int nRow)
{
! return m_iCookie | (nRow << 16);
}
#endregion
--- 405,409 ----
public virtual int GetItemLParam(int nRow)
{
! return this.Cookie | (nRow << 16);
}
#endregion
***************
*** 497,501 ****
{
case MMC_FILTER_CHANGE_CODE.MFCC_DISABLE:
! this.m_filters = null;
break;
--- 484,488 ----
{
case MMC_FILTER_CHANGE_CODE.MFCC_DISABLE:
! this._filters = null;
break;
***************
*** 511,517 ****
// Get the column object and set the string
! if(this.m_filters == null)
{
! this.m_filters = new Hashtable();
}
--- 498,504 ----
// Get the column object and set the string
! if(this._filters == null)
{
! this._filters = new Hashtable();
}
***************
*** 523,537 ****
if (!Regex.IsMatch(strData, @"\w") || strData.Length >= (bufLen / 2))
{
! this.m_filters.Remove(col);
}
else
{
! this.m_filters[col] = strData;
}
// Performance: unset the filter object when no filters are active.
! if(this.m_filters.Count == 0)
{
! this.m_filters = null;
}
--- 510,524 ----
if (!Regex.IsMatch(strData, @"\w") || strData.Length >= (bufLen / 2))
{
! this._filters.Remove(col);
}
else
{
! this._filters[col] = strData;
}
// Performance: unset the filter object when no filters are active.
! if(this._filters.Count == 0)
{
! this._filters = null;
}
***************
*** 595,599 ****
{
// Performance: No filters: return early.
! if(m_filters == null)
{
return true;
--- 582,586 ----
{
// Performance: No filters: return early.
! if(_filters == null)
{
return true;
***************
*** 603,607 ****
for(int i=0; i<data.Length; i++)
{
! string filterValue = m_filters[i] as string;
if(filterValue != null && data[i] != null)
{
--- 590,594 ----
for(int i=0; i<data.Length; i++)
{
! string filterValue = _filters[i] as string;
if(filterValue != null && data[i] != null)
{
Index: OCXNode.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/OCXNode.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OCXNode.cs 22 Jul 2004 14:07:04 -0000 1.3
--- OCXNode.cs 19 Jan 2005 23:02:46 -0000 1.4
***************
*** 15,19 ****
/// The guid for the ActivX Control
/// </summary>
! protected Guid m_guidOCX;
/// <summary>
--- 15,19 ----
/// The guid for the ActivX Control
/// </summary>
! private Guid _guidOCX;
/// <summary>
***************
*** 21,25 ****
/// of this type or reuse the existing one
/// </summary>
! protected bool m_bCreateNew;
/// <summary>
--- 21,25 ----
/// of this type or reuse the existing one
/// </summary>
! private bool _bCreateNew;
/// <summary>
***************
*** 28,33 ****
public virtual Guid OCXGuid
{
! get { return m_guidOCX; }
! set { m_guidOCX = value; }
}
--- 28,33 ----
public virtual Guid OCXGuid
{
! get { return _guidOCX; }
! set { _guidOCX = value; }
}
***************
*** 38,43 ****
public virtual bool CreateNew
{
! get { return m_bCreateNew; }
! set { m_bCreateNew = value; }
}
--- 38,43 ----
public virtual bool CreateNew
{
! get { return _bCreateNew; }
! set { _bCreateNew = value; }
}
***************
*** 48,52 ****
public OCXNode(SnapinBase snapin) : base(snapin)
{
! m_bCreateNew = false;
}
--- 48,52 ----
public OCXNode(SnapinBase snapin) : base(snapin)
{
! this.CreateNew = false;
}
Index: FormNode.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/FormNode.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FormNode.cs 22 Jul 2004 14:07:04 -0000 1.2
--- FormNode.cs 19 Jan 2005 23:02:46 -0000 1.3
***************
*** 23,34 ****
//
#region
! /// <summary>
! /// The Type of the UserControl to create
! /// </summary>
! protected Type m_ControlType;
! /// <summary>
! /// The usercontrol
! /// </summary>
! protected object m_usercontrol;
#endregion
--- 23,28 ----
//
#region
! private Type _controlType;
! private object _usercontrol;
#endregion
***************
*** 43,54 ****
public virtual Type ControlType
{
! get { return m_ControlType; }
! set { m_ControlType = value; }
}
public virtual object UserControl
{
! get { return m_usercontrol; }
! set { m_usercontrol = value; }
}
#endregion
--- 37,48 ----
public virtual Type ControlType
{
! get { return _controlType; }
! set { _controlType = value; }
}
public virtual object UserControl
{
! get { return _usercontrol; }
! set { _usercontrol = value; }
}
#endregion
***************
*** 113,133 ****
// the OCX must implement this because its our shim control
IMMCFormsShim shim = objOCX as IMMCFormsShim;
!
if (shim == null || ControlType == null)
return false;
// get the type information from reflection
! Assembly asm = Assembly.GetAssembly(m_ControlType);
// create the user control in the OCX
! System.IntPtr pUnk = shim.HostUserControl(asm.FullName, m_ControlType.ToString());
// marshal the usercontrol reference back up through the shim
// and store as UserControl property
! m_usercontrol = Marshal.GetObjectForIUnknown(pUnk);
// check if the usercontrol implements ISnapinLink
// if so provide a back reference to the base snapin.
! ISnapinLink snapinLink = m_usercontrol as ISnapinLink;
if(snapinLink != null)
snapinLink.ContextNode = this;
--- 107,127 ----
// the OCX must implement this because its our shim control
IMMCFormsShim shim = objOCX as IMMCFormsShim;
!
if (shim == null || ControlType == null)
return false;
// get the type information from reflection
! Assembly asm = Assembly.GetAssembly(this.ControlType);
// create the user control in the OCX
! System.IntPtr pUnk = shim.HostUserControl(asm.FullName, this.ControlType.ToString());
// marshal the usercontrol reference back up through the shim
// and store as UserControl property
! this.UserControl = Marshal.GetObjectForIUnknown(pUnk);
// check if the usercontrol implements ISnapinLink
// if so provide a back reference to the base snapin.
! ISnapinLink snapinLink = this.UserControl as ISnapinLink;
if(snapinLink != null)
snapinLink.ContextNode = this;
Index: HTMLNode.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/HTMLNode.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HTMLNode.cs 22 Jul 2004 14:07:04 -0000 1.3
--- HTMLNode.cs 19 Jan 2005 23:02:46 -0000 1.4
***************
*** 10,17 ****
public class HTMLNode : BaseNode, IMMCSaneNode
{
! /// <summary>
! /// The Url to navigate to on startup.
! /// </summary>
! protected string m_strUrl;
/// <summary>
--- 10,14 ----
public class HTMLNode : BaseNode, IMMCSaneNode
{
! private string _strUrl;
/// <summary>
***************
*** 20,25 ****
public string Url
{
! get { return m_strUrl; }
! set { m_strUrl = value; }
}
--- 17,22 ----
public string Url
{
! get { return _strUrl; }
! set { _strUrl = value; }
}
***************
*** 30,34 ****
public HTMLNode(SnapinBase snapin) : base(snapin)
{
! m_strUrl = "about:blank";
}
--- 27,31 ----
public HTMLNode(SnapinBase snapin) : base(snapin)
{
! this.Url = "about:blank";
}
***************
*** 40,44 ****
public HTMLNode(SnapinBase snapin, String displayName, String url) : base(snapin, displayName)
{
! m_strUrl = url;
}
--- 37,41 ----
public HTMLNode(SnapinBase snapin, String displayName, String url) : base(snapin, displayName)
{
! this.Url = url;
}
***************
*** 50,54 ****
public HTMLNode(SnapinBase snapin, String displayName, String url, String ico1, String ico2) : base(snapin, displayName, ico1,ico2)
{
! m_strUrl = url;
}
--- 47,51 ----
public HTMLNode(SnapinBase snapin, String displayName, String url, String ico1, String ico2) : base(snapin, displayName, ico1,ico2)
{
! this.Url = url;
}
Index: FolderNode.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/FolderNode.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FolderNode.cs 1 Sep 2004 13:00:02 -0000 1.3
--- FolderNode.cs 19 Jan 2005 23:02:46 -0000 1.4
***************
*** 14,23 ****
public class FolderNode : BaseNode, IMMCSaneNode
{
! protected string path;
! protected ArrayList Files = new ArrayList();
public FolderNode(SnapinBase snapin, string path) : base(snapin)
{
! this.path = path;
CreateChildFiles(path);
}
--- 14,32 ----
public class FolderNode : BaseNode, IMMCSaneNode
{
! private string _path;
! private ArrayList _files = new ArrayList();
!
! /// <summary>
! /// Get/set the path
! /// </summary>
! public string Path
! {
! set{_path = value;}
! get{return _path;}
! }
public FolderNode(SnapinBase snapin, string path) : base(snapin)
{
! this.Path = path;
CreateChildFiles(path);
}
***************
*** 36,40 ****
file.DisplayName = fileInfo.Name;
! Files.Add(file);
}
}
--- 45,49 ----
file.DisplayName = fileInfo.Name;
! _files.Add(file);
}
}
***************
*** 67,71 ****
try
{
! header.InsertColumn(0, "Name", (int)ColumnHeaderFormat.LEFT, 250);
}
catch(COMException e)
--- 76,80 ----
try
{
! header.InsertColumn(0, SnapinBase.Translate("Name"), (int)ColumnHeaderFormat.LEFT, 250);
}
catch(COMException e)
***************
*** 87,96 ****
/// in the right pane, for the respective node item selected in the left pane.
/// </summary>
! public virtual void OnShowData(IResultData ResultData)
{
int nRow = 1;
RESULTDATAITEM rdi = new RESULTDATAITEM();
! foreach (FileNode node in Files)
{
node.ToString();
--- 96,105 ----
/// in the right pane, for the respective node item selected in the left pane.
/// </summary>
! public virtual void OnShowData(IResultData resultData)
{
int nRow = 1;
RESULTDATAITEM rdi = new RESULTDATAITEM();
! foreach (FileNode node in _files)
{
node.ToString();
***************
*** 102,106 ****
rdi.lParam = node.Cookie | (nRow << 16);
! ResultData.InsertItem(ref rdi);
nRow++;
}
--- 111,115 ----
rdi.lParam = node.Cookie | (nRow << 16);
! resultData.InsertItem(ref rdi);
nRow++;
}
***************
*** 111,115 ****
public class FileNode : BaseNode
{
! protected FolderNode parentFolder = null;
public FileNode(SnapinBase snapin) : base(snapin)
--- 120,124 ----
public class FileNode : BaseNode
{
! private FolderNode _parentFolder = null;
public FileNode(SnapinBase snapin) : base(snapin)
***************
*** 120,141 ****
public FileNode(SnapinBase snapin, FolderNode parFolder) : base(snapin)
{
! parentFolder = parFolder;
}
! public override void GetDisplayInfo(ref RESULTDATAITEM ResultDataItem)
{
bool bCallbase = true;
! int nRow = (ResultDataItem.lParam >> 16) - 1;
! int nCol = ResultDataItem.nCol;
! if ((ResultDataItem.mask & (uint)RDI.STR) > 0)
{
string data = DisplayName;
! ResultDataItem.str = Marshal.StringToCoTaskMemUni(data);
}
! if ((ResultDataItem.mask & (uint)RDI.IMAGE) > 0)
{
int offset = LargeImageIndex;
--- 129,150 ----
public FileNode(SnapinBase snapin, FolderNode parFolder) : base(snapin)
{
! _parentFolder = parFolder;
}
! public override void GetDisplayInfo(ref RESULTDATAITEM resultDataItem)
{
bool bCallbase = true;
! int nRow = (resultDataItem.lParam >> 16) - 1;
! int nCol = resultDataItem.nCol;
! if ((resultDataItem.mask & (uint)RDI.STR) > 0)
{
string data = DisplayName;
! resultDataItem.str = Marshal.StringToCoTaskMemUni(data);
}
! if ((resultDataItem.mask & (uint)RDI.IMAGE) > 0)
{
int offset = LargeImageIndex;
***************
*** 143,151 ****
offset = SmallImageIndex;
! ResultDataItem.nImage = (parentFolder.Cookie << 16) + offset;
}
if (bCallbase)
! base.GetDisplayInfo(ref ResultDataItem);
}
}
--- 152,160 ----
offset = SmallImageIndex;
! resultDataItem.nImage = (_parentFolder.Cookie << 16) + offset;
}
if (bCallbase)
! base.GetDisplayInfo(ref resultDataItem);
}
}
|