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


C# UPnP.UPnPService类代码示例

本文整理汇总了C#中OpenSource.UPnP.UPnPService的典型用法代码示例。如果您正苦于以下问题:C# UPnPService类的具体用法?C# UPnPService怎么用?C# UPnPService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UPnPService类属于OpenSource.UPnP命名空间,在下文中一共展示了UPnPService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CpAVTransport

 public CpAVTransport(UPnPService s)
 {
     _S = s;
     _S.OnSubscribe += new UPnPService.UPnPEventSubscribeHandler(_subscribe_sink);
     if (HasStateVariable_TransportStatus) _S.GetStateVariableObject("TransportStatus").OnModified += new UPnPStateVariable.ModifiedHandler(TransportStatus_ModifiedSink);
     if (HasStateVariable_TransportState) _S.GetStateVariableObject("TransportState").OnModified += new UPnPStateVariable.ModifiedHandler(TransportState_ModifiedSink);
 }
开发者ID:GufCab,项目名称:Semester-Projekt---PC-Program,代码行数:7,代码来源:CpAVTransport.cs

示例2: CpConnectionManager

 public CpConnectionManager(UPnPService s)
 {
     _S = s;
     _S.OnSubscribe += new UPnPService.UPnPEventSubscribeHandler(_subscribe_sink);
     if(HasStateVariable_SourceProtocolInfo) _S.GetStateVariableObject("SourceProtocolInfo").OnModified += new UPnPStateVariable.ModifiedHandler(SourceProtocolInfo_ModifiedSink);
     if(HasStateVariable_SinkProtocolInfo) _S.GetStateVariableObject("SinkProtocolInfo").OnModified += new UPnPStateVariable.ModifiedHandler(SinkProtocolInfo_ModifiedSink);
     if(HasStateVariable_CurrentConnectionIDs) _S.GetStateVariableObject("CurrentConnectionIDs").OnModified += new UPnPStateVariable.ModifiedHandler(CurrentConnectionIDs_ModifiedSink);
 }
开发者ID:nothingmn,项目名称:UPnP-for-C---Intel-,代码行数:8,代码来源:CpConnectionManager.cs

示例3: CpContentDirectory

 public CpContentDirectory(UPnPService s)
 {
     _S = s;
     _S.OnSubscribe += new UPnPService.UPnPEventSubscribeHandler(_subscribe_sink);
     if (HasStateVariable_TransferIDs) _S.GetStateVariableObject("TransferIDs").OnModified += new UPnPStateVariable.ModifiedHandler(TransferIDs_ModifiedSink);
     if (HasStateVariable_ContainerUpdateIDs) _S.GetStateVariableObject("ContainerUpdateIDs").OnModified += new UPnPStateVariable.ModifiedHandler(ContainerUpdateIDs_ModifiedSink);
     if (HasStateVariable_SystemUpdateID) _S.GetStateVariableObject("SystemUpdateID").OnModified += new UPnPStateVariable.ModifiedHandler(SystemUpdateID_ModifiedSink);
 }
开发者ID:GufCab,项目名称:Semester-Projekt---PC-Program,代码行数:8,代码来源:CpContentDirectory.cs

示例4: UPnPServiceWatcher

        public UPnPServiceWatcher(UPnPService S, SniffHandler cb, SniffPacketHandler pcb)
        {
            OnSniff += cb;
            OnSniffPacket += pcb;
            _S = S;

            _S.OnSniff += new UPnPService.SniffHandler(SniffSink);
            _S.OnSniffPacket += new UPnPService.SniffPacketHandler(SniffPacketSink);
        }
开发者ID:genielabs,项目名称:intel-upnp-dlna,代码行数:9,代码来源:UPnPServiceWatcher.cs

示例5: ActionEditForm

        public ActionEditForm(UPnPService parentService)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            action = new UPnPAction();
            action.ParentService = parentService;
        }
开发者ID:Tieske,项目名称:Developer-Tools-for-UPnP-Technologies,代码行数:10,代码来源:ActionEditForm.cs

示例6: UPnPServiceProxy

        public UPnPServiceProxy(Type serviceType, Type contractType)
        {
            var service = Activator.CreateInstance(serviceType);
            _upnp = new UPnPService(1, contractType.GUID.ToString(), contractType.FullName, true, service);

            var methods = (from meth in contractType.GetMethods()
                          where meth.GetCustomAttributes(false).Where( atr => atr.GetType() == typeof(OperationContractAttribute)).Count()>0
                          select meth).ToArray();

            foreach (var meth in methods)
            {
                _upnp.AddMethod(meth.Name);
            }
        }
开发者ID:evisar,项目名称:upnp-poc,代码行数:14,代码来源:UPnPServiceProxy.cs

示例7: ValidationForm

        public ValidationForm(UPnPService S)
        {
            service = S;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            foreach(UPnPAction A in S.Actions)
            {
                ServiceBox.Items.Add(A,CheckState.Unchecked);
            }

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:16,代码来源:ValidationForm.cs

示例8: MethodInvoke

        public MethodInvoke(UPnPAction action, UPnPService service)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.action = action;
            this.service = service;

            this.Text += " - " + action.Name;
            actionLabel.Text = action.Name;
            serviceLabel.Text = service.ServiceID;
            deviceLabel.Text = service.ParentDevice.FriendlyName;

            if (action.ArgumentList.Length>0)
            {
                argControlList = new UPnpArgumentControl[action.ArgumentList.Length];

                for (int z=0;z<action.ArgumentList.Length;++z)
                {
            //					if (action.ArgumentList[z].IsReturnValue == true) {returnArgPresent = true;}
                    argControlList[z] = new UPnpArgumentControl(action.ArgumentList[z]);
                    argControlList[z].Dock = System.Windows.Forms.DockStyle.Top;
                    /*
                    if (action.ArgumentList[z].RelatedStateVar.ValueType == "string")
                    {
                        argControlList[z].Height = 60;
                    }
                    */
                    argPanel.Controls.Add(argControlList[z]);
                    argPanel.Controls.SetChildIndex(argControlList[z],0);

                    Splitter splitter = new Splitter();
                    splitter.Height = 4;
                    splitter.MinExtra = 0;
                    splitter.MinSize = 32;
                    splitter.BackColor = Color.Gray;
                    splitter.Dock = System.Windows.Forms.DockStyle.Top;
                    argPanel.Controls.Add(splitter);
                    argPanel.Controls.SetChildIndex(splitter,0);
                }
            }

            service.OnInvokeError += new UPnPService.UPnPServiceInvokeErrorHandler(HandleInvokeError);
            service.OnInvokeResponse += new UPnPService.UPnPServiceInvokeHandler(HandleInvoke);
        }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:47,代码来源:MethodInvoke.cs

示例9: Main

        static void Main(string[] args)
        {
            var device = UPnPDevice.CreateRootDevice(int.MaxValue, 1.0, "\\");
            device.FriendlyName = Environment.MachineName + ":" + "Network Light";
            device.DeviceURN = "NetworkLight";
            device.HasPresentation = false;

            var switchPower = new UPnPService(1.0, typeof(SwitchPower).GUID.ToString(), typeof(SwitchPower).FullName, true, new SwitchPower());
            switchPower.AddMethod("SetTarget");
            switchPower.AddMethod("GetTarget");
            switchPower.AddMethod("GetStatus");
            device.AddService(switchPower);

            device.StartDevice();

            Console.ReadLine();

            device.StopDevice();
        }
开发者ID:evisar,项目名称:upnp-poc,代码行数:19,代码来源:Program.cs

示例10: CpRenderingControl

 public CpRenderingControl(UPnPService s)
 {
     _S = s;
     _S.OnSubscribe += new UPnPService.UPnPEventSubscribeHandler(_subscribe_sink);
     if(HasStateVariable_LastChange) _S.GetStateVariableObject("LastChange").OnModified += new UPnPStateVariable.ModifiedHandler(LastChange_ModifiedSink);
 }
开发者ID:nothingmn,项目名称:UPnP-for-C---Intel-,代码行数:6,代码来源:CpRenderingControl.cs

示例11: Sink_SelectPreset

 private void Sink_SelectPreset(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle)
 {
     for(int i=0;i<Args.Length;++i)
     {
         switch(Args[i].Name)
         {
             case "PresetName":
                 switch((string)Args[i].DataValue)
                 {
                     case "FactoryDefaults":
                         Args[i].DataValue = Enum_A_ARG_TYPE_PresetName.FACTORYDEFAULTS;
                         break;
                     case "InstallationDefaults":
                         Args[i].DataValue = Enum_A_ARG_TYPE_PresetName.INSTALLATIONDEFAULTS;
                         break;
                     case "Vendor defined":
                         Args[i].DataValue = Enum_A_ARG_TYPE_PresetName.VENDOR_DEFINED;
                         break;
                     default:
                        SetUnspecifiedValue("Enum_A_ARG_TYPE_PresetName", (string)Args[i].DataValue);
                        Args[i].DataValue = Enum_A_ARG_TYPE_PresetName._UNSPECIFIED_;
                        break;
                 }
                 break;
         }
     }
     if(OnResult_SelectPreset != null)
     {
        OnResult_SelectPreset((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_PresetName )Args[1].DataValue, null, Handle);
     }
     WeakReference[] w = (WeakReference[])WeakList_SelectPreset.ToArray(typeof(WeakReference));
     foreach(WeakReference wr in w)
     {
         if(wr.IsAlive==true)
         {
            ((Delegate_OnResult_SelectPreset)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_PresetName )Args[1].DataValue, null, Handle);
         }
         else
         {
             WeakList_SelectPreset.Remove(wr);
         }
     }
 }
开发者ID:nothingmn,项目名称:UPnP-for-C---Intel-,代码行数:43,代码来源:CpRenderingControl.cs

示例12: Error_Sink_SetSharpness

 private void Error_Sink_SetSharpness(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle)
 {
     if(OnResult_SetSharpness != null)
     {
          OnResult_SetSharpness((System.UInt32 )Args[0].DataValue, (System.UInt16 )Args[1].DataValue, e, Handle);
     }
     WeakReference[] w = (WeakReference[])WeakList_SetSharpness.ToArray(typeof(WeakReference));
     foreach(WeakReference wr in w)
     {
         if(wr.IsAlive==true)
         {
            ((Delegate_OnResult_SetSharpness)wr.Target)((System.UInt32 )Args[0].DataValue, (System.UInt16 )Args[1].DataValue, e, Handle);
         }
         else
         {
             WeakList_SetSharpness.Remove(wr);
         }
     }
 }
开发者ID:nothingmn,项目名称:UPnP-for-C---Intel-,代码行数:19,代码来源:CpRenderingControl.cs

示例13: Error_Sink_SetMute

 private void Error_Sink_SetMute(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle)
 {
     for(int i=0;i<Args.Length;++i)
     {
         switch(Args[i].Name)
         {
             case "Channel":
                 switch((string)Args[i].DataValue)
                 {
                     case "Master":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.MASTER;
                         break;
                     case "LF":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.LF;
                         break;
                     case "RF":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.RF;
                         break;
                     case "CF":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.CF;
                         break;
                     case "LFE":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.LFE;
                         break;
                     case "LS":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.LS;
                         break;
                     case "RS":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.RS;
                         break;
                     case "LFC":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.LFC;
                         break;
                     case "RFC":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.RFC;
                         break;
                     case "SD":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.SD;
                         break;
                     case "SL":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.SL;
                         break;
                     case "SR ":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.SR_;
                         break;
                     case "T":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.T;
                         break;
                     case "B":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.B;
                         break;
                     case "Vendor defined":
                         Args[i].DataValue = Enum_A_ARG_TYPE_Channel.VENDOR_DEFINED;
                         break;
                 }
                 break;
         }
     }
     if(OnResult_SetMute != null)
     {
          OnResult_SetMute((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_Channel )Args[1].DataValue, (System.Boolean )Args[2].DataValue, e, Handle);
     }
     WeakReference[] w = (WeakReference[])WeakList_SetMute.ToArray(typeof(WeakReference));
     foreach(WeakReference wr in w)
     {
         if(wr.IsAlive==true)
         {
            ((Delegate_OnResult_SetMute)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_Channel )Args[1].DataValue, (System.Boolean )Args[2].DataValue, e, Handle);
         }
         else
         {
             WeakList_SetMute.Remove(wr);
         }
     }
 }
开发者ID:nothingmn,项目名称:UPnP-for-C---Intel-,代码行数:75,代码来源:CpRenderingControl.cs

示例14: HandleInvoke

 protected void HandleInvoke(UPnPService sender, string MethodName, UPnPArgument[] Args, object ReturnValue, object Handle)
 {
     this.Invoke(new UPnPService.UPnPServiceInvokeHandler(HandleInvokeEx),new object[5]{sender,MethodName,Args,ReturnValue, Handle});
 }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:4,代码来源:MethodInvoke.cs

示例15: deviceTree_MouseDown

 private void deviceTree_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     TreeNode node = deviceTree.GetNodeAt(e.X,e.Y);
     if (node == null) return;
     deviceTree.SelectedNode = node;
     object infoObject = node.Tag;
     if (infoObject == null)
     {
         service = null;
         okButton.Enabled = false;
         return;
     }
     if (infoObject.GetType() == typeof(UPnPService))
     {
         service = (UPnPService)infoObject;
         okButton.Enabled = true;
     }
     else
     {
         service = null;
         okButton.Enabled = false;
     }
 }
开发者ID:amadare,项目名称:DeveloperToolsForUPnP,代码行数:23,代码来源:UPnPServiceLocator.cs


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