Example #1
0
 public GroupView(Contact contact)
     : base(contact)
 {
     if (contact.ContactType != ContactTypes.Group)
     {
         throw new ArgumentException("Contact is not a group.", "contact");
     }
     _manager = contact.Manager;
 }
Example #2
0
            public _MeManager(ContactManager manager)
            {
                Assert.IsNotNull(manager);
                Assert.IsTrue(Directory.Exists(manager.RootDirectory));

                // If this is the same as the user's contacts folder then we can share the Me contact.
                // Otherwise use a different registry value.
                //
                // This has weird implications if the Contacts folder is redirected while the manager
                // is up and running.  The behavior there is intentional, as that's very much an edge case.
                _meRegValue = manager.RootDirectory.Equals(ContactUtil.GetContactsFolder(), StringComparison.OrdinalIgnoreCase)
                    ? ""
                    : manager.RootDirectory;

                _manager = manager;
            }
Example #3
0
 public ContactLoader(ContactManager manager)
 {
     _manager = manager;
     _fileCache = new Dictionary<string, _CacheEntry>();
     _purgeableKeys = new List<string>();
     _timer = new DispatcherTimer(TimeSpan.FromMilliseconds(_CachePolicy.TimerInterval), DispatcherPriority.Normal, _OnTimer, _manager.Dispatcher);
     _timer.Start();
 }
		public WindowsContactsProvider(IGUICallbacks host, SyncEngine syncEngine)
		{
			owner = host;
			manager = new ContactManager();
			this.syncEngine = syncEngine;
		}
        /// <summary>Internal only constructor for Contact.</summary>
        /// <param name="manager"></param>
        /// <param name="properties"></param>
        /// <param name="fileName"></param>
        internal Contact(ContactManager manager, IContactProperties properties, string fileName)
        {
            Assert.IsNotNull(properties);
            Verify.IsNeitherNullNorEmpty(fileName, "fileName");

            // Caller should have ensured this is canonicalized...
            Assert.AreEqual(fileName, IOPath.GetFullPath(fileName));

            _manager = manager;
            _contactProperties = properties;
            _sharedProperties = true;
            _sourceHash = _contactProperties.StreamHash;
            _type = GetTypeFromExtension(fileName);
            Path = fileName;
            Id = ContactId.GetRuntimeId(ContactIds.Default.Value, Path);
            _originalName = Names.Default.FormattedName;
        }
        /// <summary>
        /// Internal only constructor for ContactManager.
        /// </summary>
        /// <param name="manager">The associated ContactManager instance.</param>
        /// <param name="type">The type of the contact to create.</param>
        /// <remarks>
        /// This allows the contacts returned by IContactCollection to be managed by this class.
        /// The manager is associated with the contact, which allows for Save to be called without
        /// the contact being initially backed by a path.
        /// </remarks>
        internal Contact(ContactManager manager, ContactTypes type)
        {
            Verify.IsApartmentState(ApartmentState.STA, _exceptionStringBadThreadId);
            if (!_IsValidSingleContactType(type, false))
            {
                throw new ArgumentException("The provided type must be of a legal single value (also not ContactTypes.None).", "type");
            }

            _manager = manager;

            _contactProperties = new WriteableContactPropertiesAlias();
            // The IContactProperties is disposable by this object.
            //_sharedProperties = false;

            // New contact, no file name associated with the Id.
            Id = ContactId.GetRuntimeId(ContactIds.Default.Value, null);
            // _path = null;

            _originalName = string.Empty;
            _type = type;

            // New contact, so no worries of conflicting changes on save.
            // _sourceHash = null;
        }