コード例 #1
0
        public void TreeNodeStyle_Method_Reset()
        {
            TreeNodeStyle tns = new TreeNodeStyle();

            tns.BorderStyle       = BorderStyle.Double;
            tns.BorderWidth       = 3;
            tns.ChildNodesPadding = 4;
            tns.Height            = 5;
            tns.HorizontalPadding = 6;
            tns.ImageUrl          = "ImageUrl";
            tns.NodeSpacing       = 7;
            tns.VerticalPadding   = 8;
            tns.Width             = 9;
            Assert.AreEqual(BorderStyle.Double, tns.BorderStyle, "BorderStyle1");
            Assert.AreEqual(3.0, tns.BorderWidth.Value, "BorderWidth1");
            Assert.AreEqual(4.0, tns.ChildNodesPadding.Value, "ChildNodesPadding1");
            Assert.AreEqual(5.0, tns.Height.Value, "Height1");
            Assert.AreEqual(6.0, tns.HorizontalPadding.Value, "HorizontalPadding1");
            Assert.AreEqual("ImageUrl", tns.ImageUrl, "ImageUrl1");
            Assert.AreEqual(7.0, tns.NodeSpacing.Value, "NodeSpacing1");
            Assert.AreEqual(8.0, tns.VerticalPadding.Value, "VerticalPadding1");
            Assert.AreEqual(9.0, tns.Width.Value, "Width1");
            tns.Reset();
            Assert.AreEqual(0.0, tns.BorderWidth.Value, "BorderWidth2");
            Assert.AreEqual(0.0, tns.ChildNodesPadding.Value, "ChildNodesPadding2");
            Assert.AreEqual(0.0, tns.Height.Value, "Height2");
            Assert.AreEqual(0.0, tns.HorizontalPadding.Value, "HorizontalPadding2");
            Assert.AreEqual("", tns.ImageUrl, "ImageUrl2");
            Assert.AreEqual(0.0, tns.NodeSpacing.Value, "NodeSpacing2");
            Assert.AreEqual(0.0, tns.VerticalPadding.Value, "VerticalPadding2");
            Assert.AreEqual(0.0, tns.Width.Value, "Width2");
        }
コード例 #2
0
        public void TreeNodeStyle_Method_MergeWith()
        {
            TreeNodeStyle tns  = new TreeNodeStyle();
            TreeNodeStyle copy = new TreeNodeStyle();

            tns.BorderStyle       = BorderStyle.Double;
            tns.BorderWidth       = 3;
            tns.ChildNodesPadding = 4;
            tns.Height            = 5;
            tns.HorizontalPadding = 6;
            tns.ImageUrl          = "ImageUrl";
            tns.NodeSpacing       = 7;
            tns.VerticalPadding   = 8;
            tns.Width             = 9;
            copy.ImageUrl         = "NewImageUrl";
            copy.NodeSpacing      = 10;
            copy.VerticalPadding  = 11;
            copy.Width            = 12;
            copy.MergeWith(tns);
            Assert.AreEqual(tns.BorderStyle, copy.BorderStyle, "BorderStyle");
            Assert.AreEqual(tns.BorderWidth, copy.BorderWidth, "Borderidth");
            Assert.AreEqual(tns.ChildNodesPadding, copy.ChildNodesPadding, "ChildNodesPadding");
            Assert.AreEqual(tns.Height, copy.Height, "Height");
            Assert.AreEqual(tns.HorizontalPadding, copy.HorizontalPadding, "HorizontalPadding");
            Assert.AreEqual("NewImageUrl", copy.ImageUrl, "ImageUrl1");
            Assert.AreEqual(Unit.Pixel(10), copy.NodeSpacing, "NodeSpacing1");
            Assert.AreEqual(Unit.Pixel(11), copy.VerticalPadding, "VerticalPadding1");
            Assert.AreEqual(Unit.Pixel(12), copy.Width, "Width1");
            Assert.AreEqual("NewImageUrl", copy.ImageUrl, "ImageUrl2");
            Assert.AreEqual(10.0, copy.NodeSpacing.Value, "NodeSpacing2");
            Assert.AreEqual(11.0, copy.VerticalPadding.Value, "VerticalPadding2");
            Assert.AreEqual(12.0, copy.Width.Value, "Width2");
        }
コード例 #3
0
        public void TreeNodeStyle_ViewState()
        {
            TreeNodeStyle orig = new TreeNodeStyle();

            ((IStateManager)orig).TrackViewState();
            TreeNodeStyle copy = new TreeNodeStyle();

            Assert.AreEqual(true, orig.IsEmpty, "TreeNodeStyle_ViewState");
            orig.ChildNodesPadding = 4;
            orig.HorizontalPadding = 6;
            orig.ImageUrl          = "ImageUrl";
            orig.NodeSpacing       = 7;
            orig.VerticalPadding   = 8;
            Assert.AreEqual(false, orig.IsEmpty, "TreeNodeStyle_ViewState");

            object state = ((IStateManager)orig).SaveViewState();

            ((IStateManager)copy).LoadViewState(state);

            Assert.AreEqual(false, copy.IsEmpty, "TreeNodeStyle_ViewState");
            Assert.AreEqual(4.0, copy.ChildNodesPadding.Value, "TreeNodeStyle_ViewState");
            Assert.AreEqual(6.0, copy.HorizontalPadding.Value, "TreeNodeStyle_ViewState");
            Assert.AreEqual("ImageUrl", copy.ImageUrl, "TreeNodeStyle_ViewState");
            Assert.AreEqual(7.0, copy.NodeSpacing.Value, "TreeNodeStyle_ViewState");
            Assert.AreEqual(8.0, copy.VerticalPadding.Value, "TreeNodeStyle_ViewState");
        }
コード例 #4
0
        public void TreeNodeStyle_Method_CopyFrom()
        {
            TreeNodeStyle tns  = new TreeNodeStyle();
            TreeNodeStyle copy = new TreeNodeStyle();

            tns.BorderStyle       = BorderStyle.Double;
            tns.BorderWidth       = 3;
            tns.ChildNodesPadding = 4;
            tns.Height            = 5;
            tns.HorizontalPadding = 6;
            tns.ImageUrl          = "ImageUrl";
            tns.NodeSpacing       = 7;
            tns.VerticalPadding   = 8;
            tns.Width             = 9;
            copy.CopyFrom(tns);
            Assert.AreEqual(tns.BorderStyle, copy.BorderStyle, "BorderStyle");
            Assert.AreEqual(tns.BorderWidth, copy.BorderWidth, "Borderidth");
            Assert.AreEqual(tns.ChildNodesPadding, copy.ChildNodesPadding, "ChildNodesPadding");
            Assert.AreEqual(tns.Height, copy.Height, "Height");
            Assert.AreEqual(tns.HorizontalPadding, copy.HorizontalPadding, "HorizontalPadding");
            Assert.AreEqual(tns.ImageUrl, copy.ImageUrl, "ImageUrl");
            Assert.AreEqual(tns.NodeSpacing, copy.NodeSpacing, "NodeSpacing");
            Assert.AreEqual(tns.VerticalPadding, copy.VerticalPadding, "VerticalPadding");
            Assert.AreEqual(tns.Width, copy.Width, "Width");
        }
コード例 #5
0
        public void TreeNodeStyleCollection_ViewState()
        {
            TreeView tv = new TreeView();

            ((IStateManager)tv.LevelStyles).TrackViewState();

            TreeNodeStyle style = new TreeNodeStyle();

            tv.LevelStyles.Add(style);
            Assert.AreEqual(false, style.IsEmpty, "TreeNodeStyleCollection_ViewState#1");

            tv.LevelStyles.Remove(style);
            Assert.AreEqual(false, style.IsEmpty, "TreeNodeStyleCollection_ViewState#2");

            tv.LevelStyles.Add(style);
            tv.LevelStyles.Add(new TreeNodeStyle());
            tv.LevelStyles [1].BackColor = Color.Blue;

            object   state = ((IStateManager)tv.LevelStyles).SaveViewState();
            TreeView copy  = new TreeView();

            ((IStateManager)copy.LevelStyles).TrackViewState();
            ((IStateManager)copy.LevelStyles).LoadViewState(state);

            Assert.AreEqual(2, copy.LevelStyles.Count, "TreeNodeStyleCollection_ViewState#3");
            Assert.AreEqual(false, copy.LevelStyles [0].IsEmpty, "TreeNodeStyleCollection_ViewState#4");
            Assert.AreEqual(false, copy.LevelStyles [1].IsEmpty, "TreeNodeStyleCollection_ViewState#5");
            Assert.AreEqual(Color.Blue, copy.LevelStyles [1].BackColor, "TreeNodeStyleCollection_ViewState#6");
        }
コード例 #6
0
        public void TreeNodeStyle_DefaultProperties()
        {
            TreeNodeStyle tns = new TreeNodeStyle();

            Assert.AreEqual(0.0, tns.ChildNodesPadding.Value, "ChildNodesPadding");
            Assert.AreEqual(0.0, tns.HorizontalPadding.Value, "HorizontalPadding");
            Assert.AreEqual("", tns.ImageUrl, "ImageUrl");
            Assert.AreEqual(0.0, tns.NodeSpacing.Value, "NodeSpacing");
            Assert.AreEqual(0.0, tns.VerticalPadding.Value, "VerticalPadding");
        }
コード例 #7
0
        public void TreeNodeStyleCollection_Method_Contains()
        {
            TreeView      tv  = new TreeView();
            TreeNodeStyle tns = new TreeNodeStyle();

            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(false, tv.LevelStyles.Contains(tns), "BeforeContains");
            tv.LevelStyles.Add(tns);
            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(true, tv.LevelStyles.Contains(tns), "AfterContains");
        }
コード例 #8
0
        public void TreeNodeStyleCollection_Method_IndexOf()
        {
            TreeView      tv  = new TreeView();
            TreeNodeStyle tns = new TreeNodeStyle();

            tv.LevelStyles.Add(new TreeNodeStyle());
            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(-1, tv.LevelStyles.IndexOf(tns), "BeforeIndexOf");
            tv.LevelStyles.Add(tns);
            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(2, tv.LevelStyles.IndexOf(tns), "AfterIndexOf");
        }
コード例 #9
0
        public void TreeNodeStyleCollection_Method_Insert()
        {
            TreeView tv = new TreeView();

            tv.LevelStyles.Add(new TreeNodeStyle());
            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(2, tv.LevelStyles.Count, "BeforeInsert");
            TreeNodeStyle tns = new TreeNodeStyle();

            tns.ImageUrl = "StyleImageUrl";
            tv.LevelStyles.Insert(1, tns);
            Assert.AreEqual(3, tv.LevelStyles.Count, "AfterInsert1");
            Assert.AreEqual("StyleImageUrl", tv.LevelStyles[1].ImageUrl, "AfterInsert2");
        }
コード例 #10
0
 public FileTreeNode(TreeNodeStyle notestylt, string txt)
 {
     this.NoteStyle = notestylt;
     this.Text      = txt;
     if (notestylt == TreeNodeStyle.File)
     {
         this.ImageIndex         = (int)TreeImgIndex.txt;
         this.SelectedImageIndex = (int)TreeImgIndex.txt;
     }
     else if (notestylt == TreeNodeStyle.Folder)
     {
         this.ImageIndex = (int)TreeImgIndex.ClosedFolder;
     }
 }
コード例 #11
0
        protected override void CreateChildControls()
        {
            WBTaxonomy teams = WBTaxonomy.GetTeams(SPContext.Current.Site);

            String selectedUserLoginName = Page.Request.QueryString["LoginName"];

            if (!String.IsNullOrEmpty(selectedUserLoginName))
            {
                selectedUser = SPContext.Current.Web.WBxEnsureUserOrNull(selectedUserLoginName);
            }

            TermCollection terms = teams.TermSet.Terms;

            if (ParentTeamsTerm != null && ParentTeamsTerm != "")
            {
                Term parentTerm = teams.GetSelectedTermByPath(ParentTeamsTerm);

                terms = parentTerm.Terms;
            }

            SPTreeView treeView = new SPTreeView();

            TreeNodeStyle nodeStyle = new TreeNodeStyle();

            treeView.NodeStyle.HorizontalPadding = new Unit(3);
            treeView.NodeStyle.CssClass          = "wbf-team-tree-node";

            this.Controls.Clear();
            this.Controls.Add(treeView);

            if (UseTreeView)
            {
                treeView.ShowLines = true;

                treeView.Nodes.Clear();

                PopulateTreeView(treeView.Nodes, teams, terms);
            }
            else
            {
                PopulateListView(teams, terms);
            }

            if (!displayingAnyTeams)
            {
                Literal noTeamsLiteral = new Literal();
                noTeamsLiteral.Text = "<i>(You are not a member of such a team site yet. Contact the SharePoint champion in your area for more information)</i>";
                this.Controls.Add(noTeamsLiteral);
            }
        }
コード例 #12
0
        public void TreeNodeStyleCollection_Method_CopyTo()
        {
            TreeView tv = new TreeView();

            TreeNodeStyle[] styleArray = new TreeNodeStyle[10];
            tv.LevelStyles.Add(new TreeNodeStyle());
            TreeNodeStyle tns = new TreeNodeStyle();

            tns.ImageUrl = "StyleImageUrl";
            tv.LevelStyles.Add(tns);
            tv.LevelStyles.Add(new TreeNodeStyle());
            Assert.AreEqual(3, tv.LevelStyles.Count, "BeforeCopyTo");
            tv.LevelStyles.CopyTo(styleArray, 3);
            Assert.AreEqual("StyleImageUrl", styleArray[4].ImageUrl, "AfterCopyTo");
        }
コード例 #13
0
        public void TreeNodeStyleCollection_Method_RemoveAt()
        {
            TreeView      tv   = new TreeView();
            TreeNodeStyle tns1 = new TreeNodeStyle();

            tns1.ImageUrl = "first";
            TreeNodeStyle tns2 = new TreeNodeStyle();

            tns2.ImageUrl = "second";
            TreeNodeStyle tns3 = new TreeNodeStyle();

            tns3.ImageUrl = "third";
            tv.LevelStyles.Add(tns1);
            tv.LevelStyles.Add(tns2);
            tv.LevelStyles.Add(tns3);
            Assert.AreEqual(3, tv.LevelStyles.Count, "BeforeRemove1");
            Assert.AreEqual("second", tv.LevelStyles[1].ImageUrl, "BeforeRemove2");
            tv.LevelStyles.RemoveAt(1);
            Assert.AreEqual(2, tv.LevelStyles.Count, "AfterRemove1");
            Assert.AreEqual("third", tv.LevelStyles[1].ImageUrl, "AfterRemove2");
        }
 // Methods
 public int Add(TreeNodeStyle style)
 {
 }
コード例 #15
0
 public FileTreeNode()
 {
     this._NoteStyle = TreeNodeStyle.File;
     this.Text       = @"???";
 }
 public void CopyTo(TreeNodeStyle[] styleArray, int index)
 {
 }
 public int IndexOf(TreeNodeStyle style)
 {
 }
 public void Insert(int index, TreeNodeStyle style)
 {
 }
 public void Remove(TreeNodeStyle style)
 {
 }
コード例 #20
0
 public int IndexOf(TreeNodeStyle style)
 {
 }
コード例 #21
0
 public void Insert(int index, TreeNodeStyle style)
 {
 }
コード例 #22
0
 public void Remove(TreeNodeStyle style)
 {
 }
コード例 #23
0
 // Methods
 public int Add(TreeNodeStyle style)
 {
 }
 public bool Contains(TreeNodeStyle style)
 {
 }
コード例 #25
0
 public bool Contains(TreeNodeStyle style)
 {
 }