예제 #1
0
 public DataSourcePromptCollection GetPromptRepresentatives(ServerDataSourceSettings serverDatasourceSettings)
 {
     if (this.m_collectionByPrompt == null)
     {
         return(new DataSourcePromptCollection());
     }
     return(this.m_collectionByPrompt.GetPromptRepresentatives(serverDatasourceSettings));
 }
예제 #2
0
        public DataSourcePromptCollection GetPromptRepresentatives(ServerDataSourceSettings serverDatasourceSettings)
        {
            DataSourcePromptCollection dataSourcePromptCollection = new DataSourcePromptCollection();

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

            Global.Tracer.Assert(this.m_collection[originalName] == null, "Collection already contains this data source.");
            dataSource.ThrowIfNotUsable(serverDatasourceSettings);
            this.m_collection.Add(originalName, dataSource);
            if (dataSource.NeedPrompt)
            {
                this.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 (this.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);
         this.m_collection.Add("", dataSource);
         if (dataSource.NeedPrompt)
         {
             this.m_needPrompt = true;
         }
     }
 }
예제 #5
0
 public void ThrowIfNotUsable(ServerDataSourceSettings serverDatasourceSetting)
 {
     if (!this.Enabled)
     {
         throw new DataSourceDisabledException();
     }
     if (!this.ReferenceIsValid)
     {
         throw new InvalidDataSourceReferenceException(this.OriginalName);
     }
     if (!this.GoodForLiveExecution(serverDatasourceSetting.IsSurrogatePresent))
     {
         throw new InvalidDataSourceCredentialSettingException();
     }
     if (this.m_credentialsRetrieval != CredentialsRetrievalOption.Integrated)
     {
         return;
     }
     if (serverDatasourceSetting.AllowIntegratedSecurity)
     {
         return;
     }
     throw new WindowsIntegratedSecurityDisabledException();
 }