Create() public method

Creates a new desktop. If a handle is open, it will be closed.
public Create ( string name ) : bool
name string The name of the new desktop. Must be unique, and is case sensitive.
return bool
示例#1
0
        /// <summary>
        ///     Creates a new desktop.
        /// </summary>
        /// <param name="name">The name of the desktop to create.  Names are case sensitive.</param>
        /// <returns>If successful, a Desktop object, otherwise, null.</returns>
        public static Desktop CreateDesktop(string name)
        {
            // open the desktop.
            var desktop = new Desktop();
            var result  = desktop.Create(name);

            // somethng went wrong.
            if (!result)
            {
                return(null);
            }

            return(desktop);
        }
示例#2
0
        /// <summary>
        ///     Creates a new desktop.
        /// </summary>
        /// <param name="name">The name of the desktop to create.  Names are case sensitive.</param>
        /// <returns>If successful, a Desktop object, otherwise, null.</returns>
        public static Desktop CreateDesktop(string name)
        {
            // open the desktop.
            var desktop = new Desktop();
            var result = desktop.Create(name);

            // somethng went wrong.
            if (!result) return null;

            return desktop;
        }