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


C# Instance.defaultsAndOverrides方法代码示例

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


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

示例1: UdpEndpointI


//.........这里部分代码省略.........
                    if(argument != null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "unexpected argument `" + argument + "' provided for -z option in `udp " + str + "'";
                        throw e;
                    }
                    
                    _compress = true;
                }
                else if(option.Equals("-v") || option.Equals("-e"))
                {
                    if(argument == null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "no argument provided for " + option + " option in endpoint " + "`udp " + str + "'";
                        throw e;
                    }

                    try
                    {
                        Ice.EncodingVersion v = Ice.Util.stringToEncodingVersion(argument);
                        if(v.major != 1 || v.minor != 0)
                        {
                            instance_.initializationData().logger.warning("deprecated udp endpoint option: " + option);
                        }
                    }
                    catch(Ice.VersionParseException ex)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "invalid version `" + argument + "' in endpoint `udp " + str + "':\n" + ex.str;
                        throw e;
                    }
                }
                else if(option.Equals("--interface"))
                {
                    if(argument == null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "no argument provided for --interface option in endpoint `udp " + str + "'";
                        throw e;
                    }
                    
                    _mcastInterface = argument;
                }
                else if(option.Equals("--ttl"))
                {
                    if(argument == null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "no argument provided for --ttl option in endpoint `udp " + str + "'";
                        throw e;
                    }
                    
                    try
                    {
                        _mcastTtl = System.Int32.Parse(argument, CultureInfo.InvariantCulture);
                    }
                    catch(System.FormatException ex)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException(ex);
                        e.str = "invalid TTL value `" + argument + "' in endpoint `udp " + str + "'";
                        throw e;
                    }

                    if(_mcastTtl < 0)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "TTL value `" + argument + "' out of range in endpoint `udp " + str + "'";
                        throw e;
                    }
                }
                else
                {
                    parseOption(option, argument, "udp", str);
                }
            }

            if(_host == null)
            {
                _host = instance_.defaultsAndOverrides().defaultHost;
            }
            else if(_host.Equals("*"))
            {
                if(oaEndpoint)
                {
                    _host = null;
                }
                else
                {
                    throw new Ice.EndpointParseException("`-h *' not valid for proxy endpoint `udp " + str + "'");
                }        
            }

            if(_host == null)
            {
                _host = "";
            }
            
            calcHashValue();
        }
开发者ID:sbesson,项目名称:zeroc-ice,代码行数:101,代码来源:UdpEndpointI.cs

示例2: TcpEndpointI


//.........这里部分代码省略.........
                    }

                    case 'p':
                    {
                        if(argument == null)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException();
                            e.str = "no argument provided for -p option in endpoint `tcp " + str + "'";
                            throw e;
                        }

                        try
                        {
                            _port = System.Int32.Parse(argument, CultureInfo.InvariantCulture);
                        }
                        catch(System.FormatException ex)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException(ex);
                            e.str = "invalid port value `" + argument + "' in endpoint `tcp " + str + "'";
                            throw e;
                        }

                        if(_port < 0 || _port > 65535)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException();
                            e.str = "port value `" + argument + "' out of range in endpoint `tcp " + str + "'";
                            throw e;
                        }

                        break;
                    }

                    case 't':
                    {
                        if(argument == null)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException();
                            e.str = "no argument provided for -t option in endpoint `tcp " + str + "'";
                            throw e;
                        }

                        try
                        {
                            _timeout = System.Int32.Parse(argument, CultureInfo.InvariantCulture);
                        }
                        catch(System.FormatException ex)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException(ex);
                            e.str = "invalid timeout value `" + argument + "' in endpoint `tcp " + str + "'";
                            throw e;
                        }

                        break;
                    }

                    case 'z':
                    {
                        if(argument != null)
                        {
                            Ice.EndpointParseException e = new Ice.EndpointParseException();
                            e.str = "unexpected argument `" + argument + "' provided for -z option in `tcp " + str +
                                    "'";
                            throw e;
                        }

                        _compress = true;
                        break;
                    }

                    default:
                    {
                        parseOption(option, argument, "tcp", str);
                        break;
                    }
                }
            }

            if(_host == null)
            {
                _host = _instance.defaultsAndOverrides().defaultHost;
            }
            else if(_host.Equals("*"))
            {
                if(oaEndpoint)
                {
                    _host = null;
                }
                else
                {
                    throw new Ice.EndpointParseException("`-h *' not valid for proxy endpoint `tcp " + str + "'");
                }
            }

            if(_host == null)
            {
                _host = "";
            }

            calcHashValue();
        }
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:101,代码来源:TcpEndpointI.cs

示例3: UdpEndpointI


//.........这里部分代码省略.........
                    }

                    if(_port < 0 || _port > 65535)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "port value `" + argument + "' out of range in endpoint `udp " + str + "'";
                        throw e;
                    }
                }
                else if(option.Equals("-c"))
                {
                    if(argument != null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "unexpected argument `" + argument + "' provided for -c option in `udp " + str + "'";
                        throw e;
                    }

                    _connect = true;
                }
                else if(option.Equals("-z"))
                {
                    if(argument != null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "unexpected argument `" + argument + "' provided for -z option in `udp " + str + "'";
                        throw e;
                    }

                    _compress = true;
                }
                else if(option.Equals("--interface"))
                {
                    if(argument == null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "no argument provided for --interface option in endpoint `udp " + str + "'";
                        throw e;
                    }

                    _mcastInterface = argument;
                }
                else if(option.Equals("--ttl"))
                {
                    if(argument == null)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "no argument provided for --ttl option in endpoint `udp " + str + "'";
                        throw e;
                    }

                    try
                    {
                        _mcastTtl = System.Int32.Parse(argument, CultureInfo.InvariantCulture);
                    }
                    catch(System.FormatException ex)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException(ex);
                        e.str = "invalid TTL value `" + argument + "' in endpoint `udp " + str + "'";
                        throw e;
                    }

                    if(_mcastTtl < 0)
                    {
                        Ice.EndpointParseException e = new Ice.EndpointParseException();
                        e.str = "TTL value `" + argument + "' out of range in endpoint `udp " + str + "'";
                        throw e;
                    }
                }
                else
                {
                    Ice.EndpointParseException e = new Ice.EndpointParseException();
                    e.str = "unknown option `" + option + "' in `udp " + str + "'";
                    throw e;
                }
            }

            if(_host == null)
            {
                _host = instance_.defaultsAndOverrides().defaultHost;
            }
            else if(_host.Equals("*"))
            {
                if(oaEndpoint)
                {
                    _host = null;
                }
                else
                {
                    throw new Ice.EndpointParseException("`-h *' not valid for proxy endpoint `udp " + str + "'");
                }
            }

            if(_host == null)
            {
                _host = "";
            }

            calcHashValue();
        }
开发者ID:bholl,项目名称:zeroc-ice,代码行数:101,代码来源:UdpEndpointI.cs


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