Exemple #1
0
 public DataSourcePromptCollection GetPromptRepresentatives(ServerDataSourceSettings serverDatasourceSettings)
 {
     if (m_collectionByPrompt == null)
     {
         return(new DataSourcePromptCollection());
     }
     return(m_collectionByPrompt.GetPromptRepresentatives(serverDatasourceSettings));
 }
        internal DataSourcePromptCollection GetPromptRepresentatives(ServerDataSourceSettings serverDatasourceSettings)
        {
            DataSourcePromptCollection dataSourcePromptCollection = new DataSourcePromptCollection();

            for (int i = 0; i < Count; i++)
            {
                dataSourcePromptCollection.Add(this[i].GetRepresentative(), serverDatasourceSettings);
            }
            return(dataSourcePromptCollection);
        }
        internal void Add(DataSourceInfo dataSource, ServerDataSourceSettings serverDatasourceSettings)
        {
            string originalName = dataSource.OriginalName;

            Global.Tracer.Assert(m_collection[originalName] == null, "Collection already contains this data source.");
            dataSource.ThrowIfNotUsable(serverDatasourceSettings);
            m_collection.Add(originalName, dataSource);
            if (dataSource.NeedPrompt)
            {
                m_needPrompt = true;
            }
        }
 public void AddSingleIfPrompt(DataSourceInfo dataSource, ServerDataSourceSettings serverDatasourceSettings)
 {
     Global.Tracer.Assert(dataSource.OriginalName == null, "Data source has non-null name when adding single");
     if (m_collection.Count != 0)
     {
         throw new InternalCatalogException("Prompt collection is not empty when adding single data source");
     }
     if (dataSource.CredentialsRetrieval == DataSourceInfo.CredentialsRetrievalOption.Prompt)
     {
         dataSource.ThrowIfNotUsable(serverDatasourceSettings);
         m_collection.Add("", dataSource);
         if (dataSource.NeedPrompt)
         {
             m_needPrompt = true;
         }
     }
 }
Exemple #5
0
 public void ThrowIfNotUsable(ServerDataSourceSettings serverDatasourceSetting)
 {
     if (!Enabled)
     {
         throw new DataSourceDisabledException();
     }
     if (!ReferenceIsValid)
     {
         throw new InvalidDataSourceReferenceException(OriginalName);
     }
     if (!GoodForLiveExecution(serverDatasourceSetting.IsSurrogatePresent))
     {
         throw new InvalidDataSourceCredentialSettingException();
     }
     if (m_credentialsRetrieval == CredentialsRetrievalOption.Integrated && !serverDatasourceSetting.AllowIntegratedSecurity)
     {
         throw new WindowsIntegratedSecurityDisabledException();
     }
 }