source: trunk/CrypPlugins/QuadraticSieve/QuadraticSievePresentation.xaml.cs @ 1678

Last change on this file since 1678 was 1678, checked in by Sven Rech, 12 years ago

quadratic sieve changes

File size: 1.8 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Controls;
7using System.Windows.Data;
8using System.Windows.Documents;
9using System.Windows.Input;
10using System.Windows.Media;
11using System.Windows.Media.Imaging;
12using System.Windows.Navigation;
13using System.Windows.Shapes;
14
15namespace Cryptool.Plugins.QuadraticSieve
16{
17    /// <summary>
18    /// Interaction logic for QuadraticSievePresentation.xaml
19    /// </summary>
20    public partial class QuadraticSievePresentation : UserControl
21    {
22        private ProgressYields progressYields;
23        public ProgressYields ProgressYields
24        {
25            get { return progressYields; }
26        }
27
28        public QuadraticSievePresentation()
29        {
30            InitializeComponent();           
31            SizeChanged += sizeChanged;
32
33            ScrollViewer sviewer = new ScrollViewer();
34            sviewer.CanContentScroll = true;
35            sviewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
36            sviewer.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
37            progressYields = new ProgressYields(sviewer);
38            sviewer.Content = progressYields;
39            Grid grid = ((Grid)peer2peer.Content);
40            Grid.SetRow(sviewer, 0);
41            grid.Children.Add(sviewer);
42            sviewer.MinHeight = 100;
43            sviewer.MaxHeight = 100;
44            progressYields.MaxWidth = factorList.Width - 10;
45        }
46
47        public void sizeChanged(Object sender, EventArgs eventArgs)
48        {
49            double scale = Math.Min((this.ActualWidth / this.Grid.ActualWidth), (this.ActualHeight / this.Grid.ActualHeight));
50            this.Grid.RenderTransform = new ScaleTransform(scale, scale);
51        }
52
53    }
54}
Note: See TracBrowser for help on using the repository browser.