This is a migrated thread and some comments may be shown as answers.

Help to translate from C# to VB

1 Answer 81 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Peer
Top achievements
Rank 1
Peer asked on 18 Aug 2015, 01:13 PM

Hi.

 I need help, to translate a working C# kode til vb. It's the code highlightet with yellow, that gives me some (all the) troubles:

        private void ReadAppointmentsFromDatabase()

        {

            uiRadSchedulerMain.Appointments.Clear();

            var appointments = new ELHedegaard.BLL.Appointment(); 

            foreach (var appointment in appointments.GetAppointmentsWithResources())

            {

                Appointment schedulerAppointment = new Appointment();

                schedulerAppointment.Summary = appointment.Summary;

                schedulerAppointment.Start = appointment.Start.Value;

                schedulerAppointment.End = appointment.End.Value;

                schedulerAppointment.Location = appointment.Location;

                schedulerAppointment.Description = appointment.Description;

                //schedulerAppointment.BackgroundId = 1;

                schedulerAppointment.StatusId = 2;

                schedulerAppointment.BackgroundId = appointment.ParentID.Value;

                foreach (var x in appointment.ResourceIds.Select(a => new EventId(a)))

                  

                {

                    schedulerAppointment.ResourceIds.Add(x);

                    System.Diagnostics.Debugger.Break();

                }

                uiRadSchedulerMain.Appointments.Add(schedulerAppointment);

               //System.Diagnostics.Debugger.Break();

          }

          }

Kindly Peer​

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Aug 2015, 03:35 PM
Hi Peer,

You can have a look at our online converter as well as this thread on StackOverflow: http://stackoverflow.com/questions/10708158/how-do-i-write-this-lambda-select-method-in-vb-net

In general, it should be something like this:
For Each x As EventId In _appointment.ResourceIds.Select(Function(a) New EventId(a))

I hope this helps.

Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
Peer
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or