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


C# DvInvocation.ReadBool方法代码示例

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


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

示例1: DoSetLoudness

 private static int DoSetLoudness(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;
     bool desiredLoudness;
     try
     {
         invocation.ReadStart();
         instanceID = invocation.ReadUint("InstanceID");
         channel = invocation.ReadString("Channel");
         desiredLoudness = invocation.ReadBool("DesiredLoudness");
         invocation.ReadEnd();
         self.SetLoudness(aVersion, instanceID, channel, desiredLoudness);
     }
     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,代码来源:DvUpnpOrgRenderingControl1.cs

示例2: DoSetMute

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

示例3: DoSetTarget

 private static int DoSetTarget(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderUpnpOrgSwitchPower1 self = (DvProviderUpnpOrgSwitchPower1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     bool newTargetValue;
     try
     {
         invocation.ReadStart();
         newTargetValue = invocation.ReadBool("newTargetValue");
         invocation.ReadEnd();
         self.SetTarget(aVersion, newTargetValue);
     }
     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,代码来源:DvUpnpOrgSwitchPower1.cs

示例4: DoSetStandby

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

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

示例6: DoSetMultiple

 private static int DoSetMultiple(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     uint valueUint;
     int valueInt;
     bool valueBool;
     try
     {
         invocation.ReadStart();
         valueUint = invocation.ReadUint("ValueUint");
         valueInt = invocation.ReadInt("ValueInt");
         valueBool = invocation.ReadBool("ValueBool");
         invocation.ReadEnd();
         self.SetMultiple(invocation, valueUint, valueInt, valueBool);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "SetMultiple");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "SetMultiple"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetMultiple", 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, "SetMultiple", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:Wodath,项目名称:ohNet,代码行数:49,代码来源:DvOpenhomeOrgTestBasic1.cs

示例7: DoSetEnabled

 private static int DoSetEnabled(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     string id;
     bool enabled;
     try
     {
         invocation.ReadStart();
         id = invocation.ReadString("Id");
         enabled = invocation.ReadBool("Enabled");
         invocation.ReadEnd();
         self.SetEnabled(invocation, id, enabled);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "SetEnabled");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "SetEnabled"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetEnabled", 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, "SetEnabled", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
开发者ID:tedr56,项目名称:ohNetGenerated,代码行数:47,代码来源:DvAvOpenhomeOrgCredentials1.cs


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