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


C# Ice.getProperty方法代码示例

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


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

示例1: createClientProps

 createClientProps(Ice.Properties defaultProperties, string defaultDir, string defaultHost)
 {
     Ice.InitializationData result = new Ice.InitializationData();
     result.properties = Ice.Util.createProperties();
     //
     // TODO:
     //
     // When an application loads IceSSL.dll directly, as this one does, we
     // must ensure that it uses the same DLL as the one loaded dynamically
     // by Ice.
     //
     // When Mono supports .NET 2.0, we'll need to fix this.
     //
     result.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL:IceSSL.PluginFactory");
     if(defaultProperties.getProperty("Ice.IPv6").Length > 0)
     {
         result.properties.setProperty("Ice.IPv6", defaultProperties.getProperty("Ice.IPv6"));
     }
     result.properties.setProperty("Ice.RetryIntervals", "-1");
     if(defaultHost.Length > 0)
     {
         result.properties.setProperty("Ice.Default.Host", defaultHost);
     }
     if(defaultDir.Length > 0)
     {
         result.properties.setProperty("IceSSL.DefaultDir", defaultDir);
     }
     //result.properties.setProperty("IceSSL.Trace.Security", "1");
     return result;
 }
开发者ID:joshmoore,项目名称:ice,代码行数:30,代码来源:AllTests.cs

示例2: createServerProps

 createServerProps(Ice.Properties defaultProperties, string testDir, string defaultHost)
 {
     Dictionary<string, string> result = new Dictionary<string, string>();
     result["Ice.Plugin.IceSSL"] = "IceSSL:IceSSL.PluginFactory";
     if(defaultProperties.getProperty("Ice.IPv6").Length > 0)
     {
         result["Ice.IPv6"] = defaultProperties.getProperty("Ice.IPv6");
     }
     if(defaultHost.Length > 0)
     {
         result["Ice.Default.Host"] = defaultHost;
     }
     return result;
 }
开发者ID:sbesson,项目名称:zeroc-ice,代码行数:14,代码来源:AllTests.cs

示例3: ACMConfig

        public ACMConfig(Ice.Properties p, Ice.Logger l, string prefix, ACMConfig dflt)
        {
            Debug.Assert(prefix != null);
            
            string timeoutProperty;
            if((prefix.Equals("Ice.ACM.Client") || prefix.Equals("Ice.ACM.Server")) &&
               p.getProperty(prefix + ".Timeout").Length == 0)
            {
                timeoutProperty = prefix; // Deprecated property.
            }
            else
            {
                timeoutProperty = prefix + ".Timeout";
            };
        
            timeout = p.getPropertyAsIntWithDefault(timeoutProperty, dflt.timeout / 1000) * 1000;

            int hb = p.getPropertyAsIntWithDefault(prefix + ".Heartbeat", (int)dflt.heartbeat);
            if(hb >= (int)Ice.ACMHeartbeat.HeartbeatOff && hb <= (int)Ice.ACMHeartbeat.HeartbeatAlways)
            {
                heartbeat = (Ice.ACMHeartbeat)hb;
            }
            else
            {
                l.warning("invalid value for property `" + prefix + ".Heartbeat" + 
                          "', default value will be used instead");
                heartbeat = dflt.heartbeat;
            }

            int cl = p.getPropertyAsIntWithDefault(prefix + ".Close", (int)dflt.close);
            if(cl >= (int)Ice.ACMClose.CloseOff && cl <= (int)Ice.ACMClose.CloseOnIdleForceful)
            {
                close = (Ice.ACMClose)cl;
            }
            else
            {
                l.warning("invalid value for property `" + prefix + ".Close" +
                          "', default value will be used instead");
                close = dflt.close;
            }
        }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:41,代码来源:ACM.cs

示例4: DefaultsAndOverrides

        internal DefaultsAndOverrides(Ice.Properties properties)
        {
            string val;

            defaultProtocol = properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp");

            val = properties.getProperty("Ice.Default.Host");
            if(val.Length != 0)
            {
                defaultHost = val;
            }
            else
            {
                defaultHost = null;
            }

            val = properties.getProperty("Ice.Override.Timeout");
            if(val.Length > 0)
            {
                overrideTimeout = true;
                overrideTimeoutValue = properties.getPropertyAsInt("Ice.Override.Timeout");
            }
            else
            {
                overrideTimeout = false;
                overrideTimeoutValue = -1;
            }

            val = properties.getProperty("Ice.Override.ConnectTimeout");
            if(val.Length > 0)
            {
                overrideConnectTimeout = true;
                overrideConnectTimeoutValue = properties.getPropertyAsInt("Ice.Override.ConnectTimeout");
            }
            else
            {
                overrideConnectTimeout = false;
                overrideConnectTimeoutValue = -1;
            }

            val = properties.getProperty("Ice.Override.CloseTimeout");
            if(val.Length > 0)
            {
                overrideCloseTimeout = true;
                overrideCloseTimeoutValue = properties.getPropertyAsInt("Ice.Override.CloseTimeout");
            }
            else
            {
                overrideCloseTimeout = false;
                overrideCloseTimeoutValue = -1;
            }

#if COMPACT
            overrideCompress = false;
            overrideCompressValue = false;
#else
            val = properties.getProperty("Ice.Override.Compress");
            if(val.Length > 0)
            {
                overrideCompress = true;
                overrideCompressValue = properties.getPropertyAsInt("Ice.Override.Compress") != 0;
                if(!BasicStream.compressible() && overrideCompressValue)
                {
                    string lib = AssemblyUtil.runtime_ == AssemblyUtil.Runtime.Mono ? "bzip2 library" : "bzip2.dll";
                    Console.Error.WriteLine("warning: " + lib + " not found, Ice.Override.Compress ignored.");
                    overrideCompressValue = false;
                }
            }
            else
            {
                overrideCompress = !BasicStream.compressible();
                overrideCompressValue = false;
            }
#endif

            val = properties.getProperty("Ice.Override.Secure");
            if(val.Length > 0)
            {
                overrideSecure = true;
                overrideSecureValue = properties.getPropertyAsInt("Ice.Override.Secure") > 0;
            }
            else
            {
                overrideSecure = false;
                overrideSecureValue = false;
            }

            defaultCollocationOptimization =
                properties.getPropertyAsIntWithDefault("Ice.Default.CollocationOptimized", 1) > 0;

            val = properties.getPropertyWithDefault("Ice.Default.EndpointSelection", "Random");
            if(val.Equals("Random"))
            {
                defaultEndpointSelection = Ice.EndpointSelectionType.Random;
            }
            else if(val.Equals("Ordered"))
            {
                defaultEndpointSelection = Ice.EndpointSelectionType.Ordered;
            }
            else
//.........这里部分代码省略.........
开发者ID:Radulfr,项目名称:zeroc-ice,代码行数:101,代码来源:DefaultsAndOverrides.cs

示例5: DefaultsAndOverrides

        internal DefaultsAndOverrides(Ice.Properties properties, Ice.Logger logger)
        {
            string val;

            defaultProtocol = properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp");

            val = properties.getProperty("Ice.Default.Host");
            if(val.Length != 0)
            {
                defaultHost = val;
            }
            else
            {
                defaultHost = null;
            }

            val = properties.getProperty("Ice.Default.SourceAddress");
            if(val.Length > 0)
            {
                defaultSourceAddress = Network.getNumericAddress(val);
                if(defaultSourceAddress == null)
                {
                    throw new Ice.InitializationException("invalid IP address set for Ice.Default.SourceAddress: `" +
                                                          val + "'");
                }
            }
            else
            {
                defaultSourceAddress = null;
            }

            val = properties.getProperty("Ice.Override.Timeout");
            if(val.Length > 0)
            {
                overrideTimeout = true;
                overrideTimeoutValue = properties.getPropertyAsInt("Ice.Override.Timeout");
                if(overrideTimeoutValue < 1 && overrideTimeoutValue != -1)
                {
                    overrideTimeoutValue = -1;
                    StringBuilder msg = new StringBuilder("invalid value for Ice.Override.Timeout `");
                    msg.Append(properties.getProperty("Ice.Override.Timeout"));
                    msg.Append("': defaulting to -1");
                    logger.warning(msg.ToString());
                }
            }
            else
            {
                overrideTimeout = false;
                overrideTimeoutValue = -1;
            }

            val = properties.getProperty("Ice.Override.ConnectTimeout");
            if(val.Length > 0)
            {
                overrideConnectTimeout = true;
                overrideConnectTimeoutValue = properties.getPropertyAsInt("Ice.Override.ConnectTimeout");
                if(overrideConnectTimeoutValue < 1 && overrideConnectTimeoutValue != -1)
                {
                    overrideConnectTimeoutValue = -1;
                    StringBuilder msg = new StringBuilder("invalid value for Ice.Override.ConnectTimeout `");
                    msg.Append(properties.getProperty("Ice.Override.ConnectTimeout"));
                    msg.Append("': defaulting to -1");
                    logger.warning(msg.ToString());
                }
            }
            else
            {
                overrideConnectTimeout = false;
                overrideConnectTimeoutValue = -1;
            }

            val = properties.getProperty("Ice.Override.CloseTimeout");
            if(val.Length > 0)
            {
                overrideCloseTimeout = true;
                overrideCloseTimeoutValue = properties.getPropertyAsInt("Ice.Override.CloseTimeout");
                if(overrideCloseTimeoutValue < 1 && overrideCloseTimeoutValue != -1)
                {
                    overrideCloseTimeoutValue = -1;
                    StringBuilder msg = new StringBuilder("invalid value for Ice.Override.CloseTimeout `");
                    msg.Append(properties.getProperty("Ice.Override.CloseTimeout"));
                    msg.Append("': defaulting to -1");
                    logger.warning(msg.ToString());
                }
            }
            else
            {
                overrideCloseTimeout = false;
                overrideCloseTimeoutValue = -1;
            }

#if COMPACT
            overrideCompress = false;
            overrideCompressValue = false;
#else
            val = properties.getProperty("Ice.Override.Compress");
            if(val.Length > 0)
            {
                overrideCompress = true;
                overrideCompressValue = properties.getPropertyAsInt("Ice.Override.Compress") > 0;
//.........这里部分代码省略.........
开发者ID:joshmoore,项目名称:ice,代码行数:101,代码来源:DefaultsAndOverrides.cs

示例6: configureAdmin

        private bool configureAdmin(Ice.Properties properties, string prefix)
        {
            if(_adminEnabled && properties.getProperty("Ice.Admin.Enabled").Length == 0)
            {
            List<string> facetNames = new List<string>();
            foreach(string p in _adminFacetFilter)
            {
                if(p.StartsWith(prefix))
                {
                    facetNames.Add(p.Substring(prefix.Length));
                }
            }

            if(_adminFacetFilter.Count == 0 || facetNames.Count > 0)
            {
                properties.setProperty("Ice.Admin.Enabled", "1");

                if(facetNames.Count > 0)
                {
                    // TODO: need String.Join with escape!
                    properties.setProperty("Ice.Admin.Facets", String.Join(" ", facetNames.ToArray()));
                }
                return true;
            }
            }
            return false;
        }
开发者ID:zhangwei5095,项目名称:ice,代码行数:27,代码来源:ServiceManagerI.cs

示例7: createNetworkProxy

        private NetworkProxy createNetworkProxy(Ice.Properties props, int protocolSupport)
        {
            string proxyHost;

            proxyHost = props.getProperty("Ice.SOCKSProxyHost");
            if(proxyHost.Length > 0)
            {
                if(protocolSupport == Network.EnableIPv6)
                {
                    throw new Ice.InitializationException("IPv6 only is not supported with SOCKS4 proxies");
                }
                int proxyPort = props.getPropertyAsIntWithDefault("Ice.SOCKSProxyPort", 1080);
                return new SOCKSNetworkProxy(proxyHost, proxyPort);
            }

            proxyHost = props.getProperty("Ice.HTTPProxyHost");
            if(proxyHost.Length > 0)
            {
                return new HTTPNetworkProxy(proxyHost, props.getPropertyAsIntWithDefault("Ice.HTTPProxyPort", 1080));
            }

            return null;
        }
开发者ID:zhangwei5095,项目名称:ice,代码行数:23,代码来源:Instance.cs

示例8: createServerProps

 private static Dictionary<string, string> createServerProps(Ice.Properties defaultProperties, string defaultDir, string defaultHost)
 {
     Dictionary<string, string> result = new Dictionary<string, string>();
     result["Ice.Plugin.IceSSL"] = "IceSSL:IceSSL.PluginFactory";
     if(defaultProperties.getProperty("Ice.IPv6").Length > 0)
     {
         result["Ice.IPv6"] = defaultProperties.getProperty("Ice.IPv6");
     }
     if(defaultHost.Length > 0)
     {
         result["Ice.Default.Host"] = defaultHost;
     }
     if(defaultDir.Length > 0)
     {
         result["IceSSL.DefaultDir"] = defaultDir;
     }
     //result["IceSSL.Trace.Security"] = "1";
     return result;
 }
开发者ID:zhangwei5095,项目名称:ice,代码行数:19,代码来源:AllTests.cs


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