Files
azuredatastudio/extensions/sql-database-projects/src/controllers/databaseProjectTreeItem.ts
Benjin Dubishar 51ab435e5f Initial SQL Project tree viewlet in Explorer sidebar (#8639)
* Adding mock contents for tree
* added open sqlproj dialog
* reading files from directory
* Added directory traversal
* Adding tree sorting by folder vs file and label
* Improved auto-unfolding of tree based on node type
* replacing fs with fs.promise alias
* added activation event for when workspace contains sqlproj files
* Returning after displaying error
2019-12-27 12:42:23 -08:00

25 lines
878 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export class SqlDatabaseProjectItem {
label: string;
readonly isFolder: boolean;
readonly parent?: SqlDatabaseProjectItem;
children: SqlDatabaseProjectItem[] = [];
constructor(label: string, isFolder: boolean, parent?: SqlDatabaseProjectItem) {
this.label = label;
this.isFolder = isFolder;
this.parent = parent;
}
public createChild(label: string, isFolder: boolean): SqlDatabaseProjectItem {
let child = new SqlDatabaseProjectItem(label, isFolder, this);
this.children.push(child);
return child;
}
}