Smartmobili.Cocoa.NSFileWrapper.UpdateFromPath C# (CSharp) Method

UpdateFromPath() public method

public UpdateFromPath ( NSString path ) : bool
path NSString
return bool
        public virtual bool UpdateFromPath(NSString path)
        {
            NSFileManager fm = NSFileManager.DefaultManager;

            switch (_wrapperType)
            {
                case GSFileWrapperType.GSFileWrapperRegularFileType:
                    if (FileAttributes().IsEqualToDictionary(fm.FileAttributesAtPath(path, false)))
                        return false;
                    InitWithPath(path);
                    break;
                case GSFileWrapperType.GSFileWrapperSymbolicLinkType:
                    if (FileAttributes().IsEqualToDictionary(fm.FileAttributesAtPath(path, false)) &&
                    ((NSString)_wrapperData).IsEqualToString(fm.PathContentOfSymbolicLinkAtPath(path)))
                        return false;
                    InitWithPath(path);
                    break;
                case GSFileWrapperType.GSFileWrapperDirectoryType:
                    // Has the dictory itself changed?
                    if (!FileAttributes().IsEqualToDictionary(fm.FileAttributesAtPath(path, false)))
                    {
                        // FIXME: This is not effizent
                        InitWithPath(path);
                        return true;
                    }
                    // FIXME - for directory wrappers, we have to check if all the files are still there,
                    // if they have the same attributes and if any new files have been added.
                    // And this recursive for all included file wrappers

                    return false;
                    break;
            }

            return true;
        }