aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml.cs
blob: 8d2a442132ac2213e9a457bfb8b603e5afc0d386 (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
<
@{
    Tango.CodeGeneration.TangoWebClientv2CodeFile model = Model as Tango.CodeGeneration.TangoWebClientv2CodeFile;
}
using System;
using System.Threading.Tasks;
using Tango.Web;

namespace @(model.Namespace)
{
    /// <summary>
    /// Represents a machine service @(model.ControllerName) web client.
    /// </summary>
    /// <seealso cref="Tango.Web.TangoWebClient" />
    public abstract class @(model.Name) : TangoWebClientV2<@(model.LoginRequest), @(model.LoginResponse)>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="address">The service address.</param>
        /// <param name="token">Existing token.</param>
        public @(model.Name)(String address, String token) : base(address, "@(model.ControllerName)", token)
        {
            
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="address">The service address.</param>
        public @(model.Name)(String address) : this(address, null)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
        /// </summary>
        /// <param name="cloned">Other instance.</param>
        public @(model.Name)(@(model.Name) cloned) : base(cloned)
        {

        }

        @foreach (var action in model.Actions)
        {
          <div>
            /// <summary>
            /// Executes the @(action.Name) action and returns @(action.Response).
            /// </summary>
            /// <returns></returns>
            public Task<@(action.Response)> @(action.Name)(@(action.Request) request)
            {
                return Post<@(action.Request), @(action.Response)>("@(action.Name)", request);
            }

          </div>
        }
    }
}
ummary> /// <seealso cref="System.Windows.Controls.UserControl" /> /// <seealso cref="System.Windows.Markup.IComponentConnector" /> [ContentProperty(nameof(MainContent))] public partial class DbTableView : UserControl { /// <summary> /// Gets or sets the data table view. /// </summary> public FrameworkElement MainContent { get { return (FrameworkElement)GetValue(MainContentProperty); } set { SetValue(MainContentProperty, value); } } public static readonly DependencyProperty MainContentProperty = DependencyProperty.Register("MainContent", typeof(FrameworkElement), typeof(DbTableView), new PropertyMetadata(null)); /// <summary> /// Initializes a new instance of the <see cref="DbTableView"/> class. /// </summary> public DbTableView() { InitializeComponent(); } } }