Exemple #1
0
        /// <summary>
        /// Method to be called when a new console form is needed to be
        /// deserialized from disk, and the functions to be called on
        /// completion and on cancellation are known.
        /// </summary>
        /// <param name="path">A string with the fully qualified path to the
        /// form definition file on disk.</param>
        /// <param name="formComplete">Delegate to a function to be
        /// called when the form is completed.</param>
        /// <param name="formCancelled">Delegate to a function to be called
        /// when the form is cancelled.  Can be null.</param>
        /// <returns>A new instance of a console form with properties set and
        /// appropriate events wired up.  Can be null.</returns>
        public static ConsoleForm GetFormInstance
            (string path,
            onFormComplete formComplete,
            onFormCancelled formCancelled)
        {
            // Call the other static factory method to get a new console form.
            ConsoleForm form = ConsoleForm.GetFormInstance(path);

            if (formComplete != null)
            {
                form.FormComplete += formComplete;
            }

            if (formCancelled != null)
            {
                form.FormCancelled += formCancelled;
            }

            return(form);
        }
        /// <summary>
        /// Method to be called when a new console form is needed to be 
        /// deserialized from disk, and the functions to be called on
        /// completion and on cancellation are known.
        /// </summary>
        /// <param name="path">A string with the fully qualified path to the 
        /// form definition file on disk.</param>
        /// <param name="formComplete">Delegate to a function to be
        /// called when the form is completed.</param>
        /// <param name="formCancelled">Delegate to a function to be called
        /// when the form is cancelled.  Can be null.</param>
        /// <returns>A new instance of a console form with properties set and
        /// appropriate events wired up.  Can be null.</returns>
        public static  ConsoleForm GetFormInstance
                                    (string            path, 
                                    onFormComplete    formComplete, 
                                    onFormCancelled   formCancelled) {
            // Call the other static factory method to get a new console form.
            ConsoleForm       form     = ConsoleForm.GetFormInstance(path);

            if (formComplete != null)
                form.FormComplete += formComplete;

            if (formCancelled != null)
                form.FormCancelled += formCancelled;

            return form;
        }