aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml
blob: 2501b37d153b9a260f3993a61771a3dd216d32b1 (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
@{ 
    Tango.CodeGeneration.EntityInheritedDTOCodeFile model = Model as Tango.CodeGeneration.EntityInheritedDTOCodeFile;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.BL.DTO
{
    @if (model.Description != null)
    {
        <div>
        /// <summary>
        /// @(model.Description)
        /// </summary>
        </div>
    }
    public class @(model.Name) : @(model.BaseClass)
    {

    }
}
ont-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Core.Commands;
using Tango.Core.DI;

namespace Tango.PPC.Common.Notifications
{
    /// <summary>
    /// Represents an app button that will be displayed in the layout view.
    /// </summary>
    /// <seealso cref="ExtendedObject" />
    public abstract class AppButton : ExtendedObject
    {
        /// <summary>
        /// Occurs when the button has been pressed.
        /// </summary>
        public event Action Pressed;

        private String _text;
        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        public String Text
        {
            get { return _text; }
            set { _text = value; RaisePropertyChangedAuto(); }
        }

        private bool _isEnabled;
        /// <summary>
        /// Gets or sets a value indicating whether this instance is enabled.
        /// </summary>
        public bool IsEnabled
        {
            get { return _isEnabled; }
            set { _isEnabled = value; RaisePropertyChangedAuto(); }
        }

        private RelayCommand _command;
        /// <summary>
        /// Gets or sets the command.
        /// </summary>
        public RelayCommand Command
        {
            get { return _command; }
            set { _command = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppButton"/> class.
        /// </summary>
        public AppButton()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppButton"/> class.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="isEnabled">if set to <c>true</c> [is enabled].</param>
        /// <param name="onExecute">The on execute.</param>
        /// <param name="canExecute">The can execute.</param>
        public AppButton(String text, bool isEnabled) : this()
        {
            Text = text;
            IsEnabled = isEnabled;
            Command = new RelayCommand(() =>
            {
                Pressed?.Invoke();
            });
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AppButton"/> class.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="command">The command.</param>
        public AppButton(String text, RelayCommand command) : this(text, true)
        {
            Command = command;
        }

        /// <summary>
        /// Invalidates the button state.
        /// </summary>
        public void RaiseCanExecute()
        {
            Command.RaiseCanExecuteChanged();
        }

        /// <summary>
        /// Pops this instance.
        /// </summary>
        public void Pop()
        {
            TangoIOC.Default.GetInstance<INotificationProvider>().PopAppButton(this);
        }

        /// <summary>
        /// Pushes this instance.
        /// </summary>
        public void Push()
        {
            TangoIOC.Default.GetInstance<INotificationProvider>().PushAppButton(this);
        }
    }
}