Exemplo n.º 1
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var savedTemplates = new SavedTemplates();

            savedTemplates.ShowDialog();
            if (savedTemplates.SelectedId != -1)
            {
                _lockSelection = true;
                var path = System.Windows.Forms.Application.StartupPath + "\\SavedTemplates\\" +
                           savedTemplates.SelectedId + "\\";
                LoadTemplates(path + "templates.bin");
                var bitmapImage = new BitmapImage(new Uri(path + "image.png", UriKind.Relative));
                PaintCanvas.Background = new ImageBrush(bitmapImage);
                PaintCanvas.Height     = bitmapImage.Height;
                PaintCanvas.Width      = bitmapImage.Width;
                PaintCanvas.Children.Clear();
            }
            selectionRectangle.Width  = 0;
            selectionRectangle.Height = 0;
            if (savedTemplates.DeletedItemIds.Count != 0)
            {
                var templateProp = new TemplateProperties();
                foreach (var id in savedTemplates.DeletedItemIds)
                {
                    templateProp.DeleteTemplateFromDirectory(id);
                }
            }
        }
Exemplo n.º 2
0
        public UpdateSavedTemplates(int id)
        {
            InitializeComponent();
            var tP = new TemplateProperties();

            tP.GetTemplateNameAndId(id, out _name, out _stuffId);
            _id = id;
        }
Exemplo n.º 3
0
 private void Kayıt_Click(object sender, RoutedEventArgs e)
 {
     if (TxtName.Text.Length < 2 || TxtStuffId.Text.Length < 1)
     {
         MessageBox.Show(ResLocalization.WrongEnter, ResLocalization.Warning, MessageBoxButton.OK, MessageBoxImage.Warning);
         //*ToDo*
     }
     else
     {
         var tP = new TemplateProperties();
         tP.UpdateTemplate(TxtName.Text.Trim(), TxtStuffId.Text.Trim(), _id);
         Close();
     }
 }
Exemplo n.º 4
0
 private void Kayıt_Click(object sender, RoutedEventArgs e)
 {
     if (TxtName.Text.Length < 2 || TxtStuffId.Text.Length < 1)
     {
         MessageBox.Show(ResLocalization.WrongEnter, ResLocalization.Warning, MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     else
     {
         var testImage        = (ImageSource)_image;
         SaveImageWindows frm = new SaveImageWindows(testImage, _contours, _strokeThickness, new System.Drawing.Size(_image.PixelWidth, _image.PixelHeight));
         frm.ShowDialog();
         var tP = new TemplateProperties();
         tP.AddTemplate(frm.Image, TxtName.Text, TxtStuffId.Text, _templates);
         DialogResult = true;
         Close();
     }
 }