示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ActionSuiteProvider"/> class.
 /// </summary>
 public ActionSuiteProvider()
 {
     actionDescriptorSuite = null;
     actionListSuite       = null;
     actionReferenceSuite  = null;
     disposed = false;
 }
示例#2
0
        /// <summary>
        /// Creates the action descriptor suite.
        /// </summary>
        /// <param name="aete">The AETE scripting information.</param>
        /// <param name="descriptorHandle">The descriptor handle.</param>
        /// <param name="scriptingData">The scripting data.</param>
        /// <param name="zstringSuite">The ASZString suite instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="zstringSuite"/> is null.</exception>
        /// <exception cref="ObjectDisposedException">The class has been disposed.</exception>
        public void CreateDescriptorSuite(PluginAETE aete, IntPtr descriptorHandle, Dictionary <uint, AETEValue> scriptingData, IASZStringSuite zstringSuite)
        {
            if (zstringSuite == null)
            {
                throw new ArgumentNullException(nameof(zstringSuite));
            }
            if (disposed)
            {
                throw new ObjectDisposedException(nameof(ActionSuiteProvider));
            }

            if (!DescriptorSuiteCreated)
            {
                if (!ReferenceSuiteCreated)
                {
                    CreateReferenceSuite();
                }
                if (!ListSuiteCreated)
                {
                    CreateListSuite(zstringSuite);
                }
                actionDescriptorSuite = new ActionDescriptorSuite(aete, actionListSuite, actionReferenceSuite, zstringSuite);
                actionListSuite.ActionDescriptorSuite = actionDescriptorSuite;
                if (scriptingData != null)
                {
                    actionDescriptorSuite.SetScriptingData(descriptorHandle, scriptingData);
                }
            }
        }
示例#3
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            if (!disposed)
            {
                disposed = true;

                if (actionDescriptorSuite != null)
                {
                    actionDescriptorSuite.Dispose();
                    actionDescriptorSuite = null;
                }
            }
        }