Exemplo n.º 1
0
        /// <summary>
        /// Performs the initial setup of the ToolPanelExtensionManager.  This method
        /// must be called once before the Instance property can be used.
        /// </summary>
        /// <param name="_parentToolPanel">The view model for the toolpanel being managed</param>
        /// <param name="_scope">The scope of the data that the tool panel items will have
        /// access too</param>
        public static void InitialSetup(ToolPanelViewModel _parentToolPanel, string _scope)
        {
            // Validate parameters
            if (_parentToolPanel == null)
            {
                throw new System.ArgumentNullException("_parentToolPanel", "An invalid ToolPanelViewModel was provided");
            }

            if (string.IsNullOrEmpty(_scope))
            {
                throw new System.ArgumentNullException("_scope", "An invalid scope was provided");
            }

            lock (syncRoot)
            {
                // Ensure that this can only be called once
                if (instance == null)
                {
                    instance = new ToolPanelExtensionManager(_parentToolPanel, _scope);
                    ExtensionManager.ComposeParts(instance);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Performs the initial setup of the ToolPanelExtensionManager.  This method
        /// must be called once before the Instance property can be used.
        /// </summary>
        /// <param name="_parentToolPanel">The view model for the toolpanel being managed</param>
        /// <param name="_scope">The scope of the data that the tool panel items will have
        /// access too</param>
        public static void InitialSetup(ToolPanelViewModel _parentToolPanel, string _scope)
        {
            // Validate parameters
            if (_parentToolPanel == null)
                throw new System.ArgumentNullException("_parentToolPanel","An invalid ToolPanelViewModel was provided");

            if (string.IsNullOrEmpty(_scope))
                throw new System.ArgumentNullException("_scope", "An invalid scope was provided");

            lock (syncRoot)
            {
                // Ensure that this can only be called once
                if (instance == null)
                {
                    instance = new ToolPanelExtensionManager(_parentToolPanel, _scope);
                    ExtensionManager.ComposeParts(instance);
                }
            }
        }