3using System.Reflection;
4using System.Threading.Tasks;
14 [AttributeUsage(AttributeTargets.Class, AllowMultiple =
true, Inherited =
true)]
17 private static readonly SortedDictionary<string, bool> scopesAvailable =
new SortedDictionary<string, bool>();
63 Type T = Resource.GetType();
67 PropertyInfo PI = T.GetProperty(Scope, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
70 FieldInfo FI = T.GetField(Scope, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
74 MethodInfo MI = T.GetMethod(Scope, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static,
null,
new Type[0],
null);
88 else if (Obj is
string DynamicScope)
89 ScopesList.Add(DynamicScope);
91 Log.
Warning(
"Dynamic scopes returned an object that was not of expected type: " + T.FullName, Resource.ResourceName);
94 return ScopesList.ToArray();
106 string[] Scopes = await this.
GetScopes(Resource);
108 lock (scopesAvailable)
110 foreach (
string Scope
in Scopes)
111 scopesAvailable[Scope] =
true;
122 lock (scopesAvailable)
124 int c = scopesAvailable.Count;
125 string[] Result =
new string[c];
127 scopesAvailable.Keys.CopyTo(Result, 0);
140 Dictionary<string, object> MetaData)
142 string[] Scopes = await this.
GetScopes(Resource);
144 if (MetaData.TryGetValue(
"scopes_supported", out
object Obj) &&
145 Obj is
string[] Scopes2)
147 MetaData[
"scopes_supported"] = Scopes2.Join(Scopes);
150 MetaData[
"scopes_supported"] = Scopes;
Static class managing the application event log. Applications and services log events on this static ...
static void Warning(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs a warning event.
Base class for all HTTP resources.
A chunked list is a linked list of chunks of objects of type T .
Base class for all nodes in a parsed script tree.
static async Task< object > WaitPossibleTask(object Result)
Waits for any asynchronous process to terminate.