Last active
September 27, 2018 13:59
-
-
Save groupdocscloud/33ad9afbf76ac035c8552d2efe0ec895 to your computer and use it in GitHub Desktop.
This Gist contains .NET examples of GroupDocs.Comparison Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comparison-CSharp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PostChanges(new Model.Requests.PostChangesRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is List<ComparisonChange>", response.Count.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PostChanges: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PostCategoriesChanges(new Model.Requests.PostCategoriesChangesRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is List<ComparisonChangesCategoryDto>", response.Count.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PostCategoriesChanges: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ComparisonApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// API call for response. | |
var response = apiInstance.Comparison(new Model.Requests.ComparisonRequest() { Request = comparisonRequest, OutPath = "comparisons/compare-result.docx" }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is Link", response.Href.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ComparisonApi.Comparison: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ComparisonApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// API call for response. | |
var response = apiInstance.ComparisonStream(new Model.Requests.ComparisonStreamRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is System.IO.Stream", response.Length.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ComparisonApi.ComparisonStream: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ComparisonApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// API call for response. | |
var response = apiInstance.ComparisonImages(new Model.Requests.ComparisonImagesRequest() { Request = comparisonRequest, OutFolder = "comparisons" }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is List<Link>", response.Count.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ComparisonApi.ComparisonImages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ComparisonApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// API call for response. | |
var response = apiInstance.ComparisonImagesStream(new Model.Requests.ComparisonImagesStreamRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is System.IO.Stream", response.Length.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ComparisonApi.ComparisonImagesStream: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PutChangesDocument(new Model.Requests.PutChangesDocumentRequest() { Request = comparisonRequest, OutPath = "comparisons/compare-result.docx" }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is Link", response.Href.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PutChangesDocument: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PutChangesDocumentStream(new Model.Requests.PutChangesDocumentStreamRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is System.IO.Stream", response.Length.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PutChangesDocumentStream: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PutChangesImages(new Model.Requests.PutChangesImagesRequest() { Request = comparisonRequest, OutFolder = "comparisons" }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is List<Link>", response.Count.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PutChangesImages: " + e.Message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
var configuration = new Configuration | |
{ | |
AppSid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", | |
AppKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
}; | |
// Initiate API object | |
var apiInstance = new ChangesApi(configuration); | |
try | |
{ | |
// Comparison Request | |
ComparisonRequest comparisonRequest = new ComparisonRequest() | |
{ | |
// Comparison Request Settings | |
Settings = new ComparisonRequestSettings() | |
{ | |
GenerateSummaryPage = true, | |
ShowDeletedContent = true, | |
StyleChangeDetection = true, | |
UseFramesForDelInsElements = false, | |
DetailLevel = "Low", | |
DeletedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Red | |
}, | |
InsertedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Blue | |
}, | |
StyleChangedItemsStyle = new StyleSettingsValues() | |
{ | |
BeginSeparatorString = "", | |
EndSeparatorString = "", | |
Color = new Color().Green | |
}, | |
CalculateComponentCoordinates = false, | |
CloneMetadata = "Source", | |
MarkDeletedInsertedContentDeep = false, | |
MetaData = new ComparisonMetadataValues() | |
{ | |
Author = "GroupDocs", | |
Company = "GroupDocs", | |
LastSaveBy = "GroupDocs" | |
}, | |
Password = "", | |
PasswordSaveOption = "" | |
}, | |
// Source file | |
SourceFile = new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "source.docx", | |
Password = "" | |
} | |
}; | |
List<ComparisonFileInfo> targets = new List<ComparisonFileInfo>(); | |
// Target file | |
targets.Add(new ComparisonFileInfo() | |
{ | |
Folder = "comparisons", | |
Name = "target.docx", | |
Password = "" | |
}); | |
// Target file - single or multiple target files are allowed. | |
comparisonRequest.TargetFiles = targets.ToArray(); | |
// Accept or Reject changes | |
comparisonRequest.Changes = new List<ComparisonChange>(); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 0, Action = "Accept" }); | |
comparisonRequest.Changes.Add(new ComparisonChange() { Id = 1, Action = "Reject" }); | |
// API call for response. | |
var response = apiInstance.PutChangesImagesStream(new Model.Requests.PutChangesImagesStreamRequest() { Request = comparisonRequest }); | |
Console.WriteLine(string.Format("{0}: {1}", "response is System.IO.Stream", response.Length.ToString())); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine("Exception when calling ChangesApi.PutChangesImagesStream: " + e.Message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment