//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.Kusto.ServiceLayer.DataSource;
using Microsoft.Kusto.ServiceLayer.DataSource.Metadata;
namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer.DataSourceModel
{
///
/// Represents a folder node in the tree
///
public class FolderNode : DataSourceTreeNode
{
public FolderNode(IDataSource dataSource, DataSourceObjectMetadata objectMetadata)
: base(dataSource, objectMetadata)
{
}
///
/// For folders, this copies the context of its parent if available
///
///
public override object GetContext()
{
return Parent?.GetContext();
}
///
/// For folders, searches for its parent's SMO object rather than copying for itself
///
/// from this parent's parent, or null if not found
public override DataSourceObjectMetadata GetParentObjectMetadata()
{
return ParentAs()?.GetParentObjectMetadata();
}
}
}