Пример #1
0
        public FileModel NewFile()
        {
            if (!IsDirectory)
            {
                throw new ArgumentException("parent must be a directory");
            }

            // no more names left
            if (children.Count == Token.Count)
            {
                return(null);
            }

            FileModel child;

            child      = new FileModel();
            child.name = PickName(this);
            child.body = NewBody(10);

            child.parent          = this;
            children [child.name] = child;

            // Create the file
            child.Write();

            return(child);
        }
Пример #2
0
		public FileModel NewFile ()
		{
			if (! IsDirectory)
				throw new ArgumentException ("parent must be a directory");

			// no more names left
			if (children.Count == Token.Count)
				return null;

			FileModel child;
			child = new FileModel ();
			child.name = PickName (this);
			child.body = NewBody (10);

			child.parent = this;
			children [child.name] = child;

			// Create the file
			child.Write ();

			return child;
		}