diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-21 15:35:40 -0230 |
commit | 630a37d2fe66f24518299e705f958b571803c522 (patch) | |
tree | 969723791bdc4d73bb099c19d45554d0ca241ad9 /csharp/test/Ice/plugin/PluginFactory.cs | |
parent | Fix some README.md markdown formatting (diff) | |
download | ice-630a37d2fe66f24518299e705f958b571803c522.tar.bz2 ice-630a37d2fe66f24518299e705f958b571803c522.tar.xz ice-630a37d2fe66f24518299e705f958b571803c522.zip |
py -> python
rb -> ruby
objc -> objective-c
cs -> csharp
Diffstat (limited to 'csharp/test/Ice/plugin/PluginFactory.cs')
-rw-r--r-- | csharp/test/Ice/plugin/PluginFactory.cs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/csharp/test/Ice/plugin/PluginFactory.cs b/csharp/test/Ice/plugin/PluginFactory.cs new file mode 100644 index 00000000000..578f5104218 --- /dev/null +++ b/csharp/test/Ice/plugin/PluginFactory.cs @@ -0,0 +1,64 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +using System; + +public class PluginFactory : Ice.PluginFactory +{ + public Ice.Plugin create(Ice.Communicator communicator, string name, string[] args) + { + return new Plugin(communicator, args); + } + + internal class Plugin : Ice.Plugin + { + public Plugin(Ice.Communicator communicator, string[] args) + { + _args = args; + } + + public void initialize() + { + _initialized = true; + test(_args.Length == 3); + test(_args[0] == "C:\\Program Files\\"); + test(_args[1] == "--DatabasePath"); + test(_args[2] == "C:\\Program Files\\Application\\db"); + } + + public void destroy() + { + _destroyed = true; + } + + ~Plugin() + { + if(!_initialized) + { + Console.WriteLine("Plugin not initialized"); + } + if(!_destroyed) + { + Console.WriteLine("Plugin not destroyed"); + } + } + + private static void test(bool b) + { + if(!b) + { + throw new System.Exception(); + } + } + + private bool _initialized = false; + private bool _destroyed = false; + private string[] _args; + } +} |