Unlike Tasks and Contacts which have fixed categories (type TVpCategoryType = (ctBusiness, ctClients, ctFamily, ctOther, ctPersonal), and string conversion in CategoryLabel(categorytype)), events have more flexible categories which are defined in the CatagoryColorMap of the datastore which provides 10 categories of type TVpCategoryInfo (Category0..Category9). These are the public/published methods/properties of TVpCategoryColorMap:
type
TVpCategoryColorMap = class(TPersistent)
...
public
...
function GetColor(AIndex: Integer): TColor;
function GetName(AIndex: Integer):string;
function GetCategory(AIndex: Integer): TVpCategoryInfo;
function GetCategoryName(AIndex: Integer): String;
function IndexOfCategory(AName: String): Integer;
function IndexOfFirstUnusedCategory: Integer;
procedure SetCategoryName(AIndex: Integer; AName: String);
published
property Category0: TVpCategoryInfo index 0 read GetCategory write SetCat;
property Category1: TVpCategoryInfo index 1 read GetCategory write SetCat;
property Category2: TVpCategoryInfo index 2 read GetCategory write SetCat;
property Category3: TVpCategoryInfo index 3 read GetCategory write SetCat;
property Category4: TVpCategoryInfo index 4 read GetCategory write SetCat;
property Category5: TVpCategoryInfo index 5 read GetCategory write SetCat;
property Category6: TVpCategoryInfo index 6 read GetCategory write SetCat;
property Category7: TVpCategoryInfo index 7 read GetCategory write SetCat;
property Category8: TVpCategoryInfo index 8 read GetCategory write SetCat;
property Category9: TVpCategoryInfo index 9 read GetCategory write SetCat;
end;
type
TVpCategoryInfo= class(TPersistent)
...
published
property BackgroundColor: TColor
read FBackgroundColor write SetBackgroundColor default clWindow;
property Bitmap: TBitmap read FBitmap write SetBitmap;
property Color: TColor read FColor write SetColor;
property Description: string read FDescription write SetDescription;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1;
property CategoryIndex: Integer read FCategoryIndex;
property UseForAllDayEvents: Boolean read FAllDayEvents write FAllDayEvents default false;
end;
Returning to your question, how to get the name (property TVpCategoryInfo.Description) of an event category, you must know that event.Category is th index into the CategoryColorMap's categorinfo. Therefore, simply call the method GetCategoryName(index) (or GetName(index) which does the same) with the event's category info.
A fairly general function would be
function GetEventCategoryName(Event: TVpEvent): String;
var
resource: TVpResource;
datastore: TVpCustomDatastore;
begin
resource := Event.GetResource;
datastore := TVpCustomDatastore(resource.Owner.Owner);
Result := datastore.CategoryColorMap.GetCategoryName(Event.Category);
end;