HardLink() 공개 메소드

public HardLink ( IList links, int copyLimitSize, string folderName, string baseFolde ) : void
links IList
copyLimitSize int
folderName string
baseFolde string
리턴 void
        public void InitCommands()
        {
            this._selectSourceFolderCommand = new RelayCommand(() =>
            {
                var dialog = new VistaFolderBrowserDialog();
                dialog.ShowNewFolderButton = true;
                dialog.ShowDialog();
                if (!string.IsNullOrWhiteSpace(dialog.SelectedPath))
                {
                    this.Set(() => this.SourceFolder, ref this._sourceFolder, dialog.SelectedPath);
                    this.Set(() => this.ParentFolder, ref this._parentFolder, Directory.GetParent(dialog.SelectedPath).FullName);
                    this.Set(() => this.FolderName, ref this._folderName, Path.GetFileName(dialog.SelectedPath) + "_Copy");
                }
            });

            this._selectParentFolderCommand = new RelayCommand(() =>
            {
                var dialog = new VistaFolderBrowserDialog();
                dialog.ShowNewFolderButton = true;
                dialog.ShowDialog();
                if (dialog.SelectedPath != null)
                {
                    this.Set(() => this.ParentFolder, ref this._parentFolder, dialog.SelectedPath);
                }
            });

            this._defaultCommand = new RelayCommand(() =>
            {
                if (string.IsNullOrWhiteSpace(this._sourceFolder))
                {
                    this.Set(() => this.FolderName, ref this._folderName, "");
                }
                else
                {
                    this.Set(() => this.FolderName, ref this._folderName,
                        Path.GetDirectoryName(_folderName) + "_HLinked");
                }
            });

            this._linkCommand = new RelayCommand(() =>
            {
                var helper = new HardLinkHelper();
                helper.HardLink(this._sourceFolder, this._parentFolder, this._folderName, 1024000);
                Process.Start("explorer.exe", Path.Combine(this._parentFolder, this._folderName));
            }, () => !string.IsNullOrWhiteSpace(this._sourceFolder) && !string.IsNullOrWhiteSpace(this._parentFolder) && !string.IsNullOrWhiteSpace(this._folderName));
        }
        private void Link()
        {
            if (Path.GetPathRoot(this._outputBaseFolder) != Path.GetPathRoot(this._sourceFolder))
            {
                this.UpdateStatusFormat(
                    "Link failed, the output basefolder and the source folder must be in the same driver!");
                return;
            }

            this.UpdateStatusFormat("Linking...");
            var helper = new HardLinkHelper();
            helper.HardLink(this._locateResult.TorrentFileLinks, this._copyLimitSize, this._outputName,
                this._outputBaseFolder);
            this.UpdateStatusFormat("Done.");
            Process.Start("explorer.exe", Path.Combine(this._outputBaseFolder, this._outputName));
        }