/// <summary>
    /// Adds the lead entity to data source.
    /// </summary>
    private void AddLeadEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
    {
        var lead = resultItem.Data as ILead;

        if (lead != null)
        {
            dataTable.Rows.Add(lead.Id.ToString(), "Lead", resultItem.Score, type, lead.Company, lead.FirstName,
                               lead.LastName, lead.Title, lead.Email, lead.Address.LeadCtyStZip, lead.WorkPhone);
        }
    }
    /// <summary>
    /// Adds the account entity to data source.
    /// </summary>
    /// <param name="accountTable">The account table.</param>
    private void AddAccountEntityToDataSource(DataTable accountTable, MatchResultItem resultItem)
    {
        var account = resultItem.Data as IAccount;

        if (account != null)
        {
            accountTable.Rows.Add(account.Id.ToString(), account.AccountName, account.Industry, account.WebAddress,
                                  account.Address.CityStateZip, account.MainPhone, account.Type);
        }
    }
    /// <summary>
    /// Adds the contact entity to data source.
    /// </summary>
    /// <param name="dataTable">The data table.</param>
    private void AddContactEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
    {
        var contact = resultItem.Data as IContact;

        if (contact != null)
        {
            dataTable.Rows.Add(contact.Id.ToString(), "Contact", resultItem.Score, type, contact.Account.AccountName,
                               contact.FirstName, contact.LastName, contact.Title, contact.Email, contact.Address.CityStateZip,
                               contact.WorkPhone);
        }
    }
Exemple #4
0
        private void PerformGoToDefinition(MatchResultItem match, ITextBuffer textBuffer)
        {
            MonitoringService.MonitorCommandGoToStepDefinition(match.Type == MatchResultType.Undefined);
            switch (match.Type)
            {
            case MatchResultType.Undefined:
                PerformOfferCopySnippet(match, textBuffer);
                break;

            case MatchResultType.Defined:
            case MatchResultType.Ambiguous:
                PerformJump(match);
                break;
            }
        }
Exemple #5
0
        private void PerformOfferCopySnippet(MatchResultItem match, ITextBuffer textBuffer)
        {
            Debug.Assert(match.UndefinedStep != null);
            var snippetService = GetProjectScope(textBuffer).GetSnippetService();

            if (snippetService == null)
            {
                return;
            }

            const string indent  = "    ";
            string       newLine = Environment.NewLine;

            var snippet = snippetService.GetStepDefinitionSkeletonSnippet(match.UndefinedStep, indent, newLine);

            IdeScope.Actions.ShowQuestion(new QuestionDescription(PopupHeader, $"The step is undefined. Do you want to copy a step definition skeleton snippet to the clipboard?{Environment.NewLine}{Environment.NewLine}{snippet}", _ => PerformCopySnippet(snippet.Indent(indent + indent))));
        }
Exemple #6
0
        private void PerformJump(MatchResultItem match)
        {
            var sourceLocation = match.MatchedStepDefinition.Implementation.SourceLocation;

            if (sourceLocation == null)
            {
                Logger.LogWarning($"Cannot jump to {match}: no source location");
                IdeScope.Actions.ShowProblem("Unable to jump to the step definition. No source location detected.");
                return;
            }

            Logger.LogInfo($"Jumping to {match} at {sourceLocation}");
            if (!IdeScope.Actions.NavigateTo(sourceLocation))
            {
                Logger.LogWarning($"Cannot jump to {match}: invalid source file or position. Try to build the project to refresh positions.");
                IdeScope.Actions.ShowProblem($"Unable to jump to the step definition. Invalid source file or file position.{Environment.NewLine}{sourceLocation}");
            }
        }
Exemple #7
0
        private string GetIcon(MatchResultItem matchResult)
        {
            switch (matchResult.Type)
            {
            case MatchResultType.Defined:
                if (matchResult.HasErrors)
                {
                    return("StepDefinitionsDefinedInvalid");
                }
                return("StepDefinitionsDefined");

            case MatchResultType.Ambiguous:
                return("StepDefinitionsAmbiguous");

            case MatchResultType.Undefined:
                return("StepDefinitionsUndefined");
            }
            return(null);
        }
 /// <summary>
 /// Adds the lead entity to data source.
 /// </summary>
 private void AddLeadEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
 {
     try
     {
         string entityName = GetLocalResourceObject("lblLeads.Caption").ToString();
         ILead lead = resultItem.Data as ILead;
         dataTable.Rows.Add(lead.Id.ToString(), type, resultItem.Score, entityName, lead.Company, lead.FirstName,
             lead.LastName, lead.Title, lead.Email, lead.Address.LeadCtyStZip, lead.WorkPhone);
     }
     catch
     {
     }
 }
 /// <summary>
 /// Adds the contact entity to data source.
 /// </summary>
 /// <param name="dataTable">The data table.</param>
 private void AddContactEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
 {
     try
     {
         string entityName = GetLocalResourceObject("lblContacts.Caption").ToString();
         IContact contact = resultItem.Data as IContact;
         dataTable.Rows.Add(contact.Id.ToString(), type, resultItem.Score, entityName, contact.Account.AccountName,
             contact.FirstName, contact.LastName, contact.Title, contact.Email, contact.Address.CityStateZip,
             contact.WorkPhone);
     }
     catch
     {
     }
 }
 /// <summary>
 /// Adds the account entity to data source.
 /// </summary>
 /// <param name="accountTable">The account table.</param>
 private void AddAccountEntityToDataSource(DataTable accountTable, MatchResultItem resultItem)
 {
     try
     {
         IAccount account = resultItem.Data as IAccount;
         accountTable.Rows.Add(account.Id.ToString(), resultItem.Score, account.AccountName, account.Industry, account.WebAddress,
             account.Address.CityStateZip, account.MainPhone, account.Type);
     }
     catch
     {
     }
 }
 /// <summary>
 /// Adds the lead entity to data source.
 /// </summary>
 private void AddLeadEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
 {
     try
     {
         ILead lead = resultItem.Data as ILead;
         dataTable.Rows.Add(lead.Id.ToString(), "Lead", resultItem.Score, type, lead.Company, lead.FirstName,
             lead.LastName, lead.Title, lead.Email, lead.Address.LeadCtyStZip, lead.WorkPhone);
     }
     catch
     {
     }
 }
 /// <summary>
 /// Adds the contact entity to data source.
 /// </summary>
 /// <param name="dataTable">The data table.</param>
 private void AddContactEntityToDataSource(DataTable dataTable, MatchResultItem resultItem, string type)
 {
     try
     {
         IContact contact = resultItem.Data as IContact;
         dataTable.Rows.Add(contact.Id.ToString(), "Contact", resultItem.Score, type, contact.Account.AccountName,
             contact.FirstName, contact.LastName, contact.Title, contact.Email, contact.Address.CityStateZip,
             contact.WorkPhone);
     }
     catch
     {
     }
 }