This commit is contained in:
@@ -179,9 +179,13 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
TODO:
|
TODO:
|
||||||
* Error should post somehow to server so can see at server what went wrong
|
* wiki / attached docs
|
||||||
* custom fields processor for: User, Client, Contract, HeadOffice, LoanItem, part, project, purchaseorder, unit, unitmodel, vendor, workorderitem
|
*
|
||||||
* See util.cs in winformapp for all custom field shit, lines 3114 is a good starting point
|
* locales
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -208,7 +212,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
//BIZ objects
|
//BIZ objects
|
||||||
await ExportUsers(progress);
|
await ExportUsers(progress);
|
||||||
//dumpLocales(tempArchiveFolder, progress);
|
// await ExportLocales(progress);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -277,8 +281,6 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
#endregion locales
|
#endregion locales
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region Seeds
|
#region Seeds
|
||||||
private class GZSeeds
|
private class GZSeeds
|
||||||
{
|
{
|
||||||
@@ -554,191 +556,10 @@ var DateCustomFields = await ExportCustomFieldSchema(ocf, "User", "User");
|
|||||||
|
|
||||||
#endregion TAG ITEMS
|
#endregion TAG ITEMS
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
#endregion object dump methods
|
#endregion object export
|
||||||
|
|
||||||
|
|
||||||
#region Dump
|
#region Custom fields exporter
|
||||||
|
|
||||||
// /// <summary>
|
|
||||||
// /// Write out the object properties as JSON
|
|
||||||
// /// </summary>
|
|
||||||
// /// <param name="tempArchiveFolder"></param>
|
|
||||||
// /// <param name="o"></param>
|
|
||||||
// private void ExportObjectToFolder(object o, string objectFileName, List<string> excludeProperties,
|
|
||||||
// TypeAndID tid, string forceTypeString = "", JObject jExtra = null)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// var typestring = o.GetType().ToString();
|
|
||||||
// if (!string.IsNullOrWhiteSpace(forceTypeString))
|
|
||||||
// {
|
|
||||||
// typestring = forceTypeString;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var dumpFolder = tempArchiveFolder + Path.DirectorySeparatorChar + typestring;
|
|
||||||
// makeFolderIfNotExist(dumpFolder);
|
|
||||||
|
|
||||||
// var outputFileName = dumpFolder + Path.DirectorySeparatorChar + objectFileName + ".json";
|
|
||||||
// var wikiOutputPath = dumpFolder + Path.DirectorySeparatorChar + objectFileName + Path.DirectorySeparatorChar + "files";
|
|
||||||
|
|
||||||
// JsonSerializer serializer = new JsonSerializer();
|
|
||||||
// serializer.NullValueHandling = NullValueHandling.Include;
|
|
||||||
// serializer.ContractResolver = new ExcludeNamedPropertiesContractResolver(excludeProperties);
|
|
||||||
// serializer.ReferenceLoopHandling = ReferenceLoopHandling.Serialize;
|
|
||||||
|
|
||||||
|
|
||||||
//#if(DEBUG)
|
|
||||||
// serializer.Formatting = Formatting.Indented;
|
|
||||||
//#endif
|
|
||||||
// // serializer.Converters.Add(new JavaScriptDateTimeConverter());
|
|
||||||
// // serializer.NullValueHandling = NullValueHandling.Ignore;
|
|
||||||
|
|
||||||
// //generate file name, should be ID of object plus .json
|
|
||||||
|
|
||||||
// JObject jo = JObject.FromObject(o, serializer);
|
|
||||||
// if (jExtra != null)
|
|
||||||
// {
|
|
||||||
// jo.Add("jextra", jExtra);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// using (StreamWriter sw = new StreamWriter(outputFileName))
|
|
||||||
// using (JsonWriter writer = new JsonTextWriter(sw))
|
|
||||||
// {
|
|
||||||
|
|
||||||
// // serializer.Serialize(writer, o);
|
|
||||||
// serializer.Serialize(writer, jo);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //WIKI / ATTACHMENTS
|
|
||||||
// DumpWikiPageAndAttachments(tid, wikiOutputPath);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//WIKI
|
|
||||||
#region Wikiable objects reference
|
|
||||||
/*
|
|
||||||
Find all "Util.OpenWikiPage", Whole word, Subfolders, Keep modified files open, Find Results 1, Entire Solution, ""
|
|
||||||
C:\data\ayanova\source\WinFormApp\ClientInfoForm.cs(1579): Util.OpenWikiPage(RootObjectTypes.Client, mClient.ID,false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\ContractInfoForm.cs(687): Util.OpenWikiPage(RootObjectTypes.Contract, mContract.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\Form1.cs(3713): Util.OpenWikiPage(RootObjectTypes.Global, Address.GlobalAddressID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\Form1.cs(3856): Util.OpenWikiPage(RootObjectTypes.User, User.CurrentThreadUserID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\Form1.cs(3867): // Util.OpenWikiPage(RootObjectTypes.User,User.CurrentThreadUserID,false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\HeadOfficeInfoForm.cs(1402): Util.OpenWikiPage(RootObjectTypes.HeadOffice, mHeadOffice.ID,false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\LoanItemInfoForm.cs(860): Util.OpenWikiPage(RootObjectTypes.LoanItem, mLoanItem.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\PartInfoForm.cs(1111): Util.OpenWikiPage(RootObjectTypes.Part, mPart.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\ProjectInfoForm.cs(712): Util.OpenWikiPage(RootObjectTypes.Project, mProject.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\PurchaseOrderInfoForm.cs(1010): Util.OpenWikiPage(RootObjectTypes.PurchaseOrder, mPurchaseOrder.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\RegionInfoForm.cs(1186): Util.OpenWikiPage(RootObjectTypes.Region, mRegion.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\UnitInfoForm.cs(1280): Util.OpenWikiPage(RootObjectTypes.Unit, mUnit.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\UnitModelInfoForm.cs(926): Util.OpenWikiPage(RootObjectTypes.UnitModel, mUnitModel.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\UserInfoForm.cs(1395): Util.OpenWikiPage(RootObjectTypes.User, mUser.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\VendorInfoForm.cs(1193): Util.OpenWikiPage(RootObjectTypes.Vendor, mVendor.ID, false);
|
|
||||||
C:\data\ayanova\source\WinFormApp\WorkorderForm.cs(10332): Util.OpenWikiPage(mWorkorder.RootObjectType, mWorkorder.ID, false);//case 1584 was RootObjectTypes.Workorder
|
|
||||||
C:\data\ayanova\source\WBI\maingrid.aspx.cs(1277): Util.OpenWikiPage(this.Page, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID));
|
|
||||||
C:\data\ayanova\source\WBI\schedule.aspx.cs(187): Util.OpenWikiPage(this.Page, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID));
|
|
||||||
Matching lines: 18 Matching files: 16 Total files searched: 1769
|
|
||||||
*/
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private void ExportWikiPageAndAttachments(TypeAndID tid, string wikiOutputPath)
|
|
||||||
{
|
|
||||||
|
|
||||||
// //may not exist
|
|
||||||
// if (!WikiPage.HasWiki(tid.ID)) return;
|
|
||||||
|
|
||||||
// WikiPage w = WikiPage.GetItem(tid);
|
|
||||||
// var content = w.GetContentAsString;
|
|
||||||
// AyaFileList fl = AyaFileList.GetList(w.ID);
|
|
||||||
|
|
||||||
// if (string.IsNullOrWhiteSpace(content) && fl.Count < 1) return;
|
|
||||||
|
|
||||||
// makeFolderIfNotExist(wikiOutputPath);
|
|
||||||
|
|
||||||
// if (!string.IsNullOrWhiteSpace(content))
|
|
||||||
// {
|
|
||||||
// //write out the html wiki page
|
|
||||||
// File.WriteAllText(wikiOutputPath + Path.DirectorySeparatorChar + "w.html", content);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// //files
|
|
||||||
// foreach (AyaFileList.AyaFileListInfo i in fl)
|
|
||||||
// {
|
|
||||||
// //WikiFileInfo fi = new WikiFileInfo();
|
|
||||||
// // fi.Id = i.LT_O_AyaFile.Value.ToString();
|
|
||||||
// // fi.Name = i.LT_O_AyaFile.Display;
|
|
||||||
// // fi.Size = i.LT_AyaFile_Label_FileSize;
|
|
||||||
// // fi.Creator = i.LT_Common_Label_Creator.Display;
|
|
||||||
// // fi.Created = i.LT_Common_Label_Created.ToString();
|
|
||||||
// // ret.Add(fi);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// //save each file plus file info into their own folder by ayafile id this is because ayafiles can be dupe names and we need the wiki info to fixup the last created date etc
|
|
||||||
// var filePath = wikiOutputPath + Path.DirectorySeparatorChar + i.LT_O_AyaFile.Value.ToString();
|
|
||||||
// makeFolderIfNotExist(filePath);//output/objectype/client.f861ec01-8bde-46e1-9849-fcee9b42f05e/files/d5461ec01-8bde-46e1-9849-fcee9b42f0ff34/
|
|
||||||
|
|
||||||
// var af = AyaFile.GetItem(i.LT_O_AyaFile.Value);
|
|
||||||
// if (af == null) continue;
|
|
||||||
// af.WriteToDisk(filePath, af.Name);
|
|
||||||
|
|
||||||
// var fileInfo = new
|
|
||||||
// {
|
|
||||||
// name = i.LT_O_AyaFile.Display,
|
|
||||||
// created = i.LT_Common_Label_Created,
|
|
||||||
// creator = i.LT_Common_Label_Creator.Value,
|
|
||||||
// mimetype = af.mimeType,
|
|
||||||
// id = af.ID,
|
|
||||||
// size = af.FileSize,
|
|
||||||
// ayafiletype = af.FileType,
|
|
||||||
// rootobjectid = af.RootObjectID,
|
|
||||||
// rootobjecttype = af.RootObjectType
|
|
||||||
// };
|
|
||||||
|
|
||||||
// JsonSerializer serializer = new JsonSerializer();
|
|
||||||
// serializer.NullValueHandling = NullValueHandling.Include;
|
|
||||||
|
|
||||||
//#if(DEBUG)
|
|
||||||
// serializer.Formatting = Formatting.Indented;
|
|
||||||
//#endif
|
|
||||||
// JObject jo = JObject.FromObject(fileInfo, serializer);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// using (StreamWriter sw = new StreamWriter(filePath + Path.DirectorySeparatorChar + "meta.json"))
|
|
||||||
// using (JsonWriter writer = new JsonTextWriter(sw))
|
|
||||||
// {
|
|
||||||
|
|
||||||
// // serializer.Serialize(writer, o);
|
|
||||||
// serializer.Serialize(writer, jo);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion dump
|
|
||||||
|
|
||||||
#region Utility methods
|
|
||||||
private void Tagit(Guid g, List<string> tags)
|
|
||||||
{
|
|
||||||
if (g == Guid.Empty) return;
|
|
||||||
if (!TagMap.ContainsKey(g)) return;
|
|
||||||
var t = TagMap[g];
|
|
||||||
if (!string.IsNullOrWhiteSpace(t))
|
|
||||||
{
|
|
||||||
tags.Add(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void SetTags(dynamic d, List<string> tags)
|
|
||||||
{
|
|
||||||
dynamic dtags = new JArray();
|
|
||||||
foreach (string s in tags)
|
|
||||||
dtags.Add(s);
|
|
||||||
d.tags = dtags;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//export objects custom field data into jobject string
|
//export objects custom field data into jobject string
|
||||||
@@ -849,6 +670,173 @@ var DateCustomFields = await ExportCustomFieldSchema(ocf, "User", "User");
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion custom fields
|
||||||
|
|
||||||
|
#region WIKI page exporter
|
||||||
|
|
||||||
|
|
||||||
|
//WIKI
|
||||||
|
#region Wikiable objects reference
|
||||||
|
/*
|
||||||
|
Find all "Util.OpenWikiPage", Whole word, Subfolders, Keep modified files open, Find Results 1, Entire Solution, ""
|
||||||
|
C:\data\ayanova\source\WinFormApp\ClientInfoForm.cs(1579): Util.OpenWikiPage(RootObjectTypes.Client, mClient.ID,false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\ContractInfoForm.cs(687): Util.OpenWikiPage(RootObjectTypes.Contract, mContract.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\Form1.cs(3713): Util.OpenWikiPage(RootObjectTypes.Global, Address.GlobalAddressID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\Form1.cs(3856): Util.OpenWikiPage(RootObjectTypes.User, User.CurrentThreadUserID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\Form1.cs(3867): // Util.OpenWikiPage(RootObjectTypes.User,User.CurrentThreadUserID,false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\HeadOfficeInfoForm.cs(1402): Util.OpenWikiPage(RootObjectTypes.HeadOffice, mHeadOffice.ID,false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\LoanItemInfoForm.cs(860): Util.OpenWikiPage(RootObjectTypes.LoanItem, mLoanItem.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\PartInfoForm.cs(1111): Util.OpenWikiPage(RootObjectTypes.Part, mPart.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\ProjectInfoForm.cs(712): Util.OpenWikiPage(RootObjectTypes.Project, mProject.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\PurchaseOrderInfoForm.cs(1010): Util.OpenWikiPage(RootObjectTypes.PurchaseOrder, mPurchaseOrder.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\RegionInfoForm.cs(1186): Util.OpenWikiPage(RootObjectTypes.Region, mRegion.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\UnitInfoForm.cs(1280): Util.OpenWikiPage(RootObjectTypes.Unit, mUnit.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\UnitModelInfoForm.cs(926): Util.OpenWikiPage(RootObjectTypes.UnitModel, mUnitModel.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\UserInfoForm.cs(1395): Util.OpenWikiPage(RootObjectTypes.User, mUser.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\VendorInfoForm.cs(1193): Util.OpenWikiPage(RootObjectTypes.Vendor, mVendor.ID, false);
|
||||||
|
C:\data\ayanova\source\WinFormApp\WorkorderForm.cs(10332): Util.OpenWikiPage(mWorkorder.RootObjectType, mWorkorder.ID, false);//case 1584 was RootObjectTypes.Workorder
|
||||||
|
C:\data\ayanova\source\WBI\maingrid.aspx.cs(1277): Util.OpenWikiPage(this.Page, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID));
|
||||||
|
C:\data\ayanova\source\WBI\schedule.aspx.cs(187): Util.OpenWikiPage(this.Page, new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID));
|
||||||
|
Matching lines: 18 Matching files: 16 Total files searched: 1769
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private async System.Threading.Tasks.Task<string> ExportWikiPageAndAttachments(TypeAndID tid)
|
||||||
|
{
|
||||||
|
//todo: upload attached files
|
||||||
|
//todo: return wiki as string
|
||||||
|
|
||||||
|
//may not exist
|
||||||
|
if (!WikiPage.HasWiki(tid.ID)) return null;
|
||||||
|
|
||||||
|
WikiPage w = WikiPage.GetItem(tid);
|
||||||
|
var content = w.GetContentAsString;
|
||||||
|
AyaFileList fl = AyaFileList.GetList(w.ID);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(content) && fl.Count < 1) return null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// //files
|
||||||
|
// foreach (AyaFileList.AyaFileListInfo i in fl)
|
||||||
|
// {
|
||||||
|
// //WikiFileInfo fi = new WikiFileInfo();
|
||||||
|
// // fi.Id = i.LT_O_AyaFile.Value.ToString();
|
||||||
|
// // fi.Name = i.LT_O_AyaFile.Display;
|
||||||
|
// // fi.Size = i.LT_AyaFile_Label_FileSize;
|
||||||
|
// // fi.Creator = i.LT_Common_Label_Creator.Display;
|
||||||
|
// // fi.Created = i.LT_Common_Label_Created.ToString();
|
||||||
|
// // ret.Add(fi);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// //save each file plus file info into their own folder by ayafile id this is because ayafiles can be dupe names and we need the wiki info to fixup the last created date etc
|
||||||
|
// var filePath = wikiOutputPath + Path.DirectorySeparatorChar + i.LT_O_AyaFile.Value.ToString();
|
||||||
|
// makeFolderIfNotExist(filePath);//output/objectype/client.f861ec01-8bde-46e1-9849-fcee9b42f05e/files/d5461ec01-8bde-46e1-9849-fcee9b42f0ff34/
|
||||||
|
|
||||||
|
// var af = AyaFile.GetItem(i.LT_O_AyaFile.Value);
|
||||||
|
// if (af == null) continue;
|
||||||
|
// af.WriteToDisk(filePath, af.Name);
|
||||||
|
|
||||||
|
// var fileInfo = new
|
||||||
|
// {
|
||||||
|
// name = i.LT_O_AyaFile.Display,
|
||||||
|
// created = i.LT_Common_Label_Created,
|
||||||
|
// creator = i.LT_Common_Label_Creator.Value,
|
||||||
|
// mimetype = af.mimeType,
|
||||||
|
// id = af.ID,
|
||||||
|
// size = af.FileSize,
|
||||||
|
// ayafiletype = af.FileType,
|
||||||
|
// rootobjectid = af.RootObjectID,
|
||||||
|
// rootobjecttype = af.RootObjectType
|
||||||
|
// };
|
||||||
|
|
||||||
|
// JsonSerializer serializer = new JsonSerializer();
|
||||||
|
// serializer.NullValueHandling = NullValueHandling.Include;
|
||||||
|
|
||||||
|
//#if(DEBUG)
|
||||||
|
// serializer.Formatting = Formatting.Indented;
|
||||||
|
//#endif
|
||||||
|
// JObject jo = JObject.FromObject(fileInfo, serializer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// using (StreamWriter sw = new StreamWriter(filePath + Path.DirectorySeparatorChar + "meta.json"))
|
||||||
|
// using (JsonWriter writer = new JsonTextWriter(sw))
|
||||||
|
// {
|
||||||
|
|
||||||
|
// // serializer.Serialize(writer, o);
|
||||||
|
// serializer.Serialize(writer, jo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(content))
|
||||||
|
return content;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion wiki
|
||||||
|
|
||||||
|
|
||||||
|
#region TAGS
|
||||||
|
private void Tagit(Guid g, List<string> tags)
|
||||||
|
{
|
||||||
|
if (g == Guid.Empty) return;
|
||||||
|
if (!TagMap.ContainsKey(g)) return;
|
||||||
|
var t = TagMap[g];
|
||||||
|
if (!string.IsNullOrWhiteSpace(t))
|
||||||
|
{
|
||||||
|
tags.Add(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetTags(dynamic d, List<string> tags)
|
||||||
|
{
|
||||||
|
dynamic dtags = new JArray();
|
||||||
|
foreach (string s in tags)
|
||||||
|
dtags.Add(s);
|
||||||
|
d.tags = dtags;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion tags
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region OLD JSON EXPORT STUFF
|
||||||
|
|
||||||
|
|
||||||
|
#region contract resolver
|
||||||
|
//public class ExcludeNamedPropertiesContractResolver : DefaultContractResolver
|
||||||
|
//{
|
||||||
|
// private readonly List<string> _excludeProperties;
|
||||||
|
|
||||||
|
// public ExcludeNamedPropertiesContractResolver(List<string> excludeProperties)
|
||||||
|
// {
|
||||||
|
// _excludeProperties = excludeProperties;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
||||||
|
// {
|
||||||
|
// IList<JsonProperty> properties = base.CreateProperties(type, memberSerialization);
|
||||||
|
|
||||||
|
// // only serializer properties that start with the specified character
|
||||||
|
// //properties = properties.Where(p => p.PropertyName.StartsWith(_startingWithChar.ToString())).ToList();
|
||||||
|
// properties = properties.Where(p => !_excludeProperties.Contains(p.PropertyName)).ToList();
|
||||||
|
|
||||||
|
// return properties;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
#endregion contract resolver
|
||||||
|
|
||||||
|
|
||||||
//private static string EnsureValidFileName(string fileName)
|
//private static string EnsureValidFileName(string fileName)
|
||||||
//{
|
//{
|
||||||
@@ -911,36 +899,9 @@ var DateCustomFields = await ExportCustomFieldSchema(ocf, "User", "User");
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
#endregion
|
#endregion old
|
||||||
|
|
||||||
#region contract resolver
|
|
||||||
public class ExcludeNamedPropertiesContractResolver : DefaultContractResolver
|
|
||||||
{
|
|
||||||
private readonly List<string> _excludeProperties;
|
|
||||||
|
|
||||||
public ExcludeNamedPropertiesContractResolver(List<string> excludeProperties)
|
|
||||||
{
|
|
||||||
_excludeProperties = excludeProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
|
|
||||||
{
|
|
||||||
IList<JsonProperty> properties = base.CreateProperties(type, memberSerialization);
|
|
||||||
|
|
||||||
// only serializer properties that start with the specified character
|
|
||||||
//properties = properties.Where(p => p.PropertyName.StartsWith(_startingWithChar.ToString())).ToList();
|
|
||||||
properties = properties.Where(p => !_excludeProperties.Contains(p.PropertyName)).ToList();
|
|
||||||
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion contract resolver
|
|
||||||
|
|
||||||
|
|
||||||
//eoc
|
//eoc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//eons
|
//eons
|
||||||
|
|||||||
Reference in New Issue
Block a user