コード例 #1
0
        public void ProvideValueWithoutMember()
        {
            var x = new StaticExtension();

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

            x.MemberType = typeof(int);
            x.ProvideValue(null);
        }
コード例 #4
0
		public void ProvideValueInstanceProperty ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (StaticExtension);
			x.Member = "MemberType"; // instance property is out of scope.
			x.ProvideValue (null);
		}
コード例 #5
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));
		}
コード例 #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");
        }
コード例 #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));
        }
コード例 #8
0
            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);
            }
コード例 #9
0
        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");
        }
コード例 #10
0
        public void ProvideValueInstanceProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(StaticExtension);
            x.Member     = "MemberType";         // instance property is out of scope.
            x.ProvideValue(null);
        }
コード例 #11
0
        public void ProvideValueConst()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Xaml2006Namespace";
            Assert.AreEqual(XamlLanguage.Xaml2006Namespace, x.ProvideValue(null), "#1");
        }
コード例 #12
0
        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");
        }
コード例 #13
0
        public void ProvideValueStaticProperty()
        {
            var x = new StaticExtension();

            x.MemberType = typeof(XamlLanguage);
            x.Member     = "Array";
            Assert.AreEqual(XamlLanguage.Array, x.ProvideValue(null), "#1");
        }
コード例 #14
0
		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));
		}
コード例 #15
0
        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);
        }
コード例 #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");
     });
 }
コード例 #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");
     });
 }
コード例 #18
0
ファイル: ServiceRunner.cs プロジェクト: DHemken97/Homenet
 private void StartHostedServices()
 {
     foreach (var hostedService in _hostedServiceTypes)
     {
         var service = (IService)Activator.CreateInstance(hostedService);
         _hostedServices.Add(service);
         StaticExtension.Try(() =>
         {
             service.StartService();
         });
     }
 }
コード例 #19
0
ファイル: Program.cs プロジェクト: Erroman/universal
        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);
        }
コード例 #20
0
		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");
		}
コード例 #21
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");
		}
コード例 #22
0
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			Assert.Throws<InvalidOperationException> (() => x.ProvideValue (null));
		}
コード例 #23
0
		public void ProvideValueConst ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (XamlLanguage);
			x.Member = "Xaml2006Namespace";
			Assert.AreEqual (XamlLanguage.Xaml2006Namespace, x.ProvideValue (null), "#1");
		}
コード例 #24
0
		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");
		}
コード例 #25
0
 public void Destroy()
 {
     s1 = null;
     tlog.Info(tag, "Destroy() is called!");
 }
コード例 #26
0
 public void Init()
 {
     tlog.Info(tag, "Init() is called!");
     s1 = new StaticExtension();
 }
コード例 #27
0
 public void Destroy()
 {
     sExtention = null;
     tlog.Info(tag, "Destroy() is called!");
 }
コード例 #28
0
		public void ProvideValueWithoutMember ()
		{
			var x = new StaticExtension ();
			x.MemberType = typeof (int);
			x.ProvideValue (null);
		}