Ejemplo n.º 1
0
        public Bitmap Create(IUser User, Greet Greet)
        {
            Bitmap image = new Bitmap(Background.Width, Background.Height);

            using (Graphics g = Graphics.FromImage(image))
            {
                g.CompositingQuality = CompositingQuality.HighQuality;
                g.InterpolationMode  = InterpolationMode.HighQualityBicubic;
                g.PixelOffsetMode    = PixelOffsetMode.HighQuality;
                g.SmoothingMode      = SmoothingMode.HighQuality;
                g.TextRenderingHint  = TextRenderingHint.AntiAliasGridFit;

                g.DrawImage(Background, new PointF(0, 0));
                g.DrawImage(Frame, new PointF(0, 0));

                HttpClient client = new HttpClient();
                Stream     s      = client.GetStreamAsync(User.GetAvatarUrl(ImageFormat.Png, size: GetSize(AvatarSize.Width))).Result;

                Rectangle avatarRectangle = new Rectangle(AvatarPosition, AvatarSize);

                using (GraphicsPath path = new GraphicsPath())
                {
                    path.AddEllipse(avatarRectangle);
                    g.SetClip(path);
                    g.DrawImage(System.Drawing.Image.FromStream(s), 0, 0);
                    g.ResetClip();
                }
                g.DrawString(Text.Replace("{NAME}", User.Username), new Font(FontFamily, FontSize), new SolidBrush(TextColor), TextPosition);
            }
            return(image);
        }
Ejemplo n.º 2
0
 public void DoGreet(string message)
 {
     Greet?.Invoke(this, new GreeterEventArgs()
     {
         Message = message
     });
 }
Ejemplo n.º 3
0
        public void TestAdd()
        {
            Greet newGreeting0 = new Greet("Adim", "Zigunus", CustomerType.Potential, "Not sure why you havent joined us yet, what are you waiting for?");

            _greetingRepo.AddToList(newGreeting0);
            Greet newGreeting1 = new Greet("Tom", "Barker", CustomerType.Current, "Thank you for being a customer! Next Month We Will Send You A Coupon!");

            _greetingRepo.AddToList(newGreeting1);
            Greet newGreeting2 = new Greet("James", "Arkin", CustomerType.Past, "For being a past customer, we will offer you lower rates!");

            _greetingRepo.AddToList(newGreeting2);
            Greet newGreeting3 = new Greet("Zachary", "Arkin", CustomerType.Potential, "We have the LOWEST rates on helicopter insurance! Give us a ring!");

            _greetingRepo.AddToList(newGreeting3);
            Greet newGreeting4 = new Greet("Donnovan", "Domino", CustomerType.Current, "Thank you for being a customer! Next Month We Will Send You A Coupon!");

            _greetingRepo.AddToList(newGreeting4);
            Greet newGreeting5 = new Greet("Zdim", "Aigunus", CustomerType.Potential, "Cmonnnnnn you're over paying for insurance. Don't wait! Join Us!");

            _greetingRepo.AddToList(newGreeting5);

            _greetingRepo.ViewList();

            Console.WriteLine($" {_greetingRepo.ViewList()} ");

            var expected = 6;
            var actual   = _greetingRepo.GetListCount();

            Console.WriteLine($"{expected} {actual}");

            Assert.AreEqual(actual, expected);
        }
Ejemplo n.º 4
0
        public void SayHello()
        {
            var greet  = new Greet();
            var result = greet.SayHallo();

            result.ShouldBe("Hello");
        }
Ejemplo n.º 5
0
        public void GreetHelloWorldTest()
        {
            var greet  = new Greet();
            var actual = greet.Hello("world");

            Assert.Equal("Hello world!", actual);
        }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     using (var sim = new QuantumSimulator())
     {
         var result = Greet.Run(sim, "Quantum").Result;
         System.Console.WriteLine(result);
     }
 }
Ejemplo n.º 7
0
        public async Task AsyncEventTest()
        {
            Greet += (_, _) => Task.Run(() => Console.WriteLine("Alpha"));
            Greet += (_, _) => Task.Run(() => Console.WriteLine("Bravo"));
            Greet += (_, _) => Task.Run(() => Console.WriteLine("Charlie"));

            await Greet.InvokeAsync(this, EventArgs.Empty);
        }
Ejemplo n.º 8
0
        static void Main()
        {
            Greet gt = new Greet();

            Console.WriteLine("{0}", gt.Hello("Tom"));
            Console.WriteLine("{0}", gt.GoodBye());
            Console.ReadLine();
        }
Ejemplo n.º 9
0
 public ActionResult <IEnumerable <string> > Get(string greet)
 {
     if (Greet.greetPeople(greet) == "greet")
     {
         return(Ok("value"));
     }
     return(Ok(Greet.greetPeople(greet)));
 }
Ejemplo n.º 10
0
        public GreetResponse Any(Greet request)
        {
            this.TimesCalled++;

            this.Result = "Hello, " + request.Name;
            return(new GreetResponse {
                Result = this.Result
            });
        }
Ejemplo n.º 11
0
        public void TestRead()
        {
            Greet newGreeting0 = new Greet("Adim", "Zigunus", CustomerType.Potential, "Not sure why you havent joined us yet, what are you waiting for?");

            _greetingRepo.AddToList(newGreeting0);

            _greetingRepo.ViewList();

            Console.WriteLine($" {_greetingRepo.ViewList()} ");
        }
Ejemplo n.º 12
0
 public GreetingActor()
 {
     Receive <Greet>(greet =>
     {
         Debug.WriteLine("Hello " + greet.Who
                         + "\nSender: " + Sender.Path);
         var greetBack = new Greet("Hello " + greet.Who);
         Sender.Tell(greetBack, Self);
     });
 }
Ejemplo n.º 13
0
        public void GreetRepo_addInfotoList_ShouldAddAnItemToList()
        {
            Greet Info1 = new Greet("Billy", "Maze", "Potential", "*****@*****.**");

            _Greet.addInfotoList(Info1);

            var actual   = _Greet.Info.Count;
            var expected = 1;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 14
0
        public void GreetRepo_GetList_ShouldGetTheList()
        {
            Greet GetList = new Greet();

            _Greet.printList();

            var actual   = _Greet.printList().Count;
            var expected = 0;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 15
0
        public void TestDelete()
        {
            Greet newGreeting0 = new Greet("Adim", "Zigunus", CustomerType.Potential, "Not sure why you havent joined us yet, what are you waiting for?");

            _greetingRepo.AddToList(newGreeting0);
            Greet newGreeting1 = new Greet("Tom", "Barker", CustomerType.Current, "Thank you for being a customer! Next Month We Will Send You A Coupon!");

            _greetingRepo.AddToList(newGreeting1);

            _greetingRepo.DeleteCustomer(newGreeting0);
        }
Ejemplo n.º 16
0
 public GreetConsumer(Channel channel)
 {
     _channel = channel;
     _greet   = new Greet()
     {
         FirstName = "Palash", LastName = "Debnath"
     };
     _greetRequest = new GreetRequest()
     {
         Greet = _greet
     };
     _greetServiceClient = new GreetServiceClient(_channel);
 }
Ejemplo n.º 17
0
        public void GreetRepo_removeFromList_ShouldRemoveFromTheList()
        {
            Greet Info1 = new Greet("Billy", "Maze", "Potential", "911-911-0911");

            _Greet.addInfotoList(Info1);
            _Greet.removeFromList(Info1);
            List <Greet> something = _Greet.printList();

            var actual   = something.Count;
            var expected = 0;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 18
0
        static void Main()
        {
            Console.Write("Input t (seconds): ");
            int t = int.Parse(Console.ReadLine());
            Timer timer = new Timer();

            Greet greeting = new Greet(timer.PrintGreeting);

            while (true)
            {
                greeting("\'Hello\'");
                Thread.Sleep(t * 1000);
            }
        }
Ejemplo n.º 19
0
        static void Main()
        {
            Console.Write("Input t (seconds): ");
            int   t     = int.Parse(Console.ReadLine());
            Timer timer = new Timer();

            Greet greeting = new Greet(timer.PrintGreeting);

            while (true)
            {
                greeting("\'Hello\'");
                Thread.Sleep(t * 1000);
            }
        }
Ejemplo n.º 20
0
        public void TestMethod1()
        {
            //Greet greeting = new Greet();
            //greeting.TimeOfDay = "Noche";
            //greeting.To = "Eduardo";

            Greet greeting = GreetingBuilder
                             .CreateNew()
                             .TimeOfDay("Noche")
                             .To("Eduardo")
                             .Build();

            Assert.AreEqual("Buenas Noche Eduardo", greeting.Message);
        }
Ejemplo n.º 21
0
        private static void Main()
        {
            Console.WriteLine("Client");
            using (var system = ActorSystem.Create("GreetingSystem"))
            {
                var actor = system.ActorOf(Props.Create <GreetingActor>(), "Greeting");
                Console.WriteLine(actor);

                //send a message to the remote actor
                while (true)
                {
                    //get a reference to the remote actor
                    var greeter = system.ActorSelection("/user/Greeting");
                    Console.WriteLine("Who?");
                    var message = new Greet(Console.ReadLine());
                    greeter.Tell(message);
                }
            }
        }
Ejemplo n.º 22
0
        public void SeedLists()
        {
            Greet newGreeting0 = new Greet("Adim", "Zigunus", CustomerType.Potential, "Not sure why you havent joined us yet, what are you waiting for?");

            _greetingRepo.AddToList(newGreeting0);
            Greet newGreeting1 = new Greet("Tom", "Barker", CustomerType.Current, "Thank you for being a customer! Next Month We Will Send You A Coupon!");

            _greetingRepo.AddToList(newGreeting1);
            Greet newGreeting2 = new Greet("James", "Arkin", CustomerType.Past, "For being a past customer, we will offer you lower rates!");

            _greetingRepo.AddToList(newGreeting2);
            Greet newGreeting3 = new Greet("Zachary", "Arkin", CustomerType.Potential, "We have the LOWEST rates on helicopter insurance! Give us a ring!");

            _greetingRepo.AddToList(newGreeting3);
            Greet newGreeting4 = new Greet("Donnovan", "Domino", CustomerType.Current, "Thank you for being a customer! Next Month We Will Send You A Coupon!");

            _greetingRepo.AddToList(newGreeting4);
            Greet newGreeting5 = new Greet("Zdim", "Aigunus", CustomerType.Potential, "Cmonnnnnn you're over paying for insurance. Don't wait! Join Us!");
        }
Ejemplo n.º 23
0
        public void TestUpdate()
        {
            Greet newGreeting0 = new Greet("Adim", "Zigunus", CustomerType.Potential, "Not sure why you havent joined us yet, what are you waiting for?");

            _greetingRepo.AddToList(newGreeting0);
            Console.WriteLine("Orig:");
            Console.WriteLine($"{newGreeting0.FirstName} {newGreeting0.LastName} {newGreeting0.Type} {newGreeting0.Email}");

            _greetingRepo.UpdateFirstName("adim", "zigunus", "update1");


            _greetingRepo.UpdateLastName("update1", "zigunus", "update2");

            _greetingRepo.UpdateCustomerType("update1", "update2", CustomerType.Current);

            _greetingRepo.UpdateEmail("update1", "update2", "sup dawg this be a banana");

            Console.WriteLine("Changed to:");
            Console.WriteLine($"{newGreeting0.FirstName} {newGreeting0.LastName} {newGreeting0.Type} {newGreeting0.Email}");
        }
Ejemplo n.º 24
0
        static CommandService commands; // The commands object

        // Constructor
        public Maincontroller()
        {
            // Constructing the Client
            discord = new DiscordClient(x =>
            {
                x.LogLevel   = LogSeverity.Info;
                x.LogHandler = Log;
            });

            // Assigning the prefix
            discord.UsingCommands(x =>
            {
                x.PrefixChar         = '!';
                x.AllowMentionPrefix = true;
            });

            // Setting up audio
            discord.UsingAudio(x =>
            {
                x.Mode = AudioMode.Outgoing;    // Sending audio outgoing
            });

            // Getting the commands service from the discord object
            commands = discord.GetService <CommandService>();

            // Commands
            BotCommand image             = new Image();
            BotCommand quote             = new Quote();
            BotCommand purge             = new Purge();
            BotCommand greet             = new Greet();
            BotCommand speak             = new Speak();
            BotCommand paperScissorsRock = new PaperScissorsRock();

            // The connection - Requires a token to access the account
            discord.ExecuteAndWait(async() =>
            {
                await discord.Connect(System.Configuration.ConfigurationManager.AppSettings["reaperbot_api_key"],
                                      TokenType.Bot);
            });
        }
Ejemplo n.º 25
0
        public void AddNewCustomer()
        {
            string       firstName;
            string       lastName;
            CustomerType type;
            string       email;

            Console.Clear();
            Console.WriteLine($">Add a New Customer");
            firstName = GetFirstName();
            lastName  = GetLastName();
            type      = GetCustomerType();
            email     = GetEmail();
            Console.Clear();
            Console.WriteLine($">Add a New Customer" +
                              $"\nCustomer Added With These Details:" +
                              $"\n{firstName} {lastName}, {type} Customer - Message: {email}." +
                              $"\n\nPress Enter to Return to the Main Menu");
            Greet greeting = new Greet(firstName, lastName, type, email);

            _greetingRepo.AddToList(greeting);
            Console.ReadLine();
        }
Ejemplo n.º 26
0
	public Authentication(Greet GreetMethod)
	{
		this.GreetMethod = GreetMethod;
	}
Ejemplo n.º 27
0
        //public static Dictionary<string, Action> commandList { get; set; }
        public static Dictionary <string, Action> Commands(string commandOptions, string commandKey, PlayerSetup.Player playerData, Room.Room room)
        {
            var commandList = new Dictionary <String, Action>
            {
                { "north", () => Movement.Move(playerData, room, "North") },
                { "south", () => Movement.Move(playerData, room, "South") },
                { "east", () => Movement.Move(playerData, room, "East") },
                { "west", () => Movement.Move(playerData, room, "West") },
                { "down", () => Movement.Move(playerData, room, "Down") },
                { "up", () => Movement.Move(playerData, room, "Up") },
                { "look", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look") },
                { "l in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") },
                { "look in", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "look in") },
                { "examine", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "examine") },
                { "touch", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "touch") },
                { "smell", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "smell") },
                { "taste", () => LoadRoom.ReturnRoom(playerData, room, commandOptions, "taste") },
                { "score", () => Score.ReturnScore(playerData) },
                { "inventory", () => Inventory.ReturnInventory(playerData.Inventory, playerData) },
                { "equipment", () => Equipment.ShowEquipment(playerData) },
                { "garb", () => Equipment.ShowEquipment(playerData) },
                { "get", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") },
                { "take", () => ManipulateObject.GetItem(room, playerData, commandOptions, commandKey, "item") },
                { "drop", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) },
                { "give", () => ManipulateObject.GiveItem(room, playerData, commandOptions, commandKey, "killable") },
                { "put", () => ManipulateObject.DropItem(room, playerData, commandOptions, commandKey) },
                { "save", () => Save.UpdatePlayer(playerData) },
                { "'", () => Communicate.Say(commandOptions, playerData, room) },
                { "newbie", () => Communicate.NewbieChannel(commandOptions, playerData) },
                { "gossip", () => Communicate.GossipChannel(commandOptions, playerData) },
                { "ooc", () => Communicate.OocChannel(commandOptions, playerData) },
                { "say", () => Communicate.Say(commandOptions, playerData, room) },
                { "sayto", () => Communicate.SayTo(commandOptions, room, playerData) },
                { ">", () => Communicate.SayTo(commandOptions, room, playerData) },
                { "talkto", () => Talk.TalkTo(commandOptions, room, playerData) },
                { "emote", () => Emote.EmoteActionToRoom(commandOptions, playerData) },
                { "quit", () => HubContext.Quit(playerData.HubGuid, room) },
                { "wear", () => Equipment.WearItem(playerData, commandOptions) },
                { "remove", () => Equipment.RemoveItem(playerData, commandOptions) },
                { "doff", () => Equipment.RemoveItem(playerData, commandOptions) },
                { "wield", () => Equipment.WearItem(playerData, commandOptions, true) },
                { "unwield", () => Equipment.RemoveItem(playerData, commandOptions, false, true) },
                { "kill", () => Fight2.PerpareToFight(playerData, room, commandOptions) },
                { "flee", () => Flee.fleeCombat(playerData, room) },

                //spells
                { "c magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) },
                { "cast magic missile", () => MagicMissile.StartMagicMissile(playerData, room, commandOptions) },

                { "c armour", () => Armour.StartArmour(playerData, room, commandOptions) },
                { "cast armour", () => Armour.StartArmour(playerData, room, commandOptions) },

                { "c armor", () => Armour.StartArmour(playerData, room, commandOptions) },
                { "cast armor", () => Armour.StartArmour(playerData, room, commandOptions) },

                { "c continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) },
                { "cast continual light", () => ContinualLight.StarContinualLight(playerData, room, commandOptions) },

                { "c invis", () => Invis.StartInvis(playerData, room, commandOptions) },
                { "cast invis", () => Invis.StartInvis(playerData, room, commandOptions) },

                { "c weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) },
                { "cast weaken", () => Weaken.StartWeaken(playerData, room, commandOptions) },

                { "c chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) },
                { "cast chill touch", () => ChillTouch.StartChillTouch(playerData, room, commandOptions) },

                { "c fly", () => Fly.StartFly(playerData, room, commandOptions) },
                { "cast fly", () => Fly.StartFly(playerData, room, commandOptions) },

                { "c refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) },
                { "cast refresh", () => Refresh.StartRefresh(playerData, room, commandOptions) },

                { "c faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) },
                { "cast faerie fire", () => FaerieFire.StartFaerieFire(playerData, room, commandOptions) },

                { "c teleport", () => Teleport.StartTeleport(playerData, room) },
                { "cast teleport", () => Teleport.StartTeleport(playerData, room) },

                { "c blindness", () => Blindness.StartBlind(playerData, room, commandOptions) },
                { "cast blindess", () => Blindness.StartBlind(playerData, room, commandOptions) },

                { "c haste", () => Haste.StartHaste(playerData, room, commandOptions) },
                { "cast haste", () => Haste.StartHaste(playerData, room, commandOptions) },

                { "c create spring", () => CreateSpring.StartCreateSpring(playerData, room) },
                { "cast create spring", () => CreateSpring.StartCreateSpring(playerData, room) },

                //skills
                { "punch", () => Punch.StartPunch(playerData, room) },
                { "kick", () => Kick.StartKick(playerData, room) },

                //
                { "unlock", () => ManipulateObject.UnlockItem(room, playerData, commandOptions, commandKey) },
                { "lock", () => ManipulateObject.LockItem(room, playerData, commandOptions, commandKey) },
                { "open", () => ManipulateObject.Open(room, playerData, commandOptions, commandKey) },
                { "close", () => ManipulateObject.Close(room, playerData, commandOptions, commandKey) },
                { "drink", () => ManipulateObject.Drink(room, playerData, commandOptions, commandKey) },
                { "help", () => Help.ShowHelp(commandOptions, playerData) },
                { "time", Update.Time.ShowTime },
                { "clock", Update.Time.ShowTime },
                { "skills", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) },
                { "skills all", () => ShowSkills.ShowPlayerSkills(playerData, commandOptions) },
                { "practice", () => Trainer.Practice(playerData, room, commandOptions) },
                { "list", () => Shop.listItems(playerData, room) },
                { "buy", () => Shop.buyItems(playerData, room, commandOptions) },
                { "quest log", () => Quest.QuestLog(playerData) },
                { "qlog", () => Quest.QuestLog(playerData) },
                { "wake", () => Status.WakePlayer(playerData, room) },
                { "sleep", () => Status.SleepPlayer(playerData, room) },
                { "greet", () => Greet.GreetMob(playerData, room, commandOptions) },
                { "who", () => Who.Connected(playerData) },
                { "affects", () => Affect.Show(playerData) },
                { "follow", () => Follow.FollowThing(playerData, room, commandOptions) }
            };


            return(commandList);
        }
Ejemplo n.º 28
0
 public IActionResult Greet(Greet nameFromForm)
 {
     greet.Name = nameFromForm.Name;
     return(RedirectToAction("GreetUser"));
 }
Ejemplo n.º 29
0
 public HomeController(Greet greet)
 {
     this.greet = greet;
 }
Ejemplo n.º 30
0
 public GreetingBuilder()
 {
     _greeting = new Greet();
 }
Ejemplo n.º 31
0
 public Greeter(Greet typeOfGreets)
 {
     _typeOfGreet = typeOfGreets;
 }
Ejemplo n.º 32
0
        public void HelloTest()
        {
            var greet = new Greet();

            Assert.AreEqual("Hello World!", greet.Hello());
        }
 //1. Using Object
 public object Any(Greet request)
 {
     return(new GreetResponse {
         Result = "Hello " + request.Name
     });
 }