aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineCreationDialogVM.cs
blob: 4584d3508bc13a764c7bf0a4b9f24761ff7e21dd (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.SharedUI;

namespace Tango.MachineStudio.MachineDesigner.ViewModels
{
    public class MachineCreationDialogVM : DialogViewVM
    {
        public List<MachineVersion> MachineVersions { get; set; }

        public MachineVersion SelectedMachineVersion { get; set; }

        private bool _isNewMachine;
        public bool IsNewMachine
        {
            get { return _isNewMachine; }
            set { _isNewMachine = value; RaisePropertyChangedAuto(); }
        }

        private String _serialNumber;
        public String SerialNumber
        {
            get { return _serialNumber; }
            set { _serialNumber = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
        }

        private String _name;
        public String Name
        {
            get { return _name; }
            set { _name = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
        }

        private bool _generateDispensers;
        public bool GenerateDispensers
        {
            get { return _generateDispensers; }
            set { _generateDispensers = value; RaisePropertyChangedAuto(); }
        }

        private double _dispenserFactor;
        public double DispenserFactor
        {
            get { return _dispenserFactor; }
            set { _dispenserFactor = value; RaisePropertyChangedAuto(); }
        }

        public MachineCreationDialogVM() : base()
        {
            DispenserFactor = 2.34;
        }

        protected override bool CanOK()
        {
            return base.CanOK() && !String.IsNullOrWhiteSpace(SerialNumber) && !String.IsNullOrWhiteSpace(Name);
        }
    }
}
ass="k">null) throw new ArgumentNullException("textRunProperties"); backgroundBrush = textRunProperties.BackgroundBrush; baselineAlignment = textRunProperties.BaselineAlignment; cultureInfo = textRunProperties.CultureInfo; fontHintingEmSize = textRunProperties.FontHintingEmSize; fontRenderingEmSize = textRunProperties.FontRenderingEmSize; foregroundBrush = textRunProperties.ForegroundBrush; typeface = textRunProperties.Typeface; textDecorations = textRunProperties.TextDecorations; if (textDecorations != null && !textDecorations.IsFrozen) { textDecorations = textDecorations.Clone(); } textEffects = textRunProperties.TextEffects; if (textEffects != null && !textEffects.IsFrozen) { textEffects = textEffects.Clone(); } typographyProperties = textRunProperties.TypographyProperties; numberSubstitution = textRunProperties.NumberSubstitution; } /// <summary> /// Creates a copy of this instance. /// </summary> public virtual VisualLineElementTextRunProperties Clone() { return new VisualLineElementTextRunProperties(this); } object ICloneable.Clone() { return Clone(); } /// <inheritdoc/> public override Brush BackgroundBrush { get { return backgroundBrush; } } /// <summary> /// Sets the <see cref="BackgroundBrush"/>. /// </summary> public void SetBackgroundBrush(Brush value) { ExtensionMethods.CheckIsFrozen(value); backgroundBrush = value; } /// <inheritdoc/> public override BaselineAlignment BaselineAlignment { get { return baselineAlignment; } } /// <summary> /// Sets the <see cref="BaselineAlignment"/>. /// </summary> public void SetBaselineAlignment(BaselineAlignment value) { baselineAlignment = value; } /// <inheritdoc/> public override CultureInfo CultureInfo { get { return cultureInfo; } } /// <summary> /// Sets the <see cref="CultureInfo"/>. /// </summary> public void SetCultureInfo(CultureInfo value) { if (value == null) throw new ArgumentNullException("value"); cultureInfo = value; } /// <inheritdoc/> public override double FontHintingEmSize { get { return fontHintingEmSize; } } /// <summary> /// Sets the <see cref="FontHintingEmSize"/>. /// </summary> public void SetFontHintingEmSize(double value) { fontHintingEmSize = value; } /// <inheritdoc/> public override double FontRenderingEmSize { get { return fontRenderingEmSize; } } /// <summary> /// Sets the <see cref="FontRenderingEmSize"/>. /// </summary> public void SetFontRenderingEmSize(double value) { fontRenderingEmSize = value; } /// <inheritdoc/> public override Brush ForegroundBrush { get { return foregroundBrush; } } /// <summary> /// Sets the <see cref="ForegroundBrush"/>. /// </summary> public void SetForegroundBrush(Brush value) { ExtensionMethods.CheckIsFrozen(value); foregroundBrush = value; } /// <inheritdoc/> public override Typeface Typeface { get { return typeface; } } /// <summary> /// Sets the <see cref="Typeface"/>. /// </summary> public void SetTypeface(Typeface value) { if (value == null) throw new ArgumentNullException("value"); typeface = value; } /// <summary> /// Gets the text decorations. The value may be null, a frozen <see cref="TextDecorationCollection"/> /// or an unfrozen <see cref="TextDecorationCollection"/>. /// If the value is an unfrozen <see cref="TextDecorationCollection"/>, you may assume that the /// collection instance is only used for this <see cref="TextRunProperties"/> instance and it is safe /// to add <see cref="TextDecoration"/>s. /// </summary> public override TextDecorationCollection TextDecorations { get { return textDecorations; } } /// <summary> /// Sets the <see cref="TextDecorations"/>. /// </summary> public void SetTextDecorations(TextDecorationCollection value) { ExtensionMethods.CheckIsFrozen(value); textDecorations = value; } /// <summary> /// Gets the text effects. The value may be null, a frozen <see cref="TextEffectCollection"/> /// or an unfrozen <see cref="TextEffectCollection"/>. /// If the value is an unfrozen <see cref="TextEffectCollection"/>, you may assume that the /// collection instance is only used for this <see cref="TextRunProperties"/> instance and it is safe /// to add <see cref="TextEffect"/>s. /// </summary> public override TextEffectCollection TextEffects { get { return textEffects; } } /// <summary> /// Sets the <see cref="TextEffects"/>. /// </summary> public void SetTextEffects(TextEffectCollection value) { ExtensionMethods.CheckIsFrozen(value); textEffects = value; } /// <summary> /// Gets the typography properties for the text run. /// </summary> public override TextRunTypographyProperties TypographyProperties { get { return typographyProperties; } } /// <summary> /// Sets the <see cref="TypographyProperties"/>. /// </summary> public void SetTypographyProperties(TextRunTypographyProperties value) { typographyProperties = value; } /// <summary> /// Gets the number substitution settings for the text run. /// </summary> public override NumberSubstitution NumberSubstitution { get { return numberSubstitution; } } /// <summary> /// Sets the <see cref="NumberSubstitution"/>. /// </summary> public void SetNumberSubstitution(NumberSubstitution value) { numberSubstitution = value; } } }