private void gameFolderPathTextBox_TextChanged(object sender, TextChangedEventArgs e) { string tempPath = gameFolderPathTextBox.Text; if (gameFolderPathTextBox.Text.Last() != '\\') { gameFolderPathTextBox.Text += '\\'; return; } if (UnityL10nToolCppManaged.DetermineProjectGamePath(gameFolderPathTextBox.Text, GameName, MakerName)) { ErrorMessageTextBlock.Visibility = Visibility.Hidden; } else { string tempStr = gameFolderPathTextBox.Text + DataFolderName + "_Data\\"; if (UnityL10nToolCppManaged.DetermineProjectGamePath(tempStr, GameName, MakerName)) { gameFolderPathTextBox.Text += DataFolderName + "_Data\\"; ErrorMessageTextBlock.Visibility = Visibility.Hidden; } else { ErrorMessageTextBlock.Visibility = Visibility.Visible; } return; } }
private void gameFolderPathTextBox_Pasting(object sender, DataObjectPastingEventArgs e) { var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true); if (!isText) { return; } var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string; if (text.Last() != '\\') { e.CancelCommand(); gameFolderPathTextBox.Text = text + '\\'; return; } if (UnityL10nToolCppManaged.DetermineProjectGamePath(text, GameName, MakerName)) { ErrorMessageTextBlock.Visibility = Visibility.Hidden; } else { gameFolderPathTextBox.Text += text + DataFolderName + "_Data\\"; return; } }