GetOptionValue() public méthode

Get the value of an option
public GetOptionValue ( string optionName ) : string
optionName string
Résultat string
Exemple #1
0
    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="jobName">Name to associate with this work</param>
    /// <param name="onlineUrls"></param>
    /// <param name="userName"></param>
    /// <param name="password"></param>
    /// <param name="taskOptions"></param>
    /// <param name="manualActions"></param>
    public TaskMaster(
        string jobName,
        TableauServerUrls onlineUrls, 
        string userName, 
        string password,
        TaskMasterOptions taskOptions,
        CustomerManualActionManager manualActions = null)
    {
        this.JobName = jobName;

        _manualActions = manualActions;
        if(_manualActions == null)
        {
            _manualActions = new CustomerManualActionManager();
        }
        //Get any export path
        _exportToLocalPath = taskOptions.GetOptionValue(TaskMasterOptions.OptionParameter_PathDownloadTo);
        _onlineUrls = onlineUrls;
        _userName = userName;
        _password = password;

        //Store the status log at the class level where it is accessable
        _statusLog = new TaskStatusLogs();
        //Store the options
        _taskOptions = taskOptions;

        if(_taskOptions.IsOptionSet(TaskMasterOptions.Option_LogVerbose))
        {
            _statusLog.SetStatusLoggingLevel(int.MinValue);
        }
    }
Exemple #2
0
    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="jobName">Name to associate with this work</param>
    /// <param name="onlineUrls"></param>
    /// <param name="userName"></param>
    /// <param name="password"></param>
    /// <param name="taskOptions"></param>
    /// <param name="manualActions"></param>
    public TaskMaster(
        string jobName,
        TableauServerUrls onlineUrls,
        string userName,
        string password,
        TaskMasterOptions taskOptions,
        CustomerManualActionManager manualActions = null)
    {
        this.JobName = jobName;

        _manualActions = manualActions;
        if (_manualActions == null)
        {
            _manualActions = new CustomerManualActionManager();
        }
        //Get any export path
        _exportToLocalPath = taskOptions.GetOptionValue(TaskMasterOptions.OptionParameter_PathDownloadTo);
        _onlineUrls        = onlineUrls;
        _userName          = userName;
        _password          = password;

        //Store the status log at the class level where it is accessable
        _statusLog = new TaskStatusLogs();
        //Store the options
        _taskOptions = taskOptions;


        if (_taskOptions.IsOptionSet(TaskMasterOptions.Option_LogVerbose))
        {
            _statusLog.SetStatusLoggingLevel(int.MinValue);
        }
    }
Exemple #3
0
    /// <summary>
    /// If the user has specified a single project filter, then get it from the projects list
    /// </summary>
    /// <param name="projectsList"></param>
    /// <returns></returns>
    private SiteProject helper_DetermineIfSingleProjectFilter(IProjectsList projectsList)
    {
        string exportSingleProject_name = _taskOptions.GetOptionValue(TaskMasterOptions.OptionParameter_ExportSingleProject);

        //If there's no exclusive project name in the config, then the fitler is null
        if (string.IsNullOrWhiteSpace(exportSingleProject_name))
        {
            return(null);
        }

        var project = projectsList.FindProjectWithName(exportSingleProject_name);

        if (project == null)
        {
            throw new Exception("Site contains no project with name " + exportSingleProject_name);
        }
        return(project);
    }