Exemple #1
0
        internal static bool VerifyAndSetPossibleValues(ADObject directoryObj, ADClaimValueType valueType, StringBuilder errorBuffer)
        {
            bool flag = false;

            if (directoryObj.InternalProperties.Contains("SuggestedValues") && directoryObj.InternalProperties["SuggestedValues"].Value != null)
            {
                if (directoryObj.Contains("msDS-ClaimPossibleValues") && directoryObj["msDS-ClaimPossibleValues"].Value != null)
                {
                    bool flag1 = false;
                    try
                    {
                        ADCBACUtil.ConvertSuggestedValueXmlToSuggestedValueEntryList(directoryObj["msDS-ClaimPossibleValues"].Value as string, out flag1);
                        if (flag1)
                        {
                            flag = true;
                            object[] value = new object[2];
                            value[0] = directoryObj["name"].Value as string;
                            value[1] = "msDS-ClaimPossibleValues";
                            errorBuffer.AppendLine(string.Format(CultureInfo.CurrentCulture, StringResources.CannotOverwriteNextVersionXml, value));
                        }
                    }
                    catch (Exception exception1)
                    {
                        Exception exception = exception1;
                        if (exception as XmlException == null && exception as XmlSchemaException == null && exception as InvalidOperationException == null)
                        {
                            throw;
                        }
                    }
                }
                if (!flag)
                {
                    ADSuggestedValueEntry[] valueList = directoryObj.InternalProperties["SuggestedValues"].ValueList as ADSuggestedValueEntry[];
                    ADCBACUtil.AddSuggestedValueXmlFromADSuggestedValueEntryList(valueList, directoryObj, valueType);
                }
            }
            return(!flag);
        }