/// <internalonly/>
        /// <devdoc>
        /// Creates a clone of the MenuItemBinding.
        /// </devdoc>
        object ICloneable.Clone()
        {
            MenuItemBinding clone = new MenuItemBinding();

            clone.DataMember             = DataMember;
            clone.Depth                  = Depth;
            clone.Enabled                = Enabled;
            clone.EnabledField           = EnabledField;
            clone.FormatString           = FormatString;
            clone.ImageUrl               = ImageUrl;
            clone.ImageUrlField          = ImageUrlField;
            clone.NavigateUrl            = NavigateUrl;
            clone.NavigateUrlField       = NavigateUrlField;
            clone.PopOutImageUrl         = PopOutImageUrl;
            clone.PopOutImageUrlField    = PopOutImageUrlField;
            clone.Selectable             = Selectable;
            clone.SelectableField        = SelectableField;
            clone.SeparatorImageUrl      = SeparatorImageUrl;
            clone.SeparatorImageUrlField = SeparatorImageUrlField;
            clone.Target                 = Target;
            clone.TargetField            = TargetField;
            clone.Text         = Text;
            clone.TextField    = TextField;
            clone.ToolTip      = ToolTip;
            clone.ToolTipField = ToolTipField;
            clone.Value        = Value;
            clone.ValueField   = ValueField;

            return(clone);
        }
Exemple #2
0
		public void Test_ToString ()
		{
			var mib = new MenuItemBinding ();

			Assert.AreEqual ("(Empty)", mib.ToString (), "#A1");
			foreach (var entry in toStringValues)
				ToStringTestProperty (entry.Key, entry.Value);
		}
Exemple #3
0
        protected override void OnValidate(object value)
        {
            base.OnValidate(value);
            MenuItemBinding binding = value as MenuItemBinding;

            if (((binding != null) && (binding.DataMember.Length == 0)) && (binding.Depth == -1))
            {
                this._defaultBinding = binding;
            }
        }
 private void FindDefaultBinding() {
     _defaultBinding = null;
     // Look for another binding that would be a good default
     foreach (MenuItemBinding binding in this) {
         if (binding.Depth == -1 && binding.DataMember.Length == 0) {
             _defaultBinding = binding;
             break;
         }
     }
 }
Exemple #5
0
        object ICloneable.Clone()
        {
            MenuItemBinding bin = new MenuItemBinding();

            foreach (DictionaryEntry e in ViewState)
            {
                bin.ViewState [(string)e.Key] = e.Value;
            }
            return(bin);
        }
 private void FindDefaultBinding()
 {
     this._defaultBinding = null;
     foreach (MenuItemBinding binding in this)
     {
         if ((binding.Depth == -1) && (binding.DataMember.Length == 0))
         {
             this._defaultBinding = binding;
             break;
         }
     }
 }
Exemple #7
0
 private void FindDefaultBinding()
 {
     this._defaultBinding = null;
     foreach (MenuItemBinding binding in this)
     {
         if ((binding.Depth == -1) && (binding.DataMember.Length == 0))
         {
             this._defaultBinding = binding;
             break;
         }
     }
 }
Exemple #8
0
 private void FindDefaultBinding()
 {
     _defaultBinding = null;
     // Look for another binding that would be a good default
     foreach (MenuItemBinding binding in this)
     {
         if (binding.Depth == -1 && binding.DataMember.Length == 0)
         {
             _defaultBinding = binding;
             break;
         }
     }
 }
Exemple #9
0
 MenuItemBinding GetBinding()
 {
     if (menu == null)
     {
         return(null);
     }
     if (gotBinding)
     {
         return(binding);
     }
     binding    = menu.FindBindingForItem(GetDataItemType(), Depth);
     gotBinding = true;
     return(binding);
 }
Exemple #10
0
        /// <devdoc>
        ///     Gets a MenuItemBinding data binding definition for the specified depth or datamember
        /// </devdoc>
        internal MenuItemBinding GetBinding(string dataMember, int depth)
        {
            MenuItemBinding bestMatch = null;
            int             match     = 0;

            if ((dataMember != null) && (dataMember.Length == 0))
            {
                dataMember = null;
            }

            foreach (MenuItemBinding binding in this)
            {
                if ((binding.Depth == depth))
                {
                    if (String.Equals(binding.DataMember, dataMember, StringComparison.CurrentCultureIgnoreCase))
                    {
                        return(binding);
                    }
                    else if ((match < 1) && (binding.DataMember.Length == 0))
                    {
                        bestMatch = binding;
                        match     = 1;
                    }
                }
                else if (String.Equals(binding.DataMember, dataMember, StringComparison.CurrentCultureIgnoreCase) &&
                         (match < 2) &&
                         (binding.Depth == -1))
                {
                    bestMatch = binding;
                    match     = 2;
                }
            }

            if (bestMatch == null)
            {
                // Check that the default binding is still suitable (VSWhidbey 358817)
                if (_defaultBinding != null)
                {
                    if (_defaultBinding.Depth != -1 || _defaultBinding.DataMember.Length != 0)
                    {
                        // Look for another binding that would be a good default
                        FindDefaultBinding();
                    }
                    bestMatch = _defaultBinding;
                }
            }

            return(bestMatch);
        }
Exemple #11
0
        internal MenuItemBinding GetBinding(string dataMember, int depth)
        {
            MenuItemBinding binding = null;
            int             num     = 0;

            if ((dataMember != null) && (dataMember.Length == 0))
            {
                dataMember = null;
            }
            foreach (MenuItemBinding binding2 in this)
            {
                if (binding2.Depth == depth)
                {
                    if (string.Equals(binding2.DataMember, dataMember, StringComparison.CurrentCultureIgnoreCase))
                    {
                        return(binding2);
                    }
                    if ((num < 1) && (binding2.DataMember.Length == 0))
                    {
                        binding = binding2;
                        num     = 1;
                    }
                }
                else if ((string.Equals(binding2.DataMember, dataMember, StringComparison.CurrentCultureIgnoreCase) && (num < 2)) && (binding2.Depth == -1))
                {
                    binding = binding2;
                    num     = 2;
                }
            }
            if ((binding != null) || (this._defaultBinding == null))
            {
                return(binding);
            }
            if ((this._defaultBinding.Depth != -1) || (this._defaultBinding.DataMember.Length != 0))
            {
                this.FindDefaultBinding();
            }
            return(this._defaultBinding);
        }
 private void AddBinding()
 {
     System.Windows.Forms.TreeNode selectedNode = this._schemaTreeView.SelectedNode;
     if (selectedNode != null)
     {
         MenuItemBinding binding = new MenuItemBinding();
         if (selectedNode.Text != this._schemaTreeView.Nodes[0].Text)
         {
             binding.DataMember = selectedNode.Text;
             if (((SchemaTreeNode) selectedNode).Duplicate)
             {
                 binding.Depth = selectedNode.FullPath.Split(new char[] { this._schemaTreeView.PathSeparator[0] }).Length - 1;
             }
             ((IDataSourceViewSchemaAccessor) binding).DataSourceViewSchema = ((SchemaTreeNode) selectedNode).Schema;
             int index = this._bindingsListView.Items.IndexOf(binding);
             if (index == -1)
             {
                 this._bindingsListView.Items.Add(binding);
                 this._bindingsListView.SetSelected(this._bindingsListView.Items.Count - 1, true);
             }
             else
             {
                 binding = (MenuItemBinding) this._bindingsListView.Items[index];
                 this._bindingsListView.SetSelected(index, true);
             }
         }
         else
         {
             this._bindingsListView.Items.Add(binding);
             this._bindingsListView.SetSelected(this._bindingsListView.Items.Count - 1, true);
         }
         this._propertyGrid.SelectedObject = binding;
         this._propertyGrid.Refresh();
         this.UpdateEnabledStates();
     }
     this._bindingsListView.Focus();
 }
		void SetDataBindings (Menu menu) {
			MenuItemBinding b = new MenuItemBinding ();
			b.DataMember = "node";
			b.EnabledField = "enabled";
			b.Enabled = false;
			b.ImageUrlField = "img";
			b.ImageUrl = "img#default";
			b.NavigateUrlField = "url";
			b.NavigateUrl = "url#default";
			b.PopOutImageUrlField = "popoutimg";
			b.PopOutImageUrl = "popoutimg#default";
			b.SelectableField = "selectable";
			b.Selectable = false;
			b.SeparatorImageUrlField = "separatorimg";
			b.SeparatorImageUrl = "separatorimg#default";
			b.TargetField = "target";
			b.Target = "target#default";
			b.FormatString = "text#{0}";
			b.TextField = "text";
			b.Text = "text#default";
			b.ToolTipField = "tooltip";
			b.ToolTip = "tooltip#default";
			b.ValueField = "value";
			b.Value = "value#default";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "root";
			b.Enabled = false;
			b.ImageUrl = "img#root";
			b.NavigateUrl = "url#root";
			b.PopOutImageUrl = "popoutimg#root";
			b.Selectable = false;
			b.SeparatorImageUrl = "separatorimg#root";
			b.Target = "target#root";
			b.Text = "text#root";
			b.ToolTip = "tooltip#root";
			b.Value = "value#root";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra1";
			b.Text = "text#extra1";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra2";
			b.Value = "value#extra2";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra3";
			b.TextField = "text";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra4";
			b.TextField = "text";
			b.Text = "text#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra5";
			b.TextField = "text";
			b.Value = "value#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);
		}
 public void Remove(MenuItemBinding binding)
 {
 }
 public void Remove (MenuItemBinding binding)
 {
 }
    public int IndexOf (MenuItemBinding value)
    {
      Contract.Ensures (Contract.Result<int>() >= -1);

      return default(int);
    }
 public bool Contains (MenuItemBinding binding)
 {
   return default(bool);
 }
 public int IndexOf(MenuItemBinding binding)
 {
     return(((IList)this).IndexOf(binding));
 }
        public int IndexOf(MenuItemBinding value)
        {
            Contract.Ensures(Contract.Result <int>() >= -1);

            return(default(int));
        }
 public void CopyTo(MenuItemBinding[] array, int index)
 {
     this.CopyTo(array, index);
 }
 public int IndexOf(MenuItemBinding value)
 {
   return default(int);
 }
 public void CopyTo(MenuItemBinding[] array, int index)
 {
 }
 public int Add(MenuItemBinding binding)
 {
   return default(int);
 }
 public void Insert(int index, MenuItemBinding binding) {
     ((IList)this).Insert(index, binding);
 }
 public void Insert(int index, MenuItemBinding binding)
 {
 }
 public int Add(MenuItemBinding binding)
 {
     return(default(int));
 }
 public bool Contains(MenuItemBinding binding)
 {
     return(default(bool));
 }
		public int IndexOf (MenuItemBinding binding)
		{
			return ((IList)this).IndexOf (binding);
		}
        /// <internalonly/>
        /// <devdoc>
        /// Creates a clone of the MenuItemBinding.
        /// </devdoc>
        object ICloneable.Clone() {
            MenuItemBinding clone = new MenuItemBinding();
            clone.DataMember = DataMember;
            clone.Depth = Depth;
            clone.Enabled = Enabled;
            clone.EnabledField = EnabledField;
            clone.FormatString = FormatString;
            clone.ImageUrl = ImageUrl;
            clone.ImageUrlField = ImageUrlField;
            clone.NavigateUrl = NavigateUrl;
            clone.NavigateUrlField = NavigateUrlField;
            clone.PopOutImageUrl = PopOutImageUrl;
            clone.PopOutImageUrlField = PopOutImageUrlField;
            clone.Selectable = Selectable;
            clone.SelectableField = SelectableField;
            clone.SeparatorImageUrl = SeparatorImageUrl;
            clone.SeparatorImageUrlField = SeparatorImageUrlField;
            clone.Target = Target;
            clone.TargetField = TargetField;
            clone.Text = Text;
            clone.TextField = TextField;
            clone.ToolTip = ToolTip;
            clone.ToolTipField = ToolTipField;
            clone.Value = Value;
            clone.ValueField = ValueField;

            return clone;
        }
Exemple #30
0
		object ICloneable.Clone ()
		{
			MenuItemBinding bin = new MenuItemBinding ();
			foreach (DictionaryEntry e in ViewState)
				bin.ViewState [(string)e.Key] = e.Value;
			return bin;
		}
Exemple #31
0
		void ToStringTestProperty (string propertyName, string expectedValue)
		{
			PropertyInfo pi = typeof (MenuItemBinding).GetProperty (propertyName, BindingFlags.Instance | BindingFlags.Public);
			if (pi == null)
				Assert.Fail ("Property '{0}' not found.", propertyName);

			object defaultValue = null;
			object[] attrs = pi.GetCustomAttributes (typeof (DefaultValueAttribute), false);
			Type t = pi.PropertyType;
			if (attrs != null && attrs.Length > 0) {
				var dva = attrs [0] as DefaultValueAttribute;
				defaultValue = dva.Value;
			} else {
				if (t == typeof (string))
					defaultValue = String.Empty;
				else if (t == typeof (bool))
					defaultValue = false;
				else if (t == typeof (int))
					defaultValue = Int32.MaxValue;
				else
					Assert.Fail ("Unsupported return type '{0}' for property '{1}'", t.FullName, propertyName);
			}

			object setToValue = null;
			if (t == typeof (string)) {
				string v = defaultValue as String;
				if (v == String.Empty || v != "value")
					setToValue = "value";
				else
					setToValue = "value123";
			} else if (t == typeof (bool)) {
				bool v = (bool) defaultValue;
				if (v)
					setToValue = false;
				else
					setToValue = true;
			} else if (t == typeof (int)) {
				int v = (int) defaultValue;
				if (v == Int32.MaxValue)
					v = Int32.MinValue;
				else
					v = Int32.MaxValue;
			} else
				Assert.Fail ("Unsupported return type '{0}' for property '{1}'", t.FullName, propertyName);

			var mib = new MenuItemBinding ();
			pi.SetValue (mib, setToValue, null);

			Assert.AreEqual (expectedValue, mib.ToString (), propertyName);
		}
Exemple #32
0
        internal void Bind(IHierarchyData hierarchyData)
        {
            this.hierarchyData = hierarchyData;
            DataBound          = true;
            DataPath           = hierarchyData.Path;
            dataItem           = hierarchyData.Item;

            MenuItemBinding bin = GetBinding();

            if (bin != null)
            {
                // Bind Enabled property

                if (bin.EnabledField != "")
                {
                    try { Enabled = Convert.ToBoolean(GetBoundPropertyValue(bin.EnabledField)); }
                    catch { Enabled = bin.Enabled; }
                }
                else
                {
                    Enabled = bin.Enabled;
                }

                // Bind ImageUrl property

                if (bin.ImageUrlField.Length > 0)
                {
                    ImageUrl = Convert.ToString(GetBoundPropertyValue(bin.ImageUrlField));
                    if (ImageUrl.Length == 0)
                    {
                        ImageUrl = bin.ImageUrl;
                    }
                }
                else if (bin.ImageUrl.Length > 0)
                {
                    ImageUrl = bin.ImageUrl;
                }

                // Bind NavigateUrl property

                if (bin.NavigateUrlField.Length > 0)
                {
                    NavigateUrl = Convert.ToString(GetBoundPropertyValue(bin.NavigateUrlField));
                    if (NavigateUrl.Length == 0)
                    {
                        NavigateUrl = bin.NavigateUrl;
                    }
                }
                else if (bin.NavigateUrl.Length > 0)
                {
                    NavigateUrl = bin.NavigateUrl;
                }

                // Bind PopOutImageUrl property

                if (bin.PopOutImageUrlField.Length > 0)
                {
                    PopOutImageUrl = Convert.ToString(GetBoundPropertyValue(bin.PopOutImageUrlField));
                    if (PopOutImageUrl.Length == 0)
                    {
                        PopOutImageUrl = bin.PopOutImageUrl;
                    }
                }
                else if (bin.PopOutImageUrl.Length > 0)
                {
                    PopOutImageUrl = bin.PopOutImageUrl;
                }

                // Bind Selectable property

                if (bin.SelectableField != "")
                {
                    try { Selectable = Convert.ToBoolean(GetBoundPropertyValue(bin.SelectableField)); }
                    catch { Selectable = bin.Selectable; }
                }
                else
                {
                    Selectable = bin.Selectable;
                }

                // Bind SeparatorImageUrl property

                if (bin.SeparatorImageUrlField.Length > 0)
                {
                    SeparatorImageUrl = Convert.ToString(GetBoundPropertyValue(bin.SeparatorImageUrlField));
                    if (SeparatorImageUrl.Length == 0)
                    {
                        SeparatorImageUrl = bin.SeparatorImageUrl;
                    }
                }
                else if (bin.SeparatorImageUrl.Length > 0)
                {
                    SeparatorImageUrl = bin.SeparatorImageUrl;
                }

                // Bind Target property

                if (bin.TargetField.Length > 0)
                {
                    Target = Convert.ToString(GetBoundPropertyValue(bin.TargetField));
                    if (Target.Length == 0)
                    {
                        Target = bin.Target;
                    }
                }
                else if (bin.Target.Length > 0)
                {
                    Target = bin.Target;
                }

                // Bind ToolTip property

                if (bin.ToolTipField.Length > 0)
                {
                    ToolTip = Convert.ToString(GetBoundPropertyValue(bin.ToolTipField));
                    if (ToolTip.Length == 0)
                    {
                        ToolTip = bin.ToolTip;
                    }
                }
                else if (bin.ToolTip.Length > 0)
                {
                    ToolTip = bin.ToolTip;
                }

                // Bind Value property
                string value = null;
                if (bin.ValueField.Length > 0)
                {
                    value = Convert.ToString(GetBoundPropertyValue(bin.ValueField));
                }
                if (String.IsNullOrEmpty(value))
                {
                    if (bin.Value.Length > 0)
                    {
                        value = bin.Value;
                    }
                    else if (bin.Text.Length > 0)
                    {
                        value = bin.Text;
                    }
                    else
                    {
                        value = String.Empty;
                    }
                }
                Value = value;

                // Bind Text property
                string text = null;
                if (bin.TextField.Length > 0)
                {
                    text = Convert.ToString(GetBoundPropertyValue(bin.TextField));
                    if (bin.FormatString.Length > 0)
                    {
                        text = string.Format(bin.FormatString, text);
                    }
                }
                if (String.IsNullOrEmpty(text))
                {
                    if (bin.Text.Length > 0)
                    {
                        text = bin.Text;
                    }
                    else if (bin.Value.Length > 0)
                    {
                        text = bin.Value;
                    }
                    else
                    {
                        text = String.Empty;
                    }
                }
                Text = text;
            }
            else
            {
                Text = Value = GetDefaultBoundText();
            }

            INavigateUIData navigateUIData = hierarchyData as INavigateUIData;

            if (navigateUIData != null)
            {
                ToolTip     = navigateUIData.Description;
                Text        = navigateUIData.ToString();
                NavigateUrl = navigateUIData.NavigateUrl;
            }
        }
    public int Add (MenuItemBinding binding)
    {
      Contract.Ensures (Contract.Result<int>() >= -1);

      return default(int);
    }
Exemple #34
0
 public int IndexOf(MenuItemBinding value)
 {
     return(((IList)this).IndexOf(value));
 }
 public void CopyTo (MenuItemBinding[] array, int index)
 {
   Contract.Ensures (array.Length >= 0);
 }
Exemple #36
0
 public void Insert(int index, MenuItemBinding binding)
 {
     ((IList)this).Insert(index, binding);
 }
 public void Insert (int index, MenuItemBinding binding)
 {
 }
Exemple #38
0
 protected override void OnClear()
 {
     this._defaultBinding = null;
 }
		MenuItemBinding GetBinding ()
		{
			if (menu == null) return null;
			if (gotBinding) return binding;
			binding = menu.FindBindingForItem (GetDataItemType (), Depth);
			gotBinding = true;
			return binding;
		}
 protected override void OnValidate(object value) {
     base.OnValidate(value);
     MenuItemBinding binding = value as MenuItemBinding;
     if ((binding != null) && (binding.DataMember.Length == 0) && (binding.Depth == -1)) {
         _defaultBinding = binding;
     }
 }
		public void Menu_ChangeDefaultProperties ()
		{
			PokerMenu p = new PokerMenu ();
			Button B = new Button ();
			p.Controls.Add (B);
			Assert.AreEqual (1,p.Controls.Count, "ControlsCollection");

			MenuItemBinding M = new MenuItemBinding ();
			M.DataMember = "test";
			M.Depth = 0;
			M.TextField = "title"; 
			M.NavigateUrl="url";
			Object C = p.DataBindings;
			Assert.AreEqual (0, p.DataBindings.Count, "DataBindings#1");
			((MenuItemBindingCollection)C).Add (M);
			Assert.AreEqual (1,p.DataBindings.Count,"DataBindings#2");

			p.DisappearAfter = 100;
			Assert.AreEqual (100, p.DisappearAfter, "DisappearAfter");

			p.DynamicBottomSeparatorImageUrl = "test.aspx";
			Assert.AreEqual ("test.aspx", p.DynamicBottomSeparatorImageUrl, "DynamicBottomSeparatorImageUrl");

			p.DynamicEnableDefaultPopOutImage = false;
			Assert.AreEqual (false,p.DynamicEnableDefaultPopOutImage, "DynamicEnableDefaultPopOutImage");

			p.DynamicHorizontalOffset = 10;
			Assert.AreEqual (10, p.DynamicHorizontalOffset, "DynamicHorizontalOffset");

			p.DynamicHoverStyle.BackColor = Color.Red;
			Assert.AreEqual (Color.Red ,p.DynamicHoverStyle.BackColor, "DynamicHoverStyle");

			p.DynamicItemFormatString = "Mytest";
			Assert.AreEqual ("Mytest", p.DynamicItemFormatString, "DynamicItemFormatString");

			MyWebControl.Image myImage = new MyWebControl.Image ();
			myImage.ImageUrl = "myimage.jpg";
			ImageTemplate Template = new ImageTemplate ();
			Template.MyImage = myImage;
			// end create template image
			p.DynamicItemTemplate = Template;
			Assert.IsNotNull (p.DynamicItemTemplate, "RootNodeTemplate");
			Assert.AreEqual (typeof (ImageTemplate), p.DynamicItemTemplate.GetType (), "RootNodeTemplate#1");

			p.DynamicMenuItemStyle.BackColor = Color.Red;			
			Assert.AreEqual (Color.Red, p.DynamicMenuItemStyle.BackColor, "DynamicMenuItemStyle");

			p.DynamicMenuStyle.BackColor = Color.Red;
			Assert.AreEqual (Color.Red,p.DynamicMenuStyle.BackColor, "DynamicMenuStyle");

			p.DynamicPopOutImageUrl = "test";
			Assert.AreEqual ("test", p.DynamicPopOutImageUrl, "DynamicPopOutImageUrl");

			p.DynamicSelectedStyle.BackColor = Color.Red;
			Assert.AreEqual (Color.Red,p.DynamicSelectedStyle.BackColor, "DynamicSelectedStyle");

			p.DynamicTopSeparatorImageUrl = "test";
			Assert.AreEqual ("test", p.DynamicTopSeparatorImageUrl, "DynamicTopSeparatorImageUrl");

			p.DynamicVerticalOffset = 10;
			Assert.AreEqual (10, p.DynamicVerticalOffset, "DynamicVerticalOffset");

			MenuItem I = new MenuItem ();
			I.NavigateUrl = "default.aspx";
			I.Text = "MyText";
			I.ToolTip = "Test";
			p.Items.Add (I);
			Assert.AreEqual (1, p.Items.Count, "Items");

			p.ItemWrap = true;
			Assert.AreEqual (true, p.ItemWrap, "ItemWrap");

			MenuItemStyle S = new MenuItemStyle ();
			S.BackColor = Color.Red;
			p.LevelSelectedStyles.Add (S);
			Assert.AreEqual (1,p.LevelSelectedStyles.Count , "LevelSelectedStyles#1");
			Assert.AreEqual (true, p.LevelSelectedStyles.Contains (S), "LevelSelectedStyles#2");

			SubMenuStyle SM = new SubMenuStyle ();
			SM.BackColor = Color.Red;
			p.LevelSubMenuStyles.Add (SM);
			Assert.AreEqual(1, p.LevelSubMenuStyles.Count, "LevelSubMenuStyles#1");
			Assert.AreEqual (true, p.LevelSubMenuStyles.Contains (SM), "LevelSubMenuStyles#2");

			p.MaximumDynamicDisplayLevels = 5; 
			Assert.AreEqual (5, p.MaximumDynamicDisplayLevels, "MaximumDynamicDisplayLevels");

			p.Orientation = Orientation.Horizontal;
			Assert.AreEqual (Orientation.Horizontal, p.Orientation, "Orientation");

			p.PathSeparator = 'A';
			Assert.AreEqual ('A', p.PathSeparator, "PathSeparator");

			p.ScrollDownImageUrl = "test";
			Assert.AreEqual ("test", p.ScrollDownImageUrl, "ScrollDownImageUrl");

			p.ScrollDownText = "test";
			Assert.AreEqual ("test", p.ScrollDownText, "ScrollDownText");

			// This properties will be checked in events part of tests
			// Assert.AreEqual (0, p.SelectedItem, "p.SelectedItem");
			// Assert.AreEqual (string.Empty, p.SelectedValue, "SelectedValue");

			p.SkipLinkText = "test";
			Assert.AreEqual ("test", p.SkipLinkText, "SkipLinkText");

			p.StaticBottomSeparatorImageUrl = "test";
			Assert.AreEqual ("test", p.StaticBottomSeparatorImageUrl, "StaticBottomSeparatorImageUrl");

			p.StaticDisplayLevels = 2;
			Assert.AreEqual (2, p.StaticDisplayLevels, "StaticDisplayLevels");

			p.StaticEnableDefaultPopOutImage = false;
			Assert.AreEqual (false, p.StaticEnableDefaultPopOutImage, "StaticEnableDefaultPopOutImage");

			p.StaticHoverStyle.BackColor = Color.Red;
			Assert.AreEqual(Color.Red, p.StaticHoverStyle.BackColor, "StaticHoverStyle");

			p.StaticItemFormatString = "test";
			Assert.AreEqual ("test", p.StaticItemFormatString, "StaticItemFormatString");

			
			p.StaticItemTemplate = Template;
			Assert.IsNotNull (p.StaticItemTemplate, "StaticItemTemplate");

			p.StaticMenuItemStyle.BackColor = Color.Red;
			Assert.AreEqual(Color.Red,p.StaticMenuItemStyle.BackColor, "StaticMenuItemStyle");

			p.StaticMenuStyle.BackColor = Color.Red;
			Assert.AreEqual (Color.Red,p.StaticMenuStyle.BackColor, "StaticMenuStyle");

			p.StaticPopOutImageUrl = "test";
			Assert.AreEqual ("test", p.StaticPopOutImageUrl, "StaticPopOutImageUrl");

			p.StaticSelectedStyle.BackColor = Color.Red;
			Assert.AreEqual(Color.Red,p.StaticSelectedStyle.BackColor, "StaticSelectedStyle");

			p.StaticSubMenuIndent = 20;
			Assert.AreEqual (Unit.Pixel (20), p.StaticSubMenuIndent, "StaticSubMenuIndent");

			p.StaticTopSeparatorImageUrl = "test";
			Assert.AreEqual ("test", p.StaticTopSeparatorImageUrl, "StaticTopSeparatorImageUrl");

			p.Target = "test";
			Assert.AreEqual ("test", p.Target, "Target");
		}
 /// <devdoc>
 /// Adds a MenuItemBinding to the collection
 /// </devdoc>
 public int Add(MenuItemBinding binding) {
     return ((IList)this).Add(binding);
 }
 public int IndexOf(MenuItemBinding value) {
     return ((IList)this).IndexOf(value);
 }
 public void CopyTo(MenuItemBinding[] array, int index) {
     ((IList)this).CopyTo(array, index);
 }
 protected override void OnClear() {
     _defaultBinding = null;
 }
 public int IndexOf(MenuItemBinding value)
 {
     return(default(int));
 }
 /// <devdoc>
 /// Removes a MenuItemBinding from the collection.
 /// </devdoc>
 public void Remove(MenuItemBinding binding) {
     ((IList)this).Remove(binding);
 }
Exemple #48
0
 public void Remove(MenuItemBinding binding)
 {
     ((IList)this).Remove(binding);
 }
 public bool Contains(MenuItemBinding binding) {
     return ((IList)this).Contains(binding);
 }
Exemple #50
0
 public int Add(MenuItemBinding binding)
 {
     return(((IList)this).Add(binding));
 }
Exemple #51
0
 public bool Contains(MenuItemBinding binding)
 {
     return(((IList)this).Contains(binding));
 }
        public int Add(MenuItemBinding binding)
        {
            Contract.Ensures(Contract.Result <int>() >= -1);

            return(default(int));
        }