New User. Goodbye Delphi (at least for new projects)

Purchased today. So the journey begins…

Regarding Beta updates, can I just download and install “on top” of the existing installation?

Regards

Bob Russell

Welcome!

Yes, you can always just install on top. even to go back a version, if needed.

Thanks.

Welcome. you will not regret your decision. I made the same switch.

1 Like

I have been looking at the Windows Forms sample Sequences and Queries. I could run it ok. When I try to replicate the code in my own project, I have a problem with the code Sequence.ToArray. No ToArray is available. Today, when I re-built the sample, it wouldn’t compile saying:

*Unknown namespace ‘System.Linq.enumerable’ in uses list.

That namespace is the one containing the sequence ToArray (and also lots of other stuff like ToDictionary). It obviously isn’t available in my VS2015 based install of Elements

Can you advise?

Thanks

did you try just adding System.Linq to the uses?

System.Linq is the namespace, not System.Linq.enumerable.

Ennumerable is an (extension) class in that namespace, which adds new methods, such as ToArray, to the sequence type. By using the namespace, all the extension methods will come into scope.

Thanks to both. I must have edited the samples project by mistake. By removing the .enumerable I was able to build and run the project ok. Now just need to find out why my “look alike” project fails.

Thanks again

1 Like

Here is a mini project to mimic the sample Sequences. It just creates and fills a sequence of Customers, then displays them in a grid. This compiles and runs ok, but I get no intellisense on the .ToArray of the sequence. If I type ToArray everything works. On the actual sample project, there is full intellisence on the MyCustomers.ToArray. What am I missing?

namespace WFTest3;

interface

uses
System.Drawing,
System.Collections,
System.Collections.Generic,
System.Linq,
System.Windows.Forms,
System.ComponentModel;

type
///


/// Summary description for MainForm.
///

MainForm = partial class(System.Windows.Forms.Form)
private
{$REGION designer-generated code}
method MainForm_Load(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
protected
method Dispose(disposing: Boolean); override;

var
MyCustomers: sequence of Customer;
public
constructor;
end;

type Customer = public class
private

public
property CustomerID: String;
property CustomerSize: Integer;
constructor;
constructor (setCustomerID: String; setCustomerSize: Integer);
end;

implementation

{$REGION Construction and Disposition}
constructor MainForm;
begin
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
end;

method MainForm.Dispose(disposing: Boolean);
begin
if disposing then begin
if assigned(components) then
components.Dispose();

//
// TODO: Add custom disposition code here
//

end;
inherited Dispose(disposing);
end;
{$ENDREGION}

{$REGION designer-generated code}
method MainForm.MainForm_Load(sender: System.Object; e: System.EventArgs);
begin
// create some Customer records
MyCustomers :=
[
new Customer(‘CustomerA’,1),
new Customer(‘CustomerB’,2)
];
dataGridView1.DataSource := MyCustomers.ToArray; // HERE IS WHERE I GET NO INTELLISENSE
end;
{$ENDREGION}

constructor Customer;
begin
end;

constructor Customer (setCustomerID: String; setCustomerSize: Integer);
begin
self.CustomerID := setCustomerID;
self.CustomerSize := setCustomerSize;
end;

end.

know bug. add a reference to System.Core.dll to your project to fix CC. The compiler will add that automatically, but it seems the IDE smarts don’t, currently, that’s why they don’t see those methods. i logged an issue to get the fixed, earlier today, coincidentally.

That solved it. Thanks.

re WPF, does anyone use KAXAML or similar for viewing the rendering of xaml outside the project? I can see the results from examples in my WPF book, but using the xaml code files from the project itself gives me errors, and I haven’t figured out what the problem is yet.

Thanks.

Also, reWPF, how do I add/change the theme of a project - again I’ve looked on the web, but not sure how to do this within Oxygene

Thanks