コード例 #1
0
ファイル: DirectoryI.cs プロジェクト: zeroc-ice/ice-demos
    // Add servant to ASM and parent's _contents map.
    public void activate(Ice.ObjectAdapter a)
    {
        var thisNode = NodePrxHelper.uncheckedCast(a.add(this, _id));

        if (_parent != null)
        {
            _parent.addChild(thisNode);
        }
    }
コード例 #2
0
        // Slice find() operation.

        public override NodeDesc find(string name, Current c)
        {
            lock (this)
            {
                if (_destroyed)
                {
                    throw new ObjectNotExistException();
                }

                NodeI p = (NodeI)_contents[name];
                if (p == null)
                {
                    throw new NoSuchName(name);
                }

                NodeDesc d = new NodeDesc();
                d.name  = name;
                d.type  = p is FileI ? NodeType.FileType : NodeType.DirType;
                d.proxy = NodePrxHelper.uncheckedCast(c.adapter.createProxy(p.id()));
                return(d);
            }
        }
コード例 #3
0
        // Slice list() operation.

        public override NodeDesc[] list(Current c)
        {
            lock (this)
            {
                if (_destroyed)
                {
                    throw new ObjectNotExistException();
                }

                var ret = new NodeDesc[_contents.Count];
                int i   = 0;
                foreach (var e in _contents)
                {
                    var p = e.Value;
                    ret[i]       = new NodeDesc();
                    ret[i].name  = e.Key;
                    ret[i].type  = p is FileI ? NodeType.FileType : NodeType.DirType;
                    ret[i].proxy = NodePrxHelper.uncheckedCast(c.adapter.createProxy(p.id()));
                    ++i;
                }
                return(ret);
            }
        }
コード例 #4
0
    // 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);
    }