Exemplo n.º 1
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[3];
                RetVal[0] = new UPnPModeratedStateVariable("OysterConnectionPort", typeof(System.Int32), false);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"13075");
                RetVal[0].AddAssociation("GetConnectionVariables", "int32ConnectionPort");
                RetVal[1] = new UPnPModeratedStateVariable("OysterFilePort", typeof(System.Int32), false);
                RetVal[1].AddAssociation("GetConnectionVariables", "int32FilePort");
                RetVal[2] = new UPnPModeratedStateVariable("OysterConnectionAddress", typeof(System.String), false);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"OysterMini");
                RetVal[2].AddAssociation("GetConnectionVariables", "stringConnectionAddress");

                UPnPService S = new UPnPService(1, "ConnectionService", "urn:schemas-upnp-org:OysterConnection::1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetConnectionVariables");
                return(S);
            }
Exemplo n.º 2
0
            protected UPnPService BuildUPnPService()
            {
                UPnPStateVariable[] RetVal = new UPnPStateVariable[5];
                RetVal[0] = new UPnPModeratedStateVariable("PageMax", typeof(System.Int32), true);
                RetVal[0].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[0].AddAssociation("PowerOn", "PageMax");
                RetVal[1] = new UPnPModeratedStateVariable("Power", typeof(System.Boolean), true);
                RetVal[1].AddAssociation("GetStatus", "Power");
                RetVal[1].AddAssociation("PowerOff", "Power");
                RetVal[1].AddAssociation("PowerOn", "Power");
                RetVal[2] = new UPnPModeratedStateVariable("File", typeof(System.String), true);
                RetVal[2].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[2].AddAssociation("GetStatus", "File");
                RetVal[2].AddAssociation("PowerOn", "File");
                RetVal[3] = new UPnPModeratedStateVariable("PageNumber", typeof(System.Int32), true);
                RetVal[3].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.Int32),"1");
                RetVal[3].AddAssociation("GetStatus", "PageNumber");
                RetVal[3].AddAssociation("Go", "PageNumber");
                RetVal[3].AddAssociation("NextPage", "PageNumber");
                RetVal[3].AddAssociation("PowerOn", "PageNumber");
                RetVal[3].AddAssociation("PreviousPage", "PageNumber");
                RetVal[4] = new UPnPModeratedStateVariable("Files", typeof(System.String), true);
                RetVal[4].DefaultValue = UPnPService.CreateObjectInstance(typeof(System.String),"default.ppt");
                RetVal[4].AddAssociation("GetFiles", "Files");

                UPnPService S = new UPnPService(1, "control", "urn:schemas-upnp-org:service:control:1", true, this);
                for(int i=0;i<RetVal.Length;++i)
                {
                   S.AddStateVariable(RetVal[i]);
                }
                S.AddMethod("GetFiles");
                S.AddMethod("GetStatus");
                S.AddMethod("Go");
                S.AddMethod("NextPage");
                S.AddMethod("PowerOff");
                S.AddMethod("PowerOn");
                S.AddMethod("PreviousPage");
                return(S);
            }