Oxidiser conversion of C# to Oxygene:
Given the code extracts in C#
public class Student : INotifyPropertyChanged
{
private string firstName;
private string lastName;
public string FirstName
{
get
{
return firstName;
}
set
{
if (firstName != value)
{
firstName = value;
RaisePropertyChanged("FirstName");
RaisePropertyChanged("FullName");
}
}
}
public string LastName
{
get { return lastName; }
set
{
if (lastName != value)
{
lastName = value;
RaisePropertyChanged("LastName");
RaisePropertyChanged("FullName");
}
}
}
public string FullName
{
get
{
return firstName + " " + lastName;
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string property)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
}
public class StudentViewModel
{
public ObservableCollection<Student> Students
{
get;
set;
}
public void LoadStudents()
{
ObservableCollection<Student> students = new ObservableCollection<Student>();
_**students.Add(new Student { FirstName = "Mark", LastName = "Allain" });**_
** students.Add(new Student { FirstName = “Allen”, LastName = “Brown” });**
** students.Add(new Student { FirstName = “Linda”, LastName = “Hamerski” });**
Students = students;
}
}
Oxidiser converted the 3 lines (above in bold and italic) to
students.Add(new Student(‘Mark’) LastName(‘Allain’));
students.Add(new Student(‘Allen’) LastName(‘Brown’));
students.Add(new Student(‘Linda’) LastName(‘Hamerski’));
Re Oxidiser, it works very well from my short experience, but
How close to 100% is it?
Am I misunderstanding something?
Does it work in isolation with each clip, or does it need to know about “other” class definitions not in the clip?
(The student class definition above is in a separate file and namespace)
Any insights gratefully received.