コード例 #1
0
ファイル: ModuleActionList.cs プロジェクト: Exclr8/CloudCore
 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
ファイル: ModuleRoot.cs プロジェクト: Exclr8/CloudCore
        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);
        }