Skip to content

Commit a64b7c8

Browse files
committed
addressed the feedbacks
1 parent c6b500c commit a64b7c8

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed
Binary file not shown.

Annotations/AddStandardStampsinToolBar/MainWindow.xaml.cs

+11-9
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,31 @@ namespace AddingStandardStampsInToolBar
2121
/// </summary>
2222
public partial class MainWindow : Window
2323
{
24+
string path;
2425
public MainWindow()
2526
{
2627
InitializeComponent();
2728
this.WindowState = WindowState.Maximized;
28-
//Loads the Document
29+
//Setting the path based on the framework
2930
#if NETFRAMEWORK
30-
pdfViewer.Load("../../Data/F#.pdf");
31+
path = "../../Data/";
3132
#else
32-
pdfViewer.Load("../../../Data/F#.pdf");
33+
path = "../../../Data/";
3334
#endif
35+
pdfViewer.Load(System.IO.Path.Combine(path, "F#.pdf"));
3436
}
35-
37+
/// <summary>
38+
/// A button click event that creates a stamp from a local image and adds the standard stamp to the toolbar.
39+
/// </summary>
40+
/// <param name="sender">The source of the event.</param>
41+
/// <param name="e">Event data associated with the click event.</param>
3642
private void addStamp_Click(object sender, RoutedEventArgs e)
3743
{
3844
// Clear the existing standard stamps if it is not needed.
3945
pdfViewer.ToolbarSettings.StampAnnotations.Clear();
4046
//Load the custom image from the local disk.
4147
System.Windows.Controls.Image image = new System.Windows.Controls.Image();
42-
#if NETFRAMEWORK
43-
image.Source = new BitmapImage(new Uri(@"../../Data/Adventure_Cycle.jpg", UriKind.RelativeOrAbsolute));
44-
#else
45-
image.Source = new BitmapImage(new Uri(@"../../../Data/Adventure_Cycle.jpg", UriKind.RelativeOrAbsolute));
46-
#endif
48+
image.Source = new BitmapImage(new Uri(System.IO.Path.Combine(path,"Adventure_Cycle.jpg"), UriKind.RelativeOrAbsolute));
4749
//Create a new standard stamp from the image.
4850
PdfStampAnnotation newStandardStamp = new PdfStampAnnotation(image);
4951
//Add the custom stamp in the toolbar.

Annotations/AddStandardStampsinToolBar/Properties/AssemblyInfo.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
// General Information about an assembly is controlled through the following
88
// set of attributes. Change these attribute values to modify the information
99
// associated with an assembly.
10-
[assembly: AssemblyTitle("AddingStandardStampsInToolBar")]
11-
[assembly: AssemblyDescription("")]
12-
[assembly: AssemblyConfiguration("")]
13-
[assembly: AssemblyCompany("")]
14-
[assembly: AssemblyProduct("AddingStandardStampsInToolBar")]
10+
//[assembly: AssemblyTitle("AddingStandardStampsInToolBar")]
11+
//[assembly: AssemblyDescription("")]
12+
//[assembly: AssemblyConfiguration("")]
13+
//[assembly: AssemblyCompany("")]
14+
//[assembly: AssemblyProduct("AddingStandardStampsInToolBar")]
1515
[assembly: AssemblyCopyright("Copyright © 2025")]
1616
[assembly: AssemblyTrademark("")]
1717
[assembly: AssemblyCulture("")]
@@ -48,5 +48,5 @@
4848
// Build Number
4949
// Revision
5050
//
51-
[assembly: AssemblyVersion("1.0.0.0")]
52-
[assembly: AssemblyFileVersion("1.0.0.0")]
51+
//[assembly: AssemblyVersion("1.0.0.0")]
52+
//[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)