本文整理汇总了C#中DvInvocation.ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C# DvInvocation.ReadInt方法的具体用法?C# DvInvocation.ReadInt怎么用?C# DvInvocation.ReadInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DvInvocation
的用法示例。
在下文中一共展示了DvInvocation.ReadInt方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoConnectionComplete
private static int DoConnectionComplete(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int connectionID;
try
{
invocation.ReadStart();
connectionID = invocation.ReadInt("ConnectionID");
invocation.ReadEnd();
self.ConnectionComplete(invocation, connectionID);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "ConnectionComplete");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "ConnectionComplete" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "ConnectionComplete" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "ConnectionComplete" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例2: DoPrepareForConnection
private static int DoPrepareForConnection(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string remoteProtocolInfo;
string peerConnectionManager;
int peerConnectionID;
string direction;
int connectionID;
int aVTransportID;
int rcsID;
try
{
invocation.ReadStart();
remoteProtocolInfo = invocation.ReadString("RemoteProtocolInfo");
peerConnectionManager = invocation.ReadString("PeerConnectionManager");
peerConnectionID = invocation.ReadInt("PeerConnectionID");
direction = invocation.ReadString("Direction");
invocation.ReadEnd();
self.PrepareForConnection(invocation, remoteProtocolInfo, peerConnectionManager, peerConnectionID, direction, out connectionID, out aVTransportID, out rcsID);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "PrepareForConnection");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "PrepareForConnection" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "PrepareForConnection" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteInt("ConnectionID", connectionID);
invocation.WriteInt("AVTransportID", aVTransportID);
invocation.WriteInt("RcsID", rcsID);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "PrepareForConnection" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例3: DoSetVolumeDB
private static int DoSetVolumeDB(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgRenderingControl1 self = (DvProviderUpnpOrgRenderingControl1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint instanceID;
string channel;
int desiredVolume;
try
{
invocation.ReadStart();
instanceID = invocation.ReadUint("InstanceID");
channel = invocation.ReadString("Channel");
desiredVolume = invocation.ReadInt("DesiredVolume");
invocation.ReadEnd();
self.SetVolumeDB(aVersion, instanceID, channel, desiredVolume);
}
catch (ActionError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
return 0;
}
示例4: DoSetVolumeDB
private static int DoSetVolumeDB(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgRenderingControl2 self = (DvProviderUpnpOrgRenderingControl2)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint instanceID;
string channel;
int desiredVolume;
try
{
invocation.ReadStart();
instanceID = invocation.ReadUint("InstanceID");
channel = invocation.ReadString("Channel");
desiredVolume = invocation.ReadInt("DesiredVolume");
invocation.ReadEnd();
self.SetVolumeDB(invocation, instanceID, channel, desiredVolume);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "SetVolumeDB");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "SetVolumeDB"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetVolumeDB", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetVolumeDB", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例5: DoSeekSecondRelative
private static int DoSeekSecondRelative(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgRadio1 self = (DvProviderAvOpenhomeOrgRadio1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int value;
try
{
invocation.ReadStart();
value = invocation.ReadInt("Value");
invocation.ReadEnd();
self.SeekSecondRelative(aVersion, value);
}
catch (ActionError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
return 0;
}
示例6: DoSeekSecondRelative
private static int DoSeekSecondRelative(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgRadio1 self = (DvProviderAvOpenhomeOrgRadio1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int value;
try
{
invocation.ReadStart();
value = invocation.ReadInt("Value");
invocation.ReadEnd();
self.SeekSecondRelative(invocation, value);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "SeekSecondRelative");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "SeekSecondRelative"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SeekSecondRelative", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SeekSecondRelative", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例7: DoPrepareForConnection
private static int DoPrepareForConnection(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string remoteProtocolInfo;
string peerConnectionManager;
int peerConnectionID;
string direction;
int connectionID;
int aVTransportID;
int rcsID;
try
{
invocation.ReadStart();
remoteProtocolInfo = invocation.ReadString("RemoteProtocolInfo");
peerConnectionManager = invocation.ReadString("PeerConnectionManager");
peerConnectionID = invocation.ReadInt("PeerConnectionID");
direction = invocation.ReadString("Direction");
invocation.ReadEnd();
self.PrepareForConnection(aVersion, remoteProtocolInfo, peerConnectionManager, peerConnectionID, direction, out connectionID, out aVTransportID, out rcsID);
}
catch (ActionError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteInt("ConnectionID", connectionID);
invocation.WriteInt("AVTransportID", aVTransportID);
invocation.WriteInt("RcsID", rcsID);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
return 0;
}
示例8: DoConnectionComplete
private static int DoConnectionComplete(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int connectionID;
try
{
invocation.ReadStart();
connectionID = invocation.ReadInt("ConnectionID");
invocation.ReadEnd();
self.ConnectionComplete(aVersion, connectionID);
}
catch (ActionError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, "Invalid XML");
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError can be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
return 0;
}
示例9: DoDecrement
private static int DoDecrement(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int value;
int result;
try
{
invocation.ReadStart();
value = invocation.ReadInt("Value");
invocation.ReadEnd();
self.Decrement(invocation, value, out result);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Decrement");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Decrement" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Decrement" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteInt("Result", result);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Decrement" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例10: DoGetCurrentConnectionInfo
private static int DoGetCurrentConnectionInfo(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int connectionID;
int rcsID;
int aVTransportID;
string protocolInfo;
string peerConnectionManager;
int peerConnectionID;
string direction;
string status;
try
{
invocation.ReadStart();
connectionID = invocation.ReadInt("ConnectionID");
invocation.ReadEnd();
self.GetCurrentConnectionInfo(invocation, connectionID, out rcsID, out aVTransportID, out protocolInfo, out peerConnectionManager, out peerConnectionID, out direction, out status);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "GetCurrentConnectionInfo");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "GetCurrentConnectionInfo"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetCurrentConnectionInfo", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteInt("RcsID", rcsID);
invocation.WriteInt("AVTransportID", aVTransportID);
invocation.WriteString("ProtocolInfo", protocolInfo);
invocation.WriteString("PeerConnectionManager", peerConnectionManager);
invocation.WriteInt("PeerConnectionID", peerConnectionID);
invocation.WriteString("Direction", direction);
invocation.WriteString("Status", status);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetCurrentConnectionInfo", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例11: DoConnectionComplete
private static int DoConnectionComplete(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
int connectionID;
try
{
invocation.ReadStart();
connectionID = invocation.ReadInt("ConnectionID");
invocation.ReadEnd();
self.ConnectionComplete(invocation, connectionID);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "ConnectionComplete");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "ConnectionComplete"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "ConnectionComplete", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "ConnectionComplete", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}