示例#1
0
        public static void PushConstants(Type constantsType = null)
        {
            if (constantsType == null)
            {
                constantsType = typeof(PluginConstants);
            }

            if (Constants != null)
            {
                PluginConstantsStack.Push(Constants);
            }

            Constants = (IPluginConstants)Activator.CreateInstance(constantsType);

            Debug.Assert(Constants != null);
        }
示例#2
0
 public static void PopConstants()
 {
     Constants = PluginConstantsStack.Count > 0 ? PluginConstantsStack.Pop() : null;
 }