Пример #1
0
        public IActor ResolveArgumentActor(IActor resolvedActor, string[] parameters, IHandlerContext handlerContext)
        {
            if (parameters.Length != 1)
            {
                throw new SystemException("argument actor expects exactly one (the actor-id) parameter instead of " + parameters.Length);
            }

            IActor actor = null;

            try
            {
                string shortName = parameters[0];
                actor = organizationApplication.FindActorByUniqueName(shortName);
            }
            catch (SystemException e)
            {
                throw new SystemException("can't resolve actor-argument with parameter " + parameters[0], e);
            }

            return(actor);
        }
Пример #2
0
        public object Deserialize(string text)
        {
            if (text == null)
            {
                return(null);
            }

            IActor actor = null;
            IOrganizationApplication organizationApplication = ServiceLocator.Current.GetInstance <IOrganizationApplication>();

            try
            {
                actor = organizationApplication.FindActorByUniqueName(text);
            }
            catch (Exception t)
            {
                throw new ArgumentException("couldn't deserialize " + text + " to a User : "******" : " + t.Message);
            }

            return(actor);
        }