本文整理汇总了C#中Ice.propertyToProxy方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.propertyToProxy方法的具体用法?C# Ice.propertyToProxy怎么用?C# Ice.propertyToProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.propertyToProxy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: allTests
//.........这里部分代码省略.........
}
// This is an unknown endpoint warning, not a parse exception.
//
//try
//{
// b1 = communicator.stringToProxy("test -f the:facet:tcp");
// test(false);
//}
//catch(Ice.EndpointParseException)
//{
//}
try
{
b1 = communicator.stringToProxy("test::tcp");
test(false);
}
catch(Ice.EndpointParseException)
{
}
//
// Test for bug ICE-5543: escaped escapes in stringToIdentity
//
Ice.Identity id = new Ice.Identity("test", ",X2QNUAzSBcJ_e$AV;E\\");
Ice.Identity id2 = Ice.Util.stringToIdentity(Ice.Util.identityToString(id));
test(id.Equals(id2));
id = new Ice.Identity("test", ",X2QNUAz\\SB\\/cJ_e$AV;E\\\\");
id2 = Ice.Util.stringToIdentity(Ice.Util.identityToString(id));
test(id.Equals(id2));
WriteLine("ok");
Write("testing propertyToProxy... ");
Flush();
Ice.Properties prop = communicator.getProperties();
String propertyPrefix = "Foo.Proxy";
prop.setProperty(propertyPrefix, "test:default -p 12010");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getIdentity().name.Equals("test") && b1.ice_getIdentity().category.Length == 0 &&
b1.ice_getAdapterId().Length == 0 && b1.ice_getFacet().Length == 0);
string property;
property = propertyPrefix + ".Locator";
test(b1.ice_getLocator() == null);
prop.setProperty(property, "locator:default -p 10000");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocator() != null && b1.ice_getLocator().ice_getIdentity().name.Equals("locator"));
try
{
prop.setProperty(property, "");
}
catch(Exception ex)
{
Console.WriteLine(ex.ToString());
}
property = propertyPrefix + ".LocatorCacheTimeout";
test(b1.ice_getLocatorCacheTimeout() == -1);
prop.setProperty(property, "1");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocatorCacheTimeout() == 1);
prop.setProperty(property, "");
// Now retest with an indirect proxy.
prop.setProperty(propertyPrefix, "test");
示例2: allTests
//.........这里部分代码省略.........
b1 = communicator.stringToProxy("test");
test(!b1.ice_isSecure());
b1 = communicator.stringToProxy("test -s");
test(b1.ice_isSecure());
try
{
b1 = communicator.stringToProxy("test:[email protected]");
test(false);
}
catch(Ice.EndpointParseException)
{
}
// This is an unknown endpoint warning, not a parse exception.
//
//try
//{
// b1 = communicator.stringToProxy("test -f the:facet:tcp");
// test(false);
//}
//catch(Ice.EndpointParseException)
//{
//}
try
{
b1 = communicator.stringToProxy("test::tcp");
test(false);
}
catch(Ice.EndpointParseException)
{
}
Console.Out.WriteLine("ok");
Console.Out.Write("testing propertyToProxy... ");
Console.Out.Flush();
Ice.Properties prop = communicator.getProperties();
String propertyPrefix = "Foo.Proxy";
prop.setProperty(propertyPrefix, "test:default -p 12010");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getIdentity().name.Equals("test") && b1.ice_getIdentity().category.Length == 0 &&
b1.ice_getAdapterId().Length == 0 && b1.ice_getFacet().Length == 0);
String property;
property = propertyPrefix + ".Locator";
test(b1.ice_getLocator() == null);
prop.setProperty(property, "locator:default -p 10000");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocator() != null && b1.ice_getLocator().ice_getIdentity().name.Equals("locator"));
prop.setProperty(property, "");
property = propertyPrefix + ".LocatorCacheTimeout";
test(b1.ice_getLocatorCacheTimeout() == -1);
prop.setProperty(property, "1");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocatorCacheTimeout() == 1);
prop.setProperty(property, "");
// Now retest with an indirect proxy.
prop.setProperty(propertyPrefix, "test");
property = propertyPrefix + ".Locator";
prop.setProperty(property, "locator:default -p 10000");
b1 = communicator.propertyToProxy(propertyPrefix);
test(b1.ice_getLocator() != null && b1.ice_getLocator().ice_getIdentity().name.Equals("locator"));
prop.setProperty(property, "");