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


C# DvInvocation.ReportActionError方法代码示例

本文整理汇总了C#中DvInvocation.ReportActionError方法的典型用法代码示例。如果您正苦于以下问题:C# DvInvocation.ReportActionError方法的具体用法?C# DvInvocation.ReportActionError怎么用?C# DvInvocation.ReportActionError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DvInvocation的用法示例。


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

示例1: DoCreateRecordSchedule

 private static int DoCreateRecordSchedule(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgScheduledRecording2 self = (DvProviderUpnpOrgScheduledRecording2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string elements;
     string recordScheduleID;
     string result;
     uint updateID;
     try
     {
         invocation.ReadStart();
         elements = invocation.ReadString("Elements");
         invocation.ReadEnd();
         self.CreateRecordSchedule(invocation, elements, out recordScheduleID, out result, out updateID);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "CreateRecordSchedule");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "CreateRecordSchedule"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "CreateRecordSchedule", e.TargetSite.Name);
         Console.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteString("RecordScheduleID", recordScheduleID);
         invocation.WriteString("Result", result);
         invocation.WriteUint("UpdateID", updateID);
         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, "CreateRecordSchedule", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:Wodath,项目名称:ohNet,代码行数:51,代码来源:DvUpnpOrgScheduledRecording2.cs

示例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;
 }
开发者ID:Wodath,项目名称:ohNet,代码行数:49,代码来源:DvUpnpOrgRenderingControl2.cs

示例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;
 }
开发者ID:openhome,项目名称:ohNet,代码行数:47,代码来源:DvUpnpOrgConnectionManager1.cs

示例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;
 }
开发者ID:broonie,项目名称:ohNet,代码行数:63,代码来源:DvUpnpOrgAVTransport1.cs

示例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;
 }
开发者ID:broonie,项目名称:ohNet,代码行数:49,代码来源:DvUpnpOrgAVTransport1.cs

示例6: DoBrowse

 private static int DoBrowse(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgContentDirectory2 self = (DvProviderUpnpOrgContentDirectory2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string objectID;
     string browseFlag;
     string filter;
     uint startingIndex;
     uint requestedCount;
     string sortCriteria;
     string result;
     uint numberReturned;
     uint totalMatches;
     uint updateID;
     try
     {
         invocation.ReadStart();
         objectID = invocation.ReadString("ObjectID");
         browseFlag = invocation.ReadString("BrowseFlag");
         filter = invocation.ReadString("Filter");
         startingIndex = invocation.ReadUint("StartingIndex");
         requestedCount = invocation.ReadUint("RequestedCount");
         sortCriteria = invocation.ReadString("SortCriteria");
         invocation.ReadEnd();
         self.Browse(invocation, objectID, browseFlag, filter, startingIndex, requestedCount, sortCriteria, out result, out numberReturned, out totalMatches, out updateID);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "Browse");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "Browse"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Browse", e.TargetSite.Name);
         Console.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteString("Result", result);
         invocation.WriteUint("NumberReturned", numberReturned);
         invocation.WriteUint("TotalMatches", totalMatches);
         invocation.WriteUint("UpdateID", updateID);
         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, "Browse", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:Wodath,项目名称:ohNet,代码行数:63,代码来源:DvUpnpOrgContentDirectory2.cs

示例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;
 }
开发者ID:nterry,项目名称:ohNet,代码行数:53,代码来源:DvAvOpenhomeOrgPlaylistManager1.cs

示例8: DoWriteFile

 private static int DoWriteFile(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string data;
     string fileFullName;
     try
     {
         invocation.ReadStart();
         data = invocation.ReadString("Data");
         fileFullName = invocation.ReadString("FileFullName");
         invocation.ReadEnd();
         self.WriteFile(invocation, data, fileFullName);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "WriteFile");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "WriteFile" }));
         return -1;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "WriteFile" });
         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, "WriteFile" });
         System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:openhome,项目名称:ohNet,代码行数:47,代码来源:DvOpenhomeOrgTestBasic1.cs

示例9: DoEchoAllowedRangeUint

 private static int DoEchoAllowedRangeUint(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     uint value;
     uint result;
     try
     {
         invocation.ReadStart();
         value = invocation.ReadUint("Value");
         invocation.ReadEnd();
         self.EchoAllowedRangeUint(invocation, value, out result);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "EchoAllowedRangeUint");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "EchoAllowedRangeUint" }));
         return -1;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "EchoAllowedRangeUint" });
         System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteUint("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, "EchoAllowedRangeUint" });
         System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:openhome,项目名称:ohNet,代码行数:47,代码来源:DvOpenhomeOrgTestBasic1.cs

示例10: DoSubscribe

 private static int DoSubscribe(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgSubscriptionLongPoll1 self = (DvProviderOpenhomeOrgSubscriptionLongPoll1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string clientId;
     string udn;
     string service;
     uint requestedDuration;
     string sid;
     uint duration;
     try
     {
         invocation.ReadStart();
         clientId = invocation.ReadString("ClientId");
         udn = invocation.ReadString("Udn");
         service = invocation.ReadString("Service");
         requestedDuration = invocation.ReadUint("RequestedDuration");
         invocation.ReadEnd();
         self.Subscribe(invocation, clientId, udn, service, requestedDuration, out sid, out duration);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "Subscribe");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Subscribe" }));
         return -1;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Subscribe" });
         System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteString("Sid", sid);
         invocation.WriteUint("Duration", duration);
         invocation.WriteEnd();
     }
     catch (ActionError)
     {
         return -1;
     }
     catch (System.Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Subscribe" });
         System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:openhome,项目名称:ohNet,代码行数:55,代码来源:DvOpenhomeOrgSubscriptionLongPoll1.cs

示例11: DoSet

 private static int DoSet(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderAvOpenhomeOrgExakt2 self = (DvProviderAvOpenhomeOrgExakt2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string deviceId;
     uint bankId;
     string fileUri;
     bool mute;
     bool persist;
     try
     {
         invocation.ReadStart();
         deviceId = invocation.ReadString("DeviceId");
         bankId = invocation.ReadUint("BankId");
         fileUri = invocation.ReadString("FileUri");
         mute = invocation.ReadBool("Mute");
         persist = invocation.ReadBool("Persist");
         invocation.ReadEnd();
         self.Set(invocation, deviceId, bankId, fileUri, mute, persist);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "Set");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "Set"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Set", 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, "Set", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:tedr56,项目名称:ohNetGenerated,代码行数:53,代码来源:DvAvOpenhomeOrgExakt2.cs

示例12: DoGetPropertyUpdates

 private static int DoGetPropertyUpdates(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgSubscriptionLongPoll1 self = (DvProviderOpenhomeOrgSubscriptionLongPoll1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string clientId;
     string updates;
     try
     {
         invocation.ReadStart();
         clientId = invocation.ReadString("ClientId");
         invocation.ReadEnd();
         self.GetPropertyUpdates(invocation, clientId, out updates);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "GetPropertyUpdates");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "GetPropertyUpdates" }));
         return -1;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetPropertyUpdates" });
         System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteString("Updates", updates);
         invocation.WriteEnd();
     }
     catch (ActionError)
     {
         return -1;
     }
     catch (System.Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetPropertyUpdates" });
         System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:openhome,项目名称:ohNet,代码行数:47,代码来源:DvOpenhomeOrgSubscriptionLongPoll1.cs

示例13: 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;
 }
开发者ID:sewood,项目名称:ohNet,代码行数:59,代码来源:DvUpnpOrgConnectionManager1.cs

示例14: DoSetNextAVTransportURI

 private static int DoSetNextAVTransportURI(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgAVTransport2 self = (DvProviderUpnpOrgAVTransport2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     uint instanceID;
     string nextURI;
     string nextURIMetaData;
     try
     {
         invocation.ReadStart();
         instanceID = invocation.ReadUint("InstanceID");
         nextURI = invocation.ReadString("NextURI");
         nextURIMetaData = invocation.ReadString("NextURIMetaData");
         invocation.ReadEnd();
         self.SetNextAVTransportURI(invocation, instanceID, nextURI, nextURIMetaData);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "SetNextAVTransportURI");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "SetNextAVTransportURI"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetNextAVTransportURI", 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, "SetNextAVTransportURI", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:broonie,项目名称:ohNet,代码行数:49,代码来源:DvUpnpOrgAVTransport2.cs

示例15: DoIdArray

 private static int DoIdArray(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderAvOpenhomeOrgRadio1 self = (DvProviderAvOpenhomeOrgRadio1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     uint token;
     byte[] array;
     try
     {
         invocation.ReadStart();
         invocation.ReadEnd();
         self.IdArray(invocation, out token, out array);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "IdArray");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "IdArray"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "IdArray", e.TargetSite.Name);
         Console.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteUint("Token", token);
         invocation.WriteBinary("Array", array);
         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, "IdArray", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:nterry,项目名称:ohNet,代码行数:47,代码来源:DvAvOpenhomeOrgRadio1.cs


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