Skip to content

Instantly share code, notes, and snippets.

Angelo Luis Rodrigues Da Silva angelobelchior

Block or report user

Report or block angelobelchior

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View welcome-message-bot-framework.cs
private async Task ShowWelcomeMessage(Activity activity)
{
if (activity is IConversationUpdateActivity conversationUpdated)
{
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
foreach (var member in conversationUpdated.MembersAdded ?? Array.Empty<ChannelAccount>())
{
if (member.Id == conversationUpdated.Recipient.Id)
{
var reply = Actions.WelcomeMessage(activity);
View BotActivityLogger.cs
public sealed class BotActivityLogger : Microsoft.Bot.Builder.History.IActivityLogger
{
public async Task LogAsync(IActivity activity)
{
var message = activity.AsMessageActivity();
var text = message.Text;
}
}
[BotAuthentication]
View gist:04d6a6b9162dd521b50cd58f5deba980
git remote add upstream https://github.com/andrebaltieri/FluentValidator.git
git fetch upstream
git checkout master
git rebase upstream/master
View ChangeCanExecute.cs
//Esse código é apenas para demonstração da funcionalidade do ChangeCanExecute
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void Notify(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
View ViewModel.Custom.Cells.cs
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
namespace MyListViewCellApp
{
public class ViewModel
{
public ObservableCollection<Item> Items {
get;
View Custom.Cells.xaml
<?xml version="1.0" encoding="UTF-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyListViewCellApp.MainView">
<TabbedPage.Children>
<ContentPage Title="TextCell" Padding="0, 20, 0, 0">
<ContentPage.Content>
<StackLayout>
<ListView ItemsSource="{Binding Items}">
<ListView.ItemTemplate>
<DataTemplate>
View CodeBehind.TelaDeCadastro.cs
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace MeuDB
{
public partial class MyPage : ContentPage
{
public MyPage ()
View Cadastro.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MeuDB.MyPage">
<ContentPage.Content>
<StackLayout Padding="30" Spacing="30">
<Entry x:Name="Nome" Placeholder="Nome"></Entry>
<Entry x:Name="Email" Placeholder="Email" Keyboard="Email"></Entry>
<Entry x:Name="Telefone" Placeholder="Telefone" Keyboard="Telephone"></Entry>
<Button x:Name="Salvar" Text="Salvar" Clicked="SalvarClicked"></Button>
View IConfig.cs
using System;
using SQLite.Net.Interop;
namespace MeuDB
{
public interface IConfig
{
string DiretorioDB { get; }
ISQLitePlatform Plataforma { get; }
}
View Contato.cs
sing System;
using SQLite.Net.Attributes;
namespace MeuDB
{
public class Contato
{
[PrimaryKey, AutoIncrement]
public int Id {
get;
You can’t perform that action at this time.