cpconnectionmanager.cs

来自「zwave 无线通讯协议 PC controller 控制器源码」· CS 代码 · 共 989 行 · 第 1/4 页

CS
989
字号
                                Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT;
                                break;
                            default:
                               SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)Args[i].DataValue);
                               Args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_;
                               break;
                        }
                        break;
                    case "Status":
                        switch((string)Args[i].DataValue)
                        {
                            case "OK":
                                Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.OK;
                                break;
                            case "ContentFormatMismatch":
                                Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.CONTENTFORMATMISMATCH;
                                break;
                            case "InsufficientBandwidth":
                                Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.INSUFFICIENTBANDWIDTH;
                                break;
                            case "UnreliableChannel":
                                Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNRELIABLECHANNEL;
                                break;
                            case "Unknown":
                                Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNKNOWN;
                                break;
                            default:
                               SetUnspecifiedValue("Enum_A_ARG_TYPE_ConnectionStatus", (string)Args[i].DataValue);
                               Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus._UNSPECIFIED_;
                               break;
                        }
                        break;
                }
            }
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_GetCurrentConnectionInfo)StateInfo[1])(this, (System.Int32 )Args[0].DataValue, (System.Int32 )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (Enum_A_ARG_TYPE_Direction )Args[6].DataValue, (Enum_A_ARG_TYPE_ConnectionStatus )Args[7].DataValue, null, StateInfo[0]);
            }
            else
            {
                OnResult_GetCurrentConnectionInfo_Event.Fire(this, (System.Int32 )Args[0].DataValue, (System.Int32 )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (Enum_A_ARG_TYPE_Direction )Args[6].DataValue, (Enum_A_ARG_TYPE_ConnectionStatus )Args[7].DataValue, null, StateInfo[0]);
            }
        }
        private void Error_Sink_GetCurrentConnectionInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, object _Tag)
        {
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_GetCurrentConnectionInfo)StateInfo[1])(this, (System.Int32 )Args[0].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (Enum_A_ARG_TYPE_Direction)0, (Enum_A_ARG_TYPE_ConnectionStatus)0, e, StateInfo[0]);
            }
            else
            {
                OnResult_GetCurrentConnectionInfo_Event.Fire(this, (System.Int32 )Args[0].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (Enum_A_ARG_TYPE_Direction)0, (Enum_A_ARG_TYPE_ConnectionStatus)0, e, StateInfo[0]);
            }
        }
        public void Sync_GetProtocolInfo(out System.String Source, out System.String Sink)
        {
           UPnPArgument[] args = new UPnPArgument[2];
           args[0] = new UPnPArgument("Source", "");
           args[1] = new UPnPArgument("Sink", "");
            _S.InvokeSync("GetProtocolInfo", args);
            Source = (System.String) args[0].DataValue;
            Sink = (System.String) args[1].DataValue;
            return;
        }
        public void GetProtocolInfo()
        {
            GetProtocolInfo(null, null);
        }
        public void GetProtocolInfo(object _Tag, Delegate_OnResult_GetProtocolInfo _Callback)
        {
           UPnPArgument[] args = new UPnPArgument[2];
           args[0] = new UPnPArgument("Source", "");
           args[1] = new UPnPArgument("Sink", "");
           _S.InvokeAsync("GetProtocolInfo", args, new object[2]{_Tag,_Callback},new UPnPService.UPnPServiceInvokeHandler(Sink_GetProtocolInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetProtocolInfo));
        }
        private void Sink_GetProtocolInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, object _Tag)
        {
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_GetProtocolInfo)StateInfo[1])(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, null, StateInfo[0]);
            }
            else
            {
                OnResult_GetProtocolInfo_Event.Fire(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, null, StateInfo[0]);
            }
        }
        private void Error_Sink_GetProtocolInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, object _Tag)
        {
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_GetProtocolInfo)StateInfo[1])(this, (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), e, StateInfo[0]);
            }
            else
            {
                OnResult_GetProtocolInfo_Event.Fire(this, (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), e, StateInfo[0]);
            }
        }
        public void Sync_PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction, out System.Int32 ConnectionID, out System.Int32 AVTransportID, out System.Int32 RcsID)
        {
           UPnPArgument[] args = new UPnPArgument[7];
           args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo);
           args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager);
           args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID);
           switch(Direction)
           {
               case Enum_A_ARG_TYPE_Direction.INPUT:
                   args[3] = new UPnPArgument("Direction", "Input");
                   break;
               case Enum_A_ARG_TYPE_Direction.OUTPUT:
                   args[3] = new UPnPArgument("Direction", "Output");
                   break;
               default:
                  args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction"));
                  break;
           }
           args[4] = new UPnPArgument("ConnectionID", "");
           args[5] = new UPnPArgument("AVTransportID", "");
           args[6] = new UPnPArgument("RcsID", "");
            _S.InvokeSync("PrepareForConnection", args);
            for(int i=0;i<args.Length;++i)
            {
                switch(args[i].Name)
                {
                    case "Direction":
                        switch((string)args[i].DataValue)
                        {
                            case "Input":
                                args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT;
                                break;
                            case "Output":
                                args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT;
                                break;
                            default:
                               SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)args[i].DataValue);
                               args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_;
                               break;
                        }
                        break;
                }
            }
            RemoteProtocolInfo = (System.String) args[0].DataValue;
            PeerConnectionManager = (System.String) args[1].DataValue;
            PeerConnectionID = (System.Int32) args[2].DataValue;
            Direction = (Enum_A_ARG_TYPE_Direction) args[3].DataValue;
            ConnectionID = (System.Int32) args[4].DataValue;
            AVTransportID = (System.Int32) args[5].DataValue;
            RcsID = (System.Int32) args[6].DataValue;
            return;
        }
        public void PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction)
        {
            PrepareForConnection(RemoteProtocolInfo, PeerConnectionManager, PeerConnectionID, Direction, null, null);
        }
        public void PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction, object _Tag, Delegate_OnResult_PrepareForConnection _Callback)
        {
           UPnPArgument[] args = new UPnPArgument[7];
           args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo);
           args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager);
           args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID);
           switch(Direction)
           {
               case Enum_A_ARG_TYPE_Direction.INPUT:
                   args[3] = new UPnPArgument("Direction", "Input");
                   break;
               case Enum_A_ARG_TYPE_Direction.OUTPUT:
                   args[3] = new UPnPArgument("Direction", "Output");
                   break;
               default:
                  args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction"));
                  break;
           }
           args[4] = new UPnPArgument("ConnectionID", "");
           args[5] = new UPnPArgument("AVTransportID", "");
           args[6] = new UPnPArgument("RcsID", "");
           _S.InvokeAsync("PrepareForConnection", args, new object[2]{_Tag,_Callback},new UPnPService.UPnPServiceInvokeHandler(Sink_PrepareForConnection), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_PrepareForConnection));
        }
        private void Sink_PrepareForConnection(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, object _Tag)
        {
            for(int i=0;i<Args.Length;++i)
            {
                switch(Args[i].Name)
                {
                    case "Direction":
                        switch((string)Args[i].DataValue)
                        {
                            case "Input":
                                Args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT;
                                break;
                            case "Output":
                                Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT;
                                break;
                            default:
                               SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)Args[i].DataValue);
                               Args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_;
                               break;
                        }
                        break;
                }
            }
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_PrepareForConnection)StateInfo[1])(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32 )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (System.Int32 )Args[6].DataValue, null, StateInfo[0]);
            }
            else
            {
                OnResult_PrepareForConnection_Event.Fire(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32 )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (System.Int32 )Args[6].DataValue, null, StateInfo[0]);
            }
        }
        private void Error_Sink_PrepareForConnection(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, object _Tag)
        {
            for(int i=0;i<Args.Length;++i)
            {
                switch(Args[i].Name)
                {
                    case "Direction":
                        switch((string)Args[i].DataValue)
                        {
                            case "Input":
                                Args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT;
                                break;
                            case "Output":
                                Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT;
                                break;
                        }
                        break;
                }
            }
            object[] StateInfo = (object[])_Tag;
            if(StateInfo[1]!=null)
            {
                ((Delegate_OnResult_PrepareForConnection)StateInfo[1])(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), e, StateInfo[0]);
            }
            else
            {
                OnResult_PrepareForConnection_Event.Fire(this, (System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), e, StateInfo[0]);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?