Esempio n. 1
0
    internal IActor CreateChildActor(Type actorType, IActor parent)
    {
        var actor = (Actor)Activator.CreateInstance(actorType);

        actor.Parent = parent;
        actor.System = this;
        Mailboxes.Add(actor, actor.Mailbox);
        return(actor);
    }
Esempio n. 2
0
        /// <summary>
        /// Adds a new mailbox to the user.
        /// The firstly added Mailbox will be the default one.
        /// </summary>
        /// <param name="properties">MailBoxProperties struct with the necessary data to initialize a new mailbox</param>
        public Mailbox AddMailbox(MailBoxProperties properties)
        {
            var newMailbox = new Mailbox(properties);

            Mailboxes.Add(newMailbox);
            if (Mailboxes.Count == 1)
            {
                CurrentMailbox = newMailbox;
            }
            return(newMailbox);
        }