예제 #1
0
        /// <summary>
        /// Factory method where to create ActivityManager instance,
        /// this method must be called only once
        /// </summary>
        /// <param name="entryPoint">Application Entry point FormScreen, this might be the main screen or a splash screen.</param>
        /// <returns></returns>
        public static ActivityManager CreateActivityManagerInstance(BaseFormScreen entryPoint)
        {
            if (Instance != null)
            {
                throw new InvalidOperationException("Already Active Activity Manager");
            }

            Instance = new ActivityManager();
            entryPoint.Show();
            return(Instance);
        }
예제 #2
0
        /// <summary>
        /// Internal method to remove a form from the Forms Stack.
        /// This method will also display the previous active form screen.
        /// </summary>
        /// <param name="form">Form to be removed from stack.</param>
        internal void RemoveFromStack(BaseFormScreen form)
        {
            this.FormStack.Remove(form);

            // If there are no more active forms, stop the Application.
            if (this.FormStack.Count == 0)
            {
                ExitThread();
                return;
            }

            // If there are active forms, display the previous using last tracked form location.
            var parentForm = this.FormStack.Last();

            parentForm.StartPosition = FormStartPosition.Manual;
            parentForm.Location      = this.LastFormLocation;
            parentForm.Show();
        }
예제 #3
0
 /// <summary>
 /// Internal method to add a newly loaded form into the Forms Stack.
 /// </summary>
 /// <param name="form">Newly loaded form.</param>
 internal void AddToStack(BaseFormScreen form)
 {
     this.FormStack.Add(form);
 }