diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..ac39438c1
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,80 @@
+# EditorConfig is awesome:http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Don't use tabs for indentation.
+[*]
+indent_style = space
+# (Please don't specify an indent_size here; that has too many unintended consequences.)
+
+# Code files
+[*.{cs,csx,vb,vbx}]
+indent_size = 4
+insert_final_newline = true
+charset = utf-8-bom
+
+# Xml project files
+[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
+indent_size = 2
+
+# Xml config files
+[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
+indent_size = 2
+
+# JSON files
+[*.json]
+indent_size = 2
+
+# Dotnet code style settings:
+[*.{cs,vb}]
+# Sort using and Import directives with System.* appearing first
+dotnet_sort_system_directives_first = true
+# Avoid "this." and "Me." if not necessary
+dotnet_style_qualification_for_field = false:suggestion
+dotnet_style_qualification_for_property = false:suggestion
+dotnet_style_qualification_for_method = false:suggestion
+dotnet_style_qualification_for_event = false:suggestion
+
+# Use language keywords instead of framework type names for type references
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# Suggest more modern language features when available
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
+
+# CSharp code style settings:
+[*.cs]
+# Prefer "var" everywhere
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+csharp_style_var_elsewhere = true:suggestion
+
+# Prefer method-like constructs to have a block body
+csharp_style_expression_bodied_methods = false:none
+csharp_style_expression_bodied_constructors = false:none
+csharp_style_expression_bodied_operators = false:none
+
+# Prefer property-like constructs to have an expression-body
+csharp_style_expression_bodied_properties = true:none
+csharp_style_expression_bodied_indexers = true:none
+csharp_style_expression_bodied_accessors = true:none
+
+# Suggest more modern language features when available
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+csharp_style_throw_expression = true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion
+
+# Newline settings
+csharp_new_line_before_open_brace = anonymous_types,accessors,object_collection_array_initalizers,methods,properties,types
+csharp_new_line_before_else = false
+csharp_new_line_before_catch = false
+csharp_new_line_before_finally = false
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
diff --git a/.gitattributes b/.gitattributes
index 99af323cc..269bc192f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,50 +1,45 @@
-*.doc diff=astextplain
-*.DOC diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot diff=astextplain
-*.DOT diff=astextplain
-*.pdf diff=astextplain
-*.PDF diff=astextplain
-*.rtf diff=astextplain
-*.RTF diff=astextplain
+# Catch all for anything we forgot. Add rules if you get CRLF to LF warnings.
+* text=auto
-*.jpg binary
-*.png binary
-*.gif binary
+# Text files that should be normalized to LF in odb.
+*.cs text eol=lf diff=csharp
+*.xaml text
+*.config text
+*.c text
+*.h text
+*.cpp text
+*.hpp text
-*.cs text diff=csharp
-*.vb text
-*.c text
-*.cpp text
-*.cxx text
-*.h text
-*.hxx text
-*.py text
-*.rb text
-*.java text
-*.html text
-*.htm text
-*.css text
-*.scss text
-*.sass text
-*.less text
-*.js text
-*.lisp text
-*.clj text
-*.sql text
-*.php text
-*.lua text
-*.m text
-*.asm text
-*.erl text
-*.fs text
-*.fsx text
-*.hs text
+*.sln text
+*.csproj text
+*.vcxproj text
-*.csproj text merge=union
-*.vbproj text merge=union
-*.fsproj text merge=union
-*.dbproj text merge=union
-*.sln text eol=crlf merge=union
+*.md text
+*.tt text
+*.sh text
+*.ps1 text
+*.cmd text
+*.bat text
+*.markdown text
+*.msbuild text
+
+# Binary files that should not be normalized or diffed
+*.png binary
+*.jpg binary
+*.gif binary
+*.ico binary
+*.rc binary
+
+*.pfx binary
+*.snk binary
+*.dll binary
+*.exe binary
+*.lib binary
+*.exp binary
+*.pdb binary
+*.sdf binary
+*.7z binary
+
+# Generated file should just use CRLF, it's fiiine
+SolutionInfo.cs text eol=crlf diff=csharp
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..e3ff3083a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,29 @@
+_We will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information. This repository's issues are reserved for feature requests and bug reports. For support questions, please ask on StackOverflow: https://stackoverflow.com/questions/tagged/splat_
+
+_Please delete this note before pressing the submit button_
+
+**Do you want to request a *feature* or report a *bug*?**
+
+
+
+**What is the current behavior?**
+
+
+
+**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem**
+
+
+
+**What is the expected behavior?**
+
+
+
+**What is the motivation / use case for changing the behavior?**
+
+
+
+**Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI? Please also test with the [latest stable](https://www.nuget.org/profiles/reactiveui) and [development snapshot](https://reactiveui.net/docs/getting-started/installation/nuget-packages/development-package-feed)**
+
+
+
+**Other information (e.g. stacktraces, related issues, suggestions how to fix)**
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..e094a75d0
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+**What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)**
+
+
+
+**What is the current behavior? (You can also link to an open issue here)**
+
+
+
+**What is the new behavior (if this is a feature change)?**
+
+
+
+**What might this PR break?**
+
+
+
+**Please check if the PR fulfills these requirements**
+- [ ] Tests for the changes have been added (for bug fixes / features)
+- [ ] Docs have been added / updated (for bug fixes / features)
+
+**Other information**:
+
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 000000000..0b5e7fc6c
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +1,26 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 60
+
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 7
+
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - up-for-grabs
+ - starters
+ - bug
+ - cla-signed
+ - cla-already-signed
+ - proposal
+ - contributor-experience
+ - developer-experience
+ - ¯\_(ツ)_/¯
+
+# Label to use when marking an issue as stale
+staleLabel: waiting-for-response-or-contribution
+
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+ This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this because it helps reduce the workload of our extremely busy maintainers. If you want this issue progressed faster please start talks with a maintainer with how you can help out. There are so many ways to contribute to open-source and the most valued are often not code related. We are always looking for more help and look after those who stick around. Say howdy to one of the maintainers or browse https://reactiveui.net/contribute/ for ideas on where to start your journey.
+# Comment to post when closing a stale issue. Set to `false` to disable
+closeComment: false
diff --git a/.gitignore b/.gitignore
index 999299d17..c293217e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,25 +1,54 @@
-# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
-[Bb]in/
-[Oo]bj/
-
-# mstest test results
-TestResults
-
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
-*.userprefs
+*.userosscache
*.sln.docstates
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
# Build results
[Dd]ebug/
+[Dd]ebugPublic/
[Rr]elease/
+[Rr]eleases/
x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+*.lock.json
+artifacts/
+*.nuget.props
+*.nuget.targets
+
*_i.c
*_p.c
+*_i.h
*.ilk
*.meta
*.obj
@@ -33,35 +62,68 @@ x64/
*.tli
*.tlh
*.tmp
+*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
+*.pidb
+*.svclog
+*.scc
+*.binlog
+
+# Chutzpah Test files
+_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
+*.opendb
*.opensdf
*.sdf
+*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
-_ReSharper*
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
# NCrunch
-*.ncrunch*
+_NCrunch_*
.*crunch*.local.xml
+nCrunchTemp_*
-# Installshield output folder
-[Ee]xpress
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
@@ -74,36 +136,115 @@ DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
-publish
+publish/
# Publish Web Output
-*.Publish.xml
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
# Windows Azure Build Output
-csx
+csx/
*.build.csdef
+# Windows Azure Emulator
+ecf/
+rcf/
+
# Windows Store app package directory
AppPackages/
+BundleArtifacts/
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
# Others
-[Bb]in
-[Oo]bj
-sql
-TestResults
-[Tt]est[Rr]esult*
-*.Cache
-ClientBin
-[Ss]tyle[Cc]op.*
+ClientBin/
~$*
+*~
*.dbmdl
-Generated_Code #added for RIA/Silverlight projects
-
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
-# Mac Crap
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+
+# FAKE - F# Make
+.fake/
+
+# Tools
+tools/
+
+# ReactiveUI
+artifacts/
+src/ReactiveUI.Events*/Events_*.cs
+
+# macOS
.DS_Store
+
+src/*.Tests/API/*.received.txt
+.idea/
+
+# Fody Weavers (for tests)
+src/Tools/
\ No newline at end of file
diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
deleted file mode 100644
index 67f8ea046..000000000
--- a/.nuget/NuGet.Config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.nuget/NuGet.exe b/.nuget/NuGet.exe
deleted file mode 100644
index c296edf17..000000000
Binary files a/.nuget/NuGet.exe and /dev/null differ
diff --git a/.nuget/NuGet.targets b/.nuget/NuGet.targets
deleted file mode 100644
index 46a1b6ced..000000000
--- a/.nuget/NuGet.targets
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
- $(MSBuildProjectDirectory)\..\
-
-
- false
-
-
- false
-
-
- true
-
-
- false
-
-
-
-
-
-
-
-
-
-
- $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
- $([System.IO.Path]::Combine($(ProjectDir), "packages.config"))
-
-
-
-
- $(SolutionDir).nuget
- packages.config
-
-
-
-
- $(NuGetToolsPath)\NuGet.exe
- @(PackageSource)
-
- "$(NuGetExePath)"
- mono --runtime=v4.0.30319 $(NuGetExePath)
-
- $(TargetDir.Trim('\\'))
-
- -RequireConsent
- -NonInteractive
-
-
- $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "
- $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
-
-
-
- RestorePackages;
- $(BuildDependsOn);
-
-
-
-
- $(BuildDependsOn);
- BuildPackage;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.vsts-ci.yml b/.vsts-ci.yml
new file mode 100644
index 000000000..199219ee2
--- /dev/null
+++ b/.vsts-ci.yml
@@ -0,0 +1,52 @@
+trigger:
+- master
+- develop
+- rel/*
+
+queue: Hosted VS2017
+
+steps:
+- task: BatchScript@1
+ inputs:
+ filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
+ arguments: -no_logo
+ modifyEnvironment: true
+ displayName: Setup Environment Variables
+
+- task: NuGetToolInstaller@0
+ displayName: Use NuGet 4.6.2
+ inputs:
+ versionSpec: 4.6.2
+
+- task: DotNetCoreCLI@2
+ inputs:
+ command: build
+ projects: script/setversion.csproj
+ arguments: -c Release
+ displayName: Set Version
+ condition: eq(variables['system.pullrequest.isfork'], false)
+
+- powershell: |
+ nuget install SignClient -Version 0.9.1 -SolutionDir $(Build.SourcesDirectory) -Verbosity quiet -ExcludeVersion
+ .\build.cmd
+ displayName: Build
+ env:
+ SIGNCLIENT_SECRET: $(SignClientSecret)
+ SIGNCLIENT_USER: $(SignClientUser)
+ VSTS_ACCESS_TOKEN: $(System.AccessToken)
+ COVERALLS_TOKEN: $(COVERALLS_TOKEN)
+
+- task: CopyFiles@2
+ inputs:
+ Contents: 'artifacts/*.nupkg'
+ TargetFolder: '$(build.artifactstagingdirectory)\packages'
+ flattenFolders: true
+ condition: eq(variables['system.pullrequest.isfork'], false)
+
+- task: PublishBuildArtifacts@1
+ displayName: Publish Package Artifacts
+ inputs:
+ pathToPublish: '$(build.artifactstagingdirectory)\packages'
+ artifactType: container
+ artifactName: Packages
+ condition: eq(variables['system.pullrequest.isfork'], false)
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..5766643a2
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,3 @@
+# Contributor Code of Conduct
+
+If you’re being harassed, noticed someone else being harassed, or have any other concerns, please contact us immediately . Your reports will be taken seriously and will not be dismissed or argued with. All members, committers and volunteers in this community are required to act according to the Code of Conduct . These guidelines help steer our interactions and strive to keep ReactiveUI a positive, growing project, community and help us provide and ensure a safe environment for everyone. When referring to a group of people, we aim to use gender-neutral terms like "team", "folks", "everyone". (For details, we recommend this post ).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..d91ed16b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,148 @@
+# Contributing to Splat
+
+We'd love for you to contribute to our source code and to make splat even better than it is
+today! Here are the guidelines we'd like you to follow:
+
+ - [Code of Conduct](https://reactiveui.net/code-of-conduct)
+ - [Question or Problem?](#question)
+ - [Issues and Bugs](#issue)
+ - [Feature Requests](#feature)
+ - [Submission Guidelines](#submit)
+ - [Coding Rules](#rules)
+ - [Commit Message Guidelines](https://reactiveui.net/contribute/software-style-guide/commit-message-convention)
+
+## Got a Question or Problem?
+
+If you have questions about how to use splat, please direct these to [StackOverflow](https://stackoverflow.com/questions/tagged/splat). The project maintainers hang out in this [Slack](https://github.com/splat/splat#slack) channel.
+
+## Found an Issue?
+
+If you find a bug in the source code or a mistake in the documentation, you can help us by
+submitting an issue to our [GitHub Repository](https://github.com/splat/splat). Even better you can submit a Pull Request
+with a fix.
+
+**Please see the [Submission Guidelines](#submit) below.**
+
+## Want a Feature?
+
+You can request a new feature by submitting an issue to our [GitHub Repository](https://github.com/splat/splat). If you
+would like to implement a new feature then consider what kind of change it is:
+
+* **Major Changes** that you wish to contribute to the project should be discussed first in [Slack](https://github.com/splat/splat#slack) so that we can better coordinate our efforts,
+ prevent duplication of work, and help you to craft the change so that it is successfully accepted
+ into the project.
+* **Small Changes** can be crafted and submitted to the [GitHub Repository](https://github.com/splat/splat) as a Pull
+ Request.
+
+## Submission Guidelines
+
+### Submitting an Issue
+
+If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize
+the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
+
+Providing the following information will increase the chances of your issue being dealt with
+quickly:
+
+* **Overview of the Issue** - if an error is being thrown a stack trace helps
+* **Motivation for or Use Case** - explain why this is a bug for you
+* **splat Version(s)** - is it a regression?
+* **Operating System** - is this a problem with all browsers or only specific ones?
+* **Reproduce the Error** - provide a example or an unambiguous set of steps.
+* **Related Issues** - has a similar issue been reported before?
+* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
+ causing the problem (line of code or commit)
+
+**If you get help, help others. Good karma rulez!**
+
+### Submitting a Pull Request
+Before you submit your pull request consider the following guidelines:
+
+* Search [GitHub](https://github.com/splat/splat/pulls) for an open or closed Pull Request
+ that relates to your submission. You don't want to duplicate effort.
+* Make your changes in a new git branch:
+
+ ```shell
+ git checkout -b my-fix-branch develop
+ ```
+
+* Create your patch, **including appropriate test cases**.
+* Follow our [Coding Rules](#rules).
+* Run the test suite, as described below.
+* Commit your changes using a descriptive commit message that follows our
+ [commit message conventions](#commit).
+
+ ```shell
+ git commit -a
+ ```
+ Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
+
+* Build your changes locally to ensure all the tests pass:
+
+ ```shell
+ build.cmd
+ ```
+
+* Push your branch to GitHub:
+
+ ```shell
+ git push origin my-fix-branch
+ ```
+
+In GitHub, send a pull request to `splat:develop`.
+
+If we suggest changes, then:
+
+* Make the required updates.
+* Re-run the test suite to ensure tests are still passing.
+* Commit your changes to your branch (e.g. `my-fix-branch`).
+* Push the changes to your GitHub repository (this will update your Pull Request).
+
+If the PR gets too outdated we may ask you to rebase and force push to update the PR:
+
+```shell
+git rebase master -i
+git push origin my-fix-branch -f
+```
+
+_WARNING: Squashing or reverting commits and force-pushing thereafter may remove GitHub comments
+on code that were previously made by you or others in your commits. Avoid any form of rebasing
+unless necessary._
+
+That's it! Thank you for your contribution!
+
+#### After your pull request is merged
+
+After your pull request is merged, you can safely delete your branch and pull the changes
+from the main (upstream) repository:
+
+* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
+
+ ```shell
+ git push origin --delete my-fix-branch
+ ```
+
+* Check out the master branch:
+
+ ```shell
+ git checkout master -f
+ ```
+
+* Delete the local branch:
+
+ ```shell
+ git branch -D my-fix-branch
+ ```
+
+* Update your master with the latest upstream version:
+
+ ```shell
+ git pull --ff upstream master
+ ```
+
+## Coding Rules
+
+To ensure consistency throughout the source code, keep these rules in mind as you are working:
+
+* All features or bug fixes **must be tested** by one or more unit tests.
+* All public API methods **must be documented** with XML documentation.
diff --git a/COPYING b/COPYING
deleted file mode 100644
index d716c1492..000000000
--- a/COPYING
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright (c) 2013 Paul Betts
-
-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.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..984713a49
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) .NET Foundation and Contributors
+
+All rights reserved.
+
+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.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2f2c93795..000000000
--- a/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-MDTOOL ?= /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool
-
-.PHONY: all clean
-
-all: Splat.dll
-
-Splat.dll:
- $(MDTOOL) build -c:Release Splat-XamarinStudio.sln
-
-clean:
- $(MDTOOL) build -t:Clean -c:Release Splat-XamarinStudio.sln
diff --git a/README.md b/README.md
index 205251eb4..ce4c7da0d 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@

+[](https://ci.appveyor.com/project/ghuntley/splat)
+
Certain types of things are basically impossible to do in cross-platform
mobile code today, yet there's no reason why. Writing a ViewModel that handles
loading a gallery of pictures from disk will be completely riddled with
@@ -29,16 +31,11 @@ Splat currently supports:
[Always Be NuGetting](https://nuget.org/packages/Splat/). Package contains binaries for:
-* Xamarin.iOS
-* Xamarin.iOS 64-bit
-* Xamarin.Android
-* Xamarin.Mac
-* Xamarin.Mac 64-bit
* WPF (.NET 4.5)
* Windows Forms
-* Windows Phone 8
-* Windows Phone 8.1 Universal
-* WinRT
+* UWP
+* Xamarin (Android, iOS and Mac)
+* .NET Standard 1.0 and 2.0
## Cross-platform Image Loading
@@ -132,7 +129,7 @@ entry for.
```cs
// This System.Drawing class works, even on WinRT or WP8 where it's not supposed to exist
// Also, this works in a Portable Library, in your ViewModel
-ProfileBackgroundAccentColor = new Color(255, 255, 255, 255);
+ProfileBackgroundAccentColor = Color.FromArgb(255, 255, 255, 255);
```
Later, in the view, we can use it:
@@ -141,6 +138,25 @@ Later, in the view, we can use it:
ImageView.Background = ViewModel.ProfileBackgroundAccentColor.ToNativeBrush();
```
+If targeting iOS or Mac in a cross-platform solution (e.g. iOS & Android), use
+the SplatColor class to define colors in your netstandard library
+(since Cocoa doesn't include System.Drawing.Color).
+
+```cs
+// In a netstandard library
+SplatColor BackgroundColor = SplatColor.Red;
+```
+
+```
+// From an iOS project
+UIColor bgColor = ViewModel.BackgroundColor.ToNative();
+```
+
+```
+// From an Android project
+Android.Graphics.Color bgColor = ViewModel.BackgroundColor.ToNative();
+```
+
## Detecting whether you're in a unit test runner
```cs
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
new file mode 100644
index 000000000..61178e33c
--- /dev/null
+++ b/RELEASENOTES.md
@@ -0,0 +1,16 @@
+### 2.0.0
+
+**Features**
+
+ - .NET Standard 1.0 support has been added to replace `Profile259` Portable Class Library
+ - .NET Standard 1.4 support has been added to emulate Xamarin* and Mono* TFMs
+
+**Breaking Changes**
+
+ - Windows Phone 8 and Windows Runtime support have been deprecated, as VS2015 tooling no longer supports these platforms
+ - specific builds for Xamarin and Mono tooling have been removed due to existing limitations of .NET command line tooling
+
+**Fixes**
+
+ - `Point` implements `IEquatable` - #126 via @aalmada
+ - Factory registration mixins for registering services - #128 via @kentcb
\ No newline at end of file
diff --git a/SignPackages.json b/SignPackages.json
new file mode 100644
index 000000000..3276a45de
--- /dev/null
+++ b/SignPackages.json
@@ -0,0 +1,13 @@
+{
+ "SignClient": {
+ "AzureAd": {
+ "AADInstance": "https://login.microsoftonline.com/",
+ "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
+ "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
+ },
+ "Service": {
+ "Url": "https://codesign.dotnetfoundation.org/",
+ "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
+ }
+ }
+}
\ No newline at end of file
diff --git a/SignPackages.ps1 b/SignPackages.ps1
new file mode 100644
index 000000000..555215382
--- /dev/null
+++ b/SignPackages.ps1
@@ -0,0 +1,25 @@
+$currentDirectory = split-path $MyInvocation.MyCommand.Definition
+
+# See if we have the ClientSecret available
+if([string]::IsNullOrWhitespace($env:SIGNCLIENT_SECRET)){
+ Write-Error "Client Secret not found, not signing packages";
+ [System.Environment]::Exit(1);
+}
+
+# Setup Variables we need to pass into the sign client tool
+
+$appSettings = "$currentDirectory\SignPackages.json"
+
+$appPath = "$currentDirectory\packages\SignClient\tools\netcoreapp2.0\SignClient.dll"
+
+$nupgks = ls $currentDirectory\artifacts\*.nupkg | Select -ExpandProperty FullName
+
+foreach ($nupkg in $nupgks){
+ Write-Host "Submitting $nupkg for signing"
+
+ dotnet $appPath 'sign' -c $appSettings -i $nupkg -r $env:SIGNCLIENT_USER -s $env:SIGNCLIENT_SECRET -n 'ReactiveUI' -d 'ReactiveUI' -u 'https://reactiveui.net'
+
+ Write-Host "Finished signing $nupkg"
+}
+
+Write-Host "Sign-package complete"
\ No newline at end of file
diff --git a/Splat-VisualStudio.sln b/Splat-VisualStudio.sln
deleted file mode 100644
index def2efc42..000000000
--- a/Splat-VisualStudio.sln
+++ /dev/null
@@ -1,107 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30324.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-WP8", "Splat\Splat-WP8.csproj", "{95309EA3-055A-4B66-84DE-7771237CCF6C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-NetCore45", "Splat\Splat-NetCore45.csproj", "{18DCE642-06B7-4092-B8F4-30A675DA6929}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-Net45", "Splat\Splat-Net45.csproj", "{252CE1C2-027A-4445-A3C2-E4D6C80A935A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-Portable", "Splat\Splat-Portable.csproj", "{0EC8DBA1-D745-4EE5-993A-6026440EC3BF}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5C804897-045A-48CF-B1F7-1DD8BBFD5E1C}"
- ProjectSection(SolutionItems) = preProject
- .nuget\NuGet.Config = .nuget\NuGet.Config
- .nuget\NuGet.exe = .nuget\NuGet.exe
- .nuget\NuGet.targets = .nuget\NuGet.targets
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{43D7EB91-1B21-490D-9E25-8036E1B53A21}"
- ProjectSection(SolutionItems) = preProject
- Splat.nuspec = Splat.nuspec
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-wpa81", "Splat\Splat-wpa81.csproj", "{E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|ARM = Debug|ARM
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|ARM = Release|ARM
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|ARM.ActiveCfg = Debug|ARM
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|ARM.Build.0 = Debug|ARM
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|x64.ActiveCfg = Debug|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|x86.ActiveCfg = Debug|x86
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Debug|x86.Build.0 = Debug|x86
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|Any CPU.Build.0 = Release|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|ARM.ActiveCfg = Release|ARM
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|ARM.Build.0 = Release|ARM
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|x64.ActiveCfg = Release|Any CPU
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|x86.ActiveCfg = Release|x86
- {95309EA3-055A-4B66-84DE-7771237CCF6C}.Release|x86.Build.0 = Release|x86
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|ARM.ActiveCfg = Debug|ARM
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|ARM.Build.0 = Debug|ARM
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|x64.ActiveCfg = Debug|x64
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|x64.Build.0 = Debug|x64
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|x86.ActiveCfg = Debug|x86
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Debug|x86.Build.0 = Debug|x86
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|Any CPU.Build.0 = Release|Any CPU
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|ARM.ActiveCfg = Release|ARM
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|ARM.Build.0 = Release|ARM
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|x64.ActiveCfg = Release|x64
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|x64.Build.0 = Release|x64
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|x86.ActiveCfg = Release|x86
- {18DCE642-06B7-4092-B8F4-30A675DA6929}.Release|x86.Build.0 = Release|x86
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Debug|x64.ActiveCfg = Debug|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Release|Any CPU.Build.0 = Release|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Release|ARM.ActiveCfg = Release|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Release|x64.ActiveCfg = Release|Any CPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}.Release|x86.ActiveCfg = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|x86.ActiveCfg = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|Any CPU.Build.0 = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|ARM.ActiveCfg = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|x64.ActiveCfg = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|x86.ActiveCfg = Release|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Release|Any CPU.Build.0 = Release|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Release|ARM.ActiveCfg = Release|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Release|x64.ActiveCfg = Release|Any CPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}.Release|x86.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = Splat\Splat-monotouch.csproj
- EndGlobalSection
-EndGlobal
diff --git a/Splat-XamarinStudio.sln b/Splat-XamarinStudio.sln
deleted file mode 100644
index 453bec420..000000000
--- a/Splat-XamarinStudio.sln
+++ /dev/null
@@ -1,79 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-monotouch", "Splat\Splat-monotouch.csproj", "{95E74294-9538-44F3-AC97-F83760565242}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-monoandroid", "Splat\Splat-monoandroid.csproj", "{E429F061-65F1-4B17-A122-F6115840D56D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-monomac", "Splat\Splat-monomac.csproj", "{252CE1CF-331C-4445-A3C2-E4D6C80A935A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-Portable", "Splat\Splat-Portable.csproj", "{0EC8DBA1-D745-4EE5-993A-6026440EC3BF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-XamarinIOS", "Splat\Splat-XamarinIOS.csproj", "{E5EEF584-2A8A-4067-8309-15FE4D65DD64}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat-XamarinMac", "Splat\Splat-XamarinMac.csproj", "{990825BE-73ED-4A31-9178-B88119A72F61}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}.Release|Any CPU.Build.0 = Release|Any CPU
- {252CE1CF-331C-4445-A3C2-E4D6C80A935A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {252CE1CF-331C-4445-A3C2-E4D6C80A935A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {252CE1CF-331C-4445-A3C2-E4D6C80A935A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {252CE1CF-331C-4445-A3C2-E4D6C80A935A}.Release|Any CPU.Build.0 = Release|Any CPU
- {95E74294-9538-44F3-AC97-F83760565242}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {95E74294-9538-44F3-AC97-F83760565242}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {95E74294-9538-44F3-AC97-F83760565242}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {95E74294-9538-44F3-AC97-F83760565242}.Release|Any CPU.Build.0 = Release|Any CPU
- {990825BE-73ED-4A31-9178-B88119A72F61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {990825BE-73ED-4A31-9178-B88119A72F61}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {990825BE-73ED-4A31-9178-B88119A72F61}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {990825BE-73ED-4A31-9178-B88119A72F61}.Release|Any CPU.Build.0 = Release|Any CPU
- {E429F061-65F1-4B17-A122-F6115840D56D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E429F061-65F1-4B17-A122-F6115840D56D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E429F061-65F1-4B17-A122-F6115840D56D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E429F061-65F1-4B17-A122-F6115840D56D}.Release|Any CPU.Build.0 = Release|Any CPU
- {E5EEF584-2A8A-4067-8309-15FE4D65DD64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E5EEF584-2A8A-4067-8309-15FE4D65DD64}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E5EEF584-2A8A-4067-8309-15FE4D65DD64}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E5EEF584-2A8A-4067-8309-15FE4D65DD64}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = Splat\Splat-monotouch.csproj
- Policies = $0
- $0.TextStylePolicy = $1
- $1.FileWidth = 120
- $1.inheritsSet = VisualStudio
- $1.inheritsScope = text/plain
- $1.scope = text/plain
- $0.CSharpFormattingPolicy = $2
- $2.AutoPropertyFormatting = ForceOneLine
- $2.IndentPreprocessorDirectives = False
- $2.PropertyBraceStyle = NextLine
- $2.EventBraceStyle = NextLine
- $2.EmbeddedStatementPlacement = SameLine
- $2.ArrayInitializerBraceStyle = NextLine
- $2.BeforeMethodDeclarationParentheses = False
- $2.BeforeMethodCallParentheses = False
- $2.BeforeConstructorDeclarationParentheses = False
- $2.BeforeIndexerDeclarationBracket = False
- $2.BeforeDelegateDeclarationParentheses = False
- $2.AfterDelegateDeclarationParameterComma = True
- $2.NewParentheses = False
- $2.SpacesBeforeBrackets = False
- $2.AlignToFirstMethodDeclarationParameter = False
- $2.AlignToFirstIndexerDeclarationParameter = False
- $2.inheritsSet = Mono
- $2.inheritsScope = text/x-csharp
- $2.scope = text/x-csharp
- $0.TextStylePolicy = $3
- $3.inheritsSet = null
- $3.scope = text/x-csharp
- EndGlobalSection
-EndGlobal
diff --git a/Splat.nuspec b/Splat.nuspec
deleted file mode 100644
index e505bbcf9..000000000
--- a/Splat.nuspec
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- Splat
- 1.6.2
- Paul Betts
- http://f.cl.ly/items/1307401C3x2g3F2p2Z36/Logo.png
- https://github.com/paulcbetts/splat/blob/master/COPYING
- https://github.com/paulcbetts/splat
- false
- A library to make things cross-platform that should be
- A library to make things cross-platform that should be
- portable
-
-
-
-
-
diff --git a/Splat/Cocoa/Color.cs b/Splat/Cocoa/Color.cs
deleted file mode 100644
index 9bbe395c5..000000000
--- a/Splat/Cocoa/Color.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-
-#if UIKIT && !UNIFIED
-using MonoTouch.UIKit;
-#elif UNIFIED && UIKIT
-using UIKit;
-#elif UNIFIED && !UIKIT
-using AppKit;
-#else
-using MonoMac.AppKit;
-#endif
-
-namespace Splat
-{
-#if UIKIT
- public static class ColorExtensions
- {
- public static UIColor ToNative(this System.Drawing.Color This)
- {
- return new UIColor((float)This.R / 255.0f, (float)This.G / 255.0f, This.B / 255.0f, This.A / 255.0f);
- }
-
- public static System.Drawing.Color FromNative(this UIColor This)
- {
-#if UNIFIED
- nfloat r,g,b,a;
-#else
- float r,g,b,a;
-#endif
-
- This.GetRGBA(out r, out g, out b, out a);
- return System.Drawing.Color.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f));
- }
- }
-#else
- public static class ColorExtensions
- {
- public static NSColor ToNative(this System.Drawing.Color This)
- {
- return NSColor.FromSrgb((float)This.R / 255.0f, (float)This.G / 255.0f, This.B / 255.0f, This.A / 255.0f);
- }
-
- public static System.Drawing.Color FromNative(this NSColor This)
- {
-#if UNIFIED
- nfloat r,g,b,a;
-#else
- float r,g,b,a;
-#endif
-
- This.GetRgba(out r, out g, out b, out a);
- return System.Drawing.Color.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f));
- }
- }
-#endif
-}
diff --git a/Splat/Points/Point.cs b/Splat/Points/Point.cs
deleted file mode 100644
index 42a68a855..000000000
--- a/Splat/Points/Point.cs
+++ /dev/null
@@ -1,394 +0,0 @@
-//
-// System.Drawing.Point.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct Point
- {
- // Private x and y coordinate fields.
- private int x, y;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized Point Structure.
- ///
-
- public static readonly Point Empty;
-
- ///
- /// Ceiling Shared Method
- ///
- ///
- ///
- /// Produces a Point structure from a PointF structure by
- /// taking the ceiling of the X and Y properties.
- ///
-
- public static Point Ceiling(PointF value)
- {
- int x, y;
- checked
- {
- x = (int)Math.Ceiling(value.X);
- y = (int)Math.Ceiling(value.Y);
- }
-
- return new Point(x, y);
- }
-
- ///
- /// Round Shared Method
- ///
- ///
- ///
- /// Produces a Point structure from a PointF structure by
- /// rounding the X and Y properties.
- ///
-
- public static Point Round(PointF value)
- {
- int x, y;
- checked
- {
- x = (int)Math.Round(value.X);
- y = (int)Math.Round(value.Y);
- }
-
- return new Point(x, y);
- }
-
- ///
- /// Truncate Shared Method
- ///
- ///
- ///
- /// Produces a Point structure from a PointF structure by
- /// truncating the X and Y properties.
- ///
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Point Truncate(PointF value)
- {
- int x, y;
- checked
- {
- x = (int)value.X;
- y = (int)value.Y;
- }
-
- return new Point(x, y);
- }
-
- ///
- /// Addition Operator
- ///
- ///
- ///
- /// Translates a Point using the Width and Height
- /// properties of the given Size .
- ///
-
- public static Point operator +(Point pt, Size sz)
- {
- return new Point(pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- ///
-
- public static bool operator ==(Point left, Point right)
- {
- return ((left.X == right.X) && (left.Y == right.Y));
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- ///
-
- public static bool operator !=(Point left, Point right)
- {
- return ((left.X != right.X) || (left.Y != right.Y));
- }
-
- ///
- /// Subtraction Operator
- ///
- ///
- ///
- /// Translates a Point using the negation of the Width
- /// and Height properties of the given Size.
- ///
-
- public static Point operator -(Point pt, Size sz)
- {
- return new Point(pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- ///
- /// Point to Size Conversion
- ///
- ///
- ///
- /// Returns a Size based on the Coordinates of a given
- /// Point. Requires explicit cast.
- ///
-
- public static explicit operator Size(Point p)
- {
- return new Size(p.X, p.Y);
- }
-
- ///
- /// Point to PointF Conversion
- ///
- ///
- ///
- /// Creates a PointF based on the coordinates of a given
- /// Point. No explicit cast is required.
- ///
-
- public static implicit operator PointF(Point p)
- {
- return new PointF(p.X, p.Y);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- ///
- /// Point Constructor
- ///
- ///
- ///
- /// Creates a Point from an integer which holds the Y
- /// coordinate in the high order 16 bits and the X
- /// coordinate in the low order 16 bits.
- ///
-
- public Point(int dw)
- {
- y = dw >> 16;
- x = dw & 0xffff;
- }
-
- ///
- /// Point Constructor
- ///
- ///
- ///
- /// Creates a Point from a Size value.
- ///
-
- public Point(Size sz)
- {
- x = sz.Width;
- y = sz.Height;
- }
-
- ///
- /// Point Constructor
- ///
- ///
- ///
- /// Creates a Point from a specified x,y coordinate pair.
- ///
-
- public Point(int x, int y)
- {
- this.x = x;
- this.y = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if both X and Y are zero.
- ///
-
- public bool IsEmpty
- {
- get
- {
- return ((x == 0) && (y == 0));
- }
- }
-
- ///
- /// X Property
- ///
- ///
- ///
- /// The X coordinate of the Point.
- ///
-
- public int X
- {
- get
- {
- return x;
- }
- set
- {
- x = value;
- }
- }
-
- ///
- /// Y Property
- ///
- ///
- ///
- /// The Y coordinate of the Point.
- ///
-
- public int Y
- {
- get
- {
- return y;
- }
- set
- {
- y = value;
- }
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this Point and another object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is Point))
- return false;
-
- return (this == (Point)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return x ^ y;
- }
-
- ///
- /// Offset Method
- ///
- ///
- ///
- /// Moves the Point a specified distance.
- ///
-
- public void Offset(int dx, int dy)
- {
- x += dx;
- y += dy;
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the Point as a string in coordinate notation.
- ///
-
- public override string ToString()
- {
- return string.Format("{{X={0},Y={1}}}", x.ToString(CultureInfo.InvariantCulture),
- y.ToString(CultureInfo.InvariantCulture));
- }
-#if NET_2_0
- public static Point Add (Point pt, Size sz)
- {
- return new Point (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- public void Offset (Point p)
- {
- Offset (p.X, p.Y);
- }
-
- public static Point Subtract (Point pt, Size sz)
- {
- return new Point (pt.X - sz.Width, pt.Y - sz.Height);
- }
-#endif
-
- }
-}
\ No newline at end of file
diff --git a/Splat/Points/PointF.cs b/Splat/Points/PointF.cs
deleted file mode 100644
index b9f533f2a..000000000
--- a/Splat/Points/PointF.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// System.Drawing.PointF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct PointF
- {
- // Private x and y coordinate fields.
- private float x, y;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized PointF Structure.
- ///
-
- public static readonly PointF Empty;
-
- ///
- /// Addition Operator
- ///
- ///
- ///
- /// Translates a PointF using the Width and Height
- /// properties of the given Size.
- ///
-
- public static PointF operator +(PointF pt, Size sz)
- {
- return new PointF(pt.X + sz.Width, pt.Y + sz.Height);
- }
-#if NET_2_0
- public static PointF operator + (PointF pt, SizeF sz)
- {
- return new PointF (pt.X + sz.Width, pt.Y + sz.Height);
- }
-#endif
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- ///
-
- public static bool operator ==(PointF left, PointF right)
- {
- return ((left.X == right.X) && (left.Y == right.Y));
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- ///
-
- public static bool operator !=(PointF left, PointF right)
- {
- return ((left.X != right.X) || (left.Y != right.Y));
- }
-
- ///
- /// Subtraction Operator
- ///
- ///
- ///
- /// Translates a PointF using the negation of the Width
- /// and Height properties of the given Size.
- ///
-
- public static PointF operator -(PointF pt, Size sz)
- {
- return new PointF(pt.X - sz.Width, pt.Y - sz.Height);
- }
-#if NET_2_0
- public static PointF operator - (PointF pt, SizeF sz)
- {
- return new PointF (pt.X - sz.Width, pt.Y - sz.Height);
- }
-#endif
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- ///
- /// PointF Constructor
- ///
- ///
- ///
- /// Creates a PointF from a specified x,y coordinate pair.
- ///
-
- public PointF(float x, float y)
- {
- this.x = x;
- this.y = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if both X and Y are zero.
- ///
-
- public bool IsEmpty
- {
- get
- {
- return ((x == 0.0) && (y == 0.0));
- }
- }
-
- ///
- /// X Property
- ///
- ///
- ///
- /// The X coordinate of the PointF.
- ///
-
- public float X
- {
- get
- {
- return x;
- }
- set
- {
- x = value;
- }
- }
-
- ///
- /// Y Property
- ///
- ///
- ///
- /// The Y coordinate of the PointF.
- ///
-
- public float Y
- {
- get
- {
- return y;
- }
- set
- {
- y = value;
- }
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this PointF and another object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is PointF))
- return false;
-
- return (this == (PointF)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return (int)x ^ (int)y;
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the PointF as a string in coordinate notation.
- ///
-
- public override string ToString()
- {
- return String.Format("{{X={0}, Y={1}}}", x.ToString(CultureInfo.CurrentCulture),
- y.ToString(CultureInfo.CurrentCulture));
- }
-
-#if NET_2_0
- public static PointF Add (PointF pt, Size sz)
- {
- return new PointF (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- public static PointF Add (PointF pt, SizeF sz)
- {
- return new PointF (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- public static PointF Subtract (PointF pt, Size sz)
- {
- return new PointF (pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- public static PointF Subtract (PointF pt, SizeF sz)
- {
- return new PointF (pt.X - sz.Width, pt.Y - sz.Height);
- }
-#endif
-
- }
-}
\ No newline at end of file
diff --git a/Splat/Points/Rectangle.cs b/Splat/Points/Rectangle.cs
deleted file mode 100644
index 8831fa965..000000000
--- a/Splat/Points/Rectangle.cs
+++ /dev/null
@@ -1,659 +0,0 @@
-//
-// System.Drawing.Rectangle.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct Rectangle
- {
- private int x, y, width, height;
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized Rectangle Structure.
- ///
-
- public static readonly Rectangle Empty;
-
-#if TARGET_JVM
- internal java.awt.Rectangle NativeObject {
- get {
- return new java.awt.Rectangle(X,Y,Width,Height);
- }
- }
-#endif
-
- ///
- /// Ceiling Shared Method
- ///
- ///
- ///
- /// Produces a Rectangle structure from a RectangleF
- /// structure by taking the ceiling of the X, Y, Width,
- /// and Height properties.
- ///
-
- public static Rectangle Ceiling(RectangleF value)
- {
- int x, y, w, h;
- checked
- {
- x = (int)Math.Ceiling(value.X);
- y = (int)Math.Ceiling(value.Y);
- w = (int)Math.Ceiling(value.Width);
- h = (int)Math.Ceiling(value.Height);
- }
-
- return new Rectangle(x, y, w, h);
- }
-
- ///
- /// FromLTRB Shared Method
- ///
- ///
- ///
- /// Produces a Rectangle structure from left, top, right,
- /// and bottom coordinates.
- ///
-
- public static Rectangle FromLTRB(int left, int top,
- int right, int bottom)
- {
- return new Rectangle(left, top, right - left,
- bottom - top);
- }
-
- ///
- /// Inflate Shared Method
- ///
- ///
- ///
- /// Produces a new Rectangle by inflating an existing
- /// Rectangle by the specified coordinate values.
- ///
-
- public static Rectangle Inflate(Rectangle rect, int x, int y)
- {
- Rectangle r = new Rectangle(rect.Location, rect.Size);
- r.Inflate(x, y);
- return r;
- }
-
- ///
- /// Inflate Method
- ///
- ///
- ///
- /// Inflates the Rectangle by a specified width and height.
- ///
-
- public void Inflate(int width, int height)
- {
- Inflate(new Size(width, height));
- }
-
- ///
- /// Inflate Method
- ///
- ///
- ///
- /// Inflates the Rectangle by a specified Size.
- ///
-
- public void Inflate(Size size)
- {
- x -= size.Width;
- y -= size.Height;
- Width += size.Width * 2;
- Height += size.Height * 2;
- }
-
- ///
- /// Intersect Shared Method
- ///
- ///
- ///
- /// Produces a new Rectangle by intersecting 2 existing
- /// Rectangles. Returns null if there is no intersection.
- ///
-
- public static Rectangle Intersect(Rectangle a, Rectangle b)
- {
- // MS.NET returns a non-empty rectangle if the two rectangles
- // touch each other
- if (!a.IntersectsWithInclusive(b))
- return Empty;
-
- return Rectangle.FromLTRB(
- Math.Max(a.Left, b.Left),
- Math.Max(a.Top, b.Top),
- Math.Min(a.Right, b.Right),
- Math.Min(a.Bottom, b.Bottom));
- }
-
- ///
- /// Intersect Method
- ///
- ///
- ///
- /// Replaces the Rectangle with the intersection of itself
- /// and another Rectangle.
- ///
-
- public void Intersect(Rectangle rect)
- {
- this = Rectangle.Intersect(this, rect);
- }
-
- ///
- /// Round Shared Method
- ///
- ///
- ///
- /// Produces a Rectangle structure from a RectangleF by
- /// rounding the X, Y, Width, and Height properties.
- ///
-
- public static Rectangle Round(RectangleF value)
- {
- int x, y, w, h;
- checked
- {
- x = (int)Math.Round(value.X);
- y = (int)Math.Round(value.Y);
- w = (int)Math.Round(value.Width);
- h = (int)Math.Round(value.Height);
- }
-
- return new Rectangle(x, y, w, h);
- }
-
- ///
- /// Truncate Shared Method
- ///
- ///
- ///
- /// Produces a Rectangle structure from a RectangleF by
- /// truncating the X, Y, Width, and Height properties.
- ///
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Rectangle Truncate(RectangleF value)
- {
- int x, y, w, h;
- checked
- {
- x = (int)value.X;
- y = (int)value.Y;
- w = (int)value.Width;
- h = (int)value.Height;
- }
-
- return new Rectangle(x, y, w, h);
- }
-
- ///
- /// Union Shared Method
- ///
- ///
- ///
- /// Produces a new Rectangle from the union of 2 existing
- /// Rectangles.
- ///
-
- public static Rectangle Union(Rectangle a, Rectangle b)
- {
- return FromLTRB(Math.Min(a.Left, b.Left),
- Math.Min(a.Top, b.Top),
- Math.Max(a.Right, b.Right),
- Math.Max(a.Bottom, b.Bottom));
- }
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- ///
-
- public static bool operator ==(Rectangle left, Rectangle right)
- {
- return ((left.Location == right.Location) &&
- (left.Size == right.Size));
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- ///
-
- public static bool operator !=(Rectangle left, Rectangle right)
- {
- return ((left.Location != right.Location) ||
- (left.Size != right.Size));
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- ///
- /// Rectangle Constructor
- ///
- ///
- ///
- /// Creates a Rectangle from Point and Size values.
- ///
-
- public Rectangle(Point location, Size size)
- {
- x = location.X;
- y = location.Y;
- width = size.Width;
- height = size.Height;
- }
-
- ///
- /// Rectangle Constructor
- ///
- ///
- ///
- /// Creates a Rectangle from a specified x,y location and
- /// width and height values.
- ///
-
- public Rectangle(int x, int y, int width, int height)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
-
-
- ///
- /// Bottom Property
- ///
- ///
- ///
- /// The Y coordinate of the bottom edge of the Rectangle.
- /// Read only.
- ///
-
- public int Bottom
- {
- get
- {
- return y + height;
- }
- }
-
- ///
- /// Height Property
- ///
- ///
- ///
- /// The Height of the Rectangle.
- ///
-
- public int Height
- {
- get
- {
- return height;
- }
- set
- {
- height = value;
- }
- }
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if the width or height are zero. Read only.
- ///
- public bool IsEmpty
- {
- get
- {
- return ((x == 0) && (y == 0) && (width == 0) && (height == 0));
- }
- }
-
- ///
- /// Left Property
- ///
- ///
- ///
- /// The X coordinate of the left edge of the Rectangle.
- /// Read only.
- ///
-
- public int Left
- {
- get
- {
- return X;
- }
- }
-
- ///
- /// Location Property
- ///
- ///
- ///
- /// The Location of the top-left corner of the Rectangle.
- ///
-
- public Point Location
- {
- get
- {
- return new Point(x, y);
- }
- set
- {
- x = value.X;
- y = value.Y;
- }
- }
-
- ///
- /// Right Property
- ///
- ///
- ///
- /// The X coordinate of the right edge of the Rectangle.
- /// Read only.
- ///
-
- public int Right
- {
- get
- {
- return X + Width;
- }
- }
-
- ///
- /// Size Property
- ///
- ///
- ///
- /// The Size of the Rectangle.
- ///
-
- public Size Size
- {
- get
- {
- return new Size(Width, Height);
- }
- set
- {
- Width = value.Width;
- Height = value.Height;
- }
- }
-
- ///
- /// Top Property
- ///
- ///
- ///
- /// The Y coordinate of the top edge of the Rectangle.
- /// Read only.
- ///
-
- public int Top
- {
- get
- {
- return y;
- }
- }
-
- ///
- /// Width Property
- ///
- ///
- ///
- /// The Width of the Rectangle.
- ///
-
- public int Width
- {
- get
- {
- return width;
- }
- set
- {
- width = value;
- }
- }
-
- ///
- /// X Property
- ///
- ///
- ///
- /// The X coordinate of the Rectangle.
- ///
-
- public int X
- {
- get
- {
- return x;
- }
- set
- {
- x = value;
- }
- }
-
- ///
- /// Y Property
- ///
- ///
- ///
- /// The Y coordinate of the Rectangle.
- ///
-
- public int Y
- {
- get
- {
- return y;
- }
- set
- {
- y = value;
- }
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if an x,y coordinate lies within this Rectangle.
- ///
-
- public bool Contains(int x, int y)
- {
- return ((x >= Left) && (x < Right) &&
- (y >= Top) && (y < Bottom));
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if a Point lies within this Rectangle.
- ///
-
- public bool Contains(Point pt)
- {
- return Contains(pt.X, pt.Y);
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if a Rectangle lies entirely within this
- /// Rectangle.
- ///
-
- public bool Contains(Rectangle rect)
- {
- return (rect == Intersect(this, rect));
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this Rectangle and another object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is Rectangle))
- return false;
-
- return (this == (Rectangle)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return (height + width) ^ x + y;
- }
-
- ///
- /// IntersectsWith Method
- ///
- ///
- ///
- /// Checks if a Rectangle intersects with this one.
- ///
-
- public bool IntersectsWith(Rectangle rect)
- {
- return !((Left >= rect.Right) || (Right <= rect.Left) ||
- (Top >= rect.Bottom) || (Bottom <= rect.Top));
- }
-
- private bool IntersectsWithInclusive(Rectangle r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- ///
- /// Offset Method
- ///
- ///
- ///
- /// Moves the Rectangle a specified distance.
- ///
-
- public void Offset(int x, int y)
- {
- this.x += x;
- this.y += y;
- }
-
- ///
- /// Offset Method
- ///
- ///
- ///
- /// Moves the Rectangle a specified distance.
- ///
-
- public void Offset(Point pos)
- {
- x += pos.X;
- y += pos.Y;
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the Rectangle as a string in (x,y,w,h) notation.
- ///
-
- public override string ToString()
- {
- return String.Format("{{X={0},Y={1},Width={2},Height={3}}}",
- x, y, width, height);
- }
-
- }
-}
\ No newline at end of file
diff --git a/Splat/Points/RectangleF.cs b/Splat/Points/RectangleF.cs
deleted file mode 100644
index d17b33477..000000000
--- a/Splat/Points/RectangleF.cs
+++ /dev/null
@@ -1,604 +0,0 @@
-//
-// System.Drawing.RectangleF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct RectangleF
- {
- private float x, y, width, height;
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized RectangleF Structure.
- ///
-
- public static readonly RectangleF Empty;
-
-#if TARGET_JVM
- internal java.awt.geom.Rectangle2D NativeObject {
- get {
- return new java.awt.geom.Rectangle2D.Float(X,Y,Width,Height);
- }
- }
-#endif
-
- ///
- /// FromLTRB Shared Method
- ///
- ///
- ///
- /// Produces a RectangleF structure from left, top, right,
- /// and bottom coordinates.
- ///
-
- public static RectangleF FromLTRB(float left, float top,
- float right, float bottom)
- {
- return new RectangleF(left, top, right - left, bottom - top);
- }
-
- ///
- /// Inflate Shared Method
- ///
- ///
- ///
- /// Produces a new RectangleF by inflating an existing
- /// RectangleF by the specified coordinate values.
- ///
-
- public static RectangleF Inflate(RectangleF rect,
- float x, float y)
- {
- RectangleF ir = new RectangleF(rect.X, rect.Y, rect.Width, rect.Height);
- ir.Inflate(x, y);
- return ir;
- }
-
- ///
- /// Inflate Method
- ///
- ///
- ///
- /// Inflates the RectangleF by a specified width and height.
- ///
-
- public void Inflate(float x, float y)
- {
- Inflate(new SizeF(x, y));
- }
-
- ///
- /// Inflate Method
- ///
- ///
- ///
- /// Inflates the RectangleF by a specified Size.
- ///
-
- public void Inflate(SizeF size)
- {
- x -= size.Width;
- y -= size.Height;
- width += size.Width * 2;
- height += size.Height * 2;
- }
-
- ///
- /// Intersect Shared Method
- ///
- ///
- ///
- /// Produces a new RectangleF by intersecting 2 existing
- /// RectangleFs. Returns null if there is no intersection.
- ///
-
- public static RectangleF Intersect(RectangleF a,
- RectangleF b)
- {
- // MS.NET returns a non-empty rectangle if the two rectangles
- // touch each other
- if (!a.IntersectsWithInclusive(b))
- return Empty;
-
- return FromLTRB(
- Math.Max(a.Left, b.Left),
- Math.Max(a.Top, b.Top),
- Math.Min(a.Right, b.Right),
- Math.Min(a.Bottom, b.Bottom));
- }
-
- ///
- /// Intersect Method
- ///
- ///
- ///
- /// Replaces the RectangleF with the intersection of itself
- /// and another RectangleF.
- ///
-
- public void Intersect(RectangleF rect)
- {
- this = RectangleF.Intersect(this, rect);
- }
-
- ///
- /// Union Shared Method
- ///
- ///
- ///
- /// Produces a new RectangleF from the union of 2 existing
- /// RectangleFs.
- ///
-
- public static RectangleF Union(RectangleF a, RectangleF b)
- {
- return FromLTRB(Math.Min(a.Left, b.Left),
- Math.Min(a.Top, b.Top),
- Math.Max(a.Right, b.Right),
- Math.Max(a.Bottom, b.Bottom));
- }
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- ///
-
- public static bool operator ==(RectangleF left, RectangleF right)
- {
- return (left.X == right.X) && (left.Y == right.Y) &&
- (left.Width == right.Width) && (left.Height == right.Height);
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- ///
-
- public static bool operator !=(RectangleF left, RectangleF right)
- {
- return (left.X != right.X) || (left.Y != right.Y) ||
- (left.Width != right.Width) || (left.Height != right.Height);
- }
-
- ///
- /// Rectangle to RectangleF Conversion
- ///
- ///
- ///
- /// Converts a Rectangle object to a RectangleF.
- ///
-
- public static implicit operator RectangleF(Rectangle r)
- {
- return new RectangleF(r.X, r.Y, r.Width, r.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- ///
- /// RectangleF Constructor
- ///
- ///
- ///
- /// Creates a RectangleF from PointF and SizeF values.
- ///
-
- public RectangleF(PointF location, SizeF size)
- {
- x = location.X;
- y = location.Y;
- width = size.Width;
- height = size.Height;
- }
-
- ///
- /// RectangleF Constructor
- ///
- ///
- ///
- /// Creates a RectangleF from a specified x,y location and
- /// width and height values.
- ///
-
- public RectangleF(float x, float y, float width, float height)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
-
-#if TARGET_JVM
- internal RectangleF (java.awt.geom.RectangularShape r2d) {
- this.x = (float) r2d.getX ();
- this.y = (float) r2d.getY ();
- this.width = (float) r2d.getWidth ();
- this.height = (float) r2d.getHeight ();
- }
-#endif
-
- ///
- /// Bottom Property
- ///
- ///
- ///
- /// The Y coordinate of the bottom edge of the RectangleF.
- /// Read only.
- ///
-
- public float Bottom
- {
- get
- {
- return Y + Height;
- }
- }
-
- ///
- /// Height Property
- ///
- ///
- ///
- /// The Height of the RectangleF.
- ///
-
- public float Height
- {
- get
- {
- return height;
- }
- set
- {
- height = value;
- }
- }
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if the width or height are zero. Read only.
- ///
- //
- public bool IsEmpty
- {
- get
- {
- return (width <= 0 || height <= 0);
- }
- }
-
- ///
- /// Left Property
- ///
- ///
- ///
- /// The X coordinate of the left edge of the RectangleF.
- /// Read only.
- ///
-
- public float Left
- {
- get
- {
- return X;
- }
- }
-
- ///
- /// Location Property
- ///
- ///
- ///
- /// The Location of the top-left corner of the RectangleF.
- ///
-
- public PointF Location
- {
- get
- {
- return new PointF(x, y);
- }
- set
- {
- x = value.X;
- y = value.Y;
- }
- }
-
- ///
- /// Right Property
- ///
- ///
- ///
- /// The X coordinate of the right edge of the RectangleF.
- /// Read only.
- ///
-
- public float Right
- {
- get
- {
- return X + Width;
- }
- }
-
- ///
- /// Size Property
- ///
- ///
- ///
- /// The Size of the RectangleF.
- ///
-
- public SizeF Size
- {
- get
- {
- return new SizeF(width, height);
- }
- set
- {
- width = value.Width;
- height = value.Height;
- }
- }
-
- ///
- /// Top Property
- ///
- ///
- ///
- /// The Y coordinate of the top edge of the RectangleF.
- /// Read only.
- ///
-
- public float Top
- {
- get
- {
- return Y;
- }
- }
-
- ///
- /// Width Property
- ///
- ///
- ///
- /// The Width of the RectangleF.
- ///
-
- public float Width
- {
- get
- {
- return width;
- }
- set
- {
- width = value;
- }
- }
-
- ///
- /// X Property
- ///
- ///
- ///
- /// The X coordinate of the RectangleF.
- ///
-
- public float X
- {
- get
- {
- return x;
- }
- set
- {
- x = value;
- }
- }
-
- ///
- /// Y Property
- ///
- ///
- ///
- /// The Y coordinate of the RectangleF.
- ///
-
- public float Y
- {
- get
- {
- return y;
- }
- set
- {
- y = value;
- }
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if an x,y coordinate lies within this RectangleF.
- ///
-
- public bool Contains(float x, float y)
- {
- return ((x >= Left) && (x < Right) &&
- (y >= Top) && (y < Bottom));
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if a Point lies within this RectangleF.
- ///
-
- public bool Contains(PointF pt)
- {
- return Contains(pt.X, pt.Y);
- }
-
- ///
- /// Contains Method
- ///
- ///
- ///
- /// Checks if a RectangleF lies entirely within this
- /// RectangleF.
- ///
-
- public bool Contains(RectangleF rect)
- {
- return (rect == Intersect(this, rect));
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this RectangleF and an object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is RectangleF))
- return false;
-
- return (this == (RectangleF)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return (int)(x + y + width + height);
- }
-
- ///
- /// IntersectsWith Method
- ///
- ///
- ///
- /// Checks if a RectangleF intersects with this one.
- ///
-
- public bool IntersectsWith(RectangleF rect)
- {
- return !((Left >= rect.Right) || (Right <= rect.Left) ||
- (Top >= rect.Bottom) || (Bottom <= rect.Top));
- }
-
- private bool IntersectsWithInclusive(RectangleF r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- ///
- /// Offset Method
- ///
- ///
- ///
- /// Moves the RectangleF a specified distance.
- ///
-
- public void Offset(float x, float y)
- {
- X += x;
- Y += y;
- }
-
- ///
- /// Offset Method
- ///
- ///
- ///
- /// Moves the RectangleF a specified distance.
- ///
-
- public void Offset(PointF pos)
- {
- Offset(pos.X, pos.Y);
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the RectangleF in (x,y,w,h) notation.
- ///
-
- public override string ToString()
- {
- return String.Format("{{X={0},Y={1},Width={2},Height={3}}}",
- x, y, width, height);
- }
-
- }
-}
\ No newline at end of file
diff --git a/Splat/Points/Size.cs b/Splat/Points/Size.cs
deleted file mode 100644
index f9a1c7e85..000000000
--- a/Splat/Points/Size.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-//
-// System.Drawing.Size.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct Size
- {
-
- // Private Height and width fields.
- private int width, height;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized Size Structure.
- ///
-
- public static readonly Size Empty;
-
- ///
- /// Ceiling Shared Method
- ///
- ///
- ///
- /// Produces a Size structure from a SizeF structure by
- /// taking the ceiling of the Width and Height properties.
- ///
-
- public static Size Ceiling(SizeF value)
- {
- int w, h;
- checked
- {
- w = (int)Math.Ceiling(value.Width);
- h = (int)Math.Ceiling(value.Height);
- }
-
- return new Size(w, h);
- }
-
- ///
- /// Round Shared Method
- ///
- ///
- ///
- /// Produces a Size structure from a SizeF structure by
- /// rounding the Width and Height properties.
- ///
-
- public static Size Round(SizeF value)
- {
- int w, h;
- checked
- {
- w = (int)Math.Round(value.Width);
- h = (int)Math.Round(value.Height);
- }
-
- return new Size(w, h);
- }
-
- ///
- /// Truncate Shared Method
- ///
- ///
- ///
- /// Produces a Size structure from a SizeF structure by
- /// truncating the Width and Height properties.
- ///
-
- public static Size Truncate(SizeF value)
- {
- int w, h;
- checked
- {
- w = (int)value.Width;
- h = (int)value.Height;
- }
-
- return new Size(w, h);
- }
-
- ///
- /// Addition Operator
- ///
- ///
- ///
- /// Addition of two Size structures.
- ///
-
- public static Size operator +(Size sz1, Size sz2)
- {
- return new Size(sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- ///
-
- public static bool operator ==(Size sz1, Size sz2)
- {
- return ((sz1.Width == sz2.Width) &&
- (sz1.Height == sz2.Height));
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- ///
-
- public static bool operator !=(Size sz1, Size sz2)
- {
- return ((sz1.Width != sz2.Width) ||
- (sz1.Height != sz2.Height));
- }
-
- ///
- /// Subtraction Operator
- ///
- ///
- ///
- /// Subtracts two Size structures.
- ///
-
- public static Size operator -(Size sz1, Size sz2)
- {
- return new Size(sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- ///
- /// Size to Point Conversion
- ///
- ///
- ///
- /// Returns a Point based on the dimensions of a given
- /// Size. Requires explicit cast.
- ///
-
- public static explicit operator Point(Size size)
- {
- return new Point(size.Width, size.Height);
- }
-
- ///
- /// Size to SizeF Conversion
- ///
- ///
- ///
- /// Creates a SizeF based on the dimensions of a given
- /// Size. No explicit cast is required.
- ///
-
- public static implicit operator SizeF(Size p)
- {
- return new SizeF(p.Width, p.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- ///
- /// Size Constructor
- ///
- ///
- ///
- /// Creates a Size from a Point value.
- ///
-
- public Size(Point pt)
- {
- width = pt.X;
- height = pt.Y;
- }
-
- ///
- /// Size Constructor
- ///
- ///
- ///
- /// Creates a Size from specified dimensions.
- ///
-
- public Size(int width, int height)
- {
- this.width = width;
- this.height = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if both Width and Height are zero.
- ///
-
- public bool IsEmpty
- {
- get
- {
- return ((width == 0) && (height == 0));
- }
- }
-
- ///
- /// Width Property
- ///
- ///
- ///
- /// The Width coordinate of the Size.
- ///
-
- public int Width
- {
- get
- {
- return width;
- }
- set
- {
- width = value;
- }
- }
-
- ///
- /// Height Property
- ///
- ///
- ///
- /// The Height coordinate of the Size.
- ///
-
- public int Height
- {
- get
- {
- return height;
- }
- set
- {
- height = value;
- }
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this Size and another object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is Size))
- return false;
-
- return (this == (Size)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return width ^ height;
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the Size as a string in coordinate notation.
- ///
-
- public override string ToString()
- {
- return String.Format("{{Width={0}, Height={1}}}", width, height);
- }
-
-#if NET_2_0
- public static Size Add (Size sz1, Size sz2)
- {
- return new Size (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
-
- }
-
- public static Size Subtract (Size sz1, Size sz2)
- {
- return new Size (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-#endif
-
- }
-}
\ No newline at end of file
diff --git a/Splat/Points/SizeF.cs b/Splat/Points/SizeF.cs
deleted file mode 100644
index 11343dc84..000000000
--- a/Splat/Points/SizeF.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// System.Drawing.SizeF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (C) 2001 Mike Kestner
-// Copyright (C) 2004 Novell, Inc. http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// 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.
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace System.Drawing
-{
- public struct SizeF
- {
- // Private height and width fields.
- private float width, height;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- ///
- /// Empty Shared Field
- ///
- ///
- ///
- /// An uninitialized SizeF Structure.
- ///
-
- public static readonly SizeF Empty;
-
- ///
- /// Addition Operator
- ///
- ///
- ///
- /// Addition of two SizeF structures.
- ///
-
- public static SizeF operator +(SizeF sz1, SizeF sz2)
- {
- return new SizeF(sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- ///
- /// Equality Operator
- ///
- ///
- ///
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- ///
-
- public static bool operator ==(SizeF sz1, SizeF sz2)
- {
- return ((sz1.Width == sz2.Width) &&
- (sz1.Height == sz2.Height));
- }
-
- ///
- /// Inequality Operator
- ///
- ///
- ///
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- ///
-
- public static bool operator !=(SizeF sz1, SizeF sz2)
- {
- return ((sz1.Width != sz2.Width) ||
- (sz1.Height != sz2.Height));
- }
-
- ///
- /// Subtraction Operator
- ///
- ///
- ///
- /// Subtracts two SizeF structures.
- ///
-
- public static SizeF operator -(SizeF sz1, SizeF sz2)
- {
- return new SizeF(sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- ///
- /// SizeF to PointF Conversion
- ///
- ///
- ///
- /// Returns a PointF based on the dimensions of a given
- /// SizeF. Requires explicit cast.
- ///
-
- public static explicit operator PointF(SizeF size)
- {
- return new PointF(size.Width, size.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- ///
- /// SizeF Constructor
- ///
- ///
- ///
- /// Creates a SizeF from a PointF value.
- ///
-
- public SizeF(PointF pt)
- {
- width = pt.X;
- height = pt.Y;
- }
-
- ///
- /// SizeF Constructor
- ///
- ///
- ///
- /// Creates a SizeF from an existing SizeF value.
- ///
-
- public SizeF(SizeF size)
- {
- width = size.Width;
- height = size.Height;
- }
-
- ///
- /// SizeF Constructor
- ///
- ///
- ///
- /// Creates a SizeF from specified dimensions.
- ///
-
- public SizeF(float width, float height)
- {
- this.width = width;
- this.height = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- ///
- /// IsEmpty Property
- ///
- ///
- ///
- /// Indicates if both Width and Height are zero.
- ///
-
- public bool IsEmpty
- {
- get
- {
- return ((width == 0.0) && (height == 0.0));
- }
- }
-
- ///
- /// Width Property
- ///
- ///
- ///
- /// The Width coordinate of the SizeF.
- ///
-
- public float Width
- {
- get
- {
- return width;
- }
- set
- {
- width = value;
- }
- }
-
- ///
- /// Height Property
- ///
- ///
- ///
- /// The Height coordinate of the SizeF.
- ///
-
- public float Height
- {
- get
- {
- return height;
- }
- set
- {
- height = value;
- }
- }
-
- ///
- /// Equals Method
- ///
- ///
- ///
- /// Checks equivalence of this SizeF and another object.
- ///
-
- public override bool Equals(object obj)
- {
- if (!(obj is SizeF))
- return false;
-
- return (this == (SizeF)obj);
- }
-
- ///
- /// GetHashCode Method
- ///
- ///
- ///
- /// Calculates a hashing value.
- ///
-
- public override int GetHashCode()
- {
- return (int)width ^ (int)height;
- }
-
- public PointF ToPointF()
- {
- return new PointF(width, height);
- }
-
- public Size ToSize()
- {
- int w, h;
- checked
- {
- w = (int)width;
- h = (int)height;
- }
-
- return new Size(w, h);
- }
-
- ///
- /// ToString Method
- ///
- ///
- ///
- /// Formats the SizeF as a string in coordinate notation.
- ///
-
- public override string ToString()
- {
- return string.Format("{{Width={0}, Height={1}}}", width.ToString(CultureInfo.CurrentCulture),
- height.ToString(CultureInfo.CurrentCulture));
- }
-
-#if NET_2_0
- public static SizeF Add (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- public static SizeF Subtract (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-#endif
- }
-}
\ No newline at end of file
diff --git a/Splat/Properties/AssemblyInfo.cs b/Splat/Properties/AssemblyInfo.cs
deleted file mode 100644
index a34bab833..000000000
--- a/Splat/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Resources;
-
-// 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("Splat")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Splat")]
-[assembly: AssemblyCopyright("Copyright © 2013")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.6.2")]
-[assembly: AssemblyFileVersion("1.6.2")]
-[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/Splat/Splat-Net45.csproj b/Splat/Splat-Net45.csproj
deleted file mode 100644
index 7c2c9b380..000000000
--- a/Splat/Splat-Net45.csproj
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {252CE1C2-027A-4445-A3C2-E4D6C80A935A}
- Library
- Properties
- Splat
- Splat
- v4.5
- 512
-
-
- true
- full
- false
- bin\Debug\Net45\
- obj\Debug\Net45\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\Net45\
- obj\Release\Net45\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-NetCore45.csproj b/Splat/Splat-NetCore45.csproj
deleted file mode 100644
index 8504c4daa..000000000
--- a/Splat/Splat-NetCore45.csproj
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {18DCE642-06B7-4092-B8F4-30A675DA6929}
- Library
- Properties
- Splat
- Splat
- en-US
- 8.0
- 11
- 512
- {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
-
-
- true
- full
- false
- bin\Debug\NetCore45\
- obj\Debug\NetCore45\
- DEBUG;TRACE;NETFX_CORE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\NetCore45\
- obj\Release\NetCore45\
- TRACE;NETFX_CORE
- prompt
- 4
-
-
- true
- bin\ARM\Debug\
- DEBUG;TRACE;NETFX_CORE
- ;2008
- full
- ARM
- false
- prompt
- true
-
-
- bin\ARM\Release\
- TRACE;NETFX_CORE
- true
- ;2008
- pdbonly
- ARM
- false
- prompt
- true
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE;NETFX_CORE
- ;2008
- full
- x64
- false
- prompt
- true
-
-
- bin\x64\Release\
- TRACE;NETFX_CORE
- true
- ;2008
- pdbonly
- x64
- false
- prompt
- true
-
-
- true
- bin\x86\Debug\
- DEBUG;TRACE;NETFX_CORE
- ;2008
- full
- x86
- false
- prompt
- true
-
-
- bin\x86\Release\
- TRACE;NETFX_CORE
- true
- ;2008
- pdbonly
- x86
- false
- prompt
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Splat/Splat-Portable.csproj b/Splat/Splat-Portable.csproj
deleted file mode 100644
index 3f2498b58..000000000
--- a/Splat/Splat-Portable.csproj
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
- 11.0
- Debug
- AnyCPU
- {0EC8DBA1-D745-4EE5-993A-6026440EC3BF}
- Library
- Properties
- Splat
- Splat
- v4.5
- Profile78
- 512
- {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 10.0.0
- 2.0
-
-
- true
- full
- false
- bin\Debug\Portable-net45+win+wpa81+wp80\
- obj\Debug\Portable-net45+win+wpa81+wp80\
- DEBUG;TRACE;PORTABLE
- prompt
- 4
-
-
- true
- bin\Release\Portable-net45+win+wpa81+wp80\
- obj\Release\Portable-net45+win+wpa81+wp80\
- TRACE;PORTABLE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-XamarinIOS.csproj b/Splat/Splat-XamarinIOS.csproj
deleted file mode 100644
index 244fbeb92..000000000
--- a/Splat/Splat-XamarinIOS.csproj
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 8.0.30703
- 2.0
- {E5EEF584-2A8A-4067-8309-15FE4D65DD64}
- Library
- Splat
- Resources
- Splat
-
-
- true
- full
- false
- bin\Debug\Xamarin.iOS10
- obj\Debug\Xamarin.iOS10
- DEBUG;UNIFIED;UIKIT
- prompt
- 4
- false
-
-
- full
- true
- UNIFIED;UIKIT
- bin\Release\Xamarin.iOS10
- obj\Release\Xamarin.iOS10
- prompt
- 4
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-XamarinMac.csproj b/Splat/Splat-XamarinMac.csproj
deleted file mode 100644
index 5540db2b2..000000000
--- a/Splat/Splat-XamarinMac.csproj
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 8.0.30703
- 2.0
- {990825BE-73ED-4A31-9178-B88119A72F61}
- Library
- Splat
- Resources
- Splat
- Xamarin.Mac
- v2.0
-
-
- true
- full
- false
- bin\Debug\Xamarin.Mac10
- bin\Debug\Xamarin.Mac10
- DEBUG;UNIFIED
- prompt
- 4
- false
- false
- false
- false
- false
- false
- false
-
-
- full
- true
- UNIFIED
- bin\Release\Xamarin.Mac10
- bin\Release\Xamarin.Mac10
- prompt
- 4
- false
- false
- false
- false
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-monoandroid.csproj b/Splat/Splat-monoandroid.csproj
deleted file mode 100644
index 7cc73b7ef..000000000
--- a/Splat/Splat-monoandroid.csproj
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {E429F061-65F1-4B17-A122-F6115840D56D}
- {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Splat
- Resources\Resource.designer.cs
- Resource
- Resources
- Assets
- Splat
- v2.3
-
-
- true
- full
- false
- bin\Debug\monoandroid
- obj\Debug\monoandroid
- DEBUG;
- prompt
- 4
- None
- false
-
-
- pdbonly
- true
- bin\Release\monoandroid
- obj\Release\monoandroid
- prompt
- 4
- false
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-monomac.csproj b/Splat/Splat-monomac.csproj
deleted file mode 100644
index fd17a9c0d..000000000
--- a/Splat/Splat-monomac.csproj
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {252CE1CF-331C-4445-A3C2-E4D6C80A935A}
- {42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Properties
- Splat
- Splat
- v4.5
- 512
- 10.0.0
- 2.0
-
-
- true
- full
- false
- bin\Debug\MonoMac\
- obj\Debug\MonoMac\
- DEBUG;TRACE
- prompt
- 4
- false
- false
- false
- false
- false
-
-
- pdbonly
- true
- bin\Release\MonoMac\
- obj\Release\MonoMac\
- TRACE
- prompt
- 4
- false
- false
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-monotouch.csproj b/Splat/Splat-monotouch.csproj
deleted file mode 100644
index 367eb87f9..000000000
--- a/Splat/Splat-monotouch.csproj
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {95E74294-9538-44F3-AC97-F83760565242}
- {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Library
- Splat
- Resources
- Splat
-
-
- true
- full
- false
- bin\Debug\monotouch
- obj\Debug\monotouch
- DEBUG; UIKIT
- prompt
- 4
- false
-
-
- true
- bin\Release\monotouch
- obj\Release\monotouch
- prompt
- 4
- false
- UIKIT
- true
- pdbonly
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-wp8.csproj b/Splat/Splat-wp8.csproj
deleted file mode 100644
index e0ce7905d..000000000
--- a/Splat/Splat-wp8.csproj
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 10.0.20506
- 2.0
- {95309EA3-055A-4B66-84DE-7771237CCF6C}
- {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
- Library
- Properties
- Splat
- Splat
- WindowsPhone
- v8.0
- $(TargetFrameworkVersion)
- false
- true
- 11.0
- true
-
-
- true
- full
- false
- Bin\Debug\wp8\
- obj\Debug\wp8\
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\Release\wp8\
- obj\Release\wp8\
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- true
- full
- false
- Bin\x86\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\x86\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- true
- full
- false
- Bin\ARM\Debug
- DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
- pdbonly
- true
- Bin\ARM\Release
- TRACE;SILVERLIGHT;WINDOWS_PHONE
- true
- true
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Splat/Splat-wpa81.csproj b/Splat/Splat-wpa81.csproj
deleted file mode 100644
index fee34625b..000000000
--- a/Splat/Splat-wpa81.csproj
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
- 12.0
- Debug
- AnyCPU
- {E3C22E93-6CA9-4781-A3DE-D6DF775E8AE7}
- Library
- Properties
- Splat
- Splat
- 512
- {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 10.0.0
- 2.0
- Profile32
- v4.6
-
-
- true
- full
- false
- bin\Debug\Portable-Win81+Wpa81
- obj\Debug\Portable-Win81+Wpa81
- TRACE;DEBUG;NETFX_CORE
- prompt
- 4
-
-
- true
- true
- bin\Release\Portable-Win81+Wpa81
- obj\Release\Portable-Win81+Wpa81
- TRACE;NETFX_CORE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Splat/WinForms/Bitmaps.cs b/Splat/WinForms/Bitmaps.cs
deleted file mode 100644
index 92a574aaa..000000000
--- a/Splat/WinForms/Bitmaps.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Splat.WinForms
-{
- public class PlatformBitmapLoader : IBitmapLoader
- {
- public Task Load(Stream sourceStream, float? desiredWidth, float? desiredHeight)
- {
- return Task.Run(() => {
- var ret = new Bitmap(sourceStream);
-
- if (desiredWidth != null) {
- ret = new Bitmap(ret, (int)desiredWidth, (int)desiredHeight);
- }
-
- return (IBitmap)new BitmapBitmap(ret);
- });
- }
-
- public Task LoadFromResource(string source, float? desiredWidth, float? desiredHeight)
- {
- return Task.Run(() => {
- var ret = new Bitmap(source);
-
- if (desiredWidth != null) {
- ret = new Bitmap(ret, (int)desiredWidth, (int)desiredHeight);
- }
-
- return (IBitmap)new BitmapBitmap(ret);
- });
- }
-
- public IBitmap Create(float width, float height)
- {
- return (IBitmap)new BitmapBitmap(new Bitmap((int)width, (int)height));
- }
- }
-
- class BitmapBitmap : IBitmap
- {
- internal Bitmap inner;
-
- public float Width { get; protected set; }
- public float Height { get; protected set; }
-
- public BitmapBitmap(Bitmap bitmap)
- {
- inner = bitmap;
- Width = (float)inner.Width;
- Height = (float)inner.Height;
- }
-
- public Task Save(CompressedBitmapFormat format, float quality, Stream target)
- {
- return Task.Run(() => {
- if (format == CompressedBitmapFormat.Jpeg) {
- var jpgEncoder = GetEncoder(ImageFormat.Jpeg);
- var encoderParams = new EncoderParameters(1);
- var encoderParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (int)(quality * 100.0f));
- encoderParams.Param[0] = encoderParam;
- inner.Save(target, jpgEncoder, encoderParams);
- } else {
- inner.Save(target, ImageFormat.Png);
- }
- });
- }
-
- public void Dispose()
- {
- inner.Dispose();
- }
-
- ImageCodecInfo GetEncoder(ImageFormat format)
- {
- var codecs = ImageCodecInfo.GetImageEncoders();
-
- foreach (var codec in codecs) {
- if (codec.FormatID == format.Guid) {
- return codec;
- }
- }
-
- return null;
- }
- }
-
- public static class BitmapMixins
- {
- public static IBitmap FromNative(this Bitmap This)
- {
- return new BitmapBitmap(This);
- }
-
- public static Bitmap ToNative(this IBitmap This)
- {
- return ((BitmapBitmap)This).inner;
- }
- }
-}
diff --git a/Splat/WinRT/Point.cs b/Splat/WinRT/Point.cs
deleted file mode 100644
index bc8dbb950..000000000
--- a/Splat/WinRT/Point.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.Foundation;
-
-namespace Splat
-{
- public static class PointExtensions
- {
- public static Point ToNative(this System.Drawing.Point This)
- {
- return new Point(This.X, This.Y);
- }
-
- public static Point ToNative(this System.Drawing.PointF This)
- {
- return new Point(This.X, This.Y);
- }
-
- public static Size ToNative(this System.Drawing.Size This)
- {
- return new Size(This.Width, This.Height);
- }
-
- public static Size ToNative(this System.Drawing.SizeF This)
- {
- return new Size(This.Width, This.Height);
- }
-
- public static System.Drawing.PointF FromNative(this Point This)
- {
- return new System.Drawing.PointF((float)This.X, (float)This.Y);
- }
-
- public static System.Drawing.SizeF FromNative(this Size This)
- {
- return new System.Drawing.SizeF((float)This.Width, (float)This.Height);
- }
- }
-}
\ No newline at end of file
diff --git a/Splat/WinRT/Rect.cs b/Splat/WinRT/Rect.cs
deleted file mode 100644
index 074dd7b56..000000000
--- a/Splat/WinRT/Rect.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.Foundation;
-
-namespace Splat
-{
- public static class RectExtensions
- {
- public static Rect ToNative(this System.Drawing.Rectangle This)
- {
- return new Rect(This.X, This.Y, This.Width, This.Height);
- }
-
- public static Rect ToNative(this System.Drawing.RectangleF This)
- {
- return new Rect(This.X, This.Y, This.Width, This.Height);
- }
-
- public static System.Drawing.RectangleF FromNative(this Rect This)
- {
- return new System.Drawing.RectangleF((float)This.X, (float)This.Y, (float)This.Width, (float)This.Height);
- }
- }
-}
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 000000000..7d2ebbc83
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,42 @@
+# configuration for "master" branch
+-
+ image: Visual Studio 2017
+ configuration: Release
+ branches:
+ only:
+ - master
+ version: 1.0.{build}
+ environment:
+ GITHUB_USERNAME:
+ secure: 0Q9MvUId56SizmZwCf0cgg==
+ GITHUB_TOKEN:
+ secure: cDWUFbL2fl7VaypzZWe4FjJccQX6T4N+UV9bM9iJtByttr5RhxtOROi5/fvnmp2i
+ NUGET_SOURCE: https://www.nuget.org/api/v2/package
+ NUGET_APIKEY:
+ secure: ELiBJuPIyjt3adBoySwp1ByTYk8IEUQSol07EzbDvOdhnxcSBmj3Itl4HPLtlbbG
+ build_script:
+ - ./build.cmd
+ artifacts:
+ - path: artifacts/*
+ - path: '**/bin/*'
+ test: off
+
+# configuration for "develop" branch
+-
+ image: Visual Studio 2017
+ configuration: Development
+ branches:
+ except:
+ - master
+ skip_branch_with_pr: true
+ version: 1.0.{build}
+ environment:
+ NUGET_SOURCE: https://www.myget.org/F/splat/api/v2/package
+ NUGET_APIKEY:
+ secure: bws/D/nus12zFcbVqDfVbB/ye23dMyM/7g52dezibJ28FTjtjudwEWvm0Y4NHVfb
+ build_script:
+ - ./build.cmd
+ artifacts:
+ - path: artifacts/*
+ - path: '**/bin/*'
+ test: off
diff --git a/Logo.psd b/assets/Logo.psd
similarity index 100%
rename from Logo.psd
rename to assets/Logo.psd
diff --git a/build.cake b/build.cake
new file mode 100644
index 000000000..2bf93dee7
--- /dev/null
+++ b/build.cake
@@ -0,0 +1,131 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+//////////////////////////////////////////////////////////////////////
+// ADDINS
+//////////////////////////////////////////////////////////////////////
+
+#addin "nuget:?package=Cake.FileHelpers&version=2.0.0"
+#addin "nuget:?package=Cake.Powershell&version=0.4.3"
+
+//////////////////////////////////////////////////////////////////////
+// TOOLS
+//////////////////////////////////////////////////////////////////////
+
+#tool "nuget:?package=vswhere&version=2.4.1"
+
+//////////////////////////////////////////////////////////////////////
+// ARGUMENTS
+//////////////////////////////////////////////////////////////////////
+
+var target = Argument("target", "Default");
+if (string.IsNullOrWhiteSpace(target))
+{
+ target = "Default";
+}
+
+//////////////////////////////////////////////////////////////////////
+// PREPARATION
+//////////////////////////////////////////////////////////////////////
+
+// Should MSBuild treat any errors as warnings?
+var treatWarningsAsErrors = false;
+
+// Build configuration
+var local = BuildSystem.IsLocalBuild;
+var isPullRequest = !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"));
+var isRepository = StringComparer.OrdinalIgnoreCase.Equals("reactiveui/spalt", TFBuild.Environment.Repository.RepoName);
+
+var msBuildPath = VSWhereLatest().CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe");
+
+var informationalVersion = EnvironmentVariable("GitAssemblyInformationalVersion");
+
+// Artifacts
+var artifactDirectory = "./artifacts/";
+var packageWhitelist = new[] { "splat" };
+
+// Define global marcos.
+Action Abort = () => { throw new Exception("a non-recoverable fatal error occurred."); };
+
+///////////////////////////////////////////////////////////////////////////////
+// SETUP / TEARDOWN
+///////////////////////////////////////////////////////////////////////////////
+Setup(context =>
+{
+ if (!IsRunningOnWindows())
+ {
+ throw new NotImplementedException("Splat will only build on Windows (w/Xamarin installed) because it's not possible to target UWP, WPF and Windows Forms from UNIX.");
+ }
+
+ Information("Building version {0} of Splat.", informationalVersion);
+
+ CreateDirectory(artifactDirectory);
+});
+
+Teardown(context =>
+{
+ // Executed AFTER the last task.
+});
+
+//////////////////////////////////////////////////////////////////////
+// TASKS
+//////////////////////////////////////////////////////////////////////
+
+Task("Build")
+ .Does (() =>
+{
+ Action build = (solution, name) =>
+ {
+ Information("Building {0} using {1}", solution, msBuildPath);
+
+ MSBuild(solution, new MSBuildSettings() {
+ ToolPath = msBuildPath,
+ ArgumentCustomization = args => args.Append("/m /restore")
+ }
+ .WithTarget("build;pack")
+ .WithProperty("PackageOutputPath", MakeAbsolute(Directory(artifactDirectory)).ToString().Quote())
+ .WithProperty("TreatWarningsAsErrors", treatWarningsAsErrors.ToString())
+ .SetConfiguration("Release")
+ .SetVerbosity(Verbosity.Minimal)
+ .SetNodeReuse(false));
+ };
+
+ foreach(var package in packageWhitelist)
+ {
+ build("./src/" + package + "/" + package + ".csproj", package);
+ }
+});
+
+Task("SignPackages")
+ .WithCriteria(() => !local)
+ .WithCriteria(() => !isPullRequest)
+ .Does(() =>
+{
+ StartPowershellFile("./SignPackages.ps1", args =>
+ {
+ });
+});
+
+Task("Package")
+ .IsDependentOn("Build")
+ .IsDependentOn("SignPackages")
+ .Does (() =>
+{
+});
+
+//////////////////////////////////////////////////////////////////////
+// TASK TARGETS
+//////////////////////////////////////////////////////////////////////
+
+Task("Default")
+ .IsDependentOn("Package")
+ .Does (() =>
+{
+});
+
+//////////////////////////////////////////////////////////////////////
+// EXECUTION
+//////////////////////////////////////////////////////////////////////
+
+RunTarget(target);
diff --git a/build.cmd b/build.cmd
new file mode 100644
index 000000000..ec3dc97bd
--- /dev/null
+++ b/build.cmd
@@ -0,0 +1,6 @@
+@echo off
+tools\nuget\nuget.exe install Cake -OutputDirectory tools -ExcludeVersion -Version 0.22.1
+
+tools\Cake\Cake.exe build.cake --target=%1
+
+exit /b %errorlevel%
diff --git a/key.snk b/key.snk
new file mode 100644
index 000000000..14a5fc1ad
Binary files /dev/null and b/key.snk differ
diff --git a/script/clean-merged-branches b/script/clean-merged-branches
new file mode 100644
index 000000000..ead749f36
--- /dev/null
+++ b/script/clean-merged-branches
@@ -0,0 +1,41 @@
+#!/bin/sh
+#/ Usage: clean-merged-branches [-f]
+#/ Delete merged branches from the origin remote.
+#/
+#/ Options:
+#/ -f Really delete the branches. Without this branches are shown
+#/ but nothing is deleted.
+set -e
+
+# show usage maybe
+[ "$1" = "--help" ] && {
+ grep '^#/' <"$0"| cut -c4-
+ exit 0
+}
+
+# fetch and prune remote branches
+git fetch origin --prune
+
+# grab list of merged branches
+branches=$(
+ git branch -a --merged origin/master |
+ grep remotes/origin/ |
+ grep -v /master |
+ grep -v 'enterprise-.*-release' |
+ sed 's@remotes/origin/@@'
+)
+
+# bail out with no branches
+[ -z "$branches" ] && {
+ echo "no merged branches detected" 1>&2
+ exit 0
+}
+
+# delete the branches or just show what would be done without -f
+if [ "$1" = -f ]; then
+ git push origin $(echo "$branches" | sed 's/^ */:/')
+else
+ echo "These branches will be deleted:" 1>&2
+ echo "$branches"
+ echo "Run \`$0 -f' if you're sure."
+fi
diff --git a/script/setversion.csproj b/script/setversion.csproj
new file mode 100644
index 000000000..1f2887636
--- /dev/null
+++ b/script/setversion.csproj
@@ -0,0 +1,10 @@
+
+
+
+ netstandard2.0
+
+
+
+
+
+
diff --git a/script/version.json b/script/version.json
new file mode 100644
index 000000000..f1b52a7dc
--- /dev/null
+++ b/script/version.json
@@ -0,0 +1,8 @@
+{
+ "inherit": true,
+ "cloudBuild": {
+ "buildNumber": {
+ "enabled": true
+ }
+ }
+}
diff --git a/src/Directory.build.props b/src/Directory.build.props
new file mode 100644
index 000000000..74ef73525
--- /dev/null
+++ b/src/Directory.build.props
@@ -0,0 +1,27 @@
+
+
+ Copyright (c) .NET Foundation and Contributors
+ https://opensource.org/licenses/mit
+ https://github.com/reactiveui/splat/
+ http://f.cl.ly/items/1307401C3x2g3F2p2Z36/Logo.png
+ .NET Foundation and Contributors
+ xpaulbettsx;ghuntley
+ drawing;colours;geometry;logging;unit test detection;service location;image handling;portable;xamarin;xamarin ios;xamarin mac;android;monodroid;uwp;net45
+ https://github.com/reactiveui/splat/releases
+ https://github.com/reactiveui/splat
+ git
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Directory.build.targets b/src/Directory.build.targets
new file mode 100644
index 000000000..4337760ae
--- /dev/null
+++ b/src/Directory.build.targets
@@ -0,0 +1,17 @@
+
+
+ $(DefineConstants);NET_45;XAML
+
+
+ $(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP
+
+
+ $(DefineConstants);MONO;UIKIT;COCOA
+
+
+ $(DefineConstants);MONO;COCOA
+
+
+ $(DefineConstants);MONO;ANDROID
+
+
diff --git a/src/NuGet.config b/src/NuGet.config
new file mode 100644
index 000000000..b8c71a51b
--- /dev/null
+++ b/src/NuGet.config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Splat.sln b/src/Splat.sln
new file mode 100644
index 000000000..8cd302c24
--- /dev/null
+++ b/src/Splat.sln
@@ -0,0 +1,34 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27004.2005
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Splat", "Splat\Splat.csproj", "{8535BDE3-25B5-41D6-BF5D-2DF766AE879B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C7B370F1-BEF3-4AB7-BA08-CC5D83E74598}"
+ ProjectSection(SolutionItems) = preProject
+ Directory.build.props = Directory.build.props
+ Directory.build.targets = Directory.build.targets
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8535BDE3-25B5-41D6-BF5D-2DF766AE879B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8535BDE3-25B5-41D6-BF5D-2DF766AE879B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8535BDE3-25B5-41D6-BF5D-2DF766AE879B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8535BDE3-25B5-41D6-BF5D-2DF766AE879B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E833ED14-B971-4E09-B27E-76E99BC0FC10}
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = Splat\Splat-monotouch.csproj
+ EndGlobalSection
+EndGlobal
diff --git a/Splat/AssemblyFinder.cs b/src/Splat/AssemblyFinder.cs
similarity index 100%
rename from Splat/AssemblyFinder.cs
rename to src/Splat/AssemblyFinder.cs
diff --git a/Splat/Bitmaps.cs b/src/Splat/Bitmaps.cs
similarity index 100%
rename from Splat/Bitmaps.cs
rename to src/Splat/Bitmaps.cs
diff --git a/Splat/Colors/KnownColor.cs b/src/Splat/Colors/KnownColor.cs
similarity index 99%
rename from Splat/Colors/KnownColor.cs
rename to src/Splat/Colors/KnownColor.cs
index fd56800fe..d3583366e 100644
--- a/Splat/Colors/KnownColor.cs
+++ b/src/Splat/Colors/KnownColor.cs
@@ -1,5 +1,5 @@
//
-// System.Drawing.Color.cs
+// System.Drawing.KnownColor.cs
//
// Author:
// Dennis Hayes (dennish@raytek.com)
@@ -28,7 +28,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Drawing
+namespace Splat
{
#if ONLY_1_1
@@ -211,4 +211,4 @@ public enum KnownColor
MenuBar = 173,
MenuHighlight = 174
}
-}
\ No newline at end of file
+}
diff --git a/Splat/Colors/KnownColors.cs b/src/Splat/Colors/KnownColors.cs
similarity index 97%
rename from Splat/Colors/KnownColors.cs
rename to src/Splat/Colors/KnownColors.cs
index 418a21787..8b3e3ee2c 100644
--- a/Splat/Colors/KnownColors.cs
+++ b/src/Splat/Colors/KnownColors.cs
@@ -28,7 +28,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-namespace System.Drawing
+using System;
+
+namespace Splat
{
#if NET_2_0
@@ -284,25 +286,25 @@ static void RetrieveWindowsSystemColors()
}
#endif
- public static Color FromKnownColor(KnownColor kc)
+ public static SplatColor FromKnownColor(KnownColor kc)
{
- Color c;
+ SplatColor c;
short n = (short)kc;
if ((n <= 0) || (n >= ArgbValues.Length))
{
// This is what it returns!
- c = Color.FromArgb(0, 0, 0, 0);
+ c = SplatColor.FromArgb(0, 0, 0, 0);
#if ONLY_1_1
c.name = kc.ToString ();
#endif
- c.state |= (short)Color.ColorType.Named;
+ c.state |= (short)SplatColor.ColorType.Named;
}
else
{
- c = new Color();
- c.state = (short)(Color.ColorType.ARGB | Color.ColorType.Known | Color.ColorType.Named);
+ c = new SplatColor();
+ c.state = (short)(SplatColor.ColorType.ARGB | SplatColor.ColorType.Known | SplatColor.ColorType.Named);
if ((n < 27) || (n > 169))
- c.state |= (short)Color.ColorType.System;
+ c.state |= (short)SplatColor.ColorType.System;
c.Value = ArgbValues[n];
#if ONLY_1_1
c.name = GetName (n);
@@ -502,7 +504,7 @@ public static string GetName(KnownColor kc)
}
// FIXME: Linear scan
- public static Color FindColorMatch(Color c)
+ public static SplatColor FindColorMatch(SplatColor c)
{
uint argb = (uint)c.ToArgb();
@@ -516,14 +518,14 @@ public static Color FindColorMatch(Color c)
return KnownColors.FromKnownColor((KnownColor)i);
}
- return Color.Empty;
+ return SplatColor.Empty;
}
- // When this method is called, we teach any new color(s) to the Color class
+ // When this method is called, we teach any new color(s) to the SplatColor class
// NOTE: This is called (reflection) by System.Windows.Forms.Theme (this isn't dead code)
public static void Update(int knownColor, int color)
{
ArgbValues[knownColor] = (uint)color;
}
}
-}
\ No newline at end of file
+}
diff --git a/Splat/Colors/Color.cs b/src/Splat/Colors/SplatColor.cs
similarity index 75%
rename from Splat/Colors/Color.cs
rename to src/Splat/Colors/SplatColor.cs
index 9ef57abfc..457f4b147 100644
--- a/Splat/Colors/Color.cs
+++ b/src/Splat/Colors/SplatColor.cs
@@ -33,14 +33,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
-namespace System.Drawing
+namespace Splat
{
[DataContract]
- public struct Color
+ public struct SplatColor
{
// Private transparency (A) and R,G,B fields.
@@ -68,24 +69,24 @@ internal enum ColorType : short
internal string name;
// #endif
#if TARGET_JVM
- internal java.awt.Color NativeObject {
+ internal java.awt.SplatColor NativeObject {
get {
- return new java.awt.Color (R, G, B, A);
+ return new java.awt.SplatColor (R, G, B, A);
}
}
- internal static Color FromArgbNamed (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
+ internal static SplatColor FromArgbNamed (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
{
- Color color = FromArgb (alpha, red, green, blue);
+ SplatColor color = FromArgb (alpha, red, green, blue);
color.state = (short) (ColorType.Known|ColorType.Named);
color.name = KnownColors.GetName (knownColor);
color.knownColor = (short) knownColor;
return color;
}
- internal static Color FromArgbSystem (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
+ internal static SplatColor FromArgbSystem (int alpha, int red, int green, int blue, string name, KnownColor knownColor)
{
- Color color = FromArgbNamed (alpha, red, green, blue, name, knownColor);
+ SplatColor color = FromArgbNamed (alpha, red, green, blue, name, knownColor);
color.state |= (short) ColorType.System;
return color;
}
@@ -102,8 +103,7 @@ public string Name
return String.Format ("{0:x}", ToArgb ());
#else
// name is required for serialization under 1.x, but not under 2.0
- if (name == null)
- {
+ if (name == null) {
// Can happen with stuff deserialized from MS
if (IsNamedColor)
name = KnownColors.GetName(knownColor);
@@ -146,8 +146,7 @@ internal long Value
{
// Optimization for known colors that were deserialized
// from an MS serialized stream.
- if (value == 0 && IsKnownColor)
- {
+ if (value == 0 && IsKnownColor) {
value = KnownColors.FromKnownColor((KnownColor)knownColor).ToArgb() & 0xFFFFFFFF;
}
return value;
@@ -155,15 +154,15 @@ internal long Value
set { this.value = value; }
}
- public static Color FromArgb(int red, int green, int blue)
+ public static SplatColor FromArgb(int red, int green, int blue)
{
return FromArgb(255, red, green, blue);
}
- public static Color FromArgb(int alpha, int red, int green, int blue)
+ public static SplatColor FromArgb(int alpha, int red, int green, int blue)
{
CheckARGBValues(alpha, red, green, blue);
- Color color = new Color();
+ SplatColor color = new SplatColor();
color.state = (short)ColorType.ARGB;
color.Value = (int)((uint)alpha << 24) + (red << 16) + (green << 8) + blue;
return color;
@@ -174,32 +173,29 @@ public int ToArgb()
return (int)Value;
}
- public static Color FromArgb(int alpha, Color baseColor)
+ public static SplatColor FromArgb(int alpha, SplatColor baseColor)
{
return FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B);
}
- public static Color FromArgb(int argb)
+ public static SplatColor FromArgb(int argb)
{
return FromArgb((argb >> 24) & 0x0FF, (argb >> 16) & 0x0FF, (argb >> 8) & 0x0FF, argb & 0x0FF);
}
- public static Color FromKnownColor(KnownColor color)
+ public static SplatColor FromKnownColor(KnownColor color)
{
return KnownColors.FromKnownColor(color);
}
- public static Color FromName(string name)
+ public static SplatColor FromName(string name)
{
- try
- {
+ try {
KnownColor kc = (KnownColor)Enum.Parse(typeof(KnownColor), name, true);
return KnownColors.FromKnownColor(kc);
- }
- catch
- {
+ } catch {
// This is what it returns!
- Color d = FromArgb(0, 0, 0, 0);
+ SplatColor d = FromArgb(0, 0, 0, 0);
d.name = name;
d.state |= (short)ColorType.Named;
return d;
@@ -215,22 +211,22 @@ public static Color FromName(string name)
///
///
///
- /// An uninitialized Color Structure
+ /// An uninitialized SplatColor Structure
///
- public static readonly Color Empty;
+ public static readonly SplatColor Empty;
///
/// Equality Operator
///
///
///
- /// Compares two Color objects. The return value is
+ /// Compares two SplatColor objects. The return value is
/// based on the equivalence of the A,R,G,B properties
/// of the two Colors.
///
- public static bool operator ==(Color left, Color right)
+ public static bool operator ==(SplatColor left, SplatColor right)
{
if (left.Value != right.Value)
return false;
@@ -240,8 +236,7 @@ public static Color FromName(string name)
return false;
if (left.IsEmpty != right.IsEmpty)
return false;
- if (left.IsNamedColor)
- {
+ if (left.IsNamedColor) {
// then both are named (see previous check) and so we need to compare them
// but otherwise we don't as it kills performance (Name calls String.Format)
if (left.Name != right.Name)
@@ -255,12 +250,12 @@ public static Color FromName(string name)
///
///
///
- /// Compares two Color objects. The return value is
+ /// Compares two SplatColor objects. The return value is
/// based on the equivalence of the A,R,G,B properties
/// of the two colors.
///
- public static bool operator !=(Color left, Color right)
+ public static bool operator !=(SplatColor left, SplatColor right)
{
return !(left == right);
}
@@ -374,14 +369,14 @@ public byte B
///
///
///
- /// Checks equivalence of this Color and another object.
+ /// Checks equivalence of this SplatColor and another object.
///
public override bool Equals(object obj)
{
- if (!(obj is Color))
+ if (!(obj is SplatColor))
return false;
- Color c = (Color)obj;
+ SplatColor c = (SplatColor)obj;
return this == c;
}
@@ -392,12 +387,12 @@ public override bool Equals(object obj)
///
///
///
- /// Checks equivalence of this Color and another object.
+ /// Checks equivalence of this SplatColor and another object.
///
//public bool ReferenceEquals (object o)
//{
- // if (!(o is Color))return false;
- // return (this == (Color) o);
+ // if (!(o is SplatColor))return false;
+ // return (this == (SplatColor) o);
//}
@@ -423,19 +418,19 @@ public override int GetHashCode()
///
///
///
- /// Formats the Color as a string in ARGB notation.
+ /// Formats the SplatColor as a string in ARGB notation.
///
public override string ToString()
{
if (IsEmpty)
- return "Color [Empty]";
+ return "SplatColor [Empty]";
// Use the property here, not the field.
if (IsNamedColor)
- return "Color [" + Name + "]";
+ return "SplatColor [" + Name + "]";
- return String.Format("Color [A={0}, R={1}, G={2}, B={3}]", A, R, G, B);
+ return String.Format("SplatColor [A={0}, R={1}, G={2}, B={3}]", A, R, G, B);
}
private static void CheckRGBValues(int red, int green, int blue)
@@ -463,709 +458,709 @@ private static void CheckARGBValues(int alpha, int red, int green, int blue)
}
- static public Color Transparent
+ static public SplatColor Transparent
{
get { return KnownColors.FromKnownColor(KnownColor.Transparent); }
}
- static public Color AliceBlue
+ static public SplatColor AliceBlue
{
get { return KnownColors.FromKnownColor(KnownColor.AliceBlue); }
}
- static public Color AntiqueWhite
+ static public SplatColor AntiqueWhite
{
get { return KnownColors.FromKnownColor(KnownColor.AntiqueWhite); }
}
- static public Color Aqua
+ static public SplatColor Aqua
{
get { return KnownColors.FromKnownColor(KnownColor.Aqua); }
}
- static public Color Aquamarine
+ static public SplatColor Aquamarine
{
get { return KnownColors.FromKnownColor(KnownColor.Aquamarine); }
}
- static public Color Azure
+ static public SplatColor Azure
{
get { return KnownColors.FromKnownColor(KnownColor.Azure); }
}
- static public Color Beige
+ static public SplatColor Beige
{
get { return KnownColors.FromKnownColor(KnownColor.Beige); }
}
- static public Color Bisque
+ static public SplatColor Bisque
{
get { return KnownColors.FromKnownColor(KnownColor.Bisque); }
}
- static public Color Black
+ static public SplatColor Black
{
get { return KnownColors.FromKnownColor(KnownColor.Black); }
}
- static public Color BlanchedAlmond
+ static public SplatColor BlanchedAlmond
{
get { return KnownColors.FromKnownColor(KnownColor.BlanchedAlmond); }
}
- static public Color Blue
+ static public SplatColor Blue
{
get { return KnownColors.FromKnownColor(KnownColor.Blue); }
}
- static public Color BlueViolet
+ static public SplatColor BlueViolet
{
get { return KnownColors.FromKnownColor(KnownColor.BlueViolet); }
}
- static public Color Brown
+ static public SplatColor Brown
{
get { return KnownColors.FromKnownColor(KnownColor.Brown); }
}
- static public Color BurlyWood
+ static public SplatColor BurlyWood
{
get { return KnownColors.FromKnownColor(KnownColor.BurlyWood); }
}
- static public Color CadetBlue
+ static public SplatColor CadetBlue
{
get { return KnownColors.FromKnownColor(KnownColor.CadetBlue); }
}
- static public Color Chartreuse
+ static public SplatColor Chartreuse
{
get { return KnownColors.FromKnownColor(KnownColor.Chartreuse); }
}
- static public Color Chocolate
+ static public SplatColor Chocolate
{
get { return KnownColors.FromKnownColor(KnownColor.Chocolate); }
}
- static public Color Coral
+ static public SplatColor Coral
{
get { return KnownColors.FromKnownColor(KnownColor.Coral); }
}
- static public Color CornflowerBlue
+ static public SplatColor CornflowerBlue
{
get { return KnownColors.FromKnownColor(KnownColor.CornflowerBlue); }
}
- static public Color Cornsilk
+ static public SplatColor Cornsilk
{
get { return KnownColors.FromKnownColor(KnownColor.Cornsilk); }
}
- static public Color Crimson
+ static public SplatColor Crimson
{
get { return KnownColors.FromKnownColor(KnownColor.Crimson); }
}
- static public Color Cyan
+ static public SplatColor Cyan
{
get { return KnownColors.FromKnownColor(KnownColor.Cyan); }
}
- static public Color DarkBlue
+ static public SplatColor DarkBlue
{
get { return KnownColors.FromKnownColor(KnownColor.DarkBlue); }
}
- static public Color DarkCyan
+ static public SplatColor DarkCyan
{
get { return KnownColors.FromKnownColor(KnownColor.DarkCyan); }
}
- static public Color DarkGoldenrod
+ static public SplatColor DarkGoldenrod
{
get { return KnownColors.FromKnownColor(KnownColor.DarkGoldenrod); }
}
- static public Color DarkGray
+ static public SplatColor DarkGray
{
get { return KnownColors.FromKnownColor(KnownColor.DarkGray); }
}
- static public Color DarkGreen
+ static public SplatColor DarkGreen
{
get { return KnownColors.FromKnownColor(KnownColor.DarkGreen); }
}
- static public Color DarkKhaki
+ static public SplatColor DarkKhaki
{
get { return KnownColors.FromKnownColor(KnownColor.DarkKhaki); }
}
- static public Color DarkMagenta
+ static public SplatColor DarkMagenta
{
get { return KnownColors.FromKnownColor(KnownColor.DarkMagenta); }
}
- static public Color DarkOliveGreen
+ static public SplatColor DarkOliveGreen
{
get { return KnownColors.FromKnownColor(KnownColor.DarkOliveGreen); }
}
- static public Color DarkOrange
+ static public SplatColor DarkOrange
{
get { return KnownColors.FromKnownColor(KnownColor.DarkOrange); }
}
- static public Color DarkOrchid
+ static public SplatColor DarkOrchid
{
get { return KnownColors.FromKnownColor(KnownColor.DarkOrchid); }
}
- static public Color DarkRed
+ static public SplatColor DarkRed
{
get { return KnownColors.FromKnownColor(KnownColor.DarkRed); }
}
- static public Color DarkSalmon
+ static public SplatColor DarkSalmon
{
get { return KnownColors.FromKnownColor(KnownColor.DarkSalmon); }
}
- static public Color DarkSeaGreen
+ static public SplatColor DarkSeaGreen
{
get { return KnownColors.FromKnownColor(KnownColor.DarkSeaGreen); }
}
- static public Color DarkSlateBlue
+ static public SplatColor DarkSlateBlue
{
get { return KnownColors.FromKnownColor(KnownColor.DarkSlateBlue); }
}
- static public Color DarkSlateGray
+ static public SplatColor DarkSlateGray
{
get { return KnownColors.FromKnownColor(KnownColor.DarkSlateGray); }
}
- static public Color DarkTurquoise
+ static public SplatColor DarkTurquoise
{
get { return KnownColors.FromKnownColor(KnownColor.DarkTurquoise); }
}
- static public Color DarkViolet
+ static public SplatColor DarkViolet
{
get { return KnownColors.FromKnownColor(KnownColor.DarkViolet); }
}
- static public Color DeepPink
+ static public SplatColor DeepPink
{
get { return KnownColors.FromKnownColor(KnownColor.DeepPink); }
}
- static public Color DeepSkyBlue
+ static public SplatColor DeepSkyBlue
{
get { return KnownColors.FromKnownColor(KnownColor.DeepSkyBlue); }
}
- static public Color DimGray
+ static public SplatColor DimGray
{
get { return KnownColors.FromKnownColor(KnownColor.DimGray); }
}
- static public Color DodgerBlue
+ static public SplatColor DodgerBlue
{
get { return KnownColors.FromKnownColor(KnownColor.DodgerBlue); }
}
- static public Color Firebrick
+ static public SplatColor Firebrick
{
get { return KnownColors.FromKnownColor(KnownColor.Firebrick); }
}
- static public Color FloralWhite
+ static public SplatColor FloralWhite
{
get { return KnownColors.FromKnownColor(KnownColor.FloralWhite); }
}
- static public Color ForestGreen
+ static public SplatColor ForestGreen
{
get { return KnownColors.FromKnownColor(KnownColor.ForestGreen); }
}
- static public Color Fuchsia
+ static public SplatColor Fuchsia
{
get { return KnownColors.FromKnownColor(KnownColor.Fuchsia); }
}
- static public Color Gainsboro
+ static public SplatColor Gainsboro
{
get { return KnownColors.FromKnownColor(KnownColor.Gainsboro); }
}
- static public Color GhostWhite
+ static public SplatColor GhostWhite
{
get { return KnownColors.FromKnownColor(KnownColor.GhostWhite); }
}
- static public Color Gold
+ static public SplatColor Gold
{
get { return KnownColors.FromKnownColor(KnownColor.Gold); }
}
- static public Color Goldenrod
+ static public SplatColor Goldenrod
{
get { return KnownColors.FromKnownColor(KnownColor.Goldenrod); }
}
- static public Color Gray
+ static public SplatColor Gray
{
get { return KnownColors.FromKnownColor(KnownColor.Gray); }
}
- static public Color Green
+ static public SplatColor Green
{
get { return KnownColors.FromKnownColor(KnownColor.Green); }
}
- static public Color GreenYellow
+ static public SplatColor GreenYellow
{
get { return KnownColors.FromKnownColor(KnownColor.GreenYellow); }
}
- static public Color Honeydew
+ static public SplatColor Honeydew
{
get { return KnownColors.FromKnownColor(KnownColor.Honeydew); }
}
- static public Color HotPink
+ static public SplatColor HotPink
{
get { return KnownColors.FromKnownColor(KnownColor.HotPink); }
}
- static public Color IndianRed
+ static public SplatColor IndianRed
{
get { return KnownColors.FromKnownColor(KnownColor.IndianRed); }
}
- static public Color Indigo
+ static public SplatColor Indigo
{
get { return KnownColors.FromKnownColor(KnownColor.Indigo); }
}
- static public Color Ivory
+ static public SplatColor Ivory
{
get { return KnownColors.FromKnownColor(KnownColor.Ivory); }
}
- static public Color Khaki
+ static public SplatColor Khaki
{
get { return KnownColors.FromKnownColor(KnownColor.Khaki); }
}
- static public Color Lavender
+ static public SplatColor Lavender
{
get { return KnownColors.FromKnownColor(KnownColor.Lavender); }
}
- static public Color LavenderBlush
+ static public SplatColor LavenderBlush
{
get { return KnownColors.FromKnownColor(KnownColor.LavenderBlush); }
}
- static public Color LawnGreen
+ static public SplatColor LawnGreen
{
get { return KnownColors.FromKnownColor(KnownColor.LawnGreen); }
}
- static public Color LemonChiffon
+ static public SplatColor LemonChiffon
{
get { return KnownColors.FromKnownColor(KnownColor.LemonChiffon); }
}
- static public Color LightBlue
+ static public SplatColor LightBlue
{
get { return KnownColors.FromKnownColor(KnownColor.LightBlue); }
}
- static public Color LightCoral
+ static public SplatColor LightCoral
{
get { return KnownColors.FromKnownColor(KnownColor.LightCoral); }
}
- static public Color LightCyan
+ static public SplatColor LightCyan
{
get { return KnownColors.FromKnownColor(KnownColor.LightCyan); }
}
- static public Color LightGoldenrodYellow
+ static public SplatColor LightGoldenrodYellow
{
get { return KnownColors.FromKnownColor(KnownColor.LightGoldenrodYellow); }
}
- static public Color LightGreen
+ static public SplatColor LightGreen
{
get { return KnownColors.FromKnownColor(KnownColor.LightGreen); }
}
- static public Color LightGray
+ static public SplatColor LightGray
{
get { return KnownColors.FromKnownColor(KnownColor.LightGray); }
}
- static public Color LightPink
+ static public SplatColor LightPink
{
get { return KnownColors.FromKnownColor(KnownColor.LightPink); }
}
- static public Color LightSalmon
+ static public SplatColor LightSalmon
{
get { return KnownColors.FromKnownColor(KnownColor.LightSalmon); }
}
- static public Color LightSeaGreen
+ static public SplatColor LightSeaGreen
{
get { return KnownColors.FromKnownColor(KnownColor.LightSeaGreen); }
}
- static public Color LightSkyBlue
+ static public SplatColor LightSkyBlue
{
get { return KnownColors.FromKnownColor(KnownColor.LightSkyBlue); }
}
- static public Color LightSlateGray
+ static public SplatColor LightSlateGray
{
get { return KnownColors.FromKnownColor(KnownColor.LightSlateGray); }
}
- static public Color LightSteelBlue
+ static public SplatColor LightSteelBlue
{
get { return KnownColors.FromKnownColor(KnownColor.LightSteelBlue); }
}
- static public Color LightYellow
+ static public SplatColor LightYellow
{
get { return KnownColors.FromKnownColor(KnownColor.LightYellow); }
}
- static public Color Lime
+ static public SplatColor Lime
{
get { return KnownColors.FromKnownColor(KnownColor.Lime); }
}
- static public Color LimeGreen
+ static public SplatColor LimeGreen
{
get { return KnownColors.FromKnownColor(KnownColor.LimeGreen); }
}
- static public Color Linen
+ static public SplatColor Linen
{
get { return KnownColors.FromKnownColor(KnownColor.Linen); }
}
- static public Color Magenta
+ static public SplatColor Magenta
{
get { return KnownColors.FromKnownColor(KnownColor.Magenta); }
}
- static public Color Maroon
+ static public SplatColor Maroon
{
get { return KnownColors.FromKnownColor(KnownColor.Maroon); }
}
- static public Color MediumAquamarine
+ static public SplatColor MediumAquamarine
{
get { return KnownColors.FromKnownColor(KnownColor.MediumAquamarine); }
}
- static public Color MediumBlue
+ static public SplatColor MediumBlue
{
get { return KnownColors.FromKnownColor(KnownColor.MediumBlue); }
}
- static public Color MediumOrchid
+ static public SplatColor MediumOrchid
{
get { return KnownColors.FromKnownColor(KnownColor.MediumOrchid); }
}
- static public Color MediumPurple
+ static public SplatColor MediumPurple
{
get { return KnownColors.FromKnownColor(KnownColor.MediumPurple); }
}
- static public Color MediumSeaGreen
+ static public SplatColor MediumSeaGreen
{
get { return KnownColors.FromKnownColor(KnownColor.MediumSeaGreen); }
}
- static public Color MediumSlateBlue
+ static public SplatColor MediumSlateBlue
{
get { return KnownColors.FromKnownColor(KnownColor.MediumSlateBlue); }
}
- static public Color MediumSpringGreen
+ static public SplatColor MediumSpringGreen
{
get { return KnownColors.FromKnownColor(KnownColor.MediumSpringGreen); }
}
- static public Color MediumTurquoise
+ static public SplatColor MediumTurquoise
{
get { return KnownColors.FromKnownColor(KnownColor.MediumTurquoise); }
}
- static public Color MediumVioletRed
+ static public SplatColor MediumVioletRed
{
get { return KnownColors.FromKnownColor(KnownColor.MediumVioletRed); }
}
- static public Color MidnightBlue
+ static public SplatColor MidnightBlue
{
get { return KnownColors.FromKnownColor(KnownColor.MidnightBlue); }
}
- static public Color MintCream
+ static public SplatColor MintCream
{
get { return KnownColors.FromKnownColor(KnownColor.MintCream); }
}
- static public Color MistyRose
+ static public SplatColor MistyRose
{
get { return KnownColors.FromKnownColor(KnownColor.MistyRose); }
}
- static public Color Moccasin
+ static public SplatColor Moccasin
{
get { return KnownColors.FromKnownColor(KnownColor.Moccasin); }
}
- static public Color NavajoWhite
+ static public SplatColor NavajoWhite
{
get { return KnownColors.FromKnownColor(KnownColor.NavajoWhite); }
}
- static public Color Navy
+ static public SplatColor Navy
{
get { return KnownColors.FromKnownColor(KnownColor.Navy); }
}
- static public Color OldLace
+ static public SplatColor OldLace
{
get { return KnownColors.FromKnownColor(KnownColor.OldLace); }
}
- static public Color Olive
+ static public SplatColor Olive
{
get { return KnownColors.FromKnownColor(KnownColor.Olive); }
}
- static public Color OliveDrab
+ static public SplatColor OliveDrab
{
get { return KnownColors.FromKnownColor(KnownColor.OliveDrab); }
}
- static public Color Orange
+ static public SplatColor Orange
{
get { return KnownColors.FromKnownColor(KnownColor.Orange); }
}
- static public Color OrangeRed
+ static public SplatColor OrangeRed
{
get { return KnownColors.FromKnownColor(KnownColor.OrangeRed); }
}
- static public Color Orchid
+ static public SplatColor Orchid
{
get { return KnownColors.FromKnownColor(KnownColor.Orchid); }
}
- static public Color PaleGoldenrod
+ static public SplatColor PaleGoldenrod
{
get { return KnownColors.FromKnownColor(KnownColor.PaleGoldenrod); }
}
- static public Color PaleGreen
+ static public SplatColor PaleGreen
{
get { return KnownColors.FromKnownColor(KnownColor.PaleGreen); }
}
- static public Color PaleTurquoise
+ static public SplatColor PaleTurquoise
{
get { return KnownColors.FromKnownColor(KnownColor.PaleTurquoise); }
}
- static public Color PaleVioletRed
+ static public SplatColor PaleVioletRed
{
get { return KnownColors.FromKnownColor(KnownColor.PaleVioletRed); }
}
- static public Color PapayaWhip
+ static public SplatColor PapayaWhip
{
get { return KnownColors.FromKnownColor(KnownColor.PapayaWhip); }
}
- static public Color PeachPuff
+ static public SplatColor PeachPuff
{
get { return KnownColors.FromKnownColor(KnownColor.PeachPuff); }
}
- static public Color Peru
+ static public SplatColor Peru
{
get { return KnownColors.FromKnownColor(KnownColor.Peru); }
}
- static public Color Pink
+ static public SplatColor Pink
{
get { return KnownColors.FromKnownColor(KnownColor.Pink); }
}
- static public Color Plum
+ static public SplatColor Plum
{
get { return KnownColors.FromKnownColor(KnownColor.Plum); }
}
- static public Color PowderBlue
+ static public SplatColor PowderBlue
{
get { return KnownColors.FromKnownColor(KnownColor.PowderBlue); }
}
- static public Color Purple
+ static public SplatColor Purple
{
get { return KnownColors.FromKnownColor(KnownColor.Purple); }
}
- static public Color Red
+ static public SplatColor Red
{
get { return KnownColors.FromKnownColor(KnownColor.Red); }
}
- static public Color RosyBrown
+ static public SplatColor RosyBrown
{
get { return KnownColors.FromKnownColor(KnownColor.RosyBrown); }
}
- static public Color RoyalBlue
+ static public SplatColor RoyalBlue
{
get { return KnownColors.FromKnownColor(KnownColor.RoyalBlue); }
}
- static public Color SaddleBrown
+ static public SplatColor SaddleBrown
{
get { return KnownColors.FromKnownColor(KnownColor.SaddleBrown); }
}
- static public Color Salmon
+ static public SplatColor Salmon
{
get { return KnownColors.FromKnownColor(KnownColor.Salmon); }
}
- static public Color SandyBrown
+ static public SplatColor SandyBrown
{
get { return KnownColors.FromKnownColor(KnownColor.SandyBrown); }
}
- static public Color SeaGreen
+ static public SplatColor SeaGreen
{
get { return KnownColors.FromKnownColor(KnownColor.SeaGreen); }
}
- static public Color SeaShell
+ static public SplatColor SeaShell
{
get { return KnownColors.FromKnownColor(KnownColor.SeaShell); }
}
- static public Color Sienna
+ static public SplatColor Sienna
{
get { return KnownColors.FromKnownColor(KnownColor.Sienna); }
}
- static public Color Silver
+ static public SplatColor Silver
{
get { return KnownColors.FromKnownColor(KnownColor.Silver); }
}
- static public Color SkyBlue
+ static public SplatColor SkyBlue
{
get { return KnownColors.FromKnownColor(KnownColor.SkyBlue); }
}
- static public Color SlateBlue
+ static public SplatColor SlateBlue
{
get { return KnownColors.FromKnownColor(KnownColor.SlateBlue); }
}
- static public Color SlateGray
+ static public SplatColor SlateGray
{
get { return KnownColors.FromKnownColor(KnownColor.SlateGray); }
}
- static public Color Snow
+ static public SplatColor Snow
{
get { return KnownColors.FromKnownColor(KnownColor.Snow); }
}
- static public Color SpringGreen
+ static public SplatColor SpringGreen
{
get { return KnownColors.FromKnownColor(KnownColor.SpringGreen); }
}
- static public Color SteelBlue
+ static public SplatColor SteelBlue
{
get { return KnownColors.FromKnownColor(KnownColor.SteelBlue); }
}
- static public Color Tan
+ static public SplatColor Tan
{
get { return KnownColors.FromKnownColor(KnownColor.Tan); }
}
- static public Color Teal
+ static public SplatColor Teal
{
get { return KnownColors.FromKnownColor(KnownColor.Teal); }
}
- static public Color Thistle
+ static public SplatColor Thistle
{
get { return KnownColors.FromKnownColor(KnownColor.Thistle); }
}
- static public Color Tomato
+ static public SplatColor Tomato
{
get { return KnownColors.FromKnownColor(KnownColor.Tomato); }
}
- static public Color Turquoise
+ static public SplatColor Turquoise
{
get { return KnownColors.FromKnownColor(KnownColor.Turquoise); }
}
- static public Color Violet
+ static public SplatColor Violet
{
get { return KnownColors.FromKnownColor(KnownColor.Violet); }
}
- static public Color Wheat
+ static public SplatColor Wheat
{
get { return KnownColors.FromKnownColor(KnownColor.Wheat); }
}
- static public Color White
+ static public SplatColor White
{
get { return KnownColors.FromKnownColor(KnownColor.White); }
}
- static public Color WhiteSmoke
+ static public SplatColor WhiteSmoke
{
get { return KnownColors.FromKnownColor(KnownColor.WhiteSmoke); }
}
- static public Color Yellow
+ static public SplatColor Yellow
{
get { return KnownColors.FromKnownColor(KnownColor.Yellow); }
}
- static public Color YellowGreen
+ static public SplatColor YellowGreen
{
get { return KnownColors.FromKnownColor(KnownColor.YellowGreen); }
}
}
-}
\ No newline at end of file
+}
diff --git a/Splat/Logging.cs b/src/Splat/Logging.cs
similarity index 98%
rename from Splat/Logging.cs
rename to src/Splat/Logging.cs
index caaa5ec64..56aba7009 100644
--- a/Splat/Logging.cs
+++ b/src/Splat/Logging.cs
@@ -25,6 +25,12 @@ public interface ILogger
public interface IFullLogger : ILogger
{
+ bool IsDebugEnabled { get; }
+ bool IsInfoEnabled { get; }
+ bool IsWarnEnabled { get; }
+ bool IsErrorEnabled { get; }
+ bool IsFatalEnabled { get; }
+
void Debug(T value);
void Debug(IFormatProvider formatProvider, T value);
void DebugException([Localizable(false)] string message, Exception exception);
@@ -117,7 +123,6 @@ public DefaultLogManager(IDependencyResolver dependencyResolver = null)
static readonly IFullLogger nullLogger = new WrappingFullLogger(new NullLogger(), typeof(MemoizingMRUCache));
public IFullLogger GetLogger(Type type)
{
- if (LogHost.suppressLogging) return nullLogger;
if (type == typeof(MemoizingMRUCache)) return nullLogger;
lock (loggerCache) {
@@ -180,17 +185,12 @@ public interface IEnableLogger { }
public static class LogHost
{
- static internal bool suppressLogging = false;
- static readonly IFullLogger nullLogger = new WrappingFullLogger(new NullLogger(), typeof(string));
-
///
/// Use this logger inside miscellaneous static methods where creating
/// a class-specific logger isn't really worth it.
///
public static IFullLogger Default {
get {
- if (suppressLogging) return nullLogger;
-
var factory = Locator.Current.GetService();
if (factory == null) {
throw new Exception("ILogManager is null. This should never happen, your dependency resolver is broken");
@@ -205,8 +205,6 @@ public static IFullLogger Default {
///
public static IFullLogger Log(this T This) where T : IEnableLogger
{
- if (suppressLogging) return nullLogger;
-
var factory = Locator.Current.GetService();
if (factory == null) {
throw new Exception("ILogManager is null. This should never happen, your dependency resolver is broken");
@@ -241,6 +239,12 @@ string InvokeStringFormat(IFormatProvider formatProvider, string message, object
sfArgs[2] = args;
return (string) stringFormat.Invoke(null, sfArgs);
}
+
+ public bool IsDebugEnabled => Level <= LogLevel.Debug;
+ public bool IsInfoEnabled => Level <= LogLevel.Info;
+ public bool IsWarnEnabled => Level <= LogLevel.Warn;
+ public bool IsErrorEnabled => Level <= LogLevel.Error;
+ public bool IsFatalEnabled => Level <= LogLevel.Fatal;
public void Debug(T value)
{
diff --git a/Splat/MemoizingMRUCache.cs b/src/Splat/MemoizingMRUCache.cs
similarity index 96%
rename from Splat/MemoizingMRUCache.cs
rename to src/Splat/MemoizingMRUCache.cs
index c51f21759..6e8c8fac0 100644
--- a/Splat/MemoizingMRUCache.cs
+++ b/src/Splat/MemoizingMRUCache.cs
@@ -60,8 +60,9 @@ public TVal Get(TParam key, object context = null)
{
Contract.Requires(key != null);
- if (cacheEntries.ContainsKey(key)) {
- var found = cacheEntries[key];
+ Tuple, TVal> found;
+
+ if (cacheEntries.TryGetValue(key, out found)) {
cacheMRUList.Remove(found.Item1);
cacheMRUList.AddFirst(found.Item1);
return found.Item2;
@@ -101,10 +102,11 @@ public void Invalidate(TParam key)
{
Contract.Requires(key != null);
- if (!cacheEntries.ContainsKey(key))
+ Tuple, TVal> to_remove;
+
+ if (!cacheEntries.TryGetValue(key, out to_remove))
return;
- var to_remove = cacheEntries[key];
if (releaseFunction != null)
releaseFunction(to_remove.Item2);
diff --git a/Splat/ModeDetector.cs b/src/Splat/ModeDetector.cs
similarity index 100%
rename from Splat/ModeDetector.cs
rename to src/Splat/ModeDetector.cs
diff --git a/Splat/Android/Bitmaps.cs b/src/Splat/Platforms/Android/Bitmaps.cs
similarity index 97%
rename from Splat/Android/Bitmaps.cs
rename to src/Splat/Platforms/Android/Bitmaps.cs
index 0c191e189..6ceed2366 100644
--- a/Splat/Android/Bitmaps.cs
+++ b/src/Splat/Platforms/Android/Bitmaps.cs
@@ -59,7 +59,7 @@ public Task LoadFromResource(string source, float? desiredWidth, float?
var id = default(int);
if (Int32.TryParse(source, out id)) {
- return Task.Run(() => (IBitmap)new DrawableBitmap(res.GetDrawable(Int32.Parse(source))));
+ return Task.Run(() => (IBitmap)new DrawableBitmap(res.GetDrawable(id)));
}
if (drawableList.ContainsKey(source)) {
@@ -130,7 +130,7 @@ public float Height {
public Task Save(CompressedBitmapFormat format, float quality, Stream target)
{
var fmt = format == CompressedBitmapFormat.Jpeg ? Bitmap.CompressFormat.Jpeg : Bitmap.CompressFormat.Png;
- return Task.Run(() => { inner.Compress(fmt, (int)quality * 100, target); });
+ return Task.Run(() => { inner.Compress(fmt, (int)(quality * 100), target); });
}
public void Dispose()
diff --git a/Splat/Android/Color.cs b/src/Splat/Platforms/Android/Color.cs
similarity index 53%
rename from Splat/Android/Color.cs
rename to src/Splat/Platforms/Android/Color.cs
index 393ad05ae..de8c15886 100644
--- a/Splat/Android/Color.cs
+++ b/src/Splat/Platforms/Android/Color.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Android.Graphics;
namespace Splat
@@ -15,4 +15,17 @@ public static System.Drawing.Color FromNative(this Color This)
return System.Drawing.Color.FromArgb(This.A, This.R, This.G, This.B);
}
}
+
+ public static class SplatColorExtensions
+ {
+ public static Color ToNative(this SplatColor This)
+ {
+ return new Color(This.R, This.G, This.B, This.A);
+ }
+
+ public static SplatColor FromNative(this Color This)
+ {
+ return SplatColor.FromArgb(This.A, This.R, This.G, This.B);
+ }
+ }
}
diff --git a/Splat/Android/Point.cs b/src/Splat/Platforms/Android/Point.cs
similarity index 100%
rename from Splat/Android/Point.cs
rename to src/Splat/Platforms/Android/Point.cs
diff --git a/Splat/Android/Rect.cs b/src/Splat/Platforms/Android/Rect.cs
similarity index 100%
rename from Splat/Android/Rect.cs
rename to src/Splat/Platforms/Android/Rect.cs
diff --git a/Splat/Resources/AboutResources.txt b/src/Splat/Platforms/Android/Resources/AboutResources.txt
similarity index 100%
rename from Splat/Resources/AboutResources.txt
rename to src/Splat/Platforms/Android/Resources/AboutResources.txt
diff --git a/Splat/Resources/Resource.designer.cs b/src/Splat/Platforms/Android/Resources/Resource.designer.cs
similarity index 59%
rename from Splat/Resources/Resource.designer.cs
rename to src/Splat/Platforms/Android/Resources/Resource.designer.cs
index 3ab204a18..ea85a6195 100644
--- a/Splat/Resources/Resource.designer.cs
+++ b/src/Splat/Platforms/Android/Resources/Resource.designer.cs
@@ -1,15 +1,15 @@
#pragma warning disable 1591
-// ------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Mono Runtime Version: 4.0.30319.17020
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-// ------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//
+// 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.
+//
+//------------------------------------------------------------------------------
-[assembly: Android.Runtime.ResourceDesignerAttribute("Splat.Resource", IsApplication=false)]
+[assembly: global::Android.Runtime.ResourceDesignerAttribute("Splat.Resource", IsApplication=false)]
namespace Splat
{
diff --git a/Splat/Resources/values/Strings.xml b/src/Splat/Platforms/Android/Resources/values/Strings.xml
similarity index 100%
rename from Splat/Resources/values/Strings.xml
rename to src/Splat/Platforms/Android/Resources/values/Strings.xml
diff --git a/Splat/Cocoa/Bitmaps.cs b/src/Splat/Platforms/Cocoa/Bitmaps.cs
similarity index 91%
rename from Splat/Cocoa/Bitmaps.cs
rename to src/Splat/Platforms/Cocoa/Bitmaps.cs
index e8f727bba..f5c714054 100644
--- a/Splat/Cocoa/Bitmaps.cs
+++ b/src/Splat/Platforms/Cocoa/Bitmaps.cs
@@ -2,26 +2,16 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
-using System.Drawing;
-#if UIKIT && !UNIFIED
-using MonoTouch.UIKit;
-using MonoTouch.Foundation;
-#elif UNIFIED && UIKIT
+#if UIKIT
using UIKit;
using Foundation;
-#elif UNIFIED && !UIKIT
+#else
using AppKit;
using Foundation;
using UIImage = AppKit.NSImage;
using UIApplication = AppKit.NSApplication;
-#else
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-
-using UIImage = MonoMac.AppKit.NSImage;
-using UIApplication = MonoMac.AppKit.NSApplication;
#endif
namespace Splat
@@ -105,11 +95,7 @@ public Task Save(CompressedBitmapFormat format, float quality, Stream target)
#else
-#if UNIFIED
var rect = new CoreGraphics.CGRect();
-#else
- var rect = new RectangleF();
-#endif
var cgImage = inner.AsCGImage(ref rect, null, null);
var imageRep = new NSBitmapImageRep(cgImage);
@@ -122,7 +108,7 @@ public Task Save(CompressedBitmapFormat format, float quality, Stream target)
var outData = imageRep.RepresentationUsingTypeProperties(type, props);
outData.AsStream().CopyTo(target);
- #endif
+#endif
});
}
diff --git a/src/Splat/Platforms/Cocoa/SplatColor.cs b/src/Splat/Platforms/Cocoa/SplatColor.cs
new file mode 100644
index 000000000..1d2848ea5
--- /dev/null
+++ b/src/Splat/Platforms/Cocoa/SplatColor.cs
@@ -0,0 +1,45 @@
+using System;
+
+#if UIKIT
+using UIKit;
+#else
+using AppKit;
+#endif
+
+
+namespace Splat
+{
+#if UIKIT
+ public static class SplatColorExtensions
+ {
+ public static UIColor ToNative(this SplatColor This)
+ {
+ return new UIColor((float)This.R / 255.0f, (float)This.G / 255.0f, This.B / 255.0f, This.A / 255.0f);
+ }
+
+ public static SplatColor FromNative(this UIColor This)
+ {
+ nfloat r,g,b,a;
+
+ This.GetRGBA(out r, out g, out b, out a);
+ return SplatColor.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f));
+ }
+ }
+#else
+ public static class SplatColorExtensions
+ {
+ public static NSColor ToNative(this SplatColor This)
+ {
+ return NSColor.FromSrgb((float)This.R / 255.0f, (float)This.G / 255.0f, This.B / 255.0f, This.A / 255.0f);
+ }
+
+ public static SplatColor FromNative(this NSColor This)
+ {
+ nfloat r,g,b,a;
+
+ This.GetRgba(out r, out g, out b, out a);
+ return SplatColor.FromArgb((int)(a * 255.0f), (int)(r * 255.0f), (int)(g * 255.0f), (int)(b * 255.0f));
+ }
+ }
+#endif
+}
diff --git a/Splat/PlatformModeDetector.cs b/src/Splat/Platforms/PlatformModeDetector.cs
similarity index 74%
rename from Splat/PlatformModeDetector.cs
rename to src/Splat/Platforms/PlatformModeDetector.cs
index 99f3aec44..4e8b54f0e 100644
--- a/Splat/PlatformModeDetector.cs
+++ b/src/Splat/Platforms/PlatformModeDetector.cs
@@ -5,9 +5,7 @@
using System.Linq;
using System.Threading.Tasks;
-#if SILVERLIGHT
-using System.Windows;
-#elif NETFX_CORE
+#if NETFX_CORE
using Windows.ApplicationModel;
#endif
@@ -23,6 +21,9 @@ public class PlatformModeDetector : IModeDetector
"XUNIT",
"MBUNIT",
"NBEHAVE",
+ "VISUALSTUDIO.QUALITYTOOLS",
+ "FIXIE",
+ "NCRUNCH",
};
try {
@@ -34,13 +35,7 @@ public class PlatformModeDetector : IModeDetector
public bool? InDesignMode()
{
-#if SILVERLIGHT
- if (Application.Current.RootVisual != null) {
- return System.ComponentModel.DesignerProperties.GetIsInDesignMode(Application.Current.RootVisual);
- }
-
- return false;
-#elif NETFX_CORE
+#if NETFX_CORE
return DesignMode.DesignModeEnabled;
#else
var designEnvironments = new[] {
@@ -60,14 +55,12 @@ public class PlatformModeDetector : IModeDetector
return false;
#endif
}
-
+
static bool searchForAssembly(IEnumerable assemblyList)
{
-#if SILVERLIGHT
- return Deployment.Current.Parts.Any(x => assemblyList.Any(name => x.Source.ToUpperInvariant().Contains(name)));
-#elif NETFX_CORE
- var depPackages = Package.Current.Dependencies.Select(x => x.Id.FullName);
- if (depPackages.Any(x => assemblyList.Any(name => x.ToUpperInvariant().Contains(name)))) return true;
+#if NETFX_CORE
+ var depPackages = Package.Current.Dependencies.Select(x => x.Id.FullName.ToUpperInvariant());
+ if (depPackages.Any(x => assemblyList.Any(name => x.Contains(name)))) return true;
var fileTask = Task.Factory.StartNew(async () => {
var files = await Package.Current.InstalledLocation.GetFilesAsync();
@@ -77,7 +70,8 @@ static bool searchForAssembly(IEnumerable assemblyList)
return fileTask.Result.Any(x => assemblyList.Any(name => x.ToUpperInvariant().Contains(name)));
#else
return AppDomain.CurrentDomain.GetAssemblies()
- .Any(x => assemblyList.Any(name => x.FullName.ToUpperInvariant().Contains(name)));
+ .Select(x => x.FullName.ToUpperInvariant())
+ .Any(x => assemblyList.Any(name => x.Contains(name)));
#endif
}
}
diff --git a/Splat/ReflectionStubs.cs b/src/Splat/Platforms/ReflectionStubs.cs
similarity index 100%
rename from Splat/ReflectionStubs.cs
rename to src/Splat/Platforms/ReflectionStubs.cs
diff --git a/Splat/TypeForwardedSystemDrawing.cs b/src/Splat/Platforms/TypeForwardedSystemDrawing.cs
similarity index 100%
rename from Splat/TypeForwardedSystemDrawing.cs
rename to src/Splat/Platforms/TypeForwardedSystemDrawing.cs
diff --git a/Splat/WinRT/Bitmaps.cs b/src/Splat/Platforms/WinRT/Bitmaps.cs
similarity index 89%
rename from Splat/WinRT/Bitmaps.cs
rename to src/Splat/Platforms/WinRT/Bitmaps.cs
index 48c87fc5c..29d18451b 100644
--- a/Splat/WinRT/Bitmaps.cs
+++ b/src/Splat/Platforms/WinRT/Bitmaps.cs
@@ -17,7 +17,7 @@ public class PlatformBitmapLoader : IBitmapLoader
{
public async Task Load(Stream sourceStream, float? desiredWidth, float? desiredHeight)
{
- return await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(async () => {
+ return await GetDispatcher().RunAsync(async () => {
using (var rwStream = new InMemoryRandomAccessStream()) {
var writer = rwStream.AsStreamForWrite();
await sourceStream.CopyToAsync(writer);
@@ -28,8 +28,8 @@ public async Task Load(Stream sourceStream, float? desiredWidth, float?
var transform = new BitmapTransform
{
- ScaledWidth = (uint) (desiredWidth ?? decoder.OrientedPixelWidth),
- ScaledHeight = (uint) (desiredHeight ?? decoder.OrientedPixelHeight),
+ ScaledWidth = (uint)(desiredWidth ?? decoder.OrientedPixelWidth),
+ ScaledHeight = (uint)(desiredHeight ?? decoder.OrientedPixelHeight),
InterpolationMode = BitmapInterpolationMode.Fant
};
@@ -40,7 +40,7 @@ public async Task Load(Stream sourceStream, float? desiredWidth, float?
using (var bmpStream = bmp.PixelBuffer.AsStream()) {
bmpStream.Seek(0, SeekOrigin.Begin);
bmpStream.Write(pixels, 0, (int)bmpStream.Length);
- return (IBitmap) new WriteableBitmapImageBitmap(bmp);
+ return (IBitmap)new WriteableBitmapImageBitmap(bmp);
}
}
});
@@ -48,7 +48,7 @@ public async Task Load(Stream sourceStream, float? desiredWidth, float?
public async Task LoadFromResource(string resource, float? desiredWidth, float? desiredHeight)
{
- return await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(async () => {
+ return await GetDispatcher().RunAsync(async () => {
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(resource));
using (var stream = await file.OpenAsync(FileAccessMode.Read)) {
return await Load(stream.AsStreamForRead(), desiredWidth, desiredHeight);
@@ -60,6 +60,13 @@ public IBitmap Create(float width, float height)
{
return new WriteableBitmapImageBitmap(new WriteableBitmap((int)width, (int)height));
}
+
+ private static CoreDispatcher GetDispatcher()
+ {
+ CoreWindow currentThreadWindow = CoreWindow.GetForCurrentThread();
+
+ return currentThreadWindow == null ? CoreApplication.MainView.CoreWindow.Dispatcher : currentThreadWindow.Dispatcher;
+ }
}
class WriteableBitmapImageBitmap : IBitmap
@@ -95,7 +102,7 @@ public async Task Save(CompressedBitmapFormat format, float quality, Stream targ
public void Dispose()
{
inner = null;
- }
+ }
}
class BitmapImageBitmap : IBitmap
diff --git a/Splat/WinRT/Color.cs b/src/Splat/Platforms/WinRT/Color.cs
similarity index 52%
rename from Splat/WinRT/Color.cs
rename to src/Splat/Platforms/WinRT/Color.cs
index 30faaa290..4c80b97a7 100644
--- a/Splat/WinRT/Color.cs
+++ b/src/Splat/Platforms/WinRT/Color.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Windows.UI;
+using Windows.UI;
using Windows.UI.Xaml.Media;
namespace Splat
@@ -25,4 +20,22 @@ public static System.Drawing.Color FromNative(this Color This)
return System.Drawing.Color.FromArgb(This.A, This.R, This.G, This.B);
}
}
-}
\ No newline at end of file
+
+ public static class SplatColorExtensions
+ {
+ public static Color ToNative(this SplatColor This)
+ {
+ return Color.FromArgb(This.A, This.R, This.G, This.B);
+ }
+
+ public static SolidColorBrush ToNativeBrush(this SplatColor This)
+ {
+ return new SolidColorBrush(This.ToNative());
+ }
+
+ public static SplatColor FromNative(this Color This)
+ {
+ return SplatColor.FromArgb(This.A, This.R, This.G, This.B);
+ }
+ }
+}
diff --git a/Splat/Xaml/Bitmaps.cs b/src/Splat/Platforms/net461/Bitmaps.cs
similarity index 65%
rename from Splat/Xaml/Bitmaps.cs
rename to src/Splat/Platforms/net461/Bitmaps.cs
index 5c62687d1..8e979cba3 100644
--- a/Splat/Xaml/Bitmaps.cs
+++ b/src/Splat/Platforms/net461/Bitmaps.cs
@@ -1,10 +1,6 @@
using System;
-using System.Collections.Generic;
using System.IO;
-using System.Linq;
-using System.Text;
using System.Threading.Tasks;
-using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
@@ -15,71 +11,61 @@ public class PlatformBitmapLoader : IBitmapLoader
{
public Task Load(Stream sourceStream, float? desiredWidth, float? desiredHeight)
{
-#if SILVERLIGHT
- return Deployment.Current.Dispatcher.InvokeAsync(() => {
-#else
- return Task.Run(() => {
-#endif
+
+ return Task.Run(() =>
+ {
var ret = new BitmapImage();
- withInit(ret, source => {
- if (desiredWidth != null) {
+ withInit(ret, source =>
+ {
+ if (desiredWidth != null)
+ {
source.DecodePixelWidth = (int)desiredWidth;
+ }
+ if (desiredHeight != null) {
source.DecodePixelHeight = (int)desiredHeight;
}
-
-#if SILVERLIGHT
- source.SetSource(sourceStream);
-#else
source.StreamSource = sourceStream;
source.CacheOption = BitmapCacheOption.OnLoad;
-#endif
});
- return (IBitmap) new BitmapSourceBitmap(ret);
+ return (IBitmap)new BitmapSourceBitmap(ret);
});
}
public Task LoadFromResource(string resource, float? desiredWidth, float? desiredHeight)
{
-#if SILVERLIGHT
- return Deployment.Current.Dispatcher.InvokeAsync(() => {
-#else
- return Task.Run(() => {
-#endif
+ return Task.Run(() =>
+ {
var ret = new BitmapImage();
- withInit(ret, x => {
- if (desiredWidth != null) {
+ withInit(ret, x =>
+ {
+ if (desiredWidth != null)
+ {
x.DecodePixelWidth = (int)desiredWidth;
+ }
+ if (desiredHeight != null) {
x.DecodePixelHeight = (int)desiredHeight;
}
- x.UriSource = new Uri(resource);
+ x.UriSource = new Uri(resource, UriKind.RelativeOrAbsolute);
});
- return (IBitmap) new BitmapSourceBitmap(ret);
+ return (IBitmap)new BitmapSourceBitmap(ret);
});
}
public IBitmap Create(float width, float height)
{
-#if SILVERLIGHT
- return (IBitmap)new BitmapSourceBitmap(new WriteableBitmap((int)width, (int)height));
-#else
- return (IBitmap) new BitmapSourceBitmap(new WriteableBitmap((int)width, (int)height, 96, 96, PixelFormats.Default, null));
-#endif
+ return (IBitmap)new BitmapSourceBitmap(new WriteableBitmap((int)width, (int)height, 96, 96, PixelFormats.Default, null));
}
void withInit(BitmapImage source, Action block)
{
-#if SILVERLIGHT
- block(source);
-#else
source.BeginInit();
block(source);
source.EndInit();
source.Freeze();
-#endif
}
}
@@ -93,33 +79,20 @@ class BitmapSourceBitmap : IBitmap
public BitmapSourceBitmap(BitmapSource bitmap)
{
inner = bitmap;
-#if SILVERLIGHT
- Width = (float)inner.PixelWidth;
- Height = (float)inner.PixelHeight;
-#else
Width = (float)inner.Width;
Height = (float)inner.Height;
-#endif
}
public Task Save(CompressedBitmapFormat format, float quality, Stream target)
{
- return Task.Run(() => {
-#if SILVERLIGHT
- if (format == CompressedBitmapFormat.Png) {
- throw new PlatformNotSupportedException("WP8 can't save PNGs.");
- }
-
- var wb = new WriteableBitmap(inner);
- wb.SaveJpeg(target, wb.PixelWidth, wb.PixelHeight, 0, (int)(quality * 100.0f));
-#else
+ return Task.Run(() =>
+ {
var encoder = format == CompressedBitmapFormat.Jpeg ?
(BitmapEncoder)new JpegBitmapEncoder() { QualityLevel = (int)(quality * 100.0f) } :
(BitmapEncoder)new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(inner));
encoder.Save(target);
-#endif
});
}
public void Dispose()
@@ -147,10 +120,14 @@ public static Task InvokeAsync(this Dispatcher This, Func block)
{
var tcs = new TaskCompletionSource();
- This.BeginInvoke(new Action(() => {
- try {
+ This.BeginInvoke(new Action(() =>
+ {
+ try
+ {
tcs.SetResult(block());
- } catch (Exception ex) {
+ }
+ catch (Exception ex)
+ {
tcs.SetException(ex);
}
}));
diff --git a/Splat/Xaml/Color.cs b/src/Splat/Platforms/net461/Color.cs
similarity index 50%
rename from Splat/Xaml/Color.cs
rename to src/Splat/Platforms/net461/Color.cs
index c7465a024..63326c311 100644
--- a/Splat/Xaml/Color.cs
+++ b/src/Splat/Platforms/net461/Color.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Media;
+using System.Windows.Media;
namespace Splat
{
@@ -17,9 +12,7 @@ public static Color ToNative(this System.Drawing.Color This)
public static SolidColorBrush ToNativeBrush(this System.Drawing.Color This)
{
var ret = new SolidColorBrush(This.ToNative());
-#if !SILVERLIGHT
ret.Freeze();
-#endif
return ret;
}
@@ -28,4 +21,24 @@ public static System.Drawing.Color FromNative(this Color This)
return System.Drawing.Color.FromArgb(This.A, This.R, This.G, This.B);
}
}
+
+ public static class SplatColorExtensions
+ {
+ public static Color ToNative(this SplatColor This)
+ {
+ return Color.FromArgb(This.A, This.R, This.G, This.B);
+ }
+
+ public static SolidColorBrush ToNativeBrush(this SplatColor This)
+ {
+ var ret = new SolidColorBrush(This.ToNative());
+ ret.Freeze();
+ return ret;
+ }
+
+ public static SplatColor FromNative(this Color This)
+ {
+ return SplatColor.FromArgb(This.A, This.R, This.G, This.B);
+ }
+ }
}
diff --git a/Splat/Xaml/Point.cs b/src/Splat/Platforms/net461/Point.cs
similarity index 87%
rename from Splat/Xaml/Point.cs
rename to src/Splat/Platforms/net461/Point.cs
index 15cf9a322..3033141de 100644
--- a/Splat/Xaml/Point.cs
+++ b/src/Splat/Platforms/net461/Point.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
+using System.Windows;
namespace Splat
{
diff --git a/Splat/Xaml/Rect.cs b/src/Splat/Platforms/net461/Rect.cs
similarity index 84%
rename from Splat/Xaml/Rect.cs
rename to src/Splat/Platforms/net461/Rect.cs
index 4a6ae9e65..1c5c3af82 100644
--- a/Splat/Xaml/Rect.cs
+++ b/src/Splat/Platforms/net461/Rect.cs
@@ -1,8 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
namespace Splat
diff --git a/Splat/PointExtensions.cs b/src/Splat/PointExtensions.cs
similarity index 100%
rename from Splat/PointExtensions.cs
rename to src/Splat/PointExtensions.cs
diff --git a/src/Splat/Properties/AssemblyInfo.cs b/src/Splat/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..de1401310
--- /dev/null
+++ b/src/Splat/Properties/AssemblyInfo.cs
@@ -0,0 +1,6 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Resources;
+
+[assembly: NeutralResourcesLanguageAttribute("en-US")]
diff --git a/Splat/RectangleExtensions.cs b/src/Splat/RectangleExtensions.cs
similarity index 100%
rename from Splat/RectangleExtensions.cs
rename to src/Splat/RectangleExtensions.cs
diff --git a/Splat/ServiceLocation.cs b/src/Splat/ServiceLocation.cs
similarity index 95%
rename from Splat/ServiceLocation.cs
rename to src/Splat/ServiceLocation.cs
index 094c8715d..53f23a31c 100644
--- a/Splat/ServiceLocation.cs
+++ b/src/Splat/ServiceLocation.cs
@@ -180,22 +180,37 @@ public static IDisposable WithResolver(this IDependencyResolver resolver)
return new ActionDisposable(() => Locator.Current = origResolver);
}
-
+
+ public static void Register(this IMutableDependencyResolver This, Func factory, string contract = null)
+ {
+ This.Register(() => factory(), typeof(T), contract);
+ }
+
public static void RegisterConstant(this IMutableDependencyResolver This, object value, Type serviceType, string contract = null)
{
This.Register(() => value, serviceType, contract);
}
+ public static void RegisterConstant(this IMutableDependencyResolver This, T value, string contract = null)
+ {
+ RegisterConstant(This, value, typeof(T), contract);
+ }
+
public static void RegisterLazySingleton(this IMutableDependencyResolver This, Func valueFactory, Type serviceType, string contract = null)
{
var val = new Lazy(valueFactory, LazyThreadSafetyMode.ExecutionAndPublication);
This.Register(() => val.Value, serviceType, contract);
}
+ public static void RegisterLazySingleton(this IMutableDependencyResolver This, Func valueFactory, string contract = null)
+ {
+ RegisterLazySingleton(This, () => valueFactory(), typeof(T), contract);
+ }
+
public static void InitializeSplat(this IMutableDependencyResolver This)
{
This.Register(() => new DefaultLogManager(), typeof(ILogManager));
- This.Register(() => new DebugLogger(), typeof(ILogger));
+ This.RegisterConstant(new DebugLogger(), typeof(ILogger));
}
}
diff --git a/Splat/SizeExtensions.cs b/src/Splat/SizeExtensions.cs
similarity index 100%
rename from Splat/SizeExtensions.cs
rename to src/Splat/SizeExtensions.cs
diff --git a/src/Splat/Splat.csproj b/src/Splat/Splat.csproj
new file mode 100644
index 000000000..75d050f53
--- /dev/null
+++ b/src/Splat/Splat.csproj
@@ -0,0 +1,69 @@
+
+
+ net46
+ Splat
+ Splat
+ Paul Betts
+ A library to make things cross-platform that should be
+ Splat
+ true
+ ..\..\key.snk
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/global.json b/src/global.json
new file mode 100644
index 000000000..a75963ff5
--- /dev/null
+++ b/src/global.json
@@ -0,0 +1,5 @@
+{
+ "msbuild-sdks": {
+ "MSBuild.Sdk.Extras": "1.6.61"
+ }
+}
\ No newline at end of file
diff --git a/tools/nuget/NuGet.exe b/tools/nuget/NuGet.exe
new file mode 100644
index 000000000..0cc40884a
Binary files /dev/null and b/tools/nuget/NuGet.exe differ
diff --git a/version.json b/version.json
new file mode 100644
index 000000000..dbbde3dce
--- /dev/null
+++ b/version.json
@@ -0,0 +1,17 @@
+{
+ "version": "5.0",
+ "publicReleaseRefSpec": [
+ "^refs/heads/master$", // we release out of master
+ "^refs/heads/develop$", // we release out of develop
+ "^refs/heads/rel/\\d+\\.\\d+\\.\\d+" // we also release branches starting with rel/N.N.N
+ ],
+ "nugetPackageVersion":{
+ "semVer": 2
+ },
+ "cloudBuild": {
+ "setVersionVariables": true,
+ "buildNumber": {
+ "enabled": false
+ }
+ }
+}