示例#1
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.DataObject.Action == PolicyTipMessageConfigAction.Url && !NewPolicyTipConfig.IsAbsoluteUri(base.DynamicParametersInstance.Value))
     {
         base.WriteError(new NewPolicyTipConfigInvalidUrlException(), ErrorCategory.InvalidArgument, null);
     }
     TaskLogger.LogExit();
 }
示例#2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     if (base.Name == null)
     {
         base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
     }
     string[] array = base.Name.Split(new char[]
     {
         '\\'
     });
     if (array[0] == PolicyTipMessageConfigAction.Url.ToString())
     {
         if (array.Take(2).Count <string>() > 1)
         {
             base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
         }
         if (!NewPolicyTipConfig.IsAbsoluteUri(this.Value))
         {
             base.WriteError(new NewPolicyTipConfigInvalidUrlException(), ErrorCategory.InvalidArgument, null);
         }
         this.locale = null;
         this.action = PolicyTipMessageConfigAction.Url;
     }
     else
     {
         if (array.Take(2).Count <string>() != 2)
         {
             base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
         }
         try
         {
             this.locale = new CultureInfo(array[0]);
         }
         catch (CultureNotFoundException)
         {
             base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
         }
         if (!LanguagePackInfo.expectedCultureLcids.Contains(this.locale.LCID))
         {
             base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
         }
         if (!Enum.TryParse <PolicyTipMessageConfigAction>(array[1], true, out this.action) || this.action == PolicyTipMessageConfigAction.Url)
         {
             base.WriteError(new NewPolicyTipConfigInvalidNameException(NewPolicyTipConfig.supportedLocalesString.Value, NewPolicyTipConfig.supportedActionsString.Value), ErrorCategory.InvalidArgument, null);
         }
     }
     base.InternalValidate();
     TaskLogger.LogExit();
 }