Exemplo n.º 1
0
        // Slice createFile() operation.

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

                if (name.Length == 0 || _contents.ContainsKey(name))
                {
                    throw new NameInUse(name);
                }

                var f    = new FileI(name, this);
                var node = c.adapter.add(f, f.id());
                _contents.Add(name, f);
                return(FilePrxHelper.uncheckedCast(node));
            }
        }
Exemplo n.º 2
0
        // Slice createFile() operation.

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

                if(name.Length == 0 || _contents.Contains(name))
                {
                    throw new NameInUse(name);
                }

                FileI f = new FileI(name, this);
                ObjectPrx node = c.adapter.add(f, f.id());
                _contents.Add(name, f);
                return FilePrxHelper.uncheckedCast(node);
            }
        }