Exemple #1
0
        static void Main(string[] args)
        {
            var stat = new Stats();

            stat.Start();

            Payroll payroll = new Payroll();

            payroll.payAll();



            var adding = true;

            while (adding)
            {
                try
                {
                    var student = new Student();

                    student.Name = Util.Console.Ask("Enter student name:");

                    student.Grade = Util.Console.AskInt("Enter student grade:");

                    student.School = (Schools)Util.Console.AskInt("Enter your school(type the coreesponding number:\n 0:) Hogwarts \n 1:)Harvard \n 2:)MIT ");
                    students.Add(student);
                    Posted?.Invoke();
                    //ShowGrade("haha");
                    Student.Count++;

                    Console.WriteLine("Student count: {0}", Student.Count);

                    Console.WriteLine("Add another student? y/n");

                    if (Console.ReadLine() != "y")
                    {
                        adding = false;
                    }
                }
                catch (FormatException msg)
                {
                    Console.WriteLine(msg.Message);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error adding student, try again");
                }
            }



            foreach (var item in students)
            {
                Console.WriteLine($"{item.Name} {item.Grade} {item.School}");
            }
        }
Exemple #2
0
 internal async void PersistentPost <T>(D7NodeMap <T> objToPost)
     where T : D7NodeBase, new()
 {
     await PersistentPolicy <T>("POST").ExecuteAsync(async() =>
     {
         var node = await Post(objToPost);
         Posted?.Invoke(this, new EArg <D7NodeBase> {
             Value = node
         });
     });
 }
Exemple #3
0
        /// <inheritdoc />
        /// <summary>
        ///     Posts the specified message.
        /// </summary>
        /// <param name="characterSpawn">The character spawn.</param>
        /// <param name="text">The text.</param>
        /// <param name="type">The type.</param>
        public void Post(ICharacterSpawn characterSpawn, string text, SpeechType type)
        {
            ChannelPostingEventArgs channelPostingEventArgs = new ChannelPostingEventArgs(characterSpawn, type, text);

            Posting?.Invoke(this, channelPostingEventArgs);
            if (channelPostingEventArgs.Cancel)
            {
                return;
            }

            SendMessage(characterSpawn, channelPostingEventArgs.Text, channelPostingEventArgs.Type);

            ChannelPostedEventArgs channelPostedEventArgs = new ChannelPostedEventArgs(characterSpawn, channelPostingEventArgs.Type, channelPostingEventArgs.Text);

            Posted?.Invoke(this, channelPostedEventArgs);
        }
Exemple #4
0
 public void Post(string name, string content)
 {
     m_logger.Info($"name: {name}, content: {content}");
     Posted?.Invoke(new ChatLog(name, content));
     PostCount++;
 }
Exemple #5
0
 protected void OnPosted(HttpWebRequest request, HttpWebResponse response)
 {
     Posted?.Invoke(this, new PostedEventArgs {
         Request = request, Response = response
     });
 }