예제 #1
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);
            }
        }
예제 #2
0
        // Slice list() operation.

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

                NodeDesc[] ret = new NodeDesc[_contents.Count];
                int        i   = 0;
                foreach (DictionaryEntry e in _contents)
                {
                    NodeI p = (NodeI)e.Value;
                    ret[i]       = new NodeDesc();
                    ret[i].name  = (string)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);
            }
        }