Exemple #1
0
        public void ProvideValueWithoutMember()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(int);
            Assert.Throws <InvalidOperationException> (() => x.ProvideValue(null));
        }
		public void ProvideValueStaticProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (XamlLanguage);
			x.Member = "Array";
			Assert.AreEqual (XamlLanguage.Array, x.ProvideValue (null), "#1");
		}
        public void ProvideValueWithoutMember()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(int);
            x.ProvideValue(null);
        }
		public void ProvideValueInstanceProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (StaticExtension);
			x.Member = "MemberType"; // instance property is out of scope.
			x.ProvideValue (null);
		}
		public void ProvideValueInstanceProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (StaticExtension);
			x.Member = "MemberType"; // instance property is out of scope.
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null));
		}
Exemple #6
0
        public void ProvideValuePrivateConst()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooBar";         // private const could not be resolved.
            Assert.Throws <ArgumentException> (() => x.ProvideValue(null), "#1");
        }
Exemple #7
0
        public void ProvideValueInstanceProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(StaticExtension);
            x.Member     = "MemberType";         // instance property is out of scope.
            Assert.Throws <ArgumentException> (() => x.ProvideValue(null));
        }
            public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
            {
                ByteHolder holder = value as ByteHolder;

                BasicEngineering.UI.Factory.Advanced.Forms.FormMain m = StaticExtension.CreateAviationForm(null, holder, null, null, null, null, false, null, null, null, null);
                m.ShowDialog();
                return(m.Creator.Holder);
            }
        public void ProvideValuePrivateConst()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooBar";         // private const could not be resolved.
            Assert.AreEqual("foobar", x.ProvideValue(null), "#1");
        }
        public void ProvideValueInstanceProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(StaticExtension);
            x.Member     = "MemberType";         // instance property is out of scope.
            x.ProvideValue(null);
        }
        public void ProvideValueConst()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Xaml2006Namespace";
            Assert.AreEqual(XamlLanguage.Xaml2006Namespace, x.ProvideValue(null), "#1");
        }
        public void ProvideValueEvent()
        {
            var x = new StaticExtension();

            x.MemberType = GetType();
            x.Member     = "FooEvent";         // private const could not be resolved.
            Assert.IsNotNull(x.ProvideValue(null), "#1");
        }
        public void ProvideValueStaticProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Array";
            Assert.AreEqual(XamlLanguage.Array, x.ProvideValue(null), "#1");
        }
		public void ProvideValueWithoutType ()
		{
			var x = new StaticExtension ();
			// it fails because it cannot be resolved to a static member.
			// This possibly mean, there might be a member that 
			// could be resolved only with the name, without type.
			x.Member = "Foo";
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null));
		}
        public void ProvideValueWithoutType()
        {
            var x = new StaticExtension();

            // it fails because it cannot be resolved to a static member.
            // This possibly mean, there might be a member that
            // could be resolved only with the name, without type.
            x.Member = "Foo";
            x.ProvideValue(null);
        }
Exemple #16
0
 public void ProvideValueEvent()
 {
     Assert.Throws(typeof(ArgumentException), () =>
     {
         var x        = new StaticExtension();
         x.MemberType = GetType();
         x.Member     = "FooEvent";             // private const could not be resolved.
         Assert.IsNotNull(x.ProvideValue(null), "#1");
     });
 }
Exemple #17
0
 public void ProvideValuePrivateConst()
 {
     Assert.Throws(typeof(ArgumentException), () =>
     {
         var x        = new StaticExtension();
         x.MemberType = GetType();
         x.Member     = "FooBar";             // private const could not be resolved.
         Assert.AreEqual("foobar", x.ProvideValue(null), "#1");
     });
 }
Exemple #18
0
 private void StartHostedServices()
 {
     foreach (var hostedService in _hostedServiceTypes)
     {
         var service = (IService)Activator.CreateInstance(hostedService);
         _hostedServices.Add(service);
         StaticExtension.Try(() =>
         {
             service.StartService();
         });
     }
 }
Exemple #19
0
        static Form GetForm(string filename, Motion6D.PositionObjectFactory factory, System.IO.TextWriter logWriter, TestCategory.Interfaces.ITestInterface testInterface)
        {
            List <ButtonWrapper> l = new List <ButtonWrapper>();

            l.AddRange(ControlSystemLib.Data.UI.Factory.ControlSystemsFactory.ObjectButtons);
            l.AddRange(Simulink.Proxy.UI.Factory.SimulinkProxyFactory.ObjectButtons);
            Form form = StaticExtension.CreateAviationFormFull(GetButtons(factory), Initializers,
                                                               Aviation.Utils.ControlUtilites.Resources, null, filename, null, Factories,
                                                               null, true,
                                                               "Aviation simulation processor",
                                                               Properties.Resources.Aviation, logWriter, testInterface);

            return(form);
        }
		public void ProvideValuePrivateConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooBar"; // private const could not be resolved.
			Assert.AreEqual ("foobar", x.ProvideValue (null), "#1");
		}
		public void ProvideValuePrivateConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooBar"; // private const could not be resolved.
			Assert.Throws<ArgumentException> (() => x.ProvideValue (null), "#1");
		}
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			Assert.Throws<InvalidOperationException> (() => x.ProvideValue (null));
		}
		public void ProvideValueConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (XamlLanguage);
			x.Member = "Xaml2006Namespace";
			Assert.AreEqual (XamlLanguage.Xaml2006Namespace, x.ProvideValue (null), "#1");
		}
		public void ProvideValueEvent ()
		{
			var x = new StaticExtension ();
			x.MemberType = GetType ();
			x.Member = "FooEvent"; // private const could not be resolved.
			Assert.IsNotNull (x.ProvideValue (null), "#1");
		}
Exemple #25
0
 public void Destroy()
 {
     s1 = null;
     tlog.Info(tag, "Destroy() is called!");
 }
Exemple #26
0
 public void Init()
 {
     tlog.Info(tag, "Init() is called!");
     s1 = new StaticExtension();
 }
Exemple #27
0
 public void Destroy()
 {
     sExtention = null;
     tlog.Info(tag, "Destroy() is called!");
 }
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			x.ProvideValue (null);
		}