public void Initialize(Configuration configuration)
        {
            foreach (MigrationSource ms in configuration.SessionGroup.MigrationSources.MigrationSource)
            {
                try
                {
                    // teyang_todo : consider to use only one tfscore per tfs instance
                    TfsCore core            = new TfsCore(ms.ServerUrl);
                    Guid    migrSrcUniqueId = new Guid(ms.InternalUniqueId);
                    if (!m_perMigrationSourceTfsCores.ContainsKey(migrSrcUniqueId))
                    {
                        m_perMigrationSourceTfsCores.Add(migrSrcUniqueId, core);
                    }
                }
                catch (Exception)
                {
                    TraceManager.TraceInformation("Active Directory lookup will be used for this end point.");

                    // use the default constructor to create a core that only queries AD
                    TfsCore core            = new TfsCore();
                    Guid    migrSrcUniqueId = new Guid(ms.InternalUniqueId);
                    if (!m_perMigrationSourceTfsCores.ContainsKey(migrSrcUniqueId))
                    {
                        m_perMigrationSourceTfsCores.Add(migrSrcUniqueId, core);
                    }
                }
            }
        }
        public bool TryLookup(RichIdentity richIdentity, IdentityLookupContext context)
        {
            TfsCore core = null;

            lock (m_perMigrationSourceTfsCoresLock)
            {
                if (!m_perMigrationSourceTfsCores.ContainsKey(context.SourceMigrationSourceId))
                {
                    return(false);
                }

                core = m_perMigrationSourceTfsCores[context.SourceMigrationSourceId];
            }

            return(core.TryLookup(richIdentity, context));
        }
        public bool TryLookup(RichIdentity richIdentity, string serverUrl)
        {
            TfsCore core = new TfsCore(serverUrl);

            return(core.TryLookup(richIdentity, null));
        }