// Init instance of regular file type public virtual id InitRegularFileWithContents(NSData data) { if (base.Init() != null) { _wrapperData = data; _wrapperType = GSFileWrapperType.GSFileWrapperRegularFileType; } return this; }
// Init instance of symbolic link type public virtual id InitSymbolicLinkWithDestination(NSString path) { if (base.Init() != null) { _wrapperData = path; _wrapperType = GSFileWrapperType.GSFileWrapperSymbolicLinkType; } return this; }
public virtual id InitDirectoryWithFileWrappers(NSDictionary docs) { NSFileWrapper self = this; if (base.Init() != null) { NSEnumerator enumerator; id key; NSFileWrapper wrapper; _wrapperType = GSFileWrapperType.GSFileWrapperDirectoryType; _wrapperData = NSMutableDictionary.Alloc().InitWithCapacity((uint)docs.Count); enumerator = docs.KeyEnumerator(); while ((key = enumerator.NextObject()) != null) { wrapper = (NSFileWrapper)docs.ObjectForKey(key); if (wrapper.PreferredFilename() == null) { wrapper.SetPreferredFilename((NSString)key); } ((NSMutableDictionary)_wrapperData).SetObjectForKey(wrapper, key); } } return self; }