本文整理汇总了C#中Ice.InitializationData.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# InitializationData.Clone方法的具体用法?C# InitializationData.Clone怎么用?C# InitializationData.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice.InitializationData
的用法示例。
在下文中一共展示了InitializationData.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: main
/// <summary>
/// The application must call main after it has
/// instantiated the derived class. main creates
/// a communicator, establishes the specified signal policy, and,
/// once run returns, destroys the communicator.
/// The method prints an error message for any exception that propagates
/// out of run and ensures that the communicator is
/// destroyed correctly even if run completes abnormally.
/// </summary>
/// <param name="args">The arguments for the application (as passed to Main(string[])
/// by the operating system.</param>
/// <param name="initializationData">Additional data used to initialize the communicator.</param>
/// <returns>The value returned by run. If run terminates with an exception,
/// the return value is non-zero.</returns>
public int main(string[] args, InitializationData initializationData)
{
if(Util.getProcessLogger() is ConsoleLoggerI)
{
Util.setProcessLogger(new ConsoleLoggerI(appName__));
}
if(communicator__ != null)
{
Util.getProcessLogger().error("only one instance of the Application class can be used");
return 1;
}
//
// We parse the properties here to extract Ice.ProgramName.
//
InitializationData initData;
if(initializationData != null)
{
initData = (InitializationData)initializationData.Clone();
}
else
{
initData = new InitializationData();
}
try
{
initData.properties = Util.createProperties(ref args, initData.properties);
}
catch(Ice.Exception ex)
{
Util.getProcessLogger().error(ex.ToString());
return 1;
}
catch(System.Exception ex)
{
Util.getProcessLogger().error("unknown exception:\n" + ex);
return 1;
}
appName__ = initData.properties.getPropertyWithDefault("Ice.ProgramName", appName__);
nohup__ = initData.properties.getPropertyAsInt("Ice.Nohup") > 0;
_application = this;
int status;
#if COMPACT || UNITY
status = doMain(args, initData);
#else
if(signalPolicy__ == SignalPolicy.HandleSignals)
{
if(IceInternal.AssemblyUtil.platform_ == IceInternal.AssemblyUtil.Platform.Windows)
{
_signals = new WindowsSignals();
}
else
{
_signals = new MonoSignals();
}
_signals.register(_handler);
status = doMain(args, initData);
_signals.destroy();
_signals = null;
}
else
{
status = doMain(args, initData);
}
#endif
return status;
}