Exemple #1
0
        public SimSPFile SetFile()
        {
            var simSPFile = new SimSPFile();

            this.File = simSPFile;

            return(simSPFile);
        }
        public SimSPFile Add(string name, byte[] contents)
        {
            var simSPFile = new SimSPFile
            {
                ParentCollection = this,
                Name             = name
            };

            base.Add(simSPFile.Instance);
            if (this.Folder != null && this.Folder.ParentList != null)
            {
                var simSPListItem = this.Folder.ParentList.Items.Add();
                simSPListItem.Name = name;
                simSPListItem.FileSystemObjectType = 0;
                simSPListItem.File = simSPFile;
                simSPListItem.Update();
                simSPFile.Item = simSPListItem;
            }

            return(simSPFile);
        }