Skip to content

Commit

Permalink
- Assembled all the required properties and events.
Browse files Browse the repository at this point in the history
- Added a Test project - all tests successful.
  • Loading branch information
Willy-Kimura committed Feb 5, 2019
1 parent 3383c92 commit 445e116
Show file tree
Hide file tree
Showing 21 changed files with 2,488 additions and 15 deletions.
6 changes: 6 additions & 0 deletions SharpCliboard.Tests/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>

<supportedRuntime version="v2.0.50727"/></startup>
</configuration>
441 changes: 441 additions & 0 deletions SharpCliboard.Tests/MainForm.Designer.cs

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions SharpCliboard.Tests/MainForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;

using WK.Libraries.SharpClipboardNS;

namespace SharpClipboardPreview.Tests
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();

chkMonitorClipboard.Checked = sharpClipboard1.MonitorClipboard;
chkObserveTexts.Checked = sharpClipboard1.ObservableFormats.Texts;
chkObserveFiles.Checked = sharpClipboard1.ObservableFormats.Files;
chkObserveImages.Checked = sharpClipboard1.ObservableFormats.Images;
}

private void sharpClipboard1_MonitorClipboardChanged(object sender, EventArgs e)
{
chkMonitorClipboard.Checked = sharpClipboard1.MonitorClipboard;
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
sharpClipboard1.MonitorClipboard = chkMonitorClipboard.Checked;
}

private void chkObserveTexts_CheckedChanged(object sender, EventArgs e)
{
sharpClipboard1.ObservableFormats.Texts = chkObserveTexts.Checked;
}

private void chkObserveImages_CheckedChanged(object sender, EventArgs e)
{
sharpClipboard1.ObservableFormats.Images = chkObserveImages.Checked;
}

private void chkObserveFiles_CheckedChanged(object sender, EventArgs e)
{
sharpClipboard1.ObservableFormats.Files = chkObserveFiles.Checked;
}

private void sharpClipboard1_ClipboardChanged(object sender, SharpClipboard.ClipboardChangedEventArgs e)
{
if (e.ContentType == WK.Libraries.SharpClipboardNS.SharpClipboard.ContentTypes.Text)
{
txtCopiedTexts.Text = sharpClipboard1.ClipboardText;

// Alternatively, you can use:
// ---------------------------
// txtCopiedTexts.Text = (string)e.Content;
}
else if (e.ContentType == SharpClipboard.ContentTypes.Image)
{
pbCopiedImage.Image = sharpClipboard1.ClipboardImage;

// Alternatively, you can use:
// ---------------------------
// pbCopiedImage.Image = (Image)e.Content;
}
else if (e.ContentType == SharpClipboard.ContentTypes.Files)
{
List<string> files = new List<string>();

foreach (string file in sharpClipboard1.ClipboardFiles)
{
files.Add(Path.GetFileName(file));
}

lstCopiedFiles.Items.Clear();
lstCopiedFiles.Items.AddRange(files.ToArray());

// Alternatively, you can use:
// ---------------------------
// lstCopiedFiles.Items.AddRange(((List<string>)e.Content).ToArray()));
}
}
}
}
369 changes: 369 additions & 0 deletions SharpCliboard.Tests/MainForm.resx

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions SharpCliboard.Tests/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Windows.Forms;

namespace SharpClipboardPreview.Tests
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
36 changes: 36 additions & 0 deletions SharpCliboard.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("SharpClipboard Tests")]
[assembly: AssemblyDescription("A testing project for the SharpClipboard library.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Willy Kimura")]
[assembly: AssemblyProduct("SharpCliboard - Testing Project")]
[assembly: AssemblyCopyright("Copyright © 2019, Willy Kimura.")]
[assembly: AssemblyTrademark("A product of Willy Kimura.")]
[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("86f8eac7-259d-4a2f-842d-aa93163293c0")]

// 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")]
63 changes: 63 additions & 0 deletions SharpCliboard.Tests/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

117 changes: 117 additions & 0 deletions SharpCliboard.Tests/Properties/Resources.resx
Original file line number Diff line number Diff line change
@@ -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>
26 changes: 26 additions & 0 deletions SharpCliboard.Tests/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions SharpCliboard.Tests/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -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>
Loading

0 comments on commit 445e116

Please sign in to comment.