当前位置: 首页>>代码示例>>C#>>正文


C# BusAttachment.CreateInterfacesFromXml方法代码示例

本文整理汇总了C#中BusAttachment.CreateInterfacesFromXml方法的典型用法代码示例。如果您正苦于以下问题:C# BusAttachment.CreateInterfacesFromXml方法的具体用法?C# BusAttachment.CreateInterfacesFromXml怎么用?C# BusAttachment.CreateInterfacesFromXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BusAttachment的用法示例。


在下文中一共展示了BusAttachment.CreateInterfacesFromXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddInterfaceTest

        public void AddInterfaceTest()
        {
            BusAttachment bus = new BusAttachment("addinterface", true, 4);
            bus.CreateInterfacesFromXml(signalIntf);
            bus.CreateInterfacesFromXml(methodIntf);
            bus.CreateInterfacesFromXml(propertyIntf);
            bus.CreateInterfacesFromXml(mixedIntf);
            bus.CreateInterfacesFromXml(emptyIntf);
            InterfaceDescription[] annIntf = new InterfaceDescription[1];
            bus.CreateInterface("org.alljoyn.Annotated", annIntf, false);
            annIntf[0].AddMethod("method", "ss", "s", "in1,in2,out1", (byte)0, "");
            annIntf[0].AddProperty("property", "s", (byte)PropAccessType.PROP_ACCESS_RW);
            annIntf[0].AddSignal("signal", "suy", "str,uint,byte", (byte)0, "");
            annIntf[0].AddAnnotation("org.freedesktop.DBus.Deprecated", "false");
            annIntf[0].AddMemberAnnotation("method", "org.freedesktop.DBus.Method.NoReply", "true");
            annIntf[0].AddPropertyAnnotation("property", "org.freedesktop.DBus.Property.EmitsChangedSignal", "true");
            annIntf[0].Activate();

            BusObject busObj = new BusObject(bus, "/addinterfaces", false);
            busObj.AddInterface(bus.GetInterface("org.alljoyn.Signals"));
            busObj.AddInterface(bus.GetInterface("org.alljoyn.Methods"));
            busObj.AddInterface(bus.GetInterface("org.alljoyn.Properties"));
            busObj.AddInterface(bus.GetInterface("org.alljoyn.Empty"));
            busObj.AddInterface(bus.GetInterface("org.alljoyn.Annotated"));
        }
开发者ID:peterdocter,项目名称:Coco2dxDemo,代码行数:25,代码来源:BusObjectTests.cs

示例2: CreateInterfacesFromXMLTest

        public void CreateInterfacesFromXMLTest()
        {
            BusAttachment bus = new BusAttachment("xmlinterfaces", true, 4);

            bus.CreateInterfacesFromXml(signalIntf);
            bus.CreateInterfacesFromXml(methodIntf);
            bus.CreateInterfacesFromXml(propertyIntf);
            bus.CreateInterfacesFromXml(mixedIntf);
            InterfaceDescription i = bus.GetInterface("org.alljoyn.Signals");
            Assert.IsNotNull(i);
            Assert.IsNotNull(bus.GetInterface("org.alljoyn.Methods"));
            Assert.IsNotNull(bus.GetInterface("org.alljoyn.Properties"));
            Assert.IsNotNull(bus.GetInterface("org.alljoyn.Mixed"));
            InterfaceDescription[] intfs = new InterfaceDescription[14];
            bus.GetInterfaces(intfs);
            Assert.IsNotNull(intfs[0]);
            Assert.IsNotNull(intfs[1]);
            Assert.IsNotNull(intfs[2]);
            Assert.IsNotNull(intfs[3]);

            // BUGBUG: DeleteInterface is throwing an exception saying the interfaces don't exist
            //bus.DeleteInterface(bus.GetInterface("org.alljoyn.Signals"));
            //bus.DeleteInterface(bus.GetInterface("org.alljoyn.Methods"));
            //bus.DeleteInterface(bus.GetInterface("org.alljoyn.Properties"));
            //bus.DeleteInterface(bus.GetInterface("org.alljoyn.Mixed"));
            //Assert.IsNull(bus.GetInterface("org.alljoyn.Signals"));
            //Assert.IsNull(bus.GetInterface("org.alljoyn.Methods"));
            //Assert.IsNull(bus.GetInterface("org.alljoyn.Properties"));
            //Assert.IsNull(bus.GetInterface("org.alljoyn.Mixed"));

            //InterfaceDescription[] nullIntfs = new InterfaceDescription[14];
            //bus.GetInterfaces(nullIntfs);
            //Assert.IsNull(nullIntfs[0]);
            //Assert.IsNull(nullIntfs[1]);
            //Assert.IsNull(nullIntfs[2]);
            //Assert.IsNull(nullIntfs[3]);
        }
开发者ID:kalperin,项目名称:alljoyn_core,代码行数:37,代码来源:BusAttachmentTests.cs


注:本文中的BusAttachment.CreateInterfacesFromXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。