示例#1
0
        public void SetValue()
        {
            ProgressBarConcrete            concrete = new ProgressBarConcrete();
            FrameworkElementAutomationPeer peer
                = CreateConcreteFrameworkElementAutomationPeer(concrete)
                  as FrameworkElementAutomationPeer;
            var rangeValue = peer.GetPattern(PatternInterface.RangeValue)
                             as IRangeValueProvider;

            rangeValue.SetValue(0);
        }
示例#2
0
        public void IsReadOnly()
        {
            ProgressBarConcrete            concrete = new ProgressBarConcrete();
            FrameworkElementAutomationPeer peer
                = CreateConcreteFrameworkElementAutomationPeer(concrete)
                  as FrameworkElementAutomationPeer;
            var rangeValue = peer.GetPattern(PatternInterface.RangeValue)
                             as IRangeValueProvider;

            Assert.IsTrue(concrete.IsEnabled);
            Assert.IsTrue(peer.IsEnabled());
            Assert.IsTrue(rangeValue.IsReadOnly);

            concrete.IsEnabled = false;
            Assert.IsFalse(peer.IsEnabled());
            Assert.IsTrue(rangeValue.IsReadOnly);
        }
示例#3
0
 public ProgressBarAutomationPeerPoker(ProgressBarConcrete owner)
     : base(owner)
 {
 }
			public ProgressBarAutomationPeerPoker (ProgressBarConcrete owner)
				: base (owner)
			{
			}
		public void SetValue ()
		{
			ProgressBarConcrete concrete = new ProgressBarConcrete ();
			FrameworkElementAutomationPeer peer
				= CreateConcreteFrameworkElementAutomationPeer (concrete)
					as FrameworkElementAutomationPeer;
			var rangeValue = peer.GetPattern (PatternInterface.RangeValue)
				as IRangeValueProvider;
			rangeValue.SetValue (0);
		}
		public void IsReadOnly ()
		{
			ProgressBarConcrete concrete = new ProgressBarConcrete ();
			FrameworkElementAutomationPeer peer
				= CreateConcreteFrameworkElementAutomationPeer (concrete)
					as FrameworkElementAutomationPeer;
			var rangeValue = peer.GetPattern (PatternInterface.RangeValue)
				as IRangeValueProvider;

			Assert.IsTrue (concrete.IsEnabled);
			Assert.IsTrue (peer.IsEnabled ());
			Assert.IsTrue (rangeValue.IsReadOnly);

			concrete.IsEnabled = false;
			Assert.IsFalse (peer.IsEnabled ());
			Assert.IsTrue (rangeValue.IsReadOnly);
		}
		public void SetValue ()
		{
			ProgressBarConcrete concrete = new ProgressBarConcrete ();
			FrameworkElementAutomationPeer peer
				= CreateConcreteFrameworkElementAutomationPeer (concrete)
					as FrameworkElementAutomationPeer;
			var rangeValue = peer.GetPattern (PatternInterface.RangeValue)
				as IRangeValueProvider;

			Assert.Throws<InvalidOperationException> (() => {
				rangeValue.SetValue (0);
			});
		}
		public override void GetPattern ()
		{
			ProgressBarConcrete concrete = new ProgressBarConcrete ();
			FrameworkElementAutomationPeer peer
				= CreateConcreteFrameworkElementAutomationPeer (concrete)
					as FrameworkElementAutomationPeer;

			Assert.IsNull (peer.GetPattern (PatternInterface.Dock), "Dock");
			Assert.IsNull (peer.GetPattern (PatternInterface.ExpandCollapse), "ExpandCollapse");
			Assert.IsNull (peer.GetPattern (PatternInterface.Grid), "Grid");
			Assert.IsNull (peer.GetPattern (PatternInterface.GridItem), "GridItem");
			Assert.IsNull (peer.GetPattern (PatternInterface.Invoke), "Invoke");
			Assert.IsNull (peer.GetPattern (PatternInterface.MultipleView), "MultipleView");
			Assert.IsNull (peer.GetPattern (PatternInterface.Scroll), "Scroll");
			Assert.IsNull (peer.GetPattern (PatternInterface.ScrollItem), "ScrollItem");
			Assert.IsNull (peer.GetPattern (PatternInterface.Selection), "Selection");
			Assert.IsNull (peer.GetPattern (PatternInterface.SelectionItem), "SelectionItem");
			Assert.IsNull (peer.GetPattern (PatternInterface.Table), "Table");
			Assert.IsNull (peer.GetPattern (PatternInterface.TableItem), "TableItem");
			Assert.IsNull (peer.GetPattern (PatternInterface.Toggle), "Toggle");
			Assert.IsNull (peer.GetPattern (PatternInterface.Transform), "Transform");
			Assert.IsNull (peer.GetPattern (PatternInterface.Window), "Window");
			Assert.IsNull (peer.GetPattern (PatternInterface.Value), "Value");

			concrete.IsIndeterminate = false;
			Assert.IsNotNull (peer.GetPattern (PatternInterface.RangeValue), "RangeValue #0");
			Assert.IsTrue (Object.ReferenceEquals (peer, peer.GetPattern (PatternInterface.RangeValue)), "RangeValue #1");

			concrete.IsIndeterminate = true;
			Assert.IsNull (peer.GetPattern (PatternInterface.RangeValue), "RangeValue #2");
		}