├── .gitignore
├── .nuget
├── NuGet.Config
├── NuGet.exe
├── NuGet.targets
└── packages.config
├── BarcodePrinter.sln
├── BarcodePrinter
├── App.config
├── App.xaml
├── App.xaml.cs
├── AppBootstrapper.cs
├── BarcodeLabel.cs
├── BarcodePrinter.csproj
├── BarcodePrinter.nuspec
├── ClassDiagram1.cd
├── Logging
│ ├── DebugLogger.cs
│ └── NLogLogger.cs
├── NLog.config
├── NLog.xsd
├── PhysionBarcodePrinter
│ └── app-1.0.0.0
│ │ ├── BarcodeLib.dll
│ │ ├── BarcodePrinter.exe
│ │ ├── Caliburn.Micro.Platform.dll
│ │ ├── Caliburn.Micro.dll
│ │ ├── Com.SharpZebra.dll
│ │ ├── DeltaCompressionDotNet.MsDelta.dll
│ │ ├── DeltaCompressionDotNet.PatchApi.dll
│ │ ├── DeltaCompressionDotNet.dll
│ │ ├── ICSharpCode.SharpZipLib.dll
│ │ ├── Microsoft.Web.XmlTransform.dll
│ │ ├── Mono.Cecil.Mdb.dll
│ │ ├── Mono.Cecil.Pdb.dll
│ │ ├── Mono.Cecil.Rocks.dll
│ │ ├── Mono.Cecil.dll
│ │ ├── NLog.dll
│ │ ├── Newtonsoft.Json.dll
│ │ ├── NuGet.Core.dll
│ │ ├── QuantityTypes.dll
│ │ ├── Splat.dll
│ │ ├── Squirrel.dll
│ │ └── System.Windows.Interactivity.dll
├── Printing
│ ├── ApplicationPrinter.cs
│ └── PrintCompletion.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ ├── Settings.settings
│ └── app.manifest
├── Resources
│ └── obc_icon.ico
├── ViewModels
│ └── MainViewModel.cs
├── Views
│ ├── MainView.xaml
│ └── MainView.xaml.cs
├── lib
│ └── net45
│ │ ├── BarcodeLib.dll
│ │ └── Com.SharpZebra.dll
├── obc_icon.ico
├── packages.config
├── releasify.ps1
└── test.obc
├── LICENSE
├── README.md
├── SharpZebra README.txt
├── epl2-pm-en.pdf
└── zpl-zbi2-pm-en.pdf
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 | *.publishproj
131 |
132 | # NuGet Packages Directory
133 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
134 | #packages/
135 |
136 | # Windows Azure Build Output
137 | csx
138 | *.build.csdef
139 |
140 | # Windows Store app package directory
141 | AppPackages/
142 |
143 | # Others
144 | sql/
145 | *.Cache
146 | ClientBin/
147 | [Ss]tyle[Cc]op.*
148 | ~$*
149 | *~
150 | *.dbmdl
151 | *.[Pp]ublish.xml
152 | *.pfx
153 | *.publishsettings
154 |
155 | # RIA/Silverlight projects
156 | Generated_Code/
157 |
158 | # Backup & report files from converting an old project file to a newer
159 | # Visual Studio version. Backup files are not needed, because we have git ;-)
160 | _UpgradeReport_Files/
161 | Backup*/
162 | UpgradeLog*.XML
163 | UpgradeLog*.htm
164 |
165 | # SQL Server files
166 | App_Data/*.mdf
167 | App_Data/*.ldf
168 |
169 | #############
170 | ## Windows detritus
171 | #############
172 |
173 | # Windows image file caches
174 | Thumbs.db
175 | ehthumbs.db
176 |
177 | # Folder config file
178 | Desktop.ini
179 |
180 | # Recycle Bin used on file shares
181 | $RECYCLE.BIN/
182 |
183 | # Mac crap
184 | .DS_Store
185 |
186 |
187 | #############
188 | ## Python
189 | #############
190 |
191 | *.py[cod]
192 |
193 | # Packages
194 | *.egg
195 | *.egg-info
196 | dist/
197 | build/
198 | eggs/
199 | parts/
200 | var/
201 | sdist/
202 | develop-eggs/
203 | .installed.cfg
204 |
205 | # Installer logs
206 | pip-log.txt
207 |
208 | # Unit test / coverage reports
209 | .coverage
210 | .tox
211 |
212 | #Translations
213 | *.mo
214 |
215 | #Mr Developer
216 | .mr.developer.cfg
217 |
218 |
219 | ############
220 | ## PROJECT
221 | ############
222 | packages/
223 | *.nupkg
224 | BarcodePrinter/Releases
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/.nuget/NuGet.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildProjectDirectory)\..\
5 |
6 |
7 | false
8 |
9 |
10 | false
11 |
12 |
13 | true
14 |
15 |
16 | false
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
31 |
32 |
33 |
34 |
35 | $(SolutionDir).nuget
36 |
37 |
38 |
39 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config
40 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config
41 |
42 |
43 |
44 | $(MSBuildProjectDirectory)\packages.config
45 | $(PackagesProjectConfig)
46 |
47 |
48 |
49 |
50 | $(NuGetToolsPath)\NuGet.exe
51 | @(PackageSource)
52 |
53 | "$(NuGetExePath)"
54 | mono --runtime=v4.0.30319 "$(NuGetExePath)"
55 |
56 | $(TargetDir.Trim('\\'))
57 |
58 | -RequireConsent
59 | -NonInteractive
60 |
61 | "$(SolutionDir) "
62 | "$(SolutionDir)"
63 |
64 |
65 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
66 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
67 |
68 |
69 |
70 | RestorePackages;
71 | $(BuildDependsOn);
72 |
73 |
74 |
75 |
76 | $(BuildDependsOn);
77 | BuildPackage;
78 |
79 |
80 |
81 |
82 |
83 |
84 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
99 |
100 |
103 |
104 |
105 |
106 |
108 |
109 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/.nuget/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BarcodePrinter.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{634564DF-5D3B-4212-836D-E081E0FE8791}"
7 | ProjectSection(SolutionItems) = preProject
8 | .nuget\NuGet.Config = .nuget\NuGet.Config
9 | .nuget\NuGet.exe = .nuget\NuGet.exe
10 | .nuget\NuGet.targets = .nuget\NuGet.targets
11 | EndProjectSection
12 | EndProject
13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarcodePrinter", "BarcodePrinter\BarcodePrinter.csproj", "{20C1DE39-CB12-4028-810D-2B24E367F96D}"
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug Webpage|Any CPU = Debug Webpage|Any CPU
18 | Debug|Any CPU = Debug|Any CPU
19 | Release|Any CPU = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Debug Webpage|Any CPU.ActiveCfg = Debug|Any CPU
23 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Debug Webpage|Any CPU.Build.0 = Debug|Any CPU
24 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {20C1DE39-CB12-4028-810D-2B24E367F96D}.Release|Any CPU.Build.0 = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/BarcodePrinter/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/BarcodePrinter/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/BarcodePrinter/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace BarcodePrinter
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BarcodePrinter/AppBootstrapper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Caliburn.Micro;
5 | using BarcodePrinter.ViewModels;
6 | using System.Windows;
7 | using System.ComponentModel.Composition;
8 | using System.ComponentModel.Composition.Hosting;
9 | using System.ComponentModel.Composition.Primitives;
10 | using BarcodePrinter.Printing;
11 | using System.IO;
12 | using Newtonsoft.Json.Linq;
13 | using Newtonsoft.Json;
14 | using BarcodePrinter.Logging;
15 | using System.Threading.Tasks;
16 | using System.Windows.Threading;
17 |
18 | namespace BarcodePrinter
19 | {
20 | sealed class AppBootstrapper : BootstrapperBase, IHandle
21 | {
22 | private WindowManager _windowManager;
23 | private readonly IEventAggregator _eventAggregator = new EventAggregator();
24 |
25 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
26 | public AppBootstrapper()
27 | {
28 | StartRuntime();
29 | #if (DEBUG==false)
30 | LogManager.GetLog = type => (ILog)new NLogLogger(type);
31 | #endif
32 | }
33 |
34 |
35 | protected override void OnStartup(object sender, StartupEventArgs e)
36 | {
37 | ILog logger = LogManager.GetLog(GetType());
38 |
39 |
40 | logger.Info("Starting barcode printer");
41 |
42 | if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null)
43 | {
44 | string[] activationData = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData;
45 | if (activationData != null && activationData.Length >= 1)
46 | {
47 | var path = new Uri(activationData[0]).LocalPath;
48 | OpenLabel(path);
49 | }
50 | else
51 | {
52 | #if DEBUG
53 |
54 |
55 | OpenLabel("../../test.obc");
56 | #else
57 | logger.Info("No input file found. Exiting.");
58 | Application.Current.Shutdown();
59 | #endif
60 | }
61 | }
62 | else
63 | {
64 | #if DEBUG
65 |
66 |
67 | OpenLabel("../../test.obc");
68 | #else
69 | logger.Info("No input file found. Exiting.");
70 | Application.Current.Shutdown();
71 | #endif
72 | }
73 |
74 | }
75 |
76 |
77 | private void OpenLabel(string path)
78 | {
79 | ILog logger = LogManager.GetLog(GetType());
80 |
81 | logger.Info("Opening {0} for printing", path);
82 | try
83 | {
84 | using (StreamReader reader = File.OpenText(path))
85 | {
86 | dynamic o = JToken.ReadFrom(new JsonTextReader(reader))[0];
87 |
88 | ShowPrintLabel((string)o.label, (string)o.epl);
89 | }
90 | }
91 | catch (FileNotFoundException ex)
92 | {
93 | logger.Error(ex);
94 | MessageBox.Show("Unable to open label file:\n" + ex.Message, "Oops!", MessageBoxButton.OK, MessageBoxImage.Error);
95 | Application.Current.Shutdown();
96 | }
97 |
98 | }
99 |
100 | private void ShowPrintLabel(string label, string epl)
101 | {
102 | _eventAggregator.Subscribe(this);
103 | _windowManager.ShowWindow(new MainViewModel(new BarcodeLabel(label, epl), new ApplicationPrinter(), _eventAggregator));
104 | }
105 |
106 |
107 | protected override void Configure()
108 | {
109 | _windowManager = new WindowManager();
110 | }
111 |
112 | public void Handle(PrintCompletion message)
113 | {
114 | Application.Current.Shutdown();
115 | }
116 | }
117 | }
--------------------------------------------------------------------------------
/BarcodePrinter/BarcodeLabel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.ComponentModel.Composition;
7 | using System.Windows.Media;
8 | using System.Windows.Media.Imaging;
9 | using System.Drawing;
10 | using System.Runtime.InteropServices;
11 | using System.ComponentModel;
12 | using System.Windows;
13 | using Com.SharpZebra.Printing;
14 | using Com.SharpZebra.Commands;
15 | using Com.SharpZebra;
16 | using Com.SharpZebra.Commands.Codes;
17 |
18 |
19 | namespace BarcodePrinter
20 | {
21 |
22 | [Export(typeof(BarcodeLabel))]
23 | class BarcodeLabel
24 | {
25 |
26 | public BarcodeLabel(String contents, String epl)
27 | {
28 | this.Contents = contents;
29 | this.Epl = epl;
30 | this.Width = 1.75 * QuantityTypes.Length.Inch;
31 | this.Height = 0.6 * QuantityTypes.Length.Inch;
32 | }
33 |
34 | public string Contents { get; private set; }
35 | public string Epl { get; private set; }
36 |
37 | public string BarcodeType { get; private set; }
38 |
39 | public QuantityTypes.IQuantity Width { get; private set; }
40 | public QuantityTypes.IQuantity Height { get; private set; }
41 |
42 | public ImageSource Image
43 | {
44 | get
45 | {
46 | return RenderImage().ToBitmapSource();
47 | }
48 | }
49 |
50 | public Image RenderImage()
51 | {
52 | BarcodeLib.Barcode b = new BarcodeLib.Barcode(Contents, BarcodeLib.TYPE.CODE128);
53 | b.ForeColor = System.Drawing.Color.Black;
54 | b.BackColor = System.Drawing.Color.White;
55 | b.Width = (int)Math.Ceiling(Width.ConvertTo(QuantityTypes.Length.Inch) * 96); //96 DPI
56 | b.Height = (int)Math.Ceiling(Height.ConvertTo(QuantityTypes.Length.Inch) * 96); //96 DPI
57 | b.IncludeLabel = true;
58 |
59 |
60 | return b.Encode(BarcodeLib.TYPE.CODE128, Contents);
61 | }
62 |
63 | public static int dpi = 203;
64 |
65 | public void Print(string printer)
66 | {
67 | new ZebraPrinter(printer).Print(String.Format(this.Epl, Contents));
68 | }
69 | }
70 |
71 |
72 | public static class BitmapSourceHelper
73 | {
74 | ///
75 | /// FxCop requires all Marshalled functions to be in a class called NativeMethods.
76 | ///
77 | internal static class NativeMethods
78 | {
79 | [DllImport("gdi32.dll")]
80 | [return: MarshalAs(UnmanagedType.Bool)]
81 | internal static extern bool DeleteObject(IntPtr hObject);
82 | }
83 |
84 | ///
85 | /// Converts a into a WPF .
86 | ///
87 | /// The source image.
88 | /// A BitmapSource
89 | public static BitmapSource ToBitmapSource(this System.Drawing.Image source)
90 | {
91 | System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(source);
92 |
93 | var bitSrc = bitmap.ToBitmapSource();
94 |
95 | bitmap.Dispose();
96 | bitmap = null;
97 |
98 | return bitSrc;
99 | }
100 |
101 | ///
102 | /// Converts a into a WPF .
103 | ///
104 | /// Uses GDI to do the conversion. Hence the call to the marshalled DeleteObject.
105 | ///
106 | /// The source bitmap.
107 | /// A BitmapSource
108 | public static BitmapSource ToBitmapSource(this System.Drawing.Bitmap source)
109 | {
110 | BitmapSource bitSrc = null;
111 |
112 | var hBitmap = source.GetHbitmap();
113 |
114 | try
115 | {
116 | bitSrc = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
117 | hBitmap,
118 | IntPtr.Zero,
119 | Int32Rect.Empty,
120 | BitmapSizeOptions.FromEmptyOptions());
121 | }
122 | catch (Win32Exception)
123 | {
124 | bitSrc = null;
125 | }
126 | finally
127 | {
128 | NativeMethods.DeleteObject(hBitmap);
129 | }
130 |
131 | return bitSrc;
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/BarcodePrinter/BarcodePrinter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {20C1DE39-CB12-4028-810D-2B24E367F96D}
8 | WinExe
9 | Properties
10 | BarcodePrinter
11 | BarcodePrinter
12 | v4.5.1
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | true
17 | ..\
18 | true
19 | true
20 |
21 | true
22 | publish\
23 | true
24 | Web
25 | true
26 | Background
27 | 1
28 | Days
29 | true
30 | false
31 | true
32 | https://s3.amazonaws.com/clickonce-ovation-io/BarcodePrinter/
33 | https://ovation.io/
34 | BarcodePrinter
35 | Physion LLC
36 | Ovation Complete
37 | true
38 | publish.htm
39 | false
40 | 1
41 | 1.2.0.%2a
42 | false
43 | true
44 | true
45 |
46 |
47 | AnyCPU
48 | true
49 | full
50 | false
51 | bin\Debug\
52 | DEBUG;TRACE
53 | prompt
54 | 4
55 | true
56 | true
57 |
58 |
59 | AnyCPU
60 | pdbonly
61 | true
62 | bin\Release\
63 | TRACE
64 | prompt
65 | 4
66 | true
67 | true
68 |
69 |
70 | Internet
71 |
72 |
73 | true
74 |
75 |
76 | Properties\app.manifest
77 |
78 |
79 | true
80 |
81 |
82 | false
83 |
84 |
85 | E73E95D3B67C68C254D8CA87447038E65F2EA255
86 |
87 |
88 |
89 |
90 |
91 |
92 | http://timestamp.digicert.com
93 |
94 |
95 | BarcodePrinter_TemporaryKey.pfx
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | lib\net45\BarcodeLib.dll
104 |
105 |
106 | ..\packages\Caliburn.Micro.Core.2.0.1\lib\net45\Caliburn.Micro.dll
107 |
108 |
109 | ..\packages\Caliburn.Micro.2.0.1\lib\net45\Caliburn.Micro.Platform.dll
110 |
111 |
112 | False
113 | lib\net45\Com.SharpZebra.dll
114 |
115 |
116 | ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll
117 |
118 |
119 | ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll
120 |
121 |
122 | ..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll
123 |
124 |
125 | ..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll
126 |
127 |
128 | ..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.dll
129 |
130 |
131 | ..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Mdb.dll
132 |
133 |
134 | ..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Pdb.dll
135 |
136 |
137 | ..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Rocks.dll
138 |
139 |
140 | False
141 | ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll
142 |
143 |
144 | ..\packages\NLog.3.2.0.0\lib\net45\NLog.dll
145 |
146 |
147 | ..\packages\NLog.Targets.Syslog.2.1.5491.28378\lib\net35\NLog.Targets.Syslog.dll
148 |
149 |
150 | False
151 | ..\packages\NuGet.Core.2.8.3\lib\net40-Client\NuGet.Core.dll
152 |
153 |
154 | False
155 | ..\packages\QuantityTypes.1.0.40\lib\portable-net40+net45+sl5+windowsphone8+windows8\QuantityTypes.dll
156 |
157 |
158 | ..\packages\Splat.1.5.1\lib\Net45\Splat.dll
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | ..\packages\Caliburn.Micro.2.0.1\lib\net45\System.Windows.Interactivity.dll
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | 4.0
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 | MSBuild:Compile
183 | Designer
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | App.xaml
194 | Code
195 |
196 |
197 | MainView.xaml
198 |
199 |
200 |
201 |
202 | Code
203 |
204 |
205 | True
206 | True
207 | Resources.resx
208 |
209 |
210 | True
211 | Settings.settings
212 | True
213 |
214 |
215 |
216 | PreserveNewest
217 |
218 |
219 | ResXFileCodeGenerator
220 | Resources.Designer.cs
221 |
222 |
223 | Always
224 |
225 |
226 |
227 |
228 | Designer
229 |
230 |
231 |
232 |
233 | SettingsSingleFileGenerator
234 | Settings.Designer.cs
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 | False
244 | Microsoft .NET Framework 4.5.1 %28x86 and x64%29
245 | true
246 |
247 |
248 | False
249 | .NET Framework 3.5 SP1 Client Profile
250 | false
251 |
252 |
253 | False
254 | .NET Framework 3.5 SP1
255 | false
256 |
257 |
258 |
259 |
260 | Designer
261 | MSBuild:Compile
262 |
263 |
264 |
265 |
266 | False
267 | Ovation barcode description file
268 | C789339B-D0D4-4866-8088-40184F54432C
269 | obc_icon.ico
270 |
271 |
272 |
273 |
274 |
275 |
276 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
291 |
--------------------------------------------------------------------------------
/BarcodePrinter/BarcodePrinter.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PhysionBarcodePrinter
5 | $version$
6 | $title$
7 | $author$
8 | $author$
9 | http://opensource.org/licenses/Apache-2.0
10 | https://github.com/physion/BarcodePrinter
11 |
12 | false
13 | $description$
14 | Initial release supporting Code128 labels.
15 | Copyright 2015
16 | Zebra Barcode
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/BarcodePrinter/ClassDiagram1.cd:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/BarcodePrinter/Logging/DebugLogger.cs:
--------------------------------------------------------------------------------
1 | using Caliburn.Micro;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace BarcodePrinter.Logging
10 | {
11 | class DebugLogger : ILog
12 | {
13 | #region Fields
14 | private readonly Type _type;
15 | #endregion
16 |
17 | #region Constructors
18 | public DebugLogger(Type type)
19 | {
20 | _type = type;
21 | }
22 | #endregion
23 |
24 | #region Helper Methods
25 | private string CreateLogMessage(string format, params object[] args)
26 | {
27 | return string.Format("[{0}] {1}",
28 | DateTime.Now.ToString(),
29 | string.Format(format, args));
30 | }
31 | #endregion
32 |
33 | #region ILog Members
34 | public void Error(Exception exception)
35 | {
36 | Debug.WriteLine(CreateLogMessage(exception.ToString()), "ERROR");
37 | }
38 | public void Info(string format, params object[] args)
39 | {
40 | Debug.WriteLine(CreateLogMessage(format, args), "INFO");
41 | }
42 | public void Warn(string format, params object[] args)
43 | {
44 | Debug.WriteLine(CreateLogMessage(format, args), "WARN");
45 | }
46 | #endregion
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/BarcodePrinter/Logging/NLogLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace BarcodePrinter.Logging
8 | {
9 | class NLogLogger : Caliburn.Micro.ILog
10 | {
11 | #region Fields
12 | private readonly NLog.Logger _innerLogger;
13 | #endregion
14 |
15 | #region Constructors
16 | public NLogLogger(Type type)
17 | {
18 | _innerLogger = NLog.LogManager.GetLogger(type.Name);
19 | }
20 | #endregion
21 |
22 | #region ILog Members
23 | public void Error(Exception exception)
24 | {
25 | _innerLogger.ErrorException(exception.Message, exception);
26 | }
27 | public void Info(string format, params object[] args)
28 | {
29 | _innerLogger.Info(format, args);
30 | }
31 | public void Warn(string format, params object[] args)
32 | {
33 | _innerLogger.Warn(format, args);
34 | }
35 | #endregion
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/BarcodePrinter/NLog.config:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/BarcodeLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/BarcodeLib.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/BarcodePrinter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/BarcodePrinter.exe
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Caliburn.Micro.Platform.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Caliburn.Micro.Platform.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Caliburn.Micro.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Caliburn.Micro.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Com.SharpZebra.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Com.SharpZebra.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.MsDelta.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.MsDelta.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.PatchApi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.PatchApi.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/DeltaCompressionDotNet.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/ICSharpCode.SharpZipLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/ICSharpCode.SharpZipLib.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Microsoft.Web.XmlTransform.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Microsoft.Web.XmlTransform.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Mdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Mdb.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Pdb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Pdb.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Rocks.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.Rocks.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Mono.Cecil.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/NLog.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/NLog.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/NuGet.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/NuGet.Core.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/QuantityTypes.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/QuantityTypes.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Splat.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Splat.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Squirrel.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/Squirrel.dll
--------------------------------------------------------------------------------
/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/System.Windows.Interactivity.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/PhysionBarcodePrinter/app-1.0.0.0/System.Windows.Interactivity.dll
--------------------------------------------------------------------------------
/BarcodePrinter/Printing/ApplicationPrinter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing.Printing;
4 | using System.Linq;
5 | using System.Management;
6 | using Caliburn.Micro;
7 |
8 | namespace BarcodePrinter.Printing
9 | {
10 | public class ApplicationPrinter
11 | {
12 | ILog logger = LogManager.GetLog(typeof(ApplicationPrinter));
13 |
14 | public IList InstalledPrinters
15 | {
16 | get
17 | {
18 | if (PrinterSettings.InstalledPrinters.Count == 0)
19 | {
20 | logger.Info("InstalledPrinters list is empty. Trying via System.Management");
21 |
22 | var query = new ObjectQuery("SELECT * FROM Win32_Printer");
23 | var searcher = new ManagementObjectSearcher(query);
24 |
25 | List result = new List();
26 | foreach (ManagementObject mo in searcher.Get())
27 | {
28 | result.Add((string)mo["Name"]);
29 | }
30 |
31 | result.Sort(StringComparer.Ordinal);
32 |
33 | return result;
34 |
35 | }
36 |
37 |
38 | return ToSortedStringArray(PrinterSettings.InstalledPrinters);
39 | }
40 | }
41 |
42 | public IList InstalledZebraPrinters
43 | {
44 | get
45 | {
46 | return InstalledPrinters.Where(IsZebraPrinter).ToList();
47 | }
48 | }
49 |
50 | public string DefaultZebraPrinter
51 | {
52 | get { return InstalledZebraPrinters.FirstOrDefault(); }
53 | }
54 |
55 | private static bool IsZebraPrinter(string printer)
56 | {
57 | return !string.IsNullOrEmpty(printer)
58 | && (printer.ToUpper().Contains("ZEBRA") || printer.ToUpper().Contains("ZDESIGNER"));
59 | }
60 |
61 | private IList ToSortedStringArray(PrinterSettings.StringCollection printers)
62 | {
63 | List stringList = new List();
64 | foreach (string printer in printers)
65 | {
66 | stringList.Add(printer);
67 | }
68 | stringList.Sort(StringComparer.Ordinal);
69 | return stringList;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/BarcodePrinter/Printing/PrintCompletion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Caliburn.Micro;
7 |
8 | namespace BarcodePrinter.Printing
9 | {
10 | class PrintCompletion
11 | {
12 | public IScreen Screen { get; private set; }
13 |
14 | public PrintCompletion(IScreen sender)
15 | {
16 | Screen = sender;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("Physion.BarcodePrinter")]
11 | [assembly: AssemblyDescription("Barcode printer for Zebra thermal printers")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Physion LLC")]
14 | [assembly: AssemblyProduct("BarcodePrinter")]
15 | [assembly: AssemblyCopyright("Copyright © 2015")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.2.0.1")]
55 | [assembly: AssemblyFileVersion("1.2.0.1")]
56 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace BarcodePrinter.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BarcodePrinter.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace BarcodePrinter.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string DefaultPrinterName {
30 | get {
31 | return ((string)(this["DefaultPrinterName"]));
32 | }
33 | set {
34 | this["DefaultPrinterName"] = value;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/BarcodePrinter/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
54 |
--------------------------------------------------------------------------------
/BarcodePrinter/Resources/obc_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/Resources/obc_icon.ico
--------------------------------------------------------------------------------
/BarcodePrinter/ViewModels/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.ComponentModel.Composition;
7 | using System.Net;
8 | using System.Threading;
9 | using BarcodePrinter.Printing;
10 | using System.Windows.Media;
11 | using System.Windows;
12 | using Caliburn.Micro;
13 | using NLog;
14 | using LogManager = Caliburn.Micro.LogManager;
15 |
16 | namespace BarcodePrinter.ViewModels
17 | {
18 | [Export(typeof(MainViewModel))]
19 | class MainViewModel : Screen
20 | {
21 | private const string WindowTitleDefault = "Ovation Barcode";
22 |
23 | private string _windowTitle = WindowTitleDefault;
24 | private IEventAggregator eventAggregator;
25 |
26 | [ImportingConstructor]
27 | public MainViewModel(BarcodeLabel label, ApplicationPrinter printer, IEventAggregator eventAggregator)
28 | {
29 | this.Label = label;
30 | this.AppPrinter = printer;
31 | string printerName;
32 | if (BarcodePrinter.Properties.Settings.Default.DefaultPrinterName == null || BarcodePrinter.Properties.Settings.Default.DefaultPrinterName.Length == 0)
33 | {
34 | printerName = printer.DefaultZebraPrinter;
35 | } else {
36 | printerName = BarcodePrinter.Properties.Settings.Default.DefaultPrinterName;
37 | }
38 | this.SelectedPrinter = printerName;
39 | this.eventAggregator = eventAggregator;
40 | logger = LogManager.GetLog(GetType());
41 |
42 | }
43 |
44 |
45 | public BarcodeLabel Label { get; private set; }
46 |
47 | private string _selectedPrinter;
48 |
49 | public string SelectedPrinter
50 | {
51 | get { return _selectedPrinter; }
52 | set
53 | {
54 | _selectedPrinter = value;
55 | BarcodePrinter.Properties.Settings.Default.DefaultPrinterName = _selectedPrinter;
56 | BarcodePrinter.Properties.Settings.Default.Save();
57 | NotifyOfPropertyChange(() => SelectedPrinter);
58 | NotifyOfPropertyChange(() => CanPrint);
59 | }
60 | }
61 |
62 | private ApplicationPrinter AppPrinter { get; set; }
63 | public IList AvailablePrinters
64 | {
65 | get { return AppPrinter.InstalledPrinters; }
66 | }
67 |
68 | int _printProgress = 0;
69 | private ILog logger;
70 |
71 | public int Progress
72 | {
73 | get
74 | {
75 | return _printProgress;
76 | }
77 |
78 | set
79 | {
80 | _printProgress = value;
81 | NotifyOfPropertyChange(() => Progress);
82 | }
83 | }
84 |
85 |
86 |
87 | public string WindowTitle
88 | {
89 | get { return _windowTitle; }
90 | set
91 | {
92 | _windowTitle = value;
93 | NotifyOfPropertyChange(() => WindowTitle);
94 | }
95 | }
96 |
97 | public ImageSource LabelImage
98 | {
99 | get
100 | {
101 | return Label.Image;
102 | }
103 | }
104 |
105 | public void Print()
106 | {
107 | try
108 | {
109 | //await Task.Run(() => Label.Print(SelectedPrinter));
110 | Label.Print(SelectedPrinter);
111 |
112 | eventAggregator.PublishOnUIThread(new PrintCompletion(this));
113 |
114 | }
115 | catch (Exception e)
116 | {
117 | logger.Error(e);
118 | MessageBox.Show("Unable to print label:\n" + e.Message, "Oops!", MessageBoxButton.OK, MessageBoxImage.Error);
119 | }
120 | }
121 |
122 | public bool CanPrint
123 | {
124 | get { return SelectedPrinter != null; }
125 | }
126 |
127 |
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/BarcodePrinter/Views/MainView.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
25 |
26 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/BarcodePrinter/Views/MainView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace BarcodePrinter.Views
16 | {
17 | ///
18 | /// Interaction logic for MainView.xaml
19 | ///
20 | public partial class MainView : Window
21 | {
22 | public MainView()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/BarcodePrinter/lib/net45/BarcodeLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/lib/net45/BarcodeLib.dll
--------------------------------------------------------------------------------
/BarcodePrinter/lib/net45/Com.SharpZebra.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/lib/net45/Com.SharpZebra.dll
--------------------------------------------------------------------------------
/BarcodePrinter/obc_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/BarcodePrinter/obc_icon.ico
--------------------------------------------------------------------------------
/BarcodePrinter/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/BarcodePrinter/releasify.ps1:
--------------------------------------------------------------------------------
1 | # Build release
2 | Squirrel --releasify=bin\debug\PhysionBarcodePrinter.1.1.0.1.nupkg --packagesDir=../packages --signWithParams="/t http://timestamp.digicert.com /a"
3 |
--------------------------------------------------------------------------------
/BarcodePrinter/test.obc:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "label" : "4B5AB3C3396A",
4 | "epl" : "\nN\nq347\nD10\nb30,33,A,\"{0}\"\nB150,20,0,1,1,2,80,B,\"{0}\"\nP1\n"
5 | }
6 | ]
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BarcodePrinter
2 | Windows barcode printing helper for Zebra printers
3 |
4 | ## Deployment
5 |
6 | 1. Merge to master branch
7 | 2. Tag release (e.g. `v1.1.0.9`)
8 | 3. BarcodePrinter => Publish
9 | 4. Upload `BarcodePrinter\publish` to S3
10 |
--------------------------------------------------------------------------------
/SharpZebra README.txt:
--------------------------------------------------------------------------------
1 | SharpZebra
2 |
3 |
4 | What is it?
5 | -----------
6 | SharpZebra is a .Net wrapper for the EPL2 and ZPL languages for communicating with the Zebra range of printers.
7 |
8 |
9 | Why SharpZebra?
10 | ---------------
11 | Use these APIs if you don't want to deal with the low level language that is EPL2 or ZPL, yet still make use of the Zebra printers.
12 |
13 |
14 | File Contents
15 | -------------
16 | README.txt (this file)
17 | bin/SharpZebra.dll (the library)
18 |
19 |
20 | Release Notes
21 | -------------
22 | Version 0.91
23 | - Added ZPL support
24 | - Added support for network and USB printers (includes USB registry parse fix from submitter nimeshdhruve)
25 | - Fixed codepage problem - fixes issues uploading binary files to printers
26 | - Ability to upload custom fonts added
27 | - Added ability to upload text in any font supported by the hosting computer
28 |
29 | Version 0.90
30 | - Make IRawPrinter public
31 | - Introduce IRawPrinter so people aren't tied to the implementation of Zebra Printer
32 | - Remove duplicate namespaces
33 | - Initial Version
34 |
35 |
36 | The Latest Version
37 | ------------------
38 |
39 | Details of the latest version can be found on the SharpZebra project web site http://www.codeplex.com/sharpzebra
40 |
41 |
42 | License (based on the MIT License)
43 | ----------------------------------
44 | Copyright (c) 2007 Patrick Kua
45 |
46 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
47 |
48 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
49 |
50 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/epl2-pm-en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/epl2-pm-en.pdf
--------------------------------------------------------------------------------
/zpl-zbi2-pm-en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/physion/BarcodePrinter/9182f683704ecaa4ebfa1796bad96da722dc3dcd/zpl-zbi2-pm-en.pdf
--------------------------------------------------------------------------------