예제 #1
0
        private void buttonPreview_Click(object sender, RoutedEventArgs e)
        {
            string        preview       = GetContent();
            PreviewWindow previewWindow = new PreviewWindow(preview, true, false);

            previewWindow.ShowDialog();
        }
예제 #2
0
        private void Preview(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button != null)
            {
                KeyValuePair <string, IncludeContent> keyValuePair = (KeyValuePair <string, IncludeContent>)button.DataContext;
                string        content    = keyValuePair.Value.GetLines();
                PreviewWindow user       = new PreviewWindow(content, true);
                string        newContent = "";
                if (user.ShowDialog() == true)
                {
                    newContent = user.Answer;
                }
                if (newContent != String.Empty)
                {
                    keyValuePair.Value.Lines = repository.ParseInserts(newContent);
                }
            }
        }
예제 #3
0
        private void PreviewChange(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button != null)
            {
                Change change  = (Change)button.DataContext;
                string content = String.Empty;
                if (change.Inserts != null)
                {
                    content = change.Inserts.GetContent();
                }
                else
                {
                    content = change.Content;
                }

                PreviewWindow user = new PreviewWindow(content, false);

                ElementHost.EnableModelessKeyboardInterop(user);

                string newContent = String.Empty;
                if (user.ShowDialog() == true)
                {
                    newContent = user.Answer;
                    if (newContent == String.Empty || newContent == "\r\n\r\n")
                    {
                        changesList.Changes.Remove(change);
                    }
                    else if (repository.IsPostDiployment(change.FilePath))
                    {
                        change.Inserts = repository.GetInserts(newContent);
                    }
                    else
                    {
                        change.Content = newContent;
                    }
                }
            }
        }