This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static Dictionary<Comunicacao, IComunicacao > _comunicadores = | |
new Dictionary<Comunicacao, IComunicacao>() | |
{ | |
{Comunicacao.EMAIL, new ComunicacaoPorEmail() }, | |
{Comunicacao.SMS, new ComunicacaoPorSMS() }, | |
{Comunicacao.SinalDeFumaca, new ComunicacaoPorSinalDeFumaca() } | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person | |
{ | |
public Guid Id { get; private set; } | |
public string FullName { get; private set; } | |
public DateTime BirthDate { get; private set; } | |
public string Email { get; private set; } | |
public string PhoneNumber { get; private set; } | |
public string Tribe { get; private set; } | |
public PreferredCommunication PreferredCommunication { get; private set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonService | |
{ | |
private IComunicacao _comunicacao; | |
private IList<Pessoa> _dados; | |
public PersonService(IComunicacao comunicacao) | |
{ | |
_comunicacao = comunicacao; | |
_dados = GerarDados(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ComunicacaoPorEmail : IComunicacao | |
{ | |
/* | |
* Implementar todas as especificadades do Email | |
*/ | |
public bool EnviarComunicacao(Pessoa pessoa, Mensagem mensagem) | |
{ | |
string emailPara = pessoa.Email; | |
string titulo = mensagem.Titulo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IComunicacao | |
{ | |
bool EnviarComunicacao(Pessoa pessoa, Mensagem mensagem); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | |
* Minor edits 2019 - Diego Doná | |
* For licensing, see LICENSE.md. | |
*/ | |
export default function Base64UploaderPlugin( editor ) { | |
editor.plugins.get( 'FileRepository' ).createUploadAdapter = ( loader ) => { | |
// Configure the URL to the upload script in your back-end here! | |
return new UploadAdapter(loader, editor.t); |