public override INode Delete(INode thisNode, ref bool operationPerformed, Func <INode> defaultOperator)
        {
            INode retval = null;

            ActionUtils.ToRetryAction <object>(value => retval = defaultOperator(), retryCount)(null);

            operationPerformed = true;

            return(retval);
        }
 public virtual void Save()
 {
     using (GetAutoLock().Lock())
     {
         ActionUtils.ToRetryAction <object>
         (
             delegate
         {
             this.NodeType.Save(this);
         },
             this.NodeType.RetryTimeout,
             e => e is System.IO.IOException
         )(null);
     }
 }
        protected override IFile DoCreateHardLink(IFile targetFile, bool overwrite)
        {
            string target;
            var    path = this.fileInfo.FullName;

            try
            {
                var service = (INativePathService)targetFile.GetService(typeof(INativePathService));

                target = service.GetNativePath();
            }
            catch (NotSupportedException)
            {
                throw new NotSupportedException();
            }

            targetFile.Refresh();

            if (this.Exists && !overwrite)
            {
                throw new IOException("Hardlink already exists");
            }
            else
            {
                ActionUtils.ToRetryAction <object>
                (
                    delegate
                {
                    if (this.Exists)
                    {
                        this.Delete();
                    }

                    try
                    {
                        Native.GetInstance().CreateHardLink(path, target);
                    }
                    catch (TooManyLinksException)
                    {
                        throw new TooManyLinksException(this, targetFile);
                    }
                },
                    TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(0.25)
                )(null);
            }

            return(this);
        }
        public virtual void Load()
        {
            if (!this.Attributes.Exists)
            {
                this.value = null;
            }
            else
            {
                ActionUtils.ToRetryAction <object>
                (
                    delegate
                {
                    using (GetAutoLock().Lock())
                    {
                        try
                        {
                            this.value = this.NodeType.Load(this);
                        }
                        catch (NodeNotFoundException)
                        {
                            this.Attributes.Refresh();

                            if (!this.Attributes.Exists)
                            {
                                this.value = null;

                                return;
                            }
                        }
                    }
                },
                    this.NodeType.RetryTimeout,
                    e => e is System.IO.IOException
                )(null);
            }
        }