Exemplo n.º 1
0
        public override object Clone()
        {
            var clone = new PowerSource();

            clone.CopyFrom(this);
            return(clone);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises a <see cref="Robot.PowerSource"/> change event.
 /// </summary>
 /// <param name="id">The <see cref="Robot"/> identifier.</param>
 /// <param name="powerSource">The Power Source (see <see cref="RefDataNamespace.PowerSource"/>).</param>
 public Task RaisePowerSourceChangeAsync(Guid id, RefDataNamespace.PowerSource powerSource)
 {
     return(ManagerInvoker.Default.InvokeAsync(this, async() =>
     {
         ExecutionContext.Current.OperationType = OperationType.Unspecified;
         await RaisePowerSourceChangeOnImplementationAsync(id, powerSource).ConfigureAwait(false);
     }));
 }
Exemplo n.º 3
0
        private async Task RaisePowerSourceChangeOnImplementationAsync(Guid id, RefDataNamespace.PowerSource powerSource)
        {
            var e = new EventData <string>
            {
                Subject = $"Demo.Robot.{id}",
                Action  = "PowerSourceChange",
                Value   = powerSource,
                Key     = id
            };

            await _eventPublisher.Publish(e).SendAsync().ConfigureAwait(false);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Raises a <see cref="Robot.PowerSource"/> change event.
 /// </summary>
 /// <param name="id">The <see cref="Robot"/> identifier.</param>
 /// <param name="powerSource">The Power Source (see <see cref="RefDataNamespace.PowerSource"/>).</param>
 /// <param name="requestOptions">The optional <see cref="WebApiRequestOptions"/>.</param>
 /// <returns>A <see cref="WebApiAgentResult"/>.</returns>
 public Task <WebApiAgentResult> RaisePowerSourceChangeAsync(Guid id, RefDataNamespace.PowerSource powerSource, WebApiRequestOptions requestOptions = null)
 {
     return(RobotServiceAgent.RaisePowerSourceChangeAsync(id, powerSource, requestOptions));
 }
Exemplo n.º 5
0
        public void CopyFrom(PowerSource from)
        {
            CopyFrom((ReferenceDataBaseGuid)from);

            OnAfterCopyFrom(from);
        }
Exemplo n.º 6
0
 partial void OnAfterCopyFrom(PowerSource from);
Exemplo n.º 7
0
 /// <summary>
 /// Raises a <see cref="Robot.PowerSource"/> change event.
 /// </summary>
 /// <param name="id">The <see cref="Robot"/> identifier.</param>
 /// <param name="powerSource">The Power Source (see <see cref="RefDataNamespace.PowerSource"/>).</param>
 /// <param name="requestOptions">The optional <see cref="WebApiRequestOptions"/>.</param>
 /// <returns>A <see cref="WebApiAgentResult"/>.</returns>
 public Task <WebApiAgentResult> RaisePowerSourceChangeAsync(Guid id, RefDataNamespace.PowerSource powerSource, WebApiRequestOptions requestOptions = null)
 {
     return(base.PostAsync("api/v1/robots/{id}/powerSource/{powerSource}", requestOptions: requestOptions,
                           args: new WebApiArg[] { new WebApiArg <Guid>("id", id), new WebApiArg <RefDataNamespace.PowerSource>("powerSource", powerSource) }));
 }