예제 #1
0
 public void AddAction(ModuleAction action)
 {
     if (action.IsFolder)
     {
         actionList.Add(Tuple.Create(action.ActionGuid.ToString().ToLower(), string.Empty, string.Empty), action);
     }
     else
     {
         actionList.Add(Tuple.Create(action.Area.ToLower(), action.Controller.ToLower(), action.Action.ToLower()), action);
     }
     action.ListIndex = actionList.Count - 1;
 }
예제 #2
0
        public void AddSystemAction(string actionGuid, SystemActionType actionType, string actionTitle, string controller, string action)
        {
            ValidateDuplication(Guid.Parse(actionGuid));

            string callingAssemblyName = Assembly.GetCallingAssembly().FullName;
            var module = Environment.LoadedModules.SingleOrDefault(
                m => m.AssemblyName == callingAssemblyName);

            var systemAction = new ModuleAction()
            {
                ActionGuid = Guid.Parse(actionGuid),
                ActionType = actionType,
                ActionTitle = actionTitle,
                Area = module == null ? string.Empty : FindConfigInModule(module).GetAreaName(),
                Controller = controller,
                Action = action,
                IsMenuItem = false,
                SystemModule = module
            };

            Environment.LoadedModuleActions.AddAction(systemAction);
        }