Exemplo n.º 1
0
 public FileI(string name, DirectoryI parent)
 {
     _name = name;
     _parent = parent;
     _destroyed = false;
     _id = new Identity();
     _id.name = Guid.NewGuid().ToString();
 }
Exemplo n.º 2
0
 public FileI(string name, DirectoryI parent)
 {
     _name      = name;
     _parent    = parent;
     _destroyed = false;
     _id        = new Identity();
     _id.name   = Guid.NewGuid().ToString();
 }
Exemplo n.º 3
0
        // DirectoryI constructor. parent == null indicates root directory.

        public DirectoryI(string name, DirectoryI parent)
        {
            _name      = name;
            _parent    = parent;
            _id        = new Identity();
            _destroyed = false;
            _contents  = new Dictionary <string, NodeI>();

            if (parent == null)
            {
                _id.name = "RootDir";
            }
            else
            {
                _id.name = Guid.NewGuid().ToString();
            }
        }
Exemplo n.º 4
0
        // DirectoryI constructor. parent == null indicates root directory.
        public DirectoryI(string name, DirectoryI parent)
        {
            _name = name;
            _parent = parent;
            _id = new Identity();
            _destroyed = false;
            _contents = new Dictionary<string, NodeI>();

            if(parent == null)
            {
                _id.name = "RootDir";
            }
            else
            {
                _id.name = Guid.NewGuid().ToString();
            }
        }
Exemplo n.º 5
0
        // Slice createDirectory() operation.

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

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

                var d    = new DirectoryI(name, this);
                var node = c.adapter.add(d, d.id());
                _contents.Add(name, d);
                return(DirectoryPrxHelper.uncheckedCast(node));
            }
        }
Exemplo n.º 6
0
        // Slice createDirectory() operation.
        public override DirectoryPrx createDirectory(string name, Current c)
        {
            lock(this)
            {
                if(_destroyed)
                {
                    throw new ObjectNotExistException();
                }

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

                var d = new DirectoryI(name, this);
                var node = c.adapter.add(d, d.id());
                _contents.Add(name, d);
                return DirectoryPrxHelper.uncheckedCast(node);
            }
        }