unit [!UnitName];

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, 
  Borland.Eco.Handles, Borland.Eco.WinForm;

type
[!if=(AncestorName, "<NONE>")]
  T[!ClassName] = class(System.Windows.Forms.Form)
[!else]
  T[!ClassName] = class([!AncestorName])
[!endif]
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
    rhRoot: Borland.Eco.Handles.ReferenceHandle;
    EcoGlobalActions: Borland.Eco.WinForm.EcoActionExtender;
    EcoAutoForms: Borland.Eco.WinForm.EcoAutoFormExtender;
    EcoListActions: Borland.Eco.WinForm.EcoListActionExtender;
    EcoModelAwareDragDrop: Borland.Eco.WinForm.EcoDragDropExtender;    
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
  {$ENDREGION}
  strict private
    fEcoSpace: Borland.Eco.Handles.EcoSpace;
  strict protected
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  public
    constructor Create(anEcoSpace: EcoSpace); overload;
    function get_EcoSpace: Borland.Eco.Handles.EcoSpace;
    property EcoSpace: Borland.Eco.Handles.EcoSpace read get_EcoSpace;    
  end;

implementation
 
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure T[!ClassName].InitializeComponent;
begin
  Self.rhRoot := Borland.Eco.Handles.ReferenceHandle.Create;
  Self.EcoGlobalActions := Borland.Eco.WinForm.EcoActionExtender.Create;
  Self.EcoAutoForms := Borland.Eco.WinForm.EcoAutoFormExtender.Create;
  Self.EcoListActions := Borland.Eco.WinForm.EcoListActionExtender.Create;
  Self.EcoModelAwareDragDrop := Borland.Eco.WinForm.EcoDragDropExtender.Create;
  //
  // rhRoot
  //
  Self.rhRoot.EcoSpace := nil;
  Self.rhRoot.EcoSpaceType := nil;
  Self.rhRoot.StaticValueTypeName := '';
  Self.rhRoot.Variables := nil;
  //
  // EcoGlobalActions
  //
  Self.EcoGlobalActions.EcoSpace := nil;
  Self.EcoGlobalActions.RootHandle := Self.rhRoot;
  //
  // EcoAutoForms
  //
  Self.EcoAutoForms.EcoSpace := nil;
  //
  // EcoListActions
  //
  Self.EcoListActions.EcoSpace := nil;

  Self.Components := System.ComponentModel.Container.Create;
[!if=(AncestorName, "<NONE>")]
  Self.Size := System.Drawing.Size.Create(300, 300);
  Self.Text := 'T[!ClassName]';
[!endif]
end;
{$ENDREGION}

procedure T[!ClassName].Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor T[!ClassName].Create(anEcoSpace: Borland.Eco.Handles.EcoSpace);
begin
  inherited Create;
  //
  // Required for Windows Form Designer support
  //
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
  fEcoSpace := anEcoSpace;
  rhRoot.EcoSpace := fEcoSpace;
end;

function T[!ClassName].get_EcoSpace: Borland.Eco.Handles.EcoSpace;
begin
  result := fEcoSpace;
end;  

end.