[Mmclibrary-cvs] mmclibrary/MMCLib2/Nodes ReportNode.cs,1.23,1.24
Brought to you by:
imjimmurphy,
kachalkov
From: Lesley v. Z. <ex...@us...> - 2005-01-19 23:25:24
|
Update of /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9623 Modified Files: ReportNode.cs Log Message: Changed a lot of protected variables that where storage for properties to private moved 'ShowModalPropertyPages' to PropertyPageSettings.cs Added i18n support Method parameter names should use a camel case for their names Index: ReportNode.cs =================================================================== RCS file: /cvsroot/mmclibrary/mmclibrary/MMCLib2/Nodes/ReportNode.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ReportNode.cs 15 Nov 2004 19:42:52 -0000 1.23 --- ReportNode.cs 19 Jan 2005 23:25:14 -0000 1.24 *************** *** 21,25 **** ////////////////////////////////////////////////////////////////////// // ! // Members // #region --- 21,25 ---- ////////////////////////////////////////////////////////////////////// // ! // Private vars // #region *************** *** 28,32 **** /// A cached reference to the MMC console /// </summary> ! protected IConsole2 m_Console = null; // MAM: the filtersets that are active. --- 28,32 ---- /// A cached reference to the MMC console /// </summary> ! private IConsole2 _console = null; // MAM: the filtersets that are active. *************** *** 36,56 **** /// by testing if they occur anywhere within the value. /// </summary> ! protected Hashtable m_filters = null; ! ! /// <summary> ! /// The set of currently selected items. ! /// Multiselection is not done yet ! /// </summary> ! protected ResultViewItem[] m_currentSelectedItems = null; ! ! /// <summary> ! /// Used to get/set the resultview items. ! /// </summary> ! protected ArrayList m_items = new ArrayList(); ! /// <summary> ! /// Used to get/set the resultview items. ! /// </summary> ! protected ArrayList m_columns = new ArrayList(); #endregion --- 36,44 ---- /// by testing if they occur anywhere within the value. /// </summary> ! private Hashtable _filters = null; ! private ResultViewItem[] _currentSelectedItems = null; ! private ArrayList _items = new ArrayList(); ! private ArrayList _columns = new ArrayList(); #endregion *************** *** 66,70 **** public IHeaderCtrl2 HeaderCtrl { ! get { return (IHeaderCtrl2)m_Console; } } --- 54,58 ---- public IHeaderCtrl2 HeaderCtrl { ! get { return (IHeaderCtrl2)_console; } } *************** *** 75,79 **** public IResultData ResultData { ! get { return (IResultData)m_Console; } } --- 63,67 ---- public IResultData ResultData { ! get { return (IResultData)_console; } } *************** *** 83,88 **** public virtual ArrayList Items { ! get {return m_items;} ! set { m_items = value;} } --- 71,76 ---- public virtual ArrayList Items { ! get {return _items;} ! set { _items = value;} } *************** *** 92,97 **** public virtual ArrayList Columns { ! get { return m_columns; } ! set { m_columns = value;} } #endregion --- 80,85 ---- public virtual ArrayList Columns { ! get { return _columns; } ! set { _columns = value;} } #endregion *************** *** 122,126 **** { base.DisplayName = name; ! this.m_MultiSelectMode = multiselect; } --- 110,114 ---- { base.DisplayName = name; ! this.MultiSelectMode = multiselect; } *************** *** 136,140 **** string returnValue = base.GetResultViewType(ref pViewOptions); // Allow multiselect ! if(m_MultiSelectMode) pViewOptions |= (int)MMC_VIEW_OPTIONS.MULTISELECT; return returnValue; --- 124,128 ---- string returnValue = base.GetResultViewType(ref pViewOptions); // Allow multiselect ! if(MultiSelectMode) pViewOptions |= (int)MMC_VIEW_OPTIONS.MULTISELECT; return returnValue; *************** *** 169,173 **** { // Short-circuit the check if there are no filters. ! if(this.m_filters == null) return true; --- 157,161 ---- { // Short-circuit the check if there are no filters. ! if(this._filters == null) return true; *************** *** 176,183 **** // There are filters defined. Column-0 is as it is the display name of the item. ! foreach(int i in this.m_filters.Keys) { ResultViewColumn filterColumn = (ResultViewColumn)this.Columns[i]; ! String data = (String)this.m_filters[i]; String itemValue; if(filterColumn.Equals(col0)) --- 164,171 ---- // There are filters defined. Column-0 is as it is the display name of the item. ! foreach(int i in this._filters.Keys) { ResultViewColumn filterColumn = (ResultViewColumn)this.Columns[i]; ! String data = (String)this._filters[i]; String itemValue; if(filterColumn.Equals(col0)) *************** *** 202,212 **** } ! public override void GetDisplayInfo(ref RESULTDATAITEM ResultDataItem) { bool bCallbase = true; // the "cell" data ! int nRow = (ResultDataItem.lParam >> 16) - 1; ! int nCol = ResultDataItem.nCol; ArrayList myColumns = this.Columns; --- 190,200 ---- } ! public override void GetDisplayInfo(ref RESULTDATAITEM resultDataItem) { bool bCallbase = true; // the "cell" data ! int nRow = (resultDataItem.lParam >> 16) - 1; ! int nCol = resultDataItem.nCol; ArrayList myColumns = this.Columns; *************** *** 217,221 **** int maxItems = myItems.Count; ! if ((ResultDataItem.mask & (uint)RDI.STR) > 0) { if (nRow >= 0 && nRow < maxItems && nCol >= 0 && nCol < maxCol) --- 205,209 ---- int maxItems = myItems.Count; ! if ((resultDataItem.mask & (uint)RDI.STR) > 0) { if (nRow >= 0 && nRow < maxItems && nCol >= 0 && nCol < maxCol) *************** *** 233,237 **** bCallbase = false; } ! ResultDataItem.str = Marshal.StringToCoTaskMemUni(data); } --- 221,225 ---- bCallbase = false; } ! resultDataItem.str = Marshal.StringToCoTaskMemUni(data); } *************** *** 239,252 **** // small - 0 // large - 1 ! if ((ResultDataItem.mask & (uint)RDI.IMAGE) > 0) { if (nRow >= 0 && nRow < maxItems && nCol >= 0 && nCol < maxCol) { ! ResultDataItem.nImage = GetResultViewImageIndex((ResultViewItem)myItems[nRow]); bCallbase=false; } } if (bCallbase) ! base.GetDisplayInfo(ref ResultDataItem); } --- 227,240 ---- // small - 0 // large - 1 ! if ((resultDataItem.mask & (uint)RDI.IMAGE) > 0) { if (nRow >= 0 && nRow < maxItems && nCol >= 0 && nCol < maxCol) { ! resultDataItem.nImage = GetResultViewImageIndex((ResultViewItem)myItems[nRow]); bCallbase=false; } } if (bCallbase) ! base.GetDisplayInfo(ref resultDataItem); } *************** *** 313,322 **** System.Diagnostics.Debug.WriteLine("ReportNode::OnSelect"); ! this.m_currentSelectedItems = GetCurrentSelected(); bool havePropertyPage = false; ! for(int i=0; i<this.m_currentSelectedItems.Length; i++) { ! this.m_currentSelectedItems[i].OnSelect(); ! if(!havePropertyPage && this.m_currentSelectedItems[i].PropertyPages.Count != 0) { havePropertyPage = true; --- 301,310 ---- System.Diagnostics.Debug.WriteLine("ReportNode::OnSelect"); ! this._currentSelectedItems = GetCurrentSelected(); bool havePropertyPage = false; ! for(int i=0; i<this._currentSelectedItems.Length; i++) { ! this._currentSelectedItems[i].OnSelect(); ! if(!havePropertyPage && this._currentSelectedItems[i].PropertyPages.Count != 0) { havePropertyPage = true; *************** *** 359,365 **** } } ! for(int i=0; i<this.m_currentSelectedItems.Length; i++) { ! oldItems.Add(this.m_currentSelectedItems[i], null); } --- 347,353 ---- } } ! for(int i=0; i<this._currentSelectedItems.Length; i++) { ! oldItems.Add(this._currentSelectedItems[i], null); } *************** *** 377,383 **** } ! for(int i=0; i<this.m_currentSelectedItems.Length; i++) { ! if(newItems.ContainsKey(this.m_currentSelectedItems[i])) { // It was selected and is selected again --- 365,371 ---- } ! for(int i=0; i<this._currentSelectedItems.Length; i++) { ! if(newItems.ContainsKey(this._currentSelectedItems[i])) { // It was selected and is selected again *************** *** 386,394 **** { // It was selected, but is not selected now ! this.m_currentSelectedItems[i].OnDeselect(); } } ! this.m_currentSelectedItems = items; } --- 374,382 ---- { // It was selected, but is not selected now ! this._currentSelectedItems[i].OnDeselect(); } } ! this._currentSelectedItems = items; } *************** *** 399,404 **** public override void OnDeselectScope() { ! if(m_filters !=null ) ! this.m_filters.Clear(); base.OnDeselectScope(); } --- 387,392 ---- public override void OnDeselectScope() { ! if(_filters !=null ) ! this._filters.Clear(); base.OnDeselectScope(); } *************** *** 436,440 **** // to handle the form. //ThreadPool.QueueUserWorkItem(new WaitCallback(CreatePropertySheetForItems), (object)items[i]); ! if (ShowModalPropertySheet) CreatePropertySheetForItems((object)items[i]); else --- 424,428 ---- // to handle the form. //ThreadPool.QueueUserWorkItem(new WaitCallback(CreatePropertySheetForItems), (object)items[i]); ! if (PropertyPageSettings.Instance.ShowModalPropertySheets) CreatePropertySheetForItems((object)items[i]); else *************** *** 462,466 **** } ! m_item.PropertySheet.Text = m_item.DisplayName + " Properties"; IntPtr ctx = new System.IntPtr(); --- 450,454 ---- } ! m_item.PropertySheet.Text = m_item.DisplayName + " " + SnapinBase.Translate("Properties"); IntPtr ctx = new System.IntPtr(); *************** *** 488,496 **** { bool havePropertyPage = false; ! if(m_currentSelectedItems != null) { ! for(int i=0; i<this.m_currentSelectedItems.Length; i++) { ! if(this.m_currentSelectedItems[i].PropertyPages.Count > 0) { havePropertyPage = true; --- 476,484 ---- { bool havePropertyPage = false; ! if(_currentSelectedItems != null) { ! for(int i=0; i<this._currentSelectedItems.Length; i++) { ! if(this._currentSelectedItems[i].PropertyPages.Count > 0) { havePropertyPage = true; *************** *** 508,512 **** public override void OnResultShow() { ! m_Console = m_Snapin.ResultViewConsole; // setup the header for the columns we want to show --- 496,500 ---- public override void OnResultShow() { ! _console = Snapin.ResultViewConsole; // setup the header for the columns we want to show *************** *** 545,549 **** } ! public virtual void OnShowData(IResultData ResultData) { RESULTDATAITEM rdi = new RESULTDATAITEM(); --- 533,537 ---- } ! public virtual void OnShowData(IResultData resultData) { RESULTDATAITEM rdi = new RESULTDATAITEM(); *************** *** 566,571 **** // The low word contains the cookie for the node, while the high word // contains the row number + 1 we're inserting ! rdi.lParam = m_iCookie | (nRow << 16); ! ResultData.InsertItem(ref rdi); ((ResultViewItem)myItems[nRow - 1]).ItemID = (uint)rdi.itemID; } --- 554,559 ---- // The low word contains the cookie for the node, while the high word // contains the row number + 1 we're inserting ! rdi.lParam = Cookie | (nRow << 16); ! resultData.InsertItem(ref rdi); ((ResultViewItem)myItems[nRow - 1]).ItemID = (uint)rdi.itemID; } *************** *** 600,604 **** /// <param name="ResultDataItem"></param> /// <param name="pItemID"></param> ! public virtual void GetItem(out RESULTDATAITEM ResultDataItem, uint pItemID) { RESULTDATAITEM rdi = new RESULTDATAITEM(); --- 588,592 ---- /// <param name="ResultDataItem"></param> /// <param name="pItemID"></param> ! public virtual void GetItem(out RESULTDATAITEM resultDataItem, uint pItemID) { RESULTDATAITEM rdi = new RESULTDATAITEM(); *************** *** 609,613 **** ResultData.GetItem(ref rdi); ! ResultDataItem = rdi; } --- 597,601 ---- ResultData.GetItem(ref rdi); ! resultDataItem = rdi; } *************** *** 676,680 **** /// <param name="nRow"></param> public virtual int GetItemLParam(int nRow) { ! return m_iCookie | (nRow << 16); } #endregion --- 664,668 ---- /// <param name="nRow"></param> public virtual int GetItemLParam(int nRow) { ! return Cookie | (nRow << 16); } #endregion *************** *** 698,702 **** { case MMC_FILTER_CHANGE_CODE.MFCC_DISABLE: ! this.m_filters = null; break; case MMC_FILTER_CHANGE_CODE.MFCC_ENABLE: --- 686,690 ---- { case MMC_FILTER_CHANGE_CODE.MFCC_DISABLE: ! this._filters = null; break; case MMC_FILTER_CHANGE_CODE.MFCC_ENABLE: *************** *** 712,717 **** // Get the column object and set the string ! if(this.m_filters == null) ! this.m_filters = new Hashtable(); // Huh? We get a string back: instead of a null-ptr or zero-terminated string --- 700,705 ---- // Get the column object and set the string ! if(this._filters == null) ! this._filters = new Hashtable(); // Huh? We get a string back: instead of a null-ptr or zero-terminated string *************** *** 721,731 **** // TODO: get this verified/looked at by some COM guru. 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; // Do a forced refresh of all items. --- 709,719 ---- // TODO: get this verified/looked at by some COM guru. 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; // Do a forced refresh of all items. *************** *** 824,828 **** public virtual void RefreshResultConsole() { ! if(GetViewType() != (int)ViewMode.Filtered || this.m_filters == null) Snapin.SelectScopeNode(this); else --- 812,816 ---- public virtual void RefreshResultConsole() { ! if(GetViewType() != (int)ViewMode.Filtered || this._filters == null) Snapin.SelectScopeNode(this); else |