Skip to content

Commit

Permalink
Add comments to remove build warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Oct 4, 2023
1 parent 9f13b7d commit c38cabd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions uSync.BackOffice/SyncHandlers/Handlers/ContentHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public ContentHandler(
this.serializer = syncItemFactory.GetSerializer<IContent>("ContentSerializer");
}

/// <inheritdoc />
protected override bool HasChildren(IContent item)
=> contentService.HasChildren(item.Id);

Expand Down
1 change: 1 addition & 0 deletions uSync.BackOffice/SyncHandlers/Handlers/MediaHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public MediaHandler(
this.mediaService = mediaService;
}

/// <inheritdoc />
protected override bool HasChildren(IMedia item)
=> mediaService.HasChildren(item.Id);

Expand Down
1 change: 1 addition & 0 deletions uSync.BackOffice/SyncHandlers/SyncHandlerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public SyncHandlerBase(
this.entityService = entityService;
}

/// <inheritdoc />
protected override bool HasChildren(TObject item)
=> entityService.GetChildren(item.Id).Any();

Expand Down
11 changes: 11 additions & 0 deletions uSync.BackOffice/SyncHandlers/SyncHandlerRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,13 @@ virtual public IEnumerable<uSyncAction> Export(TObject item, string folder, Hand
return uSyncActionHelper<XElement>.SetAction(attempt, filename, GetItemKey(item), this.Alias).AsEnumerableOfOne();
}

/// <summary>
/// does this item have any children ?
/// </summary>
/// <remarks>
/// on items where we can check this (quickly) we can reduce the number of checks we might
/// make on child items or cleaning up where we don't need to.
/// </remarks>
protected virtual bool HasChildren(TObject item)
=> true;

Expand Down Expand Up @@ -1783,6 +1790,10 @@ private string GetNameFromFileOrNode(string filename, XElement node)
=> !string.IsNullOrWhiteSpace(filename) ? filename : node.GetAlias();


/// <summary>
/// get thekey for any caches we might call (thread based cache value)
/// </summary>
/// <returns></returns>
protected string GetCacheKeyBase()
=> $"keycache_{this.Alias}_{Thread.CurrentThread.ManagedThreadId}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,12 @@ protected uSyncChange HandleSortOrder(TObject item, int sortOrder)
return null;
}

protected abstract uSyncChange HandleTrashedState(TObject item, bool trashed, Guid restoreParent);
[Obsolete("Pass in a restore guid for the parent - should relationships be missing")]
protected virtual uSyncChange HandleTrashedState(TObject item, bool trashed)
=> uSyncChange.NoChange($"Member/{item.Name}", item.Name);

protected virtual uSyncChange HandleTrashedState(TObject item, bool trashed, Guid restoreParent)
=> uSyncChange.NoChange($"Member/{item.Name}", item.Name);

protected string GetExportValue(object value, IPropertyType propertyType, string culture, string segment)
{
Expand Down

0 comments on commit c38cabd

Please sign in to comment.