예제 #1
0
파일: person_snd.cs 프로젝트: tito97sp/ecal
    static void Main()
    {
        // initialize eCAL API
        Util.Initialize("Person Send C#");

        // print version info
        System.Console.WriteLine(String.Format("eCAL {0} ({1})\n", Util.GetVersion(), Util.GetDate()));

        // create a publisher (topic name "Hello", type "base:std::string", description "")
        var publisher = new ProtobufPublisher <People.Person>("person");

        // idle main thread
        int loop   = 0;
        var person = new People.Person
        {
            Id    = 0,
            Email = "*****@*****.**",
            Name  = "Max",
            Stype = People.Person.Types.SType.Female,
            Dog   = new Animal.Dog {
                Name = "Brandy"
            },
            House = new Environment.House {
                Rooms = 4
            }
        };

        while (Util.Ok())
        {
            // message to send
            person.Id = loop;
            loop++;

            // print message
            System.Console.WriteLine(String.Format("Sending:  {0}", person.ToString()));

            // send the content
            publisher.Send(person);

            // cool down
            System.Threading.Thread.Sleep(500);
        }

        // finalize eCAL API
        Util.Terminate();
    }
예제 #2
0
        public void Build()
        {
            //create test data here...
            var neo = new People.Person("Neo");
            var pp  = new People.Person("PP");

            _context.People.Add(neo);
            _context.People.Add(pp);
            _context.SaveChanges();

            _context.Tasks.AddRange(
                new Task("Follow the white rabbit", "Follow the white rabbit in order to know the reality.", neo.Id),
                new Task("Clean your room")
            {
                State = TaskState.Completed
            }
                );
        }