Esempio n. 1
0
        private bool IsInformationValid()
        {
            if (this.PackageNameTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Package name missing", "Please specify a name for the new package.");
                return(false);
            }

            if (MOG_ControllerProject.DoesAssetExists(MOG_Filename.CreateAssetName(Classification, Platform, PackageName)))
            {
                MOG_Prompt.PromptResponse("Package name not unique", "This package already exists, please specify a unique package name and try again.");
                return(false);
            }

            if (this.ClassificationTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Classification missing", "Please select a classification for the new package.");
                return(false);
            }

            if (SyncTargetTextBox.Enabled &&
                SyncTargetTextBox.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Sync target missing", "Please select a sync target for the new package.");
                return(false);
            }

            // Check if this package is missing an extension?
            if (Path.GetExtension(PackageName).Length == 0)
            {
                // Check if we are also missing a defined DefaultPackageFileExtension?
                MOG_Properties tempProperties = new MOG_Properties(Classification);
                if (tempProperties.DefaultPackageFileExtension.Length == 0)
                {
                    if (MOG_Prompt.PromptResponse("Warning - Missing extension", "This package does not have an extension.  Most eninges require extensions on packages.\n\nDo you want to continue without and extenstion?", "", MOG.PROMPT.MOGPromptButtons.YesNo, MOG.PROMPT.MOG_ALERT_LEVEL.ALERT) == MOG.PROMPT.MOGPromptResult.No)
                    {
                        return(false);
                    }
                }
            }

            if (this.PlatformCombo.BackColor == Color.Tomato)
            {
                MOG_Prompt.PromptResponse("Invalid Platform", "Please select a valid platform for the new package.");
                return(false);
            }

            return(true);
        }