Ejemplo n.º 1
0
        protected virtual void ProcessUserPropertiesInstance(IUccProvisioningPolicyInstance userProperties)
        {
            IUccProperty property = userProperties.Properties.get_NamedProperty(@"lines");

            if (property != null)
            {
                IUccCollection phoneLines = property.Value as IUccCollection;

                if (phoneLines.Count > 0)
                {
                    PhoneLine[] phones = new PhoneLine[phoneLines.Count];

                    for (int i = 0; i < phones.Length; i++)
                    {
                        IUccPresencePhoneLine line = phoneLines[i + 1] as IUccPresencePhoneLine;

                        phones[i] = new PhoneLine();

                        try { phones[i].LineServer = line.LineServer; }
                        catch (COMException) { }

                        try { phones[i].Uri = line.Uri; }
                        catch (COMException) { }

                        try { phones[i].UccLineType = line.LineType; }
                        catch (COMException) { }
                    }

                    this.Phones = phones;
                }
            }

            this.Fax      = GetNamedProperty(userProperties, @"facsimileTelephoneNumber");
            this.Homepage = GetNamedProperty(userProperties, @"wWWHomePage");

            string streetAddr  = GetNamedProperty(userProperties, @"streetAddress");
            string city        = GetNamedProperty(userProperties, @"l");
            string state       = GetNamedProperty(userProperties, @"st");
            string zip         = GetNamedProperty(userProperties, @"postalCode");
            string countryCode = GetNamedProperty(userProperties, @"countryCode");

            string addr = @"";

            if (string.IsNullOrEmpty(streetAddr) == false)
            {
                addr += streetAddr + "\r\n";
            }
            if (string.IsNullOrEmpty(state) == false)
            {
                addr += state + "\r\n";
            }
            if (string.IsNullOrEmpty(city) == false)
            {
                addr += city + "\r\n";
            }
            addr += zip + @" " + countryCode;

            this.Address = addr;
        }
Ejemplo n.º 2
0
 private string GetNamedProperty(IUccProvisioningPolicyInstance properties, string name)
 {
     if (properties.Properties.IsNamedPropertySet(name))
     {
         IUccProperty property = properties.Properties.get_NamedProperty(name);
         if (property != null)
         {
             return(property.StringValue);
         }
     }
     return(null);
 }