1
0
mirror of synced 2024-11-15 08:53:50 +00:00
unitswitcher/Source/ProjSwObjects.pas
2010-02-16 12:39:29 +00:00

59 lines
1.1 KiB
ObjectPascal

unit ProjSwObjects;
interface
uses
ToolsAPI,
BaseSwObjects;
type
TProjSwProject = class(TBaseSwItem)
private
FProject: IOTAProject;
FName: String;
protected
function GetName: String; override;
public
constructor Create(AProject: IOTAProject);
procedure Activate(const AClearSelection: Boolean);
end;
implementation
uses
SysUtils, Dialogs;
{ TProjSwProject }
constructor TProjSwProject.Create(AProject: IOTAProject);
begin
inherited Create;
FProject := AProject;
FName := ExtractFileName(FProject.ProjectOptions.TargetName);
end;
procedure TProjSwProject.Activate(const AClearSelection: Boolean);
var
moduleServices: IOTAModuleServices;
projectGroup: IOTAProjectGroup;
begin
moduleServices := (BorlandIDEServices as IOTAModuleServices);
projectGroup := moduleServices.MainProjectGroup;
if Assigned(projectGroup) then
projectGroup.ActiveProject := FProject;
end;
function TProjSwProject.GetName: String;
begin
Result := FName;
end;
end.