aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/ExternalBridge/IExternalBridgeSecureClient.cs
blob: 7d35963d41b169587275a159e1331eb0904015c2 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PMR.Integration;

namespace Tango.Integration.ExternalBridge
{
    /// <summary>
    /// Represents a secure external bridge client which requires authentication.
    /// </summary>
    /// <seealso cref="Tango.Integration.ExternalBridge.IExternalBridgeClient" />
    public interface IExternalBridgeSecureClient : IExternalBridgeClient
    {
        /// <summary>
        /// Occurs when the remote host has closed the session.
        /// </summary>
        event EventHandler SessionClosed;

        /// <summary>
        /// Connects to a remote external bridge service using the specified login.
        /// </summary>
        /// <param name="login">The login.</param>
        /// <returns></returns>
        Task Connect(ExternalBridgeLoginRequest login);
    }
}
tializeEventFactory() { if (!_eventFactoryInitialized) { _eventFactoryInitialized = true; _eventTypesGuids = new Dictionary<EventTypes, EventType>(); foreach (var type in ObservablesEntitiesAdapter.Instance.EventTypes) { _eventTypesGuids.Add((EventTypes)type.Code, type); } } } public MachinesEvent(Event pmrEvent) : this() { InitializeEventFactory(); DateTime = DateTime.UtcNow; Description = pmrEvent.Message; EventType = _eventTypesGuids[(EventTypes)pmrEvent.Type]; } [NotMapped] public EventTypesCategories Category { get { return (EventTypesCategories)EventType.EventTypesCategory.Code; } } [NotMapped] public EventTypesGroups Group { get { return (EventTypesGroups)EventType.EventTypesGroup.Code; } } [NotMapped] public EventTypes Type { get { return (EventTypes)EventType.Code; } } [NotMapped] public List<ActionTypes> ActionTypes { get { return EventType.EventTypesActions.Select(x => (ActionTypes)x.ActionType.Code).Distinct().ToList(); } } } }