public override Form CreateForm(FormPropertyBag bag)
 {
     UserPropertyAdvancedForm ret = new UserPropertyAdvancedForm(null == bag ? string.Empty : bag.UserName);
     if ((null == bag) || string.IsNullOrEmpty(bag.UserName) || !ret.loadUserData())
     {
         MessageBox.Show(Resources.ContosoServicesSubTab_ErrorDescription, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
         return null;
     }
     else
     {
         return ret;
     }
 }
        public override Form CreateForm(FormPropertyBag bag)
        {
            UserPropertyAdvancedForm ret = new UserPropertyAdvancedForm(null == bag ? string.Empty : bag.UserName);

            if ((null == bag) || string.IsNullOrEmpty(bag.UserName) || !ret.loadUserData())
            {
                MessageBox.Show(Resources.ContosoServicesSubTab_ErrorDescription, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                return(null);
            }
            else
            {
                return(ret);
            }
        }