예제 #1
0
 public void updateFromPromptReturn(LmiDataSourcePromptModel promptModel)
 {
     Host          = promptModel.Host;
     Query         = promptModel.Query;
     UserName      = promptModel.UserName;
     UserPass      = promptModel.UserPass;
     QueryId       = promptModel.QueryId;
     IsCorrelation = promptModel.IsCorrelation;
     From          = promptModel.From;
     To            = promptModel.To;
 }
예제 #2
0
        /// <summary>Handle prompting for this data source. This method is written using the
        /// yield return construct to be able to handle asynchronous prompting. After the first yeild
        /// return one can assume that the prompting has been successfully performed.
        /// </summary>
        /// <returns>The prompt models.</returns>
        private IEnumerable <object> Prompt()
        {
            LmiDataSourcePromptModel promptModel = createPromptModel();

            // Return the prompt model to the prompting framework.
            yield return(promptModel);

            // When we get to this point we know that the prompting has been performed, so we assign
            // the properties to the model.
            updateFromPromptReturn(promptModel);
        }
예제 #3
0
        /// <summary>Handle prompting for this data source. This method is written using the
        /// yield return construct to be able to handle asynchronous prompting. After the first yeild
        /// return one can assume that the prompting has been successfully performed.
        /// </summary>
        /// <returns>The prompt models.</returns>
        private IEnumerable <object> Prompt(CredentialsService credentialsService)
        {
            LmiDataSourcePromptModel promptModel = createPromptModel();

            // Return the prompt model to the prompting framework.
            yield return(promptModel);

            String[] credentials = { promptModel.Host, promptModel.UserName, promptModel.UserPass };
            credentialsService.SetCredentials <String[]>("LMI::DEFAULT", credentials);
            // When we get to this point we know that the prompting has been performed, so we assign
            // the properties to the model.
            updateFromPromptReturn(promptModel);
        }
예제 #4
0
        protected override IEnumerable <object> ExecuteAndPromptCore(AnalysisApplication context)
        {
            LMIDataSource.LmiDataSource lMIDataSource = new LmiDataSource();

            LmiDataSourcePromptModel promptModel = lMIDataSource.createPromptModel();

            yield return(promptModel);

            lMIDataSource.updateFromPromptReturn(promptModel);

            if (context.Document == null)
            {
                context.Open(lMIDataSource);
            }
            else
            {
                context.Document.Data.Tables.Add("dataTableName", lMIDataSource);
            }
        }