aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/Views/OrganizationManagementView.xaml.cs
blob: df7f7916821abe8a6493f2bfdc456da954624648 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using static Tango.SharedUI.Controls.MultiTransitionControl;
using static Tango.SharedUI.Controls.NavigationControl;

namespace Tango.MachineStudio.UsersAndRoles.Views
{
    /// <summary>
    /// Interaction logic for OrganizationManagementView.xaml
    /// </summary>
    public partial class OrganizationManagementView : UserControl , INavigationView
    {
        public OrganizationManagementView()
        {
            InitializeComponent();
        }

        public void OnNavigatedTo()
        {
            address_auto.Text = "";
        }

        public void OnNavigatedFrom()
        {
            
        }
    }
}
;OptimizeBounds"/> was called. /// </summary> public int Left { get; private set; } /// <summary> /// Gets the top position of this frame. /// Will always be 0 unless <see cref="OptimizeBounds"/> was called. /// </summary> public int Top { get; private set; } /// <summary> /// Gets the frame width. /// </summary> public override int Width { get { return _bitmap.Width; } } /// <summary> /// Gets the frame height. /// </summary> public override int Height { get { return _bitmap.Height; } } /// <summary> /// Initializes a new instance of the <see cref="RasterFrame"/> class. /// </summary> /// <param name="bitmap">The bitmap.</param> public RasterFrame(Bitmap bitmap) { _bitmap = bitmap; } /// <summary> /// Initializes a new instance of the <see cref="RasterFrame"/> class. /// </summary> /// <param name="bitmap">The bitmap.</param> /// <param name="left">The left position of the frame.</param> /// <param name="top">The top position of the frame.</param> public RasterFrame(Bitmap bitmap, int left, int top) : this(bitmap) { Left = left; Top = top; } /// <summary> /// Returns a GDI bitmap representing the frame. /// </summary> /// <returns></returns> public override Bitmap ToBitmap() { return _bitmap; } /// <summary> /// Scales the frame by the specified coefficient. /// </summary> /// <param name="coefficient">The coefficient.</param> /// <returns></returns> public RasterFrame Scale(float coefficient) { var scaled = new Bitmap(_bitmap, new Size((int)(Width * coefficient), (int)(Height * coefficient))); _bitmap.Dispose(); _bitmap = scaled; return this; } /// <summary> /// Applies this frame onto an existing bitmap. /// </summary> /// <param name="bitmap">The bitmap.</param> public override void Apply(Bitmap bitmap) { if (Top == 0 && Left == 0) { base.Apply(bitmap); } else { using (Graphics g = Graphics.FromImage(bitmap)) { g.DrawImage(_bitmap, new Rectangle(Left, Top, Width, Height)); } } } /// <summary> /// Draws the specified image on to this frame. /// </summary> /// <param name="bitmap">The bitmap.</param> public virtual void DrawImage(Bitmap bitmap, Point position) { using (Graphics g = Graphics.FromImage(_bitmap)) { g.DrawImage(bitmap, new Rectangle(position, bitmap.Size)); } } /// <summary> /// Optimizes the bounds of this frame by removing unnecessary margins. /// </summary> /// <returns></returns> public RasterFrame OptimizeBounds() { var result = BitmapCliper.ClipBitmap(_bitmap); _bitmap.Dispose(); Left = result.Bounds.Left; Top = result.Bounds.Top; _bitmap = result.Bitmap; return this; } /// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> public override void Dispose() { _bitmap.Dispose(); } } }