private static IApplication GetApplicationByID(string id) { ApplicationCollection apps = PermissionMechanismFactory.GetMechanism().GetAllApplications(); IApplication app = apps.Find(a => string.Compare(a.ID, id, true) == 0); ExceptionHelper.FalseThrow(app != null, Translator.Translate(Define.DefaultCulture, "不能在授权系统中找到ID为'{0}'的应用", id)); return(app); }
public static bool Exists(this ApplicationCollection applications, string alias) { return(applications.Find(alias) != null); }