/// ------------------------------------------------------------------------------------ /// <summary> /// Called when the user clicked the OK button and the File Location Options panel is /// visible. /// </summary> /// ------------------------------------------------------------------------------------ private void ApplyFileLocationOptions() { FileLocationChoice fileLocChoice; if (m_rbCopy.Checked) { fileLocChoice = FileLocationChoice.Copy; } else { fileLocChoice = (m_rbMove.Checked ? FileLocationChoice.Move : FileLocationChoice.Leave); } // If this dialog is being displayed for the purpose of inserting a new // picture or changing which picture is being displayed, remember the user's // copy/move/leave choice if (m_initialPicture == null || m_initialPicture.PictureFileRA.AbsoluteInternalPath != m_filePath) { s_defaultFileLocChoiceForSession = fileLocChoice; } m_picPreview.Image = null; m_currentImage.Dispose(); m_currentImage = null; m_filePath = MoveOrCopyFilesDlg.PerformMoveCopyOrLeaveFile(m_filePath, m_txtDestination.Text, fileLocChoice); if (MoveOrCopyFilesDlg.FileIsInExternalLinksFolder(m_filePath, m_txtDestination.Text)) { s_sExternalLinkDestinationDir = m_txtDestination.Text; } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Determines whether file is in the external links folder. /// </summary> /// <param name="sFilePath">The file path.</param> /// ------------------------------------------------------------------------------------ private bool FileIsInExternalLinksFolder(string sFilePath) { return(MoveOrCopyFilesDlg.FileIsInExternalLinksFolder(sFilePath, m_cache.LangProject.ExternalLinkRootDir)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Determines whether file is in the LinkedFiles folder. /// </summary> /// <param name="sFilePath">The file path.</param> /// ------------------------------------------------------------------------------------ private bool FileIsInLinkedFilesFolder(string sFilePath) { return(MoveOrCopyFilesDlg.FileIsInExternalLinksFolder(sFilePath, s_defaultPicturesFolder)); }