Пример #1
0
        private void ParentDir_ParentDirectoryChanged(object sender, EventArgs e)
        {
            var oldname = this.FullName;
            var newname = ParentDirectory.FileInfo.FullName + "\\" + this.Name;

            base.RenameFile(newname);
            UpdateProperties();
            if (OnFileNameChangedChanged != null)
            {
                OnFileNameChangedChanged.Invoke(oldname, this);
            }
        }
Пример #2
0
        public void RenameFile(string newFilePath)
        {
            var oldname = this.FullName;

            this.filepath = newFilePath;
            directory     = null;
            fileinfo      = null;
            if (ParentDirectoryChanged != null)
            {
                ParentDirectoryChanged.Invoke(this, new EventArgs());
            }
            if (OnFileNameChangedChanged != null)
            {
                OnFileNameChangedChanged.Invoke(oldname, this);
            }
        }