예제 #1
0
        private void OnGoToVersionCommand(object sender, ExecutedRoutedEventArgs e)
        {
            VersionSelectWindow window = new VersionSelectWindow(codeEditor.CurrentCodeFile)
            {
                Owner = this
            };
            bool?result = window.ShowDialog();

            if (result.HasValue && result.Value)
            {
                KeyValuePair <DateTime, string>?pair = window.versionView.SelectedItem as KeyValuePair <DateTime, string>?;
                codeEditor.CurrentCodeFile.GoToVersion(pair.Value.Key);
            }
        }
        private void MenuItem_GoToVer_Click(object sender, RoutedEventArgs e)
        {
            var file = treeView1.SelectedItem as CodeFile;

            if (file != null)
            {
                VersionSelectWindow window = new VersionSelectWindow(file)
                {
                    Owner = Window.GetWindow(this)
                };
                bool?result = window.ShowDialog();
                if (result.HasValue && result.Value)
                {
                    object o = window.versionView.SelectedItem;
                    KeyValuePair <DateTime, string>?pair = window.versionView.SelectedItem as KeyValuePair <DateTime, string>?;
                    file.GoToVersion(pair.Value.Key);
                }
            }
        }