Skip to content

Instantly share code, notes, and snippets.

@jvanhoesen
Created June 2, 2021 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvanhoesen/4699b942a87b34ec5e821b124360a866 to your computer and use it in GitHub Desktop.
Save jvanhoesen/4699b942a87b34ec5e821b124360a866 to your computer and use it in GitHub Desktop.
Retrieves slot of type PXCacheExtensionCollection
public static PXCacheExtension[] GetExtensions(TNode row)
{
object pxCacheExtensionCollection = AAReflectionHelper.InvokeMethod(PXCacheExtensionCollectionType, null, "GetSlot", PXCacheExtensionCollectionType, new Type[0], new object[] { true });
object syncRoot = ((ICollection)pxCacheExtensionCollection).SyncRoot;
PXCacheExtension[] extensions;
IDictionary<IBqlTable, PXCacheExtension[]> dict = pxCacheExtensionCollection as IDictionary<IBqlTable, PXCacheExtension[]>;
lock (syncRoot)
{
if (!dict.TryGetValue(row, out extensions) || extensions == null)
{
extensions = (dict[row] = StaticInfo._CreateExtensions != null ? StaticInfo._CreateExtensions(row) : new PXCacheExtension[0]);
}
}
return extensions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment