protected static void ValidateAttributeName(string attribute, DetailsTemplateControl.AttributeControlTypes controlType, string controlName)
 {
     if (string.IsNullOrEmpty(attribute))
     {
         throw new ArgumentNullException(DirectoryStrings.AttributeNameNull);
     }
 }
Пример #2
0
        internal ICollection <string> GetControlMAPIAttributes(string templateType, DetailsTemplateControl.AttributeControlTypes controlType)
        {
            Dictionary <DetailsTemplateControl.AttributeControlTypes, ICollection <string> > dictionary;
            ICollection <string> result;

            if (this.winformDictionaries.TryGetValue(templateType, out dictionary) && dictionary.TryGetValue(controlType, out result))
            {
                return(result);
            }
            return(null);
        }
Пример #3
0
 internal AttributeInfo(int mapiID, DetailsTemplateControl.AttributeControlTypes controlType)
 {
     this.mapiID        = mapiID;
     this.templateTypes = new Dictionary <string, bool>();
     this.controlType   = controlType;
 }
Пример #4
0
        private void RetrieveMapiAttributes(ITopologyConfigurationSession configSession, Dictionary <string, string> ldapDisplayNameMapping)
        {
            PropertyDefinition mapiID = ADSchemaAttributeSchema.MapiID;

            foreach (ADSchemaAttributeObject adschemaAttributeObject in configSession.Find <ADSchemaAttributeObject>(configSession.SchemaNamingContext, QueryScope.SubTree, new ExistsFilter(mapiID), null, int.MaxValue))
            {
                int    num             = (int)adschemaAttributeObject[mapiID];
                string name            = adschemaAttributeObject.Name;
                string ldapDisplayName = adschemaAttributeObject.LdapDisplayName;
                this.idToAttributeName[num] = name;
                if (!this.attributeNameToInfo.ContainsKey(name))
                {
                    AttributeSyntax omsyntax = adschemaAttributeObject.OMSyntax;
                    DetailsTemplateControl.AttributeControlTypes attributeControlTypes = DetailsTemplateControl.AttributeControlTypes.None;
                    AttributeSyntax attributeSyntax = omsyntax;
                    if (attributeSyntax <= AttributeSyntax.Printable)
                    {
                        switch (attributeSyntax)
                        {
                        case AttributeSyntax.Boolean:
                            attributeControlTypes = DetailsTemplateControl.AttributeControlTypes.Checkbox;
                            break;

                        case AttributeSyntax.Integer:
                            goto IL_D0;

                        default:
                            switch (attributeSyntax)
                            {
                            case AttributeSyntax.Numeric:
                            case AttributeSyntax.Printable:
                                goto IL_D0;
                            }
                            break;
                        }
                    }
                    else
                    {
                        if (attributeSyntax == AttributeSyntax.GeneralizedTime || attributeSyntax == AttributeSyntax.Unicode)
                        {
                            goto IL_D0;
                        }
                        if (attributeSyntax == AttributeSyntax.AccessPoint)
                        {
                            attributeControlTypes = DetailsTemplateControl.AttributeControlTypes.Listbox;
                            if (!adschemaAttributeObject.IsSingleValued)
                            {
                                attributeControlTypes |= DetailsTemplateControl.AttributeControlTypes.MultiValued;
                            }
                        }
                    }
IL_E1:
                    this.attributeNameToInfo.Add(name, new AttributeInfo(num, attributeControlTypes));
                    goto IL_F7;
IL_D0:
                    attributeControlTypes = DetailsTemplateControl.AttributeControlTypes.Edit;
                    if (!adschemaAttributeObject.IsSingleValued)
                    {
                        attributeControlTypes |= DetailsTemplateControl.AttributeControlTypes.MultiValued;
                        goto IL_E1;
                    }
                    goto IL_E1;
                }
IL_F7:
                ldapDisplayNameMapping[ldapDisplayName] = name;
            }
            int    num2 = 12289;
            string text = "Display-Name";
            string key  = "displayName";

            this.idToAttributeName.Add(num2, text);
            this.attributeNameToInfo.Add(text, new AttributeInfo(num2, DetailsTemplateControl.AttributeControlTypes.Edit));
            ldapDisplayNameMapping[key] = text;
            string key2 = "lDAPDisplayName";

            if (ldapDisplayNameMapping.ContainsKey(key2))
            {
                ldapDisplayNameMapping.Remove(key2);
            }
        }