Update of /cvsroot/mmclibrary/mmclibrary/MMCTest2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10662
Modified Files:
MMCTest2.csproj MyPropertyPage.cs MyPropertyPageForItems.cs
Added Files:
TestNode.cs
Log Message:
updated to adopt changes
--- NEW FILE: TestNode.cs ---
using System;
using Ironring.MMC.Nodes;
using Ironring.MMC.Core;
using System.Collections;
namespace MMCTest2
{
public class TestNode : ReportNode
{
public static ResultViewColumn col1 = new ResultViewColumn("Name", (int)ColumnHeaderFormat.LEFT, 100);
BaseNode node1,node2;
public TestNode(SnapinBase snapin, String displayName, String closedIco, String openIco) : base(snapin, displayName, closedIco, openIco)
{
node1 = new BaseNode(Snapin,"test1","","");
node2 = new BaseNode(Snapin,"test2","","");
this.MultiSelectMode = true;
this.AddChild(node1);
this.AddChild(node2);
}
public override ArrayList Items
{
get
{
ArrayList items = new ArrayList();
for(int i=0;i<5;i++)
items.Add(new ResultViewItem(this.Snapin,this,i.ToString()));
return items;
}
}
public override ArrayList Columns
{
get
{
ArrayList a = new ArrayList();
a.Add(col1);
return a;
}
}
public override ArrayList Menus
{
get
{
ArrayList l = new ArrayList(1);
l.Add(new MenuItem("remove subnodes", "remove the child nodes", new MenuCommandHandler(deleteHandler)));
l.Add(new MenuItem("add subnodes", "add some child nodes", new MenuCommandHandler(addHandler)));
return l;
}
}
private void deleteHandler(object o, BaseNode node)
{
node1.Remove(false);
node2.Remove(false);
m_ChildNodes.Clear();
Snapin.SelectScopeNode(this);
}
private void addHandler(object o, BaseNode node)
{
this.AddChild(new BaseNode(Snapin, "a", "", ""));
this.AddChild(new BaseNode(Snapin, "b", "", ""));
this.AddChild(new BaseNode(Snapin, "c", "", ""));
InsertChildren();
}
public override string GetResultViewType(ref int pViewOptions)
{
string returnValue = base.GetResultViewType(ref pViewOptions);
pViewOptions |= (int)MMC_VIEW_OPTIONS.EXCLUDE_SCOPE_ITEMS_FROM_LIST;
return returnValue;
}
public override string ResultViewSmallImage
{
get
{
return "MMCTest2.images.snapin.Ico";
}
}
public override string ResultViewLargeImage
{
get
{
return "MMCTest2.images.snapin.Ico";
}
}
}
}
Index: MyPropertyPageForItems.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCTest2/MyPropertyPageForItems.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MyPropertyPageForItems.cs 15 Apr 2004 10:20:24 -0000 1.4
--- MyPropertyPageForItems.cs 15 Nov 2004 19:47:24 -0000 1.5
***************
*** 25,29 ****
}
! public override void init()
{
this.tbName.Text = SelectedResultItem.DisplayName;
--- 25,29 ----
}
! public override void Init()
{
this.tbName.Text = SelectedResultItem.DisplayName;
Index: MMCTest2.csproj
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCTest2/MMCTest2.csproj,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MMCTest2.csproj 7 Nov 2004 14:45:32 -0000 1.9
--- MMCTest2.csproj 15 Nov 2004 19:47:24 -0000 1.10
***************
*** 131,135 ****
<File
RelPath = "MyPropertyPage.cs"
! SubType = "Code"
BuildAction = "Compile"
/>
--- 131,135 ----
<File
RelPath = "MyPropertyPage.cs"
! SubType = "UserControl"
BuildAction = "Compile"
/>
***************
*** 141,145 ****
<File
RelPath = "MyPropertyPageForItems.cs"
! SubType = "Code"
BuildAction = "Compile"
/>
--- 141,145 ----
<File
RelPath = "MyPropertyPageForItems.cs"
! SubType = "UserControl"
BuildAction = "Compile"
/>
***************
*** 176,180 ****
<File
RelPath = "TestSnapinBase.cs"
! SubType = "Code"
BuildAction = "Compile"
/>
--- 176,180 ----
<File
RelPath = "TestSnapinBase.cs"
! SubType = "Component"
BuildAction = "Compile"
/>
Index: MyPropertyPage.cs
===================================================================
RCS file: /cvsroot/mmclibrary/mmclibrary/MMCTest2/MyPropertyPage.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MyPropertyPage.cs 31 Mar 2004 07:58:46 -0000 1.3
--- MyPropertyPage.cs 15 Nov 2004 19:47:24 -0000 1.4
***************
*** 4,7 ****
--- 4,9 ----
using System.Drawing;
using System.Windows.Forms;
+
+ using Ironring.MMC.Core;
using Ironring.MMC.Nodes;
***************
*** 16,32 ****
private System.ComponentModel.IContainer components = null;
public MyPropertyPage()
{
InitializeComponent();
- //tbNodeName.Text = Node.DisplayName;
- //tbNodeType.Text = Node.GetType().ToString();
}
! private void OnInit()
{
! BaseNode node = this.PropertyPage.PropertySheet.Node;
! tbNodeName.Text = node.DisplayName;
! tbNodeType.Text = node.GetType().ToString();
}
/// <summary>
/// Clean up any resources being used.
--- 18,54 ----
private System.ComponentModel.IContainer components = null;
+ BaseNode m_node;
+ SnapinBase m_snapin;
+
public MyPropertyPage()
{
InitializeComponent();
}
!
! //private void OnInit()
! public override void Init()
{
! m_node = this.PropertyPage.PropertySheet.Node;
! m_snapin = m_node.Snapin;
! tbNodeName.Text = m_node.DisplayName;
! tbNodeType.Text = m_node.GetType().ToString();
! this.tbNodeName.TextChanged+=new EventHandler(ActivateApplyBtn);
! base.Init ();
}
+ public override void onApply()
+ {
+ //m_node.AddChild(new BaseNode(m_snapin, "tryout", "", ""));
+ //m_node.InsertChildren();
+ base.onApply();
+ }
+
+ protected override void fancyName()
+ {
+ m_node.AddChild(new BaseNode(m_snapin, "tryout", "", ""));
+ m_node.InsertChildren();
+ }
+
+
/// <summary>
/// Clean up any resources being used.
***************
*** 96,109 ****
this.Controls.Add(this.tbNodeName);
this.Name = "MyPropertyPage";
- this.Paint += new System.Windows.Forms.PaintEventHandler(this.MyPropertyPage_Paint);
this.ResumeLayout(false);
}
#endregion
-
- private void MyPropertyPage_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
- {
- OnInit();
- }
}
}
--- 118,125 ----
|