From 1ffb9de55c5785d2c2cc10728844ec26ad9964ea Mon Sep 17 00:00:00 2001 From: SubPointSupport Date: Wed, 29 Mar 2017 07:54:28 -0700 Subject: [PATCH] + NET35 fix --- .../ModelHandlers/FolderModelHandler.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/SPMeta2/SPMeta2.CSOM/ModelHandlers/FolderModelHandler.cs b/SPMeta2/SPMeta2.CSOM/ModelHandlers/FolderModelHandler.cs index 330241166..23e4949cf 100644 --- a/SPMeta2/SPMeta2.CSOM/ModelHandlers/FolderModelHandler.cs +++ b/SPMeta2/SPMeta2.CSOM/ModelHandlers/FolderModelHandler.cs @@ -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;