Skip to content

Commit

Permalink
+ NET35 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SubPointSupport committed Mar 29, 2017
1 parent 6195fae commit 1ffb9de
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions SPMeta2/SPMeta2.CSOM/ModelHandlers/FolderModelHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,21 @@ public override void WithResolvingModelHost(ModelHostResolveContext modelHostCon
// once done, pass down via model host
if (folderModel.Name.ToLower() == "forms")
{
var doesFileHaveListItem = false;

#if !NET35
currentFolder.Context.Load(currentFolder, f => f.Properties);
currentFolder.Context.ExecuteQueryWithTrace();

var doesFileHaveListItem =
//Forms folders
!(currentFolder != null
&&
(currentFolder.Properties.FieldValues.ContainsKey("vti_winfileattribs")
doesFileHaveListItem = !(currentFolder != null
&&
currentFolder.Properties.FieldValues["vti_winfileattribs"].ToString() ==
"00000012"));
(currentFolder.Properties.FieldValues.ContainsKey("vti_winfileattribs")
&&
currentFolder.Properties.FieldValues["vti_winfileattribs"].ToString() ==
"00000012"));


#endif
isSpecialFolderContext = !doesFileHaveListItem;

folderModelHost.IsSpecialFolderContext = isSpecialFolderContext;
Expand Down

0 comments on commit 1ffb9de

Please sign in to comment.