// // Copyright 2014 Perforce Software Inc. // using Perforce.Helper; namespace Perforce.Model { public class FolderItem : ListingItem { private string _depotPath; public override string DepotPath { get { return _depotPath; } set { _depotPath = value; } } private string _clientPath; public override string ClientPath { get { return _clientPath; } set { _clientPath = value; } } private bool _isMapped; public override bool IsMapped { get { return _isMapped; } set { _isMapped = value; } } private bool _isPathInClientView; public bool IsPathInClientView { get { return _isPathInClientView; } set { _isPathInClientView = value; } } public bool AllowDrop { get { var allowDrop = false; if (_isMapped || ClientPath != null) { allowDrop = true; } return allowDrop; } } public override TYPE Type { get { return TYPE.FOLDER; } } public override void Refresh() { var helper = Utility.GetPerforceHelper(); _isMapped = helper.IsDirectoryMapped(_depotPath); _isPathInClientView = helper.IsPathInClientView(_depotPath); base.Refresh(); } public override string Icon { get { return UIHelper.GetFolderIcon(selected: IsSelected, mapped: IsMapped, inClientView: IsPathInClientView, ignored: IsIgnored); } } } }