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


C# DvInvocation.ReadString方法代码示例

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


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

示例1: DoFreeFormQuery

 private static int DoFreeFormQuery(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgContentDirectory3 self = (DvProviderUpnpOrgContentDirectory3)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string containerID;
     uint cDSView;
     string queryRequest;
     string queryResult;
     uint updateID;
     try
     {
         invocation.ReadStart();
         containerID = invocation.ReadString("ContainerID");
         cDSView = invocation.ReadUint("CDSView");
         queryRequest = invocation.ReadString("QueryRequest");
         invocation.ReadEnd();
         self.FreeFormQuery(aVersion, containerID, cDSView, queryRequest, out queryResult, out updateID);
     }
     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("QueryResult", queryResult);
         invocation.WriteUint("UpdateID", updateID);
         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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:54,代码来源:DvUpnpOrgContentDirectory3.cs

示例2: DoSetRecordQualityMode

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

示例3: 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

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

示例5: 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

示例6: DoSetChannel

 private static int DoSetChannel(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderAvOpenhomeOrgRadio1 self = (DvProviderAvOpenhomeOrgRadio1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string uri;
     string metadata;
     try
     {
         invocation.ReadStart();
         uri = invocation.ReadString("Uri");
         metadata = invocation.ReadString("Metadata");
         invocation.ReadEnd();
         self.SetChannel(aVersion, uri, metadata);
     }
     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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:48,代码来源:DvAvOpenhomeOrgRadio1.cs

示例7: DoSetOnEffect

 private static int DoSetOnEffect(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgDimming1 self = (DvProviderUpnpOrgDimming1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string newOnEffect;
     try
     {
         invocation.ReadStart();
         newOnEffect = invocation.ReadString("newOnEffect");
         invocation.ReadEnd();
         self.SetOnEffect(aVersion, newOnEffect);
     }
     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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:46,代码来源:DvUpnpOrgDimming1.cs

示例8: DoSetStateVariables

 private static int DoSetStateVariables(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgAVTransport2 self = (DvProviderUpnpOrgAVTransport2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     uint instanceID;
     string aVTransportUDN;
     string serviceType;
     string serviceId;
     string stateVariableValuePairs;
     string stateVariableList;
     try
     {
         invocation.ReadStart();
         instanceID = invocation.ReadUint("InstanceID");
         aVTransportUDN = invocation.ReadString("AVTransportUDN");
         serviceType = invocation.ReadString("ServiceType");
         serviceId = invocation.ReadString("ServiceId");
         stateVariableValuePairs = invocation.ReadString("StateVariableValuePairs");
         invocation.ReadEnd();
         self.SetStateVariables(aVersion, instanceID, aVTransportUDN, serviceType, serviceId, stateVariableValuePairs, out stateVariableList);
     }
     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("StateVariableList", stateVariableList);
         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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:56,代码来源:DvUpnpOrgAVTransport2.cs

示例9: DoGetAllowedValues

 private static int DoGetAllowedValues(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgScheduledRecording1 self = (DvProviderUpnpOrgScheduledRecording1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string dataTypeID;
     string filter;
     string propertyInfo;
     try
     {
         invocation.ReadStart();
         dataTypeID = invocation.ReadString("DataTypeID");
         filter = invocation.ReadString("Filter");
         invocation.ReadEnd();
         self.GetAllowedValues(aVersion, dataTypeID, filter, out propertyInfo);
     }
     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("PropertyInfo", propertyInfo);
         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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:50,代码来源:DvUpnpOrgScheduledRecording1.cs

示例10: 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

示例11: DoSetNextAVTransportURI

 private static int DoSetNextAVTransportURI(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     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(aVersion, instanceID, nextURI, nextURIMetaData);
     }
     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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:50,代码来源:DvUpnpOrgAVTransport2.cs

示例12: DoGetAllowedValues

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

示例13: DoExportResource

 private static int DoExportResource(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgContentDirectory2 self = (DvProviderUpnpOrgContentDirectory2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string sourceURI;
     string destinationURI;
     uint transferID;
     try
     {
         invocation.ReadStart();
         sourceURI = invocation.ReadString("SourceURI");
         destinationURI = invocation.ReadString("DestinationURI");
         invocation.ReadEnd();
         self.ExportResource(aVersion, sourceURI, destinationURI, out transferID);
     }
     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.WriteUint("TransferID", transferID);
         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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:50,代码来源:DvUpnpOrgContentDirectory2.cs

示例14: DoCreateReference

 private static int DoCreateReference(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgContentDirectory2 self = (DvProviderUpnpOrgContentDirectory2)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string containerID;
     string objectID;
     string newID;
     try
     {
         invocation.ReadStart();
         containerID = invocation.ReadString("ContainerID");
         objectID = invocation.ReadString("ObjectID");
         invocation.ReadEnd();
         self.CreateReference(aVersion, containerID, objectID, out newID);
     }
     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("NewID", newID);
         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;
 }
开发者ID:wifigeek,项目名称:ohNet,代码行数:50,代码来源:DvUpnpOrgContentDirectory2.cs

示例15: DoSetSourceIndexByName

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


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