本文整理汇总了C#中DvInvocation.ReadEnd方法的典型用法代码示例。如果您正苦于以下问题:C# DvInvocation.ReadEnd方法的具体用法?C# DvInvocation.ReadEnd怎么用?C# DvInvocation.ReadEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DvInvocation
的用法示例。
在下文中一共展示了DvInvocation.ReadEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoProduct
private static int DoProduct(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgProduct1 self = (DvProviderAvOpenhomeOrgProduct1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string room;
string name;
string info;
string url;
string imageUri;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.Product(invocation, out room, out name, out info, out url, out imageUri);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Product");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Product" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Product" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("Room", room);
invocation.WriteString("Name", name);
invocation.WriteString("Info", info);
invocation.WriteString("Url", url);
invocation.WriteString("ImageUri", imageUri);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Product" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例2: 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;
}
示例3: DoGetProtocolInfo
private static int DoGetProtocolInfo(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string source;
string sink;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.GetProtocolInfo(invocation, out source, out sink);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "GetProtocolInfo");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "GetProtocolInfo" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetProtocolInfo" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("Source", source);
invocation.WriteString("Sink", sink);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetProtocolInfo" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例4: DoGetMediaInfo
private static int DoGetMediaInfo(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgAVTransport1 self = (DvProviderUpnpOrgAVTransport1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint instanceID;
uint nrTracks;
string mediaDuration;
string currentURI;
string currentURIMetaData;
string nextURI;
string nextURIMetaData;
string playMedium;
string recordMedium;
string writeStatus;
try
{
invocation.ReadStart();
instanceID = invocation.ReadUint("InstanceID");
invocation.ReadEnd();
self.GetMediaInfo(invocation, instanceID, out nrTracks, out mediaDuration, out currentURI, out currentURIMetaData, out nextURI, out nextURIMetaData, out playMedium, out recordMedium, out writeStatus);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "GetMediaInfo");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "GetMediaInfo"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetMediaInfo", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteUint("NrTracks", nrTracks);
invocation.WriteString("MediaDuration", mediaDuration);
invocation.WriteString("CurrentURI", currentURI);
invocation.WriteString("CurrentURIMetaData", currentURIMetaData);
invocation.WriteString("NextURI", nextURI);
invocation.WriteString("NextURIMetaData", nextURIMetaData);
invocation.WriteString("PlayMedium", playMedium);
invocation.WriteString("RecordMedium", recordMedium);
invocation.WriteString("WriteStatus", writeStatus);
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, "GetMediaInfo", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例5: DoGetTransportSettings
private static int DoGetTransportSettings(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgAVTransport1 self = (DvProviderUpnpOrgAVTransport1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint instanceID;
string playMode;
string recQualityMode;
try
{
invocation.ReadStart();
instanceID = invocation.ReadUint("InstanceID");
invocation.ReadEnd();
self.GetTransportSettings(invocation, instanceID, out playMode, out recQualityMode);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "GetTransportSettings");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "GetTransportSettings"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetTransportSettings", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("PlayMode", playMode);
invocation.WriteString("RecQualityMode", recQualityMode);
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, "GetTransportSettings", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例6: DoDestroyObject
private static int DoDestroyObject(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgContentDirectory2 self = (DvProviderUpnpOrgContentDirectory2)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string objectID;
try
{
invocation.ReadStart();
objectID = invocation.ReadString("ObjectID");
invocation.ReadEnd();
self.DestroyObject(invocation, objectID);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "DestroyObject");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "DestroyObject"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "DestroyObject", 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, "DestroyObject", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例7: DoPlaylistInsert
private static int DoPlaylistInsert(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgPlaylistManager1 self = (DvProviderAvOpenhomeOrgPlaylistManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint afterId;
string name;
string description;
uint imageId;
uint newId;
try
{
invocation.ReadStart();
afterId = invocation.ReadUint("AfterId");
name = invocation.ReadString("Name");
description = invocation.ReadString("Description");
imageId = invocation.ReadUint("ImageId");
invocation.ReadEnd();
self.PlaylistInsert(invocation, afterId, name, description, imageId, out newId);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "PlaylistInsert");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "PlaylistInsert"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "PlaylistInsert", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteUint("NewId", newId);
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, "PlaylistInsert", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例8: DoReadList
private static int DoReadList(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgPlaylist1 self = (DvProviderAvOpenhomeOrgPlaylist1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string idList;
string trackList;
try
{
invocation.ReadStart();
idList = invocation.ReadString("IdList");
invocation.ReadEnd();
self.ReadList(aVersion, idList, out trackList);
}
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.WriteString("TrackList", trackList);
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: DoStatus
private static int DoStatus(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgSender1 self = (DvProviderAvOpenhomeOrgSender1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string value;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.Status(invocation, out value);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Status");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Status" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Status" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("Value", value);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Status" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例10: DoGetProtocolInfo
private static int DoGetProtocolInfo(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgConnectionManager1 self = (DvProviderUpnpOrgConnectionManager1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
string source;
string sink;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.GetProtocolInfo(aVersion, out source, out sink);
}
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.WriteString("Source", source);
invocation.WriteString("Sink", sink);
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;
}
示例11: 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;
}
示例12: DoDetails
private static int DoDetails(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgInfo1 self = (DvProviderAvOpenhomeOrgInfo1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint duration;
uint bitRate;
uint bitDepth;
uint sampleRate;
bool lossless;
string codecName;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.Details(invocation, out duration, out bitRate, out bitDepth, out sampleRate, out lossless, out codecName);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Details");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "Details"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Details", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteUint("Duration", duration);
invocation.WriteUint("BitRate", bitRate);
invocation.WriteUint("BitDepth", bitDepth);
invocation.WriteUint("SampleRate", sampleRate);
invocation.WriteBool("Lossless", lossless);
invocation.WriteString("CodecName", codecName);
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, "Details", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例13: DoCounters
private static int DoCounters(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgInfo1 self = (DvProviderAvOpenhomeOrgInfo1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint trackCount;
uint detailsCount;
uint metatextCount;
try
{
invocation.ReadStart();
invocation.ReadEnd();
self.Counters(invocation, out trackCount, out detailsCount, out metatextCount);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Counters");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "Counters"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Counters", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteUint("TrackCount", trackCount);
invocation.WriteUint("DetailsCount", detailsCount);
invocation.WriteUint("MetatextCount", metatextCount);
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, "Counters", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例14: DoSource
private static int DoSource(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderAvOpenhomeOrgProduct1 self = (DvProviderAvOpenhomeOrgProduct1)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint index;
string systemName;
string type;
string name;
bool visible;
try
{
invocation.ReadStart();
index = invocation.ReadUint("Index");
invocation.ReadEnd();
self.Source(invocation, index, out systemName, out type, out name, out visible);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "Source");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Source" }));
return -1;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Source" });
System.Diagnostics.Debug.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("SystemName", systemName);
invocation.WriteString("Type", type);
invocation.WriteString("Name", name);
invocation.WriteBool("Visible", visible);
invocation.WriteEnd();
}
catch (ActionError)
{
return -1;
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Source" });
System.Diagnostics.Debug.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}
示例15: DoGetTransferProgress
private static int DoGetTransferProgress(IntPtr aPtr, IntPtr aInvocation)
{
GCHandle gch = GCHandle.FromIntPtr(aPtr);
DvProviderUpnpOrgContentDirectory2 self = (DvProviderUpnpOrgContentDirectory2)gch.Target;
DvInvocation invocation = new DvInvocation(aInvocation);
uint transferID;
string transferStatus;
string transferLength;
string transferTotal;
try
{
invocation.ReadStart();
transferID = invocation.ReadUint("TransferID");
invocation.ReadEnd();
self.GetTransferProgress(invocation, transferID, out transferStatus, out transferLength, out transferTotal);
}
catch (ActionError e)
{
invocation.ReportActionError(e, "GetTransferProgress");
return -1;
}
catch (PropertyUpdateError)
{
invocation.ReportError(501, String.Format("Invalid value for property {0}", "GetTransferProgress"));
return -1;
}
catch (Exception e)
{
Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetTransferProgress", e.TargetSite.Name);
Console.WriteLine(" Only ActionError or PropertyUpdateError should be thrown by actions");
return -1;
}
try
{
invocation.WriteStart();
invocation.WriteString("TransferStatus", transferStatus);
invocation.WriteString("TransferLength", transferLength);
invocation.WriteString("TransferTotal", transferTotal);
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, "GetTransferProgress", e.TargetSite.Name);
Console.WriteLine(" Only ActionError can be thrown by action response writer");
}
return 0;
}