示例#1
0
        //================================================================== Action framework

        public ActionBase CreateAction(Content context, string backUrl, object parameters)
        {
            try
            {
                return(ActionFactory.CreateAction(GetActionTypeName(), this, context, backUrl, parameters));
            }
            catch (InvalidOperationException)
            {
                //not enough permissions to access actiontype name, return null
            }

            return(null);
        }
示例#2
0
        public static ActionBase GetAction(string name, Content context, string backUri, object parameters)
        {
            if (context == null)
            {
                return(null);
            }

            bool existingApplication;
            var  app = ApplicationStorage.Instance.GetApplication(name, context, out existingApplication, GetDevice());

            //if app is null, than create action in memory only if this is _not_ an existing application
            //(existing app can be null because of denied access or cleared/disabled status)
            //(we create Service and ClientAction types in memory this way - they do not exist in the tree)
            var action = app != null?
                         CreateActionWithPermissions(app, context, backUri, parameters) :
                             (existingApplication ? null : ActionFactory.CreateAction(name, context, backUri, parameters));

            return(action);
        }