Example #1
0
        /// <summary>
        /// Creates a docked window.
        /// </summary>
        /// <param name="window">The form window that is to be docked.</param>
        /// <param name="title">The window title.</param>
        /// <param name="alignment">Window alignment, or floating.</param>
        /// <param name="id">An identifier for this docked window.
        /// The ID must be greater than zero.</param>
        /// <returns>An IDockWindow interface that can be used to hide or show the window.</returns>
        /// <remarks>
        /// <para>
        ///	This window will not be restored the next time Notepad++ starts.
        ///	The plugin must recreate the window during the 'Ready' event, if it wishes to have the window visible again.
        /// </para>
        /// <para>
        ///	Notepad++ will use the ID to remember the state for this docked window between sessions.
        ///	If another docked window with the same ID had been opened previously with a different alignment,
        ///	or the user had dragged the window to another side of the screen, then the docked window
        ///	will appear in the previous location rather than the one specified here.
        /// </para>
        /// </remarks>
        public IDockWindow DockWindow(IWin32Window window, string title, DockWindowAlignment alignment, int id)
        {
            // Notepad++ doesn't seem to support icons for docked windows, so it's excluded here.

            if (window == null)
            {
                throw new ArgumentException(Res.err_InvalidWindowObj);
            }
            if (id <= 0)
            {
                throw new ArgumentException(Res.err_InvalidDockWindowId);
            }

            return(Plugin.NppIntf.CreateDockWindow(window, title, alignment, null, id));
        }
Example #2
0
        /// <summary>
        /// Creates a docked window.
        /// </summary>
        /// <param name="window">The form window that is to be docked.</param>
        /// <param name="title">The window title.</param>
        /// <param name="alignment">Window alignment, or floating.</param>
        /// <param name="id">An identifier for this docked window.
        /// The ID must be greater than zero.</param>
        /// <returns>An IDockWindow interface that can be used to hide or show the window.</returns>
        /// <remarks>
        /// <para>
        ///	This window will not be restored the next time Notepad++ starts.
        ///	The plugin must recreate the window during the 'Ready' event, if it wishes to have the window visible again.
        /// </para>
        /// <para>
        ///	Notepad++ will use the ID to remember the state for this docked window between sessions.
        ///	If another docked window with the same ID had been opened previously with a different alignment,
        ///	or the user had dragged the window to another side of the screen, then the docked window
        ///	will appear in the previous location rather than the one specified here.
        /// </para>
        /// </remarks>
        public IDockWindow DockWindow(IWin32Window window, string title, DockWindowAlignment alignment, int id)
        {
            // Notepad++ doesn't seem to support icons for docked windows, so it's excluded here.

            if (window == null) throw new ArgumentException(Res.err_InvalidWindowObj);
            if (id <= 0) throw new ArgumentException(Res.err_InvalidDockWindowId);

            return Plugin.NppIntf.CreateDockWindow(window, title, alignment, null, id);
        }