/// <summary> /// Initializes a new instance of the <see cref="ActorId"/> class. /// </summary> internal ActorId(Type type, ulong value, string name, ActorExecutionContext context, bool useNameForHashing = false) { this.Runtime = context; this.Type = type.FullName; this.Value = value; if (useNameForHashing) { this.NameValue = name; this.Runtime.Assert(!string.IsNullOrEmpty(this.NameValue), "The actor name cannot be null when used as id."); this.Name = this.NameValue; } else { this.NameValue = string.Empty; this.Runtime.Assert(this.Value != ulong.MaxValue, "Detected actor id overflow."); this.Name = string.Format(CultureInfo.InvariantCulture, "{0}({1})", string.IsNullOrEmpty(name) ? this.Type : name, this.Value.ToString()); } }
/// <summary> /// Bind the actor id. /// </summary> internal void Bind(ActorExecutionContext context) { this.Runtime = context; }
/// <summary> /// Bind the actor id. /// </summary> internal void Bind(ActorExecutionContext context) { this.Context = context; }