Ejemplo n.º 1
0
        protected override void ProcessValidation()
        {
            if (string.IsNullOrEmpty(this.MeshFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.MeshFile, ValidationValue.IsError,
                                                        string.Format(CultureInfo.CurrentCulture, AMLResources.Properties.Resources.IsRequired, AMLResources.Properties.Resources.MeshFile));
            }
            else if (!MeshFile.EndsWith(DataStrings.DXSExtension, StringComparison.OrdinalIgnoreCase))
            {
                base.ValidationCollection.AddValidation(DataStrings.MeshFile, ValidationValue.IsWarnState,
                                                        AMLResources.Properties.Resources.MeshFileExtensionValidation);
            }
            if (string.IsNullOrEmpty(this.DiffuseFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.DiffuseFile, ValidationValue.IsError,
                                                        string.Format(CultureInfo.CurrentCulture, AMLResources.Properties.Resources.IsRequired, AMLResources.Properties.Resources.DiffuseFile));
            }
            else if (!FileHelper.IsImageFile(DiffuseFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.DiffuseFile, ValidationValue.IsError,
                                                        AMLResources.Properties.Resources.NotAnImageFile);
            }



            if (string.IsNullOrEmpty(this.GlowFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.GlowFile, ValidationValue.IsError,
                                                        string.Format(CultureInfo.CurrentCulture, AMLResources.Properties.Resources.IsRequired, AMLResources.Properties.Resources.GlowFile));
            }
            else if (!FileHelper.IsImageFile(GlowFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.GlowFile, ValidationValue.IsError,
                                                        AMLResources.Properties.Resources.NotAnImageFile);
            }


            if (string.IsNullOrEmpty(this.SpecularFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.SpecularFile, ValidationValue.IsError,
                                                        string.Format(CultureInfo.CurrentCulture, AMLResources.Properties.Resources.IsRequired, AMLResources.Properties.Resources.SpecularFile));
            }
            else if (!FileHelper.IsImageFile(SpecularFile))
            {
                base.ValidationCollection.AddValidation(DataStrings.SpecularFile, ValidationValue.IsError,
                                                        AMLResources.Properties.Resources.NotAnImageFile);
            }

            if (Scale <= 0)
            {
                base.ValidationCollection.AddValidation(DataStrings.Scale, ValidationValue.IsError,
                                                        AMLResources.Properties.Resources.ScaleValidation);
            }
            if (PushRadius <= 0)
            {
                base.ValidationCollection.AddValidation(DataStrings.PushRadius, ValidationValue.IsWarnState,
                                                        AMLResources.Properties.Resources.PushRadiusValidation);
            }
        }