Changeset 16 for trunk/StudioCommon
- Timestamp:
- Aug 6, 2012, 3:16:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioCommon/USource.pas
r15 r16 9 9 10 10 type 11 12 { TSourceType } 13 14 TSourceType = class 15 Extension: string; 16 Title: string; 17 Form: TForm; 18 constructor Create; virtual; 19 end; 20 21 TFileTypeClass = class of TSourceType; 22 23 { TFileTypes } 24 25 TFileTypes = class(TListObject) 26 function GetDialogFilter: string; 27 end; 11 TSourceType = class; 28 12 29 13 { TSource } … … 36 20 Modified: Boolean; 37 21 Form: TForm; 22 FileType: TSourceType; 38 23 property Name: string read FName write SetName; 39 24 end; … … 44 29 Items: TListObject; // TListObject<TSource> 45 30 Main: TSource; 31 end; 32 33 34 { TSourceType } 35 36 TSourceType = class 37 Extension: string; 38 Title: string; 39 Form: TFormClass; 40 SourceClass: TSourceClass; 41 constructor Create; virtual; 42 end; 43 44 TFileTypeClass = class of TSourceType; 45 46 { TFileTypes } 47 48 TFileTypes = class(TListObject) 49 function GetDialogFilter: string; 50 function FindByExt(Extension: string): TSourceType; 46 51 end; 47 52 … … 84 89 TConvertorClass = class of TConvertor; 85 90 86 { TSourceText }87 88 TSourceText = class(TSource)89 private90 public91 Loaded: Boolean;92 Content: TStringList;93 constructor Create;94 destructor Destroy; override;95 end;96 97 98 91 99 92 implementation … … 107 100 begin 108 101 inherited; 102 SourceClass := TSource; 109 103 end; 110 104 … … 151 145 end; 152 146 147 function TFileTypes.FindByExt(Extension: string): TSourceType; 148 var 149 I: Integer; 150 begin 151 I := 0; 152 while (I < count) and (TSourceType(Items[I]).Extension <> Extension) do Inc(I); 153 if I < Count then Result := TSourceType(Items[I]) 154 else Result := nil; 155 end; 156 153 157 { TConvertor } 154 158 … … 169 173 end; 170 174 171 { TSourceText }172 173 constructor TSourceText.Create;174 begin175 Content := TStringList.Create;176 end;177 178 destructor TSourceText.Destroy;179 begin180 Content.Free;181 inherited Destroy;182 end;183 184 175 end. 185 176
Note:
See TracChangeset
for help on using the changeset viewer.