summaryrefslogtreecommitdiff
path: root/cs/demo/Manual/simple_filesystem/FileI.cs
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2014-11-11 22:33:50 +0100
committerJose <jose@zeroc.com>2014-11-11 22:33:50 +0100
commitfefe5c503a8bec0882443e994db64f916f806b5e (patch)
treef1881528106f75b50ab0f72ea6b5da6f90dc5b2e /cs/demo/Manual/simple_filesystem/FileI.cs
parentICE-5863 - merge Java RPMs (diff)
downloadice-fefe5c503a8bec0882443e994db64f916f806b5e.tar.bz2
ice-fefe5c503a8bec0882443e994db64f916f806b5e.tar.xz
ice-fefe5c503a8bec0882443e994db64f916f806b5e.zip
Fixed (ICE-5857) rename manual -> Manual
Diffstat (limited to 'cs/demo/Manual/simple_filesystem/FileI.cs')
-rw-r--r--cs/demo/Manual/simple_filesystem/FileI.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/cs/demo/Manual/simple_filesystem/FileI.cs b/cs/demo/Manual/simple_filesystem/FileI.cs
new file mode 100644
index 00000000000..3ecebed2448
--- /dev/null
+++ b/cs/demo/Manual/simple_filesystem/FileI.cs
@@ -0,0 +1,64 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 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 Filesystem;
+using System.Diagnostics;
+
+public class FileI : FileDisp_
+{
+ // FileI constructor
+
+ public FileI(Ice.Communicator communicator, string name, DirectoryI parent)
+ {
+ _name = name;
+ _parent = parent;
+
+ Debug.Assert(_parent != null);
+
+ //
+ // Create an identity
+ //
+ _id = new Ice.Identity();
+ _id.name = System.Guid.NewGuid().ToString();
+ }
+
+ // Slice Node::name() operation
+
+ public override string name(Ice.Current current)
+ {
+ return _name;
+ }
+
+ // Slice File::read() operation
+
+ public override string[] read(Ice.Current current)
+ {
+ return _lines;
+ }
+
+ // Slice File::write() operation
+
+ public override void write(string[] text, Ice.Current current)
+ {
+ _lines = text;
+ }
+
+ // Add servant to ASM and parent's _contents map.
+
+ public void activate(Ice.ObjectAdapter a)
+ {
+ NodePrx thisNode = NodePrxHelper.uncheckedCast(a.add(this, _id));
+ _parent.addChild(thisNode);
+ }
+
+ private string _name;
+ private DirectoryI _parent;
+ private Ice.Identity _id;
+ private string[] _lines;
+}