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


C# Udbus.Exception方法代码示例

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


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

示例1: TryV4VConnection

        private static Udbus.v4v.v4vConnection TryV4VConnection(Udbus.Serialization.UdbusDelegates.D_io_debug io_debug, Udbus.Core.Logging.ILog log)
        {
            Udbus.v4v.v4vConnection result = null;

            try
            {
                Udbus.v4v.v4vConnection create = new Udbus.v4v.v4vConnection(io_debug);
                result = create;
            }
            catch (Udbus.Serialization.Exceptions.TransportFailureException transportEx)
            {
                log.Exception("Failed to create V4V transport. {0}", transportEx);
            }
            catch (Exception ex)
            {
                log.Exception("Error creating V4V transport. {0}", ex);
            }

            return result;
        }
开发者ID:rneilturner,项目名称:win-tools,代码行数:20,代码来源:DbusHosts.cs

示例2: SetRegistryValue

        private static bool SetRegistryValue(Microsoft.Win32.RegistryKey key, string name, string value, Udbus.Core.Logging.ILog log)
        {
            bool result = false;

            try
            {
                key.SetValue(name, value);
                result = true;
            }
            catch (System.ArgumentNullException argnullEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (argument null) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, argnullEx);
                }
            }
            catch (System.ArgumentException argEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (argument exception) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, argEx);
                }
            }
            catch (System.ObjectDisposedException objdispEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (object disposed) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, objdispEx);
                }
            }
            catch (System.UnauthorizedAccessException unauthEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (unauthorised) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, unauthEx);
                }
            }
            catch (System.Security.SecurityException secEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (security exception) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, secEx);
                }
            }
            catch (System.IO.IOException ioEx)
            {
                if (log != null)
                {
                    log.Exception("Failed to set registry key (io exception) \"{0}\\{1}\" to \"{2}\". {3}", key.Name, name, value, ioEx);
                }
            }

            return result;
        }
开发者ID:jean-edouard,项目名称:win-tools,代码行数:54,代码来源:XenClientGuestWCFService.cs

示例3: TryServiceConnectionParams

        private static Udbus.Core.ServiceConnectionParams TryServiceConnectionParams(Udbus.v4v.v4vConnection connection, Udbus.Core.Logging.ILog log)
        {
            Udbus.Core.ServiceConnectionParams result = null;

            try
            {
                Udbus.Core.ServiceConnectionParams create = new Udbus.Core.ServiceConnectionParams(connection);
                result = create;
            }
            catch (Udbus.Serialization.Exceptions.UdbusAuthorisationException authex)
            {
                log.Exception("Authorisation Error creating ServiceConnectionParams. {0}", authex);
            }
            catch (Exception ex)
            {
                log.Exception("Error creating ServiceConnectionParams. {0}", ex);
            }
            return result;
        }
开发者ID:rneilturner,项目名称:win-tools,代码行数:19,代码来源:DbusHosts.cs


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