コード例 #1
0
 public HostBundleMetadataNode(IResolver resolver, Interface1 metadata) : base(resolver, metadata)
 {
     this._referencableProxy = new Referencable();
     AssertUtility.ArgumentNotNull(resolver, "resolver");
     this.FragmentNodes = new List <IFragmentBundleMetadataNode>();
     BundleUtility.BuildFragments(this);
 }
コード例 #2
0
 public Class65(Interface3 A_0)
 {
     this.interface3_0 = A_0;
     this.interface1_0 = null;
     this.int_0        = this.interface3_0.imethod_3();
     this.int_1        = 0;
 }
コード例 #3
0
ファイル: Class66.cs プロジェクト: hk1722/CyberAIO-1
 // Token: 0x060004DA RID: 1242 RVA: 0x00005432 File Offset: 0x00003632
 public override void imethod_1(bool bool_1, Interface1 interface1_0)
 {
     this.bool_0 = bool_1;
     this.imethod_15();
     this.interface8_0.imethod_0();
     this.interface6_0.imethod_1(bool_1, interface1_0);
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: satoumegumin/MyWeb
        private void Button1_Click(object sender, EventArgs e)
        {
            IApplicationContext ctx    = ContextRegistry.GetContext();
            Interface1          class1 = (Interface1)ctx.GetObject("Class1");

            MessageBox.Show(class1.ShowMsg());
        }
コード例 #5
0
        private void BundleEventHandler(object sender, BundleStateChangedEventArgs e)
        {
            bool flag = e.CurrentState == BundleState.Starting;
            IBundleInstallerService firstOrDefaultService = this._framework.ServiceContainer.GetFirstOrDefaultService <IBundleInstallerService>();
            BundleData bundleDataByName = firstOrDefaultService.GetBundleDataByName(e.Bundle.SymbolicName);

            if (bundleDataByName != null)
            {
                if (flag)
                {
                    this.AddExtensionPoint(e.Bundle, bundleDataByName.ExtensionPoints);
                    this.AddExtension(e.Bundle, bundleDataByName.Extensions);
                    Interface1 bundleByID = this._framework.FrameworkAdaptor.State.GetBundleByID(e.Bundle.BundleID) as Interface1;
                    if (bundleByID != null)
                    {
                        BundleData data2 = null;
                        foreach (IFragmentBundleMetadata metadata in bundleByID.Fragments)
                        {
                            data2 = firstOrDefaultService.GetBundleDataByName(metadata.SymbolicName);
                            this.AddExtensionPoint(e.Bundle, data2.ExtensionPoints);
                            this.AddExtension(e.Bundle, data2.Extensions);
                        }
                    }
                }
                else if (e.CurrentState == BundleState.Stopping)
                {
                    this.ReleaseExtension(e.Bundle);
                }
            }
        }
コード例 #6
0
ファイル: ScopeTests.cs プロジェクト: cpiehl/TeenyInjector
        public void TestCustomScope()
        {
            int scope = 1;             // can be any object

            TeenyKernel kernel = new TeenyKernel();

            kernel.Bind <Interface1>().To <RandomIdClass>().InScope((_) => scope);

            Interface1 test1 = kernel.Get <Interface1>();
            Interface1 test2 = kernel.Get <Interface1>();

            Assert.AreEqual(test1.Test(), test2.Test());

            // change scope
            scope = 2;
            Interface1 test3 = kernel.Get <Interface1>();

            Assert.AreNotEqual(test1.Test(), test3.Test());

            // change scope back
            scope = 1;
            Interface1 test4 = kernel.Get <Interface1>();

            Assert.AreEqual(test1.Test(), test4.Test());
        }
コード例 #7
0
ファイル: Class23.cs プロジェクト: jkoxo123/Desktop
 // Token: 0x06000429 RID: 1065 RVA: 0x000048DB File Offset: 0x00002ADB
 public Class23(Interface1 interface1_1, Interface2 interface2_1)
 {
     this.interface1_0 = interface1_1;
     this.interface2_0 = interface2_1;
     this.byte_1       = new byte[interface1_1.imethod_2()];
     this.int_0        = 0;
 }
コード例 #8
0
        static void Main()
        {
            DerivedClass instance = new DerivedClass();

            instance.Method();
            instance.Method1();
            instance.Method2();

            Console.WriteLine(new string('-', 40));

            BaseClass instance0 = instance as BaseClass;

            instance0.Method();

            Interface1 instance1 = instance as Interface1;

            instance1.Method1();

            Interface2 instance2 = instance as Interface2;

            instance2.Method2();

            // Delay.
            Console.ReadKey();
        }
コード例 #9
0
ファイル: HostBundleLoader.cs プロジェクト: yshulin/OSGi
        public override Type LoadClass(string className)
        {
            Predicate <IBundleMetadata>         match      = null;
            Predicate <IFragmentBundleMetadata> predicate2 = null;
            var type = base.LoadClass(className);

            if (type == null)
            {
                if (match == null)
                {
                    match = a => a.BundleID == Bundle.BundleID;
                }
                Interface1 interface2 = FrameworkAdaptor.State.Bundles.Find(match) as Interface1;
                if (predicate2 == null)
                {
                    predicate2 = a => Framework.Bundles.Exists(bundle => (bundle.BundleID == a.BundleID) && ((type = (bundle as FragmentBundle).LoadClassForHost(className)) != null));
                }
                if (interface2.Fragments.Exists(predicate2))
                {
                    if (type != null)
                    {
                        CacheLoadedType(className, type);
                    }
                    return(type);
                }
            }
            return(type);
        }
コード例 #10
0
ファイル: HostBundleLoader.cs プロジェクト: yshulin/OSGi
        public override object LoadResource(string resourceName, ResourceLoadMode resourceLoadMode)
        {
            Predicate <IBundleMetadata>         match      = null;
            Predicate <IFragmentBundleMetadata> predicate2 = null;
            object result = base.LoadResource(resourceName, resourceLoadMode);

            if ((result == null) && ((resourceLoadMode == ResourceLoadMode.LocalAndFragment) || (resourceLoadMode == ResourceLoadMode.ClassSpace)))
            {
                if (match == null)
                {
                    match = a => a.BundleID == Bundle.BundleID;
                }
                Interface1 interface2 = FrameworkAdaptor.State.Bundles.Find(match) as Interface1;
                if (predicate2 == null)
                {
                    predicate2 = delegate(IFragmentBundleMetadata a) {
                        IBundle bundle = Framework.Bundles.Find(bundle => bundle.BundleID == a.BundleID);
                        if (bundle == null)
                        {
                            return(false);
                        }
                        return((result = bundle.LoadResource(resourceName, resourceLoadMode)) != null);
                    };
                }
                if (interface2.Fragments.Exists(predicate2))
                {
                    return(result);
                }
            }
            return(result);
        }
コード例 #11
0
 public Class774(RectangleF A_0, Interface22 A_1, Interface1 A_2, bool A_3)
 {
     this.bool_0        = true;
     this.rectangleF_0  = A_0;
     this.interface22_0 = A_1;
     this.method_21(A_2, A_3);
 }
コード例 #12
0
 static void Display(Interface1 e)
 {
     if (e is Manager)
     {
         Console.WriteLine(((Manager)e).name);
     }
 }
コード例 #13
0
        private void btnDesocupar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("¿Desea desocupar?", "Desocupar", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                Alquiler   alquiler = alquileres.BuscarCocheraAlquiler(coche); //busca el alquiler de una cochera por ubicacion y lo guarda en alquiler
                Interface1 i        = this.Owner as Interface1;                //los datos los saca de aca
                if (radioButtonHora.Checked)
                {
                    Movimiento mov = new Movimiento("AlquilerHora", alquiler.CalcularImporte(), DateTime.Now, true, Activo, null, alquiler);
                    ListaMovimientos.AgregarMovimientos(mov);                                //agrega movimientos a la lista
                    managerMov.AgregarXMLMovimientos(ListaMovimientos.MostrarMovimientos()); //genera el xml de movimientos
                    MessageBox.Show("El importe es: " + mov.Importe.ToString());


                    if (i != null)
                    {
                        i.AgregarMovimientoInterfaz(mov);
                    }
                }


                if (i != null)
                {
                    i.BorrarAlquilerInterfaz(alquiler);
                }
                this.Close();
            }
        }
コード例 #14
0
        private void button1_Click(object sender, EventArgs e)
        {
            string texto  = textBoxVi.Text;
            string texto2 = textBoxVd.Text;

            if (texto == "" || texto2 == "")
            {
                texto  = "invalido";
                texto2 = "invalido";
            }

            double textoAInt  = 0;
            double texto2AInt = 0;

            bool result  = double.TryParse(texto, out textoAInt);
            bool result2 = double.TryParse(texto2, out texto2AInt);

            if (result && result2)
            {
                Interface1 owner = this.Owner as Interface1;
                owner.CalcularRaiz(textoAInt, texto2AInt);
            }
            else
            {
                MessageBox.Show("No se ingresaron datos correctos, por favor corroborar el intervalo");
            }
        }
コード例 #15
0
        public Juego(int tipo, int opcion, int nivel)
        {
            entrenamiento = null;
            multi         = null;
            individual    = null;

            _modo = tipo;
            switch (_modo)
            {
            case 1:
                entrenamiento = new Entrenamiento(_tamaño, nivel, this);

                juegoActual = entrenamiento;

                break;

            case 2:
                individual = new Individual(_tamaño, opcion);

                juegoActual = individual;

                break;

            case 3:
                multi = new Multi(_tamaño, opcion, nivel);

                juegoActual = multi;

                break;
            }
        }
コード例 #16
0
        public void WriteConsole(Interface1 inter, Interface1 inter2)
        {
            if (inter == null)
            {
                return;
            }

            if (inter2 == null)
            {
                return;
            }


            if (inter is Class5)
            {
                Console.Write("");
            }

            if (inter is Class5_1)
            {
                Console.Write("");
            }

            if (inter is Class5_2)
            {
                Console.Write("");
            }
        }
コード例 #17
0
        public IBundle InstallBundle(string location, Stream stream)
        {
            IBundle bundle = Framework.Bundles.GetBundle(location);

            if (bundle == null)
            {
                BundleData bundleData = Framework.ServiceContainer.GetFirstOrDefaultService <IBundleInstallerService>().CreateBundleData(location, stream);
                if (bundleData == null)
                {
                    Framework.EventManager.DispatchFrameworkEvent(this, new FrameworkEventArgs(FrameworkEventType.Error, new Exception($"Install bundle in '{location}' failed.")));
                    return(null);
                }
                Tuple <IBundle, IBundleMetadata> tuple = Framework.AddBundleData(bundleData);
                bundle = tuple.Item1;
                IBundleMetadata metadata = tuple.Item2;
                if (string.IsNullOrEmpty(bundleData.HostBundleSymbolicName))
                {
                    Interface1 host = metadata as Interface1;
                    AssertUtility.IsTrue(host != null);
                    List <IFragmentBundleMetadata> metadatas = BundleUtility.GetMetadatas <IFragmentBundleMetadata>(Framework.FrameworkAdaptor.State.Bundles);
                    BundleUtility.BindFragmentMetadatas(host, metadatas);
                }
                else
                {
                    IFragmentBundleMetadata metadata2 = metadata as IFragmentBundleMetadata;
                    AssertUtility.IsTrue(metadata2 != null);
                    BundleUtility.GetMetadatas <Interface1>(Framework.FrameworkAdaptor.State.Bundles);
                }
                Framework.ServiceContainer.GetFirstOrDefaultService <IBundlePersistent>().SaveInstallLocation(location);
            }
            return(bundle);
        }
コード例 #18
0
        static void Main(string[] args)
        {
            Class1     obj1   = new Class1();
            Interface1 inter1 = obj1;

            inter1.funcA();
        }
コード例 #19
0
ファイル: Class73.cs プロジェクト: jkoxo123/Desktop
 // Token: 0x060003FF RID: 1023 RVA: 0x00020644 File Offset: 0x0001E844
 public Class73(Interface1 interface1_1)
 {
     this.interface1_0 = interface1_1;
     this.int_0        = interface1_1.imethod_2();
     this.byte_0       = new byte[this.int_0];
     this.byte_1       = new byte[this.int_0];
     this.byte_2       = new byte[this.int_0];
 }
コード例 #20
0
 /// <summary>
 /// 通过autofac 注入,自定扩展的实例
 /// </summary>
 /// <param name="interface1"></param>
 /// <param name="interface2"></param>
 /// <param name="interface3"></param>
 public AutofacController(Interface1 interface1, Interface2 interface2, Interface3 interface3, InterfaceA interfaceA)
 {
     interface1.Show();//通过配置文件注入的实例
     this._Interface1 = interface1;
     this._Interface2 = interface2;
     this._Interface3 = interface3;
     this._interfaceA = interfaceA;
 }
コード例 #21
0
        static void Main(string[] args)
        {
            ImplementationClass IC = new ImplementationClass();
            Interface1          i1 = IC;

            i1.Show();

            Console.ReadKey();
        }
コード例 #22
0
        public ValuesController(Interface1 i1, Interface2 i2, Interface3 i3, IServiceProvider provider)
        {
            Console.WriteLine(i1.function1());
            Console.WriteLine(i2.function2());
            Console.WriteLine(i3.function3());
            var test = provider.GetService <Interface3>();

            Console.WriteLine(test.function3());
        }
コード例 #23
0
 public static void Call(Interface1 iface)
 {
     if (iface.GetInt() != 42)
     {
         throw new System.Exception();
         throw new System.Exception("expected i == 42");
     }
     iface.SetInt(99);
 }
コード例 #24
0
        public void NoBoundInterface()
        {
            TeenyKernel kernel = new TeenyKernel();

            Assert.ThrowsException <Exception>(() =>
            {
                Interface1 test1 = kernel.Get <Interface1>();
            });
        }
コード例 #25
0
        static void Main(string[] args)
        {
            ITest1 test  = new Interface1();
            ITest1 test2 = new Interface2();

            test.Print();
            test2.Print();
            Console.ReadKey();
        }
コード例 #26
0
        public void WriteConsole(Interface1 inter, Interface1 inter2, Class5_1 cs, object obj)
        {
            if (inter == null)
            {
                return;
            }

            if (inter2 == null)
            {
                return;
            }


            if (inter is Class5)
            {
                Console.Write("");
            }

            if (inter is Class5_1)
            {
                Console.Write("");
            }

            if (inter is Class5_2)
            {
                Console.Write("");
            }



            if (obj is Class5_2)
            {
                Console.Write("");
            }
            if (obj is Class1)
            {
                Console.Write("");
            }
            if (obj is Class2)
            {
                Console.Write("");
            }
            if (obj is Class3)
            {
                Console.Write("");
            }
            if (obj is Class4)
            {
                Console.Write("");
            }

            if (obj is multiImplementation.Class7)
            {
                Console.Write("");
            }
        }
コード例 #27
0
ファイル: Program.cs プロジェクト: xgtz/Autofac-Module-
        static void Main(string[] args)
        {
            var assembly = Assembly.GetExecutingAssembly();
            var builder  = new ContainerBuilder();

            // Where+Lambda
            // builder.RegisterAssemblyTypes(assembly).Where(type => type.Namespace.Equals("ConsoleApplication2.IocAutofac.Example"));

            // 类型在ConsoleApplication2.IocAutofac.Example命名空间中
            //builder.RegisterAssemblyTypes(assembly).InNamespace("ConsoleApplication2.IocAutofac.Example");

            // 也是用来判断命名空间的,这种方式是根据类型来获取命名空间
            //builder.RegisterAssemblyTypes(assembly).InNamespaceOf<Program>();
            builder.RegisterAssemblyTypes(assembly).InNamespaceOf <IocClass1>();



            using (IContainer container = builder.Build())
            {
                try
                {
                    Class1 cls1 = container.Resolve <Class1>();
                    if (null != cls1)
                    {
                        cls1.print();
                    }
                    Class2 cls2 = container.Resolve <Class2>();
                    if (null != cls2)
                    {
                        cls2.print();
                    }
                }
                catch
                { }
                try
                {
                    IocClass1 IocCls1 = container.Resolve <IocClass1>();
                    if (null != IocCls1)
                    {
                        IocCls1.Print();
                    }
                }
                catch { }

                try
                {
                    Interface1 ISay = container.Resolve <Interface1>();
                    if (null != ISay)
                    {
                        ISay.say();
                    }
                }
                catch { }
            }
            Console.ReadKey();
        }
コード例 #28
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            Locker locker = new Locker();

            locker.deleteLockerFiles();
            Interface1 close = myFormSettings.myForm1;

            close.close();
            this.Close();
        }
コード例 #29
0
ファイル: Program.cs プロジェクト: KonkolMaciej/CS_OOP
        static void Main(string[] args)
        {
            B b = new B();

            b.f();
            ((A)b).f();
            ((Interface1)b).f();
            A          a  = new A();
            Interface1 ii = b;
        }
コード例 #30
0
 // Token: 0x0600019D RID: 413 RVA: 0x000039BC File Offset: 0x00001BBC
 public Class22(Interface1 interface1_1)
 {
     if (interface1_1 == null)
     {
         throw new ArgumentNullException("cipher");
     }
     this.interface1_0 = interface1_1;
     this.byte_1       = new byte[interface1_1.imethod_2()];
     this.int_0        = 0;
 }
コード例 #31
0
ファイル: Issue364_3.cs プロジェクト: BrainSlugs83/JSIL
 public void Method(Interface1 item)
 {
     Console.WriteLine("Interface1");
 }
コード例 #32
0
ファイル: MicroMapTests.cs プロジェクト: mweinand/Mangifera
 public Class2(Interface1 class1)
 {
     Class1 = class1;
 }
コード例 #33
0
 public Class1(Interface1 if1, Interface2 if2)
 {
     _if1 = if1;
     _if2 = if2;
 }
コード例 #34
0
ファイル: MicroMapTests.cs プロジェクト: mweinand/Mangifera
 public Class3(Interface1 i1, Interface2 i2)
 {
     Class1 = i1;
     Class2 = i2;
 }
コード例 #35
0
ファイル: 2_Interfaces.cs プロジェクト: RashmiPankaj/Bridge
        public bool Method4(Interface1 i)
        {
            Field = i.Property;

            return true;
        }
コード例 #36
0
	        public static void Call(Interface1 iface)
	        {
		        if (iface.GetInt() != 42) {
			        throw new System.Exception();
			        throw new System.Exception("expected i == 42");
		        }
		        iface.SetInt(99);
	        }
コード例 #37
0
ファイル: Program.cs プロジェクト: naynishchaughule/ASP.NET
 static void Display(Interface1 e)
 {
     if(e is Manager)
         Console.WriteLine(((Manager)e).name);
 }