tigerchen 6 years ago
commit 391f268a80
  1. 4
      03_RoyalGallery/DotNet-PrinterController/.gitignore
  2. 25
      03_RoyalGallery/DotNet-PrinterController/PrinterController.sln
  3. 14
      03_RoyalGallery/DotNet-PrinterController/PrinterController/App.config
  4. 102
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Form1.Designer.cs
  5. 406
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Form1.cs
  6. 67909
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Form1.resx
  7. 116
      03_RoyalGallery/DotNet-PrinterController/PrinterController/PrinterController.csproj
  8. 22
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Program.cs
  9. 36
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Properties/AssemblyInfo.cs
  10. 71
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Properties/Resources.Designer.cs
  11. 117
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Properties/Resources.resx
  12. 30
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Properties/Settings.Designer.cs
  13. 7
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Properties/Settings.settings
  14. 97
      03_RoyalGallery/DotNet-PrinterController/PrinterController/Ultracombos.printerGrpc.cs
  15. 276
      03_RoyalGallery/DotNet-PrinterController/PrinterController/UltracombosPrinter.cs
  16. BIN
      03_RoyalGallery/DotNet-PrinterController/PrinterController/bin/Bob-from-the-minions-movie.jpg
  17. BIN
      03_RoyalGallery/DotNet-PrinterController/PrinterController/bin/Lady_Godiva_5x7.png
  18. 9
      03_RoyalGallery/DotNet-PrinterController/PrinterController/packages.config
  19. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/.signature.p7s
  20. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/Google.Protobuf.3.6.1.nupkg
  21. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/lib/net45/Google.Protobuf.dll
  22. 7548
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/lib/net45/Google.Protobuf.xml
  23. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/lib/netstandard1.0/Google.Protobuf.dll
  24. 7548
      03_RoyalGallery/DotNet-PrinterController/packages/Google.Protobuf.3.6.1/lib/netstandard1.0/Google.Protobuf.xml
  25. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.1.21.0/.signature.p7s
  26. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.1.21.0/Grpc.1.21.0.nupkg
  27. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/.signature.p7s
  28. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/Grpc.Core.1.21.0.nupkg
  29. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/net45/Grpc.Core.dll
  30. 2524
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/net45/Grpc.Core.xml
  31. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/netstandard1.5/Grpc.Core.dll
  32. 2524
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/netstandard1.5/Grpc.Core.xml
  33. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/netstandard2.0/Grpc.Core.dll
  34. 2524
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/lib/netstandard2.0/Grpc.Core.xml
  35. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/native/android/arm64-v8a/libgrpc_csharp_ext.so
  36. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/native/android/armeabi-v7a/libgrpc_csharp_ext.so
  37. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/native/android/x86/libgrpc_csharp_ext.so
  38. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/native/ios/universal/libgrpc.a
  39. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/native/ios/universal/libgrpc_csharp_ext.a
  40. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/linux/native/libgrpc_csharp_ext.x64.so
  41. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/linux/native/libgrpc_csharp_ext.x86.so
  42. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/osx/native/libgrpc_csharp_ext.x64.dylib
  43. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/osx/native/libgrpc_csharp_ext.x86.dylib
  44. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/win/native/grpc_csharp_ext.x64.dll
  45. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.1.21.0/runtimes/win/native/grpc_csharp_ext.x86.dll
  46. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/.signature.p7s
  47. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/Grpc.Core.Api.1.21.0.nupkg
  48. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/net45/Grpc.Core.Api.dll
  49. 1953
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/net45/Grpc.Core.Api.xml
  50. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/netstandard1.5/Grpc.Core.Api.dll
  51. 1953
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/netstandard1.5/Grpc.Core.Api.xml
  52. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/netstandard2.0/Grpc.Core.Api.dll
  53. 1965
      03_RoyalGallery/DotNet-PrinterController/packages/Grpc.Core.Api.1.21.0/lib/netstandard2.0/Grpc.Core.Api.xml
  54. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/.signature.p7s
  55. 20
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/LICENSE.md
  56. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/Newtonsoft.Json.11.0.2.nupkg
  57. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net20/Newtonsoft.Json.dll
  58. 9967
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net20/Newtonsoft.Json.xml
  59. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net35/Newtonsoft.Json.dll
  60. 9096
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net35/Newtonsoft.Json.xml
  61. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net40/Newtonsoft.Json.dll
  62. 9296
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net40/Newtonsoft.Json.xml
  63. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net45/Newtonsoft.Json.dll
  64. 10912
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/net45/Newtonsoft.Json.xml
  65. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard1.0/Newtonsoft.Json.dll
  66. 10619
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard1.0/Newtonsoft.Json.xml
  67. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard1.3/Newtonsoft.Json.dll
  68. 10722
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard1.3/Newtonsoft.Json.xml
  69. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard2.0/Newtonsoft.Json.dll
  70. 10887
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/netstandard2.0/Newtonsoft.Json.xml
  71. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll
  72. 8707
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml
  73. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll
  74. 10619
      03_RoyalGallery/DotNet-PrinterController/packages/Newtonsoft.Json.11.0.2/lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml
  75. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/.signature.p7s
  76. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/System.Interactive.Async.3.2.0.nupkg
  77. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/net45/System.Interactive.Async.dll
  78. 84
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/net45/System.Interactive.Async.xml
  79. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/net46/System.Interactive.Async.dll
  80. 84
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/net46/System.Interactive.Async.xml
  81. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard1.0/System.Interactive.Async.dll
  82. 84
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard1.0/System.Interactive.Async.xml
  83. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard1.3/System.Interactive.Async.dll
  84. 84
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard1.3/System.Interactive.Async.xml
  85. BIN
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard2.0/System.Interactive.Async.dll
  86. 84
      03_RoyalGallery/DotNet-PrinterController/packages/System.Interactive.Async.3.2.0/lib/netstandard2.0/System.Interactive.Async.xml
  87. 2
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Navigator_PC/19050-03_RoyalGallery_Navigator_PC/Assets/PaintingNavigator.unity
  88. 7
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Navigator_PC/19050-03_RoyalGallery_Navigator_PC/Assets/PaintingNavigator/Script/ArtworkGenerator.cs
  89. 27
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Navigator_PC/19050-03_RoyalGallery_Navigator_PC/Assets/PaintingNavigator/Script/PrintingGenerator.cs
  90. 44
      03_RoyalGallery/Unity-19050-03_RoyalGallery_Navigator_PC/19050-03_RoyalGallery_Navigator_PC/Assets/PaintingNavigator/Script/ResourceServer.cs
  91. 98
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/Main-1-Intro.unity
  92. BIN
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/StreamingAssets/Video/Background.mp4
  93. BIN
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/StreamingAssets/Video/focus_intro.mp4
  94. 7
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/StreamingAssets/Video/focus_intro.mp4.meta
  95. BIN
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/StreamingAssets/Video/focus_loop.mp4
  96. 7
      03_RoyalGallery/Unity-19050-03_RoyalGallery_iPad/19050-03_RoyalGallery_iPad/Assets/StreamingAssets/Video/focus_loop.mp4.meta
  97. 5
      _Setup/[UnityBuild] 03_RoyalGallery_LH.bat
  98. 26
      _Setup/conf/UnityBuild-03_RoyalGallery_LH.conf

@ -0,0 +1,4 @@
Debug
Release
/.vs/

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrinterController", "PrinterController\PrinterController.csproj", "{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD895EE7-DBD5-4DF2-B2D1-1CB4416489A8}
EndGlobalSection
EndGlobal

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Interactive.Async" publicKeyToken="94bc3704cddfc263" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -0,0 +1,102 @@
namespace TestPrinter
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.printer_preview = new System.Windows.Forms.Button();
this.printer_setup = new System.Windows.Forms.Button();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout();
//
// printer_preview
//
this.printer_preview.Location = new System.Drawing.Point(461, 442);
this.printer_preview.Name = "printer_preview";
this.printer_preview.Size = new System.Drawing.Size(166, 34);
this.printer_preview.TabIndex = 1;
this.printer_preview.Text = "預覽列印";
this.printer_preview.UseVisualStyleBackColor = true;
this.printer_preview.Click += new System.EventHandler(this.printer_preview_Click);
//
// printer_setup
//
this.printer_setup.Location = new System.Drawing.Point(180, 442);
this.printer_setup.Name = "printer_setup";
this.printer_setup.Size = new System.Drawing.Size(135, 34);
this.printer_setup.TabIndex = 2;
this.printer_setup.Text = "印表機設定";
this.printer_setup.UseVisualStyleBackColor = true;
this.printer_setup.Click += new System.EventHandler(this.printer_setup_Click);
//
// pictureBox
//
this.pictureBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.pictureBox.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox.Image")));
this.pictureBox.Location = new System.Drawing.Point(0, 1);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(799, 484);
this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox.TabIndex = 3;
this.pictureBox.TabStop = false;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(461, 415);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(166, 21);
this.comboBox1.TabIndex = 4;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.printer_scale_mode_Changed);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 488);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.printer_setup);
this.Controls.Add(this.printer_preview);
this.Controls.Add(this.pictureBox);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button printer_preview;
private System.Windows.Forms.Button printer_setup;
private System.Windows.Forms.PictureBox pictureBox;
private System.Windows.Forms.ComboBox comboBox1;
}
}

@ -0,0 +1,406 @@
using Grpc.Core;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using UltraCombos.Utility;
using grpc = global::Grpc.Core;
using Newtonsoft.Json;
namespace TestPrinter
{
public partial class Form1 : Form
{
private PrintDocument pdDocument = new PrintDocument();
private PageSetupDialog setupDlg = new PageSetupDialog();
private PrintPreviewDialog previewDlg = new PrintPreviewDialog();
private PageSettings pageSettings;
private bool is_preview = false;
private bool is_pressed_ok = false;
private bool is_loaded_ok = false;
private string path = @"printer_settings.json";
//private System.Drawing.Image testing_image;
PrinterService service;
public enum ScaleMode
{
ScaleFit = 0,
ScaleFill,
ScaleFullFit,
ScaleFullFill,
ScaleFullPageFit,
ScaleFullPageFill,
MaxNum,
}
public Form1()
{
InitializeComponent();
for (int i = 0; i < (int)ScaleMode.MaxNum; ++i)
{
comboBox1.Items.Add((ScaleMode)(i));
}
comboBox1.SelectedIndex = 0;
pdDocument.DefaultPageSettings.Landscape = true;
pdDocument.PrinterSettings.DefaultPageSettings.Landscape = true;
pdDocument.PrintPage += new PrintPageEventHandler(OnPrintPage);
PaperSize papersize = null;
foreach (PaperSize size in pdDocument.PrinterSettings.PaperSizes)
{
if(size.PaperName.StartsWith("A4"))
{
papersize = size;
break;
}
}
if (papersize != null)
{
pdDocument.DefaultPageSettings.PaperSize = papersize;
pdDocument.PrinterSettings.DefaultPageSettings.PaperSize = papersize;
var hard_area = pdDocument.PrinterSettings.DefaultPageSettings.PrintableArea;
Margins margins = new Margins(
(int)Math.Round(hard_area.X),
(int)Math.Round(hard_area.Y),
(int)Math.Round(papersize.Width - (hard_area.X + hard_area.Width)),
(int)Math.Round(papersize.Height - (hard_area.Y + hard_area.Height))
);
pdDocument.DefaultPageSettings.Margins = margins;
}
pageSettings = pdDocument.DefaultPageSettings.Clone() as PageSettings;
PrintSettings s = Utils.LoadPrintSettings(path, pageSettings);
is_loaded_ok = s != null;
if (is_loaded_ok)
{
pdDocument.DefaultPageSettings = pageSettings.Clone() as PageSettings;
comboBox1.SelectedItem = s.ScaleMode;
}
var options = new List<Grpc.Core.ChannelOption> { new Grpc.Core.ChannelOption(ChannelOptions.MaxReceiveMessageLength, int.MaxValue) };
var services = new ServerServiceDefinition[] { Printer.BindService(new PrinterImpl(print_impl)) };
service = new PrinterService();
service.StartServer(options, services, 54578);
}
RectangleF getPrintableArea()
{
var rect = pdDocument.DefaultPageSettings.PrintableArea;
if (pdDocument.DefaultPageSettings.Landscape)
{
float tmp = rect.X;
rect.X = rect.Y;
rect.Y = tmp;
tmp = rect.Width;
rect.Width = rect.Height;
rect.Height = tmp;
}
return rect;
}
RectangleF getFullPageArea()
{
var rect = new RectangleF(0, 0, pdDocument.DefaultPageSettings.PaperSize.Width, pdDocument.DefaultPageSettings.PaperSize.Height);
if (pdDocument.DefaultPageSettings.Landscape)
{
float tmp = rect.Width;
rect.Width = rect.Height;
rect.Height = tmp;
}
return rect;
}
private void OnPrintPage(object sender, PrintPageEventArgs e)
{
Console.WriteLine("OnPrintPage()");
float dpiX = (float)e.PageSettings.PrinterSettings.DefaultPageSettings.PrinterResolution.X;
float dpiY = (float)e.PageSettings.PrinterSettings.DefaultPageSettings.PrinterResolution.Y;
e.Graphics.PageUnit = GraphicsUnit.Pixel;
e.Graphics.ScaleTransform(dpiX*0.01f, dpiY*0.01f);
var printable_area = getPrintableArea();
RectangleF hot_area;
switch (comboBox1.SelectedItem)
{
default:
case ScaleMode.ScaleFit:
case ScaleMode.ScaleFill:
hot_area = RectangleF.Intersect(e.MarginBounds, printable_area);
break;
case ScaleMode.ScaleFullFit:
case ScaleMode.ScaleFullFill:
hot_area = printable_area;
break;
case ScaleMode.ScaleFullPageFit:
case ScaleMode.ScaleFullPageFill:
hot_area = getFullPageArea();
break;
}
{
var state = e.Graphics.Save();
e.Graphics.TranslateTransform(hot_area.X, hot_area.Y);
if(is_preview == false)
e.Graphics.TranslateTransform(-printable_area.X, -printable_area.Y);
var image = pictureBox.Image;
float area_aspect = hot_area.Width / hot_area.Height;
float img_aspect = (float)image.Width / image.Height;
float x, y, w, h;
switch (comboBox1.SelectedItem)
{
default:
case ScaleMode.ScaleFit:
case ScaleMode.ScaleFullFit:
case ScaleMode.ScaleFullPageFit:
if (img_aspect > area_aspect)
{
w = hot_area.Width;
h = w / img_aspect;
}
else
{
h = hot_area.Height;
w = h * img_aspect;
}
break;
case ScaleMode.ScaleFill:
case ScaleMode.ScaleFullFill:
case ScaleMode.ScaleFullPageFill:
w = hot_area.Width;
h = hot_area.Height;
break;
}
x = 0.5f * (hot_area.Width - w);
y = 0.5f * (hot_area.Height - h);
Rectangle myRect = new Rectangle(
(int)Math.Round(x),
(int)Math.Round(y),
(int)Math.Round(w),
(int)Math.Round(h)
);
e.Graphics.DrawImage(
image,
myRect,
0,
0,
image.Width,
image.Height,
GraphicsUnit.Pixel);
e.Graphics.Restore(state);
}
if (is_preview)
{
e.Graphics.DrawRectangle(new Pen(Color.Red, 1), printable_area.X, printable_area.Y, printable_area.Width, printable_area.Height);
e.Graphics.DrawRectangle(new Pen(Color.Blue, 1), e.MarginBounds);
is_preview = false;
}
}
private void printer_preview_Click(object sender, EventArgs e)
{
previewDlg.Document = pdDocument;
is_preview = true;
previewDlg.ShowDialog();
}
private void printer_setup_Click(object sender, EventArgs e)
{
setupDlg.Document = pdDocument;
setupDlg.AllowMargins = true;
setupDlg.AllowOrientation = true;
setupDlg.AllowPaper = true;
setupDlg.AllowPrinter = true;
setupDlg.PageSettings = pageSettings;
PrintSettings s = Utils.LoadPrintSettings(path, setupDlg.PageSettings);
if (is_pressed_ok || s != null)
{
Utils.FixMarginsBug(setupDlg.PageSettings);
}
DialogResult ret = setupDlg.ShowDialog();
is_pressed_ok = ret == DialogResult.OK;
if (is_pressed_ok)
{
pdDocument.DefaultPageSettings = setupDlg.PageSettings.Clone() as PageSettings;
Utils.SavePrintSettings(path, setupDlg.PageSettings, (ScaleMode)comboBox1.SelectedItem);
}
}
private void print_impl(UltraCombos.Utility.Image request)
{
var data = request.Content.ToByteArray();
MemoryStream ms = new MemoryStream(data);
pictureBox.Image = System.Drawing.Image.FromStream(ms);
pdDocument.Print();
Console.WriteLine("print_impl");
}
private void printer_scale_mode_Changed(object sender, EventArgs e)
{
if (pageSettings == null)
{
return;
}
Utils.SavePrintSettings(path, pageSettings, (ScaleMode)comboBox1.SelectedItem);
}
}
sealed class Utils
{
//WTF Bug...
static public void FixMarginsBug(PageSettings s)
{
double left = s.Margins.Left;
double right = s.Margins.Right;
double top = s.Margins.Top;
double Bottom = s.Margins.Bottom;
s.Margins.Left = Convert.ToInt32(left * 2.54);
s.Margins.Right = Convert.ToInt32(right * 2.54);
s.Margins.Top = Convert.ToInt32(top * 2.54);
s.Margins.Bottom = Convert.ToInt32(Bottom * 2.54);
}
static public PrintSettings LoadPrintSettings(string path, PageSettings s)
{
if (!File.Exists(path))
{
return null;
}
string json = File.ReadAllText(path);
var obj = JsonConvert.DeserializeObject<PrintSettings>(json);
if (obj == null)
{
return null;
}
obj.To(s);
return obj;
}
static public bool SavePrintSettings(string path, PageSettings s, Form1.ScaleMode scale_mode)
{
var obj = new PrintSettings();
obj.From(s);
obj.ScaleMode = scale_mode;
string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
File.WriteAllText(path, json);
return true;
}
}
public class PrintSettings
{
public PaperSize PaperSize;
public PaperSource PaperSource;
public Margins Margins;
public bool Landscape;
public Form1.ScaleMode ScaleMode;
public void To(PageSettings s)
{
s.PaperSize = PaperSize;
s.PaperSource = PaperSource;
s.Margins = Margins;
s.Landscape = Landscape;
}
public void From(PageSettings s)
{
PaperSize = s.PaperSize;
PaperSource = s.PaperSource;
Margins = s.Margins;
Landscape = s.Landscape;
}
}
public class PrinterService
{
//public int port = 54578;
protected Server server;
public void StartServer(IEnumerable<ChannelOption> options, IEnumerable<ServerServiceDefinition> services, int port)
{
try
{
server = new Server(options)
{
Ports = { new ServerPort("0.0.0.0", port, ServerCredentials.Insecure) }
};
foreach (var def in services)
server.Services.Add(def);
server.Start();
//Log("Start Grpc Server");
Console.WriteLine("Start Grpc Server");
}
catch (System.Exception e)
{
//Log(e.Message, LogType.Error);
Console.WriteLine(e.Message);
}
}
~PrinterService()
{
Shutdown();
}
protected void Shutdown()
{
if (server != null)
{
try
{
server.ShutdownAsync().Wait();
server = null;
}
catch { }
}
}
/*
protected void Log(object msg, LogType type = LogType.Log)
{
Debug.unityLogger.Log(type, $"<b>[Grpc Server]</b> {msg}");
}
*/
}
public class PrinterImpl : Printer.PrinterBase
{
public delegate void PrintDelegate(UltraCombos.Utility.Image request);
public event PrintDelegate onPrint;
public PrinterImpl(PrintDelegate func)
{
onPrint += func;
}
public override Task<Empty> Print(UltraCombos.Utility.Image request, grpc::ServerCallContext context)
{
//throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
onPrint.Invoke(request);
return Task.FromResult(new Empty());
}
}
}

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A8C4999E-BE74-44FF-8320-C95E2EB43C6F}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Girl's_Room_Printer</RootNamespace>
<AssemblyName>PrinterController</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<HintPath>..\packages\Grpc.Core.1.21.0\lib\net45\Grpc.Core.dll</HintPath>
</Reference>
<Reference Include="Grpc.Core.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<HintPath>..\packages\Grpc.Core.Api.1.21.0\lib\net45\Grpc.Core.Api.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Ultracombos.printerGrpc.cs" />
<Compile Include="UltracombosPrinter.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="NewFolder1\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Grpc.Core.1.21.0\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.21.0\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.21.0\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.21.0\build\net45\Grpc.Core.targets'))" />
</Target>
</Project>

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TestPrinter
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestPrinter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestPrinter")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a8c4999e-be74-44ff-8320-c95e2eb43c6f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TestPrinter.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestPrinter.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TestPrinter.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

@ -0,0 +1,97 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ultracombos.printer.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace UltraCombos.Utility {
public static partial class Printer
{
static readonly string __ServiceName = "UltraCombos.Utility.Printer";
static readonly grpc::Marshaller<global::UltraCombos.Utility.Image> __Marshaller_UltraCombos_Utility_Image = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Utility.Image.Parser.ParseFrom);
static readonly grpc::Marshaller<global::UltraCombos.Utility.Empty> __Marshaller_UltraCombos_Utility_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Utility.Empty.Parser.ParseFrom);
static readonly grpc::Method<global::UltraCombos.Utility.Image, global::UltraCombos.Utility.Empty> __Method_Print = new grpc::Method<global::UltraCombos.Utility.Image, global::UltraCombos.Utility.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Print",
__Marshaller_UltraCombos_Utility_Image,
__Marshaller_UltraCombos_Utility_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::UltraCombos.Utility.UltracombosPrinterReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of Printer</summary>
public abstract partial class PrinterBase
{
public virtual global::System.Threading.Tasks.Task<global::UltraCombos.Utility.Empty> Print(global::UltraCombos.Utility.Image request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Printer</summary>
public partial class PrinterClient : grpc::ClientBase<PrinterClient>
{
/// <summary>Creates a new client for Printer</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public PrinterClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Printer that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public PrinterClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected PrinterClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected PrinterClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::UltraCombos.Utility.Empty Print(global::UltraCombos.Utility.Image request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Print(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::UltraCombos.Utility.Empty Print(global::UltraCombos.Utility.Image request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Print, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Utility.Empty> PrintAsync(global::UltraCombos.Utility.Image request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return PrintAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Utility.Empty> PrintAsync(global::UltraCombos.Utility.Image request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Print, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override PrinterClient NewInstance(ClientBaseConfiguration configuration)
{
return new PrinterClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(PrinterBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Print, serviceImpl.Print).Build();
}
}
}
#endregion

@ -0,0 +1,276 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ultracombos.printer.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace UltraCombos.Utility {
/// <summary>Holder for reflection information generated from ultracombos.printer.proto</summary>
public static partial class UltracombosPrinterReflection {
#region Descriptor
/// <summary>File descriptor for ultracombos.printer.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static UltracombosPrinterReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Chl1bHRyYWNvbWJvcy5wcmludGVyLnByb3RvEhNVbHRyYUNvbWJvcy5VdGls",
"aXR5IgcKBUVtcHR5IhgKBUltYWdlEg8KB2NvbnRlbnQYASABKAwyTAoHUHJp",
"bnRlchJBCgVQcmludBIaLlVsdHJhQ29tYm9zLlV0aWxpdHkuSW1hZ2UaGi5V",
"bHRyYUNvbWJvcy5VdGlsaXR5LkVtcHR5IgBiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Utility.Empty), global::UltraCombos.Utility.Empty.Parser, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Utility.Image), global::UltraCombos.Utility.Image.Parser, new[]{ "Content" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class Empty : pb::IMessage<Empty> {
private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Empty> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Utility.UltracombosPrinterReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty(Empty other) : this() {
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Empty Clone() {
return new Empty(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Empty);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Empty other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Empty other) {
if (other == null) {
return;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
}
}
}
}
public sealed partial class Image : pb::IMessage<Image> {
private static readonly pb::MessageParser<Image> _parser = new pb::MessageParser<Image>(() => new Image());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Image> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Utility.UltracombosPrinterReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image(Image other) : this() {
content_ = other.content_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Image Clone() {
return new Image(this);
}
/// <summary>Field number for the "content" field.</summary>
public const int ContentFieldNumber = 1;
private pb::ByteString content_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString Content {
get { return content_; }
set {
content_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Image);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Image other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Content != other.Content) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Content.Length != 0) hash ^= Content.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Content.Length != 0) {
output.WriteRawTag(10);
output.WriteBytes(Content);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Content.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(Content);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Image other) {
if (other == null) {
return;
}
if (other.Content.Length != 0) {
Content = other.Content;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Content = input.ReadBytes();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.6.1" targetFramework="net461" />
<package id="Grpc" version="1.21.0" targetFramework="net461" />
<package id="Grpc.Core" version="1.21.0" targetFramework="net461" />
<package id="Grpc.Core.Api" version="1.21.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
<package id="System.Interactive.Async" version="3.2.0" targetFramework="net461" />
</packages>

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Interactive.Async</name>
</assembly>
<members>
<member name="T:System.Linq.Internal.Grouping`2">
Adapted from System.Linq.Grouping from .NET Framework
Source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64
</member>
<member name="T:System.Linq.IIListProvider`1">
<summary>
An iterator that can produce an array or <see cref="T:System.Collections.Generic.List`1"/> through an optimized path.
</summary>
</member>
<member name="M:System.Linq.IIListProvider`1.ToArrayAsync(System.Threading.CancellationToken)">
<summary>
Produce an array of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The array.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.ToListAsync(System.Threading.CancellationToken)">
<summary>
Produce a <see cref="T:System.Collections.Generic.List`1"/> of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The <see cref="T:System.Collections.Generic.List`1"/>.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.GetCountAsync(System.Boolean,System.Threading.CancellationToken)">
<summary>
Returns the count of elements in the sequence.
</summary>
<param name="onlyIfCheap">If true then the count should only be calculated if doing
so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
<param name="cancellationToken"></param>
<returns>The number of elements.</returns>
</member>
<member name="M:System.Collections.Generic.AsyncEnumerator.MoveNext``1(System.Collections.Generic.IAsyncEnumerator{``0})">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerable`1">
<summary>
Asynchronous version of the IEnumerable&lt;T&gt; interface, allowing elements of the
enumerable sequence to be retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerable`1.GetEnumerator">
<summary>
Gets an asynchronous enumerator over the sequence.
</summary>
<returns>Enumerator for asynchronous enumeration over the sequence.</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerator`1">
<summary>
Asynchronous version of the IEnumerator&lt;T&gt; interface, allowing elements to be
retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="P:System.Collections.Generic.IAsyncEnumerator`1.Current">
<summary>
Gets the current element in the iteration.
</summary>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerator`1.MoveNext(System.Threading.CancellationToken)">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
</members>
</doc>

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Interactive.Async</name>
</assembly>
<members>
<member name="T:System.Linq.Internal.Grouping`2">
Adapted from System.Linq.Grouping from .NET Framework
Source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64
</member>
<member name="T:System.Linq.IIListProvider`1">
<summary>
An iterator that can produce an array or <see cref="T:System.Collections.Generic.List`1"/> through an optimized path.
</summary>
</member>
<member name="M:System.Linq.IIListProvider`1.ToArrayAsync(System.Threading.CancellationToken)">
<summary>
Produce an array of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The array.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.ToListAsync(System.Threading.CancellationToken)">
<summary>
Produce a <see cref="T:System.Collections.Generic.List`1"/> of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The <see cref="T:System.Collections.Generic.List`1"/>.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.GetCountAsync(System.Boolean,System.Threading.CancellationToken)">
<summary>
Returns the count of elements in the sequence.
</summary>
<param name="onlyIfCheap">If true then the count should only be calculated if doing
so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
<param name="cancellationToken"></param>
<returns>The number of elements.</returns>
</member>
<member name="M:System.Collections.Generic.AsyncEnumerator.MoveNext``1(System.Collections.Generic.IAsyncEnumerator{``0})">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerable`1">
<summary>
Asynchronous version of the IEnumerable&lt;T&gt; interface, allowing elements of the
enumerable sequence to be retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerable`1.GetEnumerator">
<summary>
Gets an asynchronous enumerator over the sequence.
</summary>
<returns>Enumerator for asynchronous enumeration over the sequence.</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerator`1">
<summary>
Asynchronous version of the IEnumerator&lt;T&gt; interface, allowing elements to be
retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="P:System.Collections.Generic.IAsyncEnumerator`1.Current">
<summary>
Gets the current element in the iteration.
</summary>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerator`1.MoveNext(System.Threading.CancellationToken)">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
</members>
</doc>

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Interactive.Async</name>
</assembly>
<members>
<member name="T:System.Linq.Internal.Grouping`2">
Adapted from System.Linq.Grouping from .NET Framework
Source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64
</member>
<member name="T:System.Linq.IIListProvider`1">
<summary>
An iterator that can produce an array or <see cref="T:System.Collections.Generic.List`1"/> through an optimized path.
</summary>
</member>
<member name="M:System.Linq.IIListProvider`1.ToArrayAsync(System.Threading.CancellationToken)">
<summary>
Produce an array of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The array.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.ToListAsync(System.Threading.CancellationToken)">
<summary>
Produce a <see cref="T:System.Collections.Generic.List`1"/> of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The <see cref="T:System.Collections.Generic.List`1"/>.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.GetCountAsync(System.Boolean,System.Threading.CancellationToken)">
<summary>
Returns the count of elements in the sequence.
</summary>
<param name="onlyIfCheap">If true then the count should only be calculated if doing
so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
<param name="cancellationToken"></param>
<returns>The number of elements.</returns>
</member>
<member name="M:System.Collections.Generic.AsyncEnumerator.MoveNext``1(System.Collections.Generic.IAsyncEnumerator{``0})">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerable`1">
<summary>
Asynchronous version of the IEnumerable&lt;T&gt; interface, allowing elements of the
enumerable sequence to be retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerable`1.GetEnumerator">
<summary>
Gets an asynchronous enumerator over the sequence.
</summary>
<returns>Enumerator for asynchronous enumeration over the sequence.</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerator`1">
<summary>
Asynchronous version of the IEnumerator&lt;T&gt; interface, allowing elements to be
retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="P:System.Collections.Generic.IAsyncEnumerator`1.Current">
<summary>
Gets the current element in the iteration.
</summary>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerator`1.MoveNext(System.Threading.CancellationToken)">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
</members>
</doc>

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Interactive.Async</name>
</assembly>
<members>
<member name="T:System.Linq.Internal.Grouping`2">
Adapted from System.Linq.Grouping from .NET Framework
Source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64
</member>
<member name="T:System.Linq.IIListProvider`1">
<summary>
An iterator that can produce an array or <see cref="T:System.Collections.Generic.List`1"/> through an optimized path.
</summary>
</member>
<member name="M:System.Linq.IIListProvider`1.ToArrayAsync(System.Threading.CancellationToken)">
<summary>
Produce an array of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The array.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.ToListAsync(System.Threading.CancellationToken)">
<summary>
Produce a <see cref="T:System.Collections.Generic.List`1"/> of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The <see cref="T:System.Collections.Generic.List`1"/>.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.GetCountAsync(System.Boolean,System.Threading.CancellationToken)">
<summary>
Returns the count of elements in the sequence.
</summary>
<param name="onlyIfCheap">If true then the count should only be calculated if doing
so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
<param name="cancellationToken"></param>
<returns>The number of elements.</returns>
</member>
<member name="M:System.Collections.Generic.AsyncEnumerator.MoveNext``1(System.Collections.Generic.IAsyncEnumerator{``0})">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerable`1">
<summary>
Asynchronous version of the IEnumerable&lt;T&gt; interface, allowing elements of the
enumerable sequence to be retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerable`1.GetEnumerator">
<summary>
Gets an asynchronous enumerator over the sequence.
</summary>
<returns>Enumerator for asynchronous enumeration over the sequence.</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerator`1">
<summary>
Asynchronous version of the IEnumerator&lt;T&gt; interface, allowing elements to be
retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="P:System.Collections.Generic.IAsyncEnumerator`1.Current">
<summary>
Gets the current element in the iteration.
</summary>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerator`1.MoveNext(System.Threading.CancellationToken)">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
</members>
</doc>

@ -0,0 +1,84 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>System.Interactive.Async</name>
</assembly>
<members>
<member name="T:System.Linq.Internal.Grouping`2">
Adapted from System.Linq.Grouping from .NET Framework
Source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64
</member>
<member name="T:System.Linq.IIListProvider`1">
<summary>
An iterator that can produce an array or <see cref="T:System.Collections.Generic.List`1"/> through an optimized path.
</summary>
</member>
<member name="M:System.Linq.IIListProvider`1.ToArrayAsync(System.Threading.CancellationToken)">
<summary>
Produce an array of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The array.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.ToListAsync(System.Threading.CancellationToken)">
<summary>
Produce a <see cref="T:System.Collections.Generic.List`1"/> of the sequence through an optimized path.
</summary>
<param name="cancellationToken"></param>
<returns>The <see cref="T:System.Collections.Generic.List`1"/>.</returns>
</member>
<member name="M:System.Linq.IIListProvider`1.GetCountAsync(System.Boolean,System.Threading.CancellationToken)">
<summary>
Returns the count of elements in the sequence.
</summary>
<param name="onlyIfCheap">If true then the count should only be calculated if doing
so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
<param name="cancellationToken"></param>
<returns>The number of elements.</returns>
</member>
<member name="M:System.Collections.Generic.AsyncEnumerator.MoveNext``1(System.Collections.Generic.IAsyncEnumerator{``0})">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerable`1">
<summary>
Asynchronous version of the IEnumerable&lt;T&gt; interface, allowing elements of the
enumerable sequence to be retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerable`1.GetEnumerator">
<summary>
Gets an asynchronous enumerator over the sequence.
</summary>
<returns>Enumerator for asynchronous enumeration over the sequence.</returns>
</member>
<member name="T:System.Collections.Generic.IAsyncEnumerator`1">
<summary>
Asynchronous version of the IEnumerator&lt;T&gt; interface, allowing elements to be
retrieved asynchronously.
</summary>
<typeparam name="T">Element type.</typeparam>
</member>
<member name="P:System.Collections.Generic.IAsyncEnumerator`1.Current">
<summary>
Gets the current element in the iteration.
</summary>
</member>
<member name="M:System.Collections.Generic.IAsyncEnumerator`1.MoveNext(System.Threading.CancellationToken)">
<summary>
Advances the enumerator to the next element in the sequence, returning the result asynchronously.
</summary>
<param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
<returns>
Task containing the result of the operation: true if the enumerator was successfully advanced
to the next element; false if the enumerator has passed the end of the sequence.
</returns>
</member>
</members>
</doc>

@ -7309,7 +7309,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8229dcd11ab919c4a95848ed679cccaf, type: 3}
m_Name:
m_EditorClassIdentifier:
host: 192.168.234.87
host: 127.0.0.1
port: 54578
onStateChanged:
m_PersistentCalls:

@ -27,12 +27,12 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
}
public void OnPaintingReceived(Artwork artwork, string paintingPath, string signaturePath)
public void OnPaintingReceived(Artwork artwork, string paintingPath, string signaturePath, string messagePath)
{
StartCoroutine(Generate(artwork, paintingPath, signaturePath));
StartCoroutine(Generate(artwork, paintingPath, signaturePath, messagePath));
}
IEnumerator Generate(Artwork artwork, string paintingPath, string signaturePath)
IEnumerator Generate(Artwork artwork, string paintingPath, string signaturePath, string messagePath)
{
paint.UpdateArtwork(artwork);
yield return new WaitForEndOfFrame();
@ -42,6 +42,7 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
serial = artwork.serial,
painting_path = paintingPath,
signature_path = signaturePath,
message_path = messagePath
};
int width = cam.targetTexture.width;

@ -27,7 +27,7 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
public TextureEvent onPrint = new TextureEvent();
[System.Serializable]
public class LuggageEvent : UnityEvent<string, Texture2D, Texture2D> { }
public class LuggageEvent : UnityEvent<string, Texture2D, Texture2D, Color32> { }
public LuggageEvent onPrintLuggage = new LuggageEvent();
private void Start()
@ -66,7 +66,18 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
if (painting_texture && signature_texture)
{
painting.UpdateArtwork(work.serial, painting_texture, signature_texture);
Color32 color;
try
{
string message = File.ReadAllText(work.message_path);
color = Frozen.RoyalGallery.Utils.HexToColor(message);
}
catch (FileNotFoundException e)
{
color = new Color32(255, 255, 255, 255);
}
painting.UpdateArtwork(work.serial, painting_texture, signature_texture, color);
yield return new WaitForEndOfFrame();
@ -78,7 +89,7 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
// should be replaced with printing process
onPrint.Invoke(printing_texture);
onPrintLuggage.Invoke(work.serial, painting_texture, signature_texture);
onPrintLuggage.Invoke(work.serial, painting_texture, signature_texture, color);
/*
string path = $"../../Build_GirlsRoomNav/Print/{work.serial}.jpg";
System.IO.File.WriteAllBytes(path, printing_texture.EncodeToJPG());
@ -89,11 +100,11 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
coroutine = null;
}
public void PrintLuggage(string serial, Texture2D painting, Texture2D signature)
public void PrintLuggage(string serial, Texture2D painting, Texture2D signature, Color32 color)
{
if (luggage_coroutine == null)
{
luggage_coroutine = StartCoroutine(PrintingLuggage(serial, painting, signature));
luggage_coroutine = StartCoroutine(PrintingLuggage(serial, painting, signature, color));
}
}
@ -101,13 +112,13 @@ namespace UltraCombos.Minions.GirlsRoom.Nav
{
if (luggage_coroutine == null)
{
luggage_coroutine = StartCoroutine(PrintingLuggage(work.serial, work.painting, work.signature));
luggage_coroutine = StartCoroutine(PrintingLuggage(work.serial, work.painting, work.signature, work.color));
}
}
IEnumerator PrintingLuggage(string serial, Texture2D painting_texture, Texture2D signature_texture)
IEnumerator PrintingLuggage(string serial, Texture2D painting_texture, Texture2D signature_texture, Color32 color)
{
painting.UpdateArtwork(serial, painting_texture, signature_texture);
painting.UpdateArtwork(serial, painting_texture, signature_texture, color);
yield return new WaitForEndOfFrame();

@ -31,12 +31,13 @@ namespace UltraCombos.Frozen.RoyalGallery
PrintingGenerator luggagePrinter;
[System.Serializable]
public class PaintingEvent : UnityEvent<Artwork, string, string> { }
public class PaintingEvent : UnityEvent<Artwork, string, string, string> { }
[Space(10)]
public PaintingEvent onPaintingReceived = new PaintingEvent();
const string painting_filename = "painting.png";
const string signature_filename = "signature.png";
const string message_filename = "message.dat";
Artwork last_data = null;
Coroutine fetching = null;
@ -111,12 +112,37 @@ namespace UltraCombos.Frozen.RoyalGallery
string signature_path = $"{folder.FullName}/{signature_filename}";
yield return Utility.Network.LoadTexture(signature_path, value => signature = value);
if (painting && signature)
string message_path = $"{folder.FullName}/{message_filename}";
do
{
var artwork = new Artwork() { serial = folder.Name, painting = painting, signature = signature };
if (!painting)
{
break;
}
if (!signature)
{
break;
}
Color32 color;
try
{
string message = File.ReadAllText(message_path);
color = Utils.HexToColor(message);
}
catch (FileNotFoundException e)
{
color = new Color32(255, 255, 255, 255);
}
var artwork = new Artwork() { serial = folder.Name, painting = painting, signature = signature, color = color };
last_data = artwork;
onPaintingReceived.Invoke(artwork, painting_path, signature_path);
}
onPaintingReceived.Invoke(artwork, painting_path, signature_path, message_path);
} while (false);
yield return null;
}
@ -150,8 +176,9 @@ namespace UltraCombos.Frozen.RoyalGallery
var folder = Directory.CreateDirectory($"{store_dir.FullName}/{last_data.serial}");
string painting_path = $"{folder.FullName}/{painting_filename}";
string signature_path = $"{folder.FullName}/{signature_filename}";
string message_path = $"{folder.FullName}/{message_filename}";
onPaintingReceived.Invoke(last_data, painting_path, signature_path);
onPaintingReceived.Invoke(last_data, painting_path, signature_path, message_path);
}
}
@ -188,13 +215,14 @@ namespace UltraCombos.Frozen.RoyalGallery
File.WriteAllBytes(painting_path, data.Content.ToByteArray());
string signature_path = $"{folder.FullName}/{signature_filename}";
File.WriteAllBytes(signature_path, data.Signature.ToByteArray());
string message_path = $"{folder.FullName}/{message_filename}";
File.WriteAllText(message_path, data.Message);
last_data = artwork;
if (luggagePrinter.isActiveAndEnabled)
{
luggagePrinter.PrintLuggage(artwork);
}
onPaintingReceived.Invoke(artwork, painting_path, signature_path);
onPaintingReceived.Invoke(artwork, painting_path, signature_path, message_path);
Log($"Painting {data.Id} is loaded. ({painting.width} x {painting.height})");
}
}

@ -404,6 +404,85 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &420544968
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 420544969}
- component: {fileID: 420544971}
- component: {fileID: 420544970}
m_Layer: 5
m_Name: COLORING-ARENDELLE
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &420544969
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420544968}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 746257130}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 493.19995, y: 1118.2}
m_SizeDelta: {x: -1193.5, y: -2304.9}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &420544970
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420544968}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 85207f0ae8c12c0419cfd50880ee22dd, type: 3}
m_FontSize: 154
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 1
m_MaxSize: 205
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 0.87
m_Text: 'COLORING
ARENDELLE'
--- !u!222 &420544971
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420544968}
m_CullTransparentMesh: 0
--- !u!1 &474003861
GameObject:
m_ObjectHideFlags: 0
@ -436,7 +515,7 @@ RectTransform:
- {fileID: 694176951}
- {fileID: 379599992}
m_Father: {fileID: 746257130}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -1001,6 +1080,7 @@ RectTransform:
m_Children:
- {fileID: 1237191813}
- {fileID: 1103808276}
- {fileID: 420544969}
- {fileID: 944149852}
- {fileID: 1282467667}
- {fileID: 938718533}
@ -1154,7 +1234,7 @@ RectTransform:
- {fileID: 2138975510}
- {fileID: 725555480}
m_Father: {fileID: 746257130}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -1316,7 +1396,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 746257130}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -1679,7 +1759,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1103808276
RectTransform:
m_ObjectHideFlags: 0
@ -1696,7 +1776,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -2452, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1103808277
@ -1885,7 +1965,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1237191813
RectTransform:
m_ObjectHideFlags: 0
@ -2078,7 +2158,7 @@ RectTransform:
- {fileID: 1264086241}
- {fileID: 779108441}
m_Father: {fileID: 746257130}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
@ -2768,7 +2848,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 746257130}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -3177,7 +3257,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 746257130}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 529309d8d547f95468255f4355a8c92e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: cedf87803f660d84790f2709db76cff1
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,5 @@
@ECHO OFF
TASKKILL /IM "Resilio Sync.exe" /F
COPY /Y conf\UnityBuild-03_RoyalGallery_LH.conf "%USERPROFILE%\AppData\Roaming\Resilio Sync\sync.conf"
START "" "%USERPROFILE%\AppData\Roaming\Resilio Sync\Resilio Sync.exe"
REM PAUSE

@ -0,0 +1,26 @@
//samples can be found here: http://internal.getsync.com/support/sample.conf
{
"shared_folders" :
[
{
"secret" : "A7LKLFO7YRW533ECKCUMQVA2NY55VKLE5",
"dir" : "W:/UC/Project-19050-Frozen2/_Deploy_PC/03_RoyalGallery/UnityBuild-19050-03_RoyalGallery_Portrait", // * required field
"use_relay_server" : true, // use relay server when direct connection fails
"use_tracker" : true,
"search_lan" : true,
"use_sync_trash" : false, // enable SyncArchive to store files deleted on remote devices
"overwrite_changes" : true, // restore modified files to original version, ONLY for Read-Only folders
"selective_sync" : false//, // add folder in selective sync mode
},
{
"secret" : "ASBQMD3K6XSHHCVNELTTYKRKHJBDBS3CS",
"dir" : "W:/UC/Project-19050-Frozen2/_Deploy_PC/03_RoyalGallery/UnityBuild-19050-03_RoyalGallery_Navigator", // * required field
"use_relay_server" : true, // use relay server when direct connection fails
"use_tracker" : true,
"search_lan" : true,
"use_sync_trash" : false, // enable SyncArchive to store files deleted on remote devices
"overwrite_changes" : true, // restore modified files to original version, ONLY for Read-Only folders
"selective_sync" : false//, // add folder in selective sync mode
}
]
}
Loading…
Cancel
Save