diff --git a/.gitignore b/.gitignore index 6452e73..29d243a 100644 --- a/.gitignore +++ b/.gitignore @@ -317,3 +317,13 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ "bin/" +"obj/" +/StartupHelper/obj/Debug +/SDK_Debug/obj/Debug +/FluentWPF/obj/ +/RestartHelper/obj/Debug +/DeviceExcludeTool/obj/Debug +/BackgroundUploadHelper/obj/Debug +/Launcher/obj/Debug +/FluentWPF/obj +obj diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..da2bff2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "SLS"] + path = SLS + url = https://github.com/madninjaskillz/Simple-LED-SDK.git +[submodule "RGBPluginManager"] + path = RGBPluginManager + url = https://github.com/Fanman03/RGBPluginManager.git diff --git a/BackgroundUploadHelper/App.xaml b/BackgroundUploadHelper/App.xaml deleted file mode 100644 index 3b89723..0000000 --- a/BackgroundUploadHelper/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/BackgroundUploadHelper/App.xaml.cs b/BackgroundUploadHelper/App.xaml.cs deleted file mode 100644 index 7123c49..0000000 --- a/BackgroundUploadHelper/App.xaml.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace BackgroundUploadHelper -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - } -} diff --git a/BackgroundUploadHelper/MainWindow.xaml b/BackgroundUploadHelper/MainWindow.xaml deleted file mode 100644 index be97cd8..0000000 --- a/BackgroundUploadHelper/MainWindow.xaml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - Upload Background Image - - - - - - - - - - - - - - - - - - - - - diff --git a/BackgroundUploadHelper/MainWindow.xaml.cs b/BackgroundUploadHelper/MainWindow.xaml.cs deleted file mode 100644 index e3ddb5c..0000000 --- a/BackgroundUploadHelper/MainWindow.xaml.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.IO; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace BackgroundUploadHelper -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - public static string imageLocalPath = Directory.GetCurrentDirectory() + "\\CustomTheme\\base.png"; - public static string presetPath = Directory.GetCurrentDirectory() + "\\CustomTheme\\presets"; - public static string imagePath; - public bool restartMainExe; - public string mainExe = "RGBSync+"; - public MainWindow() - { - InitializeComponent(); - - var converter = new ImageSourceConverter(); - PreviewImage.ImageSource = (ImageSource)converter.ConvertFromString("pack://application:,,,/default-bg.png"); - - - Process[] processes = Process.GetProcessesByName(mainExe); - if (processes.Length == 0) - { - restartMainExe = false; - } - else - { - foreach (var process in processes) - { - process.Kill(); - } - restartMainExe = true; - } - } - - private void Window_Closed(object sender, EventArgs e) - { - if (restartMainExe) - { - Process[] processes = Process.GetProcessesByName(mainExe); - if (processes.Length == 0) - { - string ExeName = mainExe + ".exe"; - Process.Start(ExeName); - } - } - } - - private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) - { - if (restartMainExe) - { - Process[] processes = Process.GetProcessesByName(mainExe); - if (processes.Length == 0) - { - string ExeName = mainExe + ".exe"; - Process.Start(ExeName); - } - } - } - - private void ImagePanel_Drop(object sender, DragEventArgs e) - { - - if (e.Data.GetDataPresent(DataFormats.FileDrop)) - { - string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); - string ext = System.IO.Path.GetExtension(files[0]); - if (ext == ".png" || ext == ".jpg" || ext == ".jpeg") - { - RegisterFileName(files[0]); - } else - { - MessageBox.Show("The file you selected is not a .png or .jpg image file. Please try again with a file of the correct type.","Error!",MessageBoxButton.OK, MessageBoxImage.Error); - } - } - } - - private void ChooseFileButton_Click(object sender, RoutedEventArgs e) - { - OpenFileDialog openFileDialog = new OpenFileDialog(); - openFileDialog.Filter = "Image files (*.png;*.jpeg;*.jpg)|*.png;*.jpeg;*.jpg"; - openFileDialog.Title = "Pick background image."; - openFileDialog.InitialDirectory = presetPath; - if (openFileDialog.ShowDialog() == true) - { - RegisterFileName(openFileDialog.FileName); - } - } - - public void RegisterFileName(string path) - { - BitmapImage bimage = new BitmapImage(); - bimage.BeginInit(); - bimage.UriSource = new Uri(path, UriKind.Absolute); - bimage.EndInit(); - PreviewImage.ImageSource = bimage; - imagePath = path; - } - - private void UploadFileButton_Click(object sender, RoutedEventArgs e) - { - if(imagePath != null) - { - try - { - File.Copy(imagePath, imageLocalPath, true); - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error); - } - } else - { - MessageBox.Show("No file selected.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error); - } - - } - } -} diff --git a/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe b/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe deleted file mode 100644 index a319b40..0000000 Binary files a/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe and /dev/null differ diff --git a/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe.config b/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe.config deleted file mode 100644 index 56efbc7..0000000 --- a/BackgroundUploadHelper/bin/Release/BackgroundUploadHelper.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/BackgroundUploadHelper/bin/Release/Costura.dll b/BackgroundUploadHelper/bin/Release/Costura.dll deleted file mode 100644 index 27d80be..0000000 Binary files a/BackgroundUploadHelper/bin/Release/Costura.dll and /dev/null differ diff --git a/BackgroundUploadHelper/bin/Release/Costura.xml b/BackgroundUploadHelper/bin/Release/Costura.xml deleted file mode 100644 index 7e9ca15..0000000 --- a/BackgroundUploadHelper/bin/Release/Costura.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Costura - - - - - Contains methods for interacting with the Costura system. - - - - - Call this to Initialize the Costura system. - - - - diff --git a/BackgroundUploadHelper/bin/Release/MaterialDesignColors.dll b/BackgroundUploadHelper/bin/Release/MaterialDesignColors.dll deleted file mode 100644 index 9e8e732..0000000 Binary files a/BackgroundUploadHelper/bin/Release/MaterialDesignColors.dll and /dev/null differ diff --git a/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.dll b/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.dll deleted file mode 100644 index 8638ec5..0000000 Binary files a/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.dll and /dev/null differ diff --git a/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.xml b/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.xml deleted file mode 100644 index 4990299..0000000 --- a/BackgroundUploadHelper/bin/Release/MaterialDesignThemes.Wpf.xml +++ /dev/null @@ -1,1644 +0,0 @@ - - - - MaterialDesignThemes.Wpf - - - - - this is a simple utility to add and remove a single adorner to an element since there is no built-in way to do that in xaml. - see here - - - - - Helper properties for working with for make round corner. - - - - - Controls the corner radius of the surrounding box. - - - - - A card is a content control, styled according to Material Design guidelines. - - - - - Indicates if the delete button should be visible. - - - - - Event correspond to delete button left mouse button click - - - - - Add / Remove DeleteClickEvent handler - - - - - This override method is called when the control is clicked by mouse or keyboard - - - - - User a colour zone to easily switch the background and foreground colours, from selected Material Design palette or custom ones. - - - - - By default ComboBox uses the wrapper popup. Popup can be switched to classic Windows desktop view by means of this attached property. - - - - - By default the selected item is hidden from the drop down list, as per Material Design specifications. - To revert to a more classic Windows desktop behaviour, and show the currently selected item again in the drop - down, set this attached propety to true. - - - - - Help us format the content of a header button in a calendar. - - - Expected items, in the following order: - 1) DateTime Calendar.DisplayDate - 2) DateTime? Calendar.SelectedDate - - - - - Converter for control. Can be extended by method. - - - - - Helps coerce the correct item container style for a , according to whether the list is displaying in standard mode, or using a , such as a . - - - - - Item container style to use when is null. - - - - - Item container style to use when is not null, typically when a is applied. - - - - - Returns the item container to use for a . - - Should be a or instance. - - - - - - - - 1 - Content presenter render size, - 2 - Clipping border padding (main control padding) - - - - - - - - - - Set the maximum length for the text field. - - Not a dprop, as is only applied once. - - - - Cancel the close. - - - - - Indicates if the close has already been cancelled. - - - - - Gets the parameter originally provided to / - - - - - Allows interaction with the current dialog session. - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - The data context from the sender element (typically a ) - is applied to the content. - - - - - The data context from the is applied to the content. - - - - - The data context is explicitly set to null. - - - - - Routed command to be used somewhere inside an instance to trigger showing of the dialog. Content can be passed to the dialog via a . - - - - - Routed command to be used inside dialog content to close a dialog. Use a to indicate the result of the parameter. - - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Identifier which is used in conjunction with to determine where a dialog should be shown. - - - - - Returns a DialogSession for the currently open dialog for managing it programmatically. If no dialog is open, CurrentSession will return null - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - Indicates whether the dialog will close if the user clicks off the dialog, on the obscured background. - - - - - Parameter to provide to close handlers if an close due to click away is instigated. - - - - - Allows association of a snackbar, so that notifications can be paused whilst a dialog is being displayed. - - - - - Set the theme (light/dark) for the dialog. - - - - - Represents the overlay brush that is used to dim the background behind the dialog - - - - - Raised when a dialog is opened. - - - - - Attached property which can be used on the which instigated the to process the event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Raised just before a dialog is closed. - - - - - Attached property which can be used on the which instigated the to process the closing event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Attempts to focus the content of a popup. - - The popup content. - - - - Helper extensions for showing dialogs. - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Allows interation with the current dialog session. - - - - - Allows an open dialog to be managed. Use is only permitted during a single display operation. - - - - - Indicates if the dialog session has ended. Once ended no further method calls will be permitted. - - - Client code cannot set this directly, this is internally managed. To end the dialog session use . - - - - - The parameter passed to the and return by - - - - - Gets the which is currently displayed, so this could be a view model or a UI element. - - - - - Update the current content in the dialog. - - - - - - Closes the dialog. - - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Closes the dialog. - - Result parameter which will be returned in or from method. - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Returns full visual ancestry, starting at the leaf. - - - - - - - The hint property - - - - - Sets the hint. - - The element. - The value. - - - - Gets the hint. - - The element. - - The . - - - - - The hint opacity property - - - - - Gets the text box view margin. - - The element. - - The . - - - - - Sets the hint opacity. - - The element. - The value. - - - - The color for the text of a focused control. - - - - - Gets the color for the text of a focused control. - - - - - Sets the color for the text of a focused control. - - - - - The color for the background of a focused control. - - - - - Gets the color for the background of a focused control. - - - - - Sets the color for the background of a focused control. - - - - - The HelperText property - - - - - Sets the HelperText. - - The element. - The value. - - - - Gets the HelperText. - - The element. - - The . - - - - - Displays an icon image/path, according to the specified name. - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Gets or sets the name of icon being displayed. - - - - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - This interface is the adapter from UiControl (like , and others) to - - You should implement this interface in order to use SmartHint for your own control. - - - - - Checks to see if the targeted control can be deemed as logically - empty, even if not null, affecting the current hint display. - - - - - - Targeted control has keyboard focus - - - - - - Queues a notification message for display in a snackbar. - - Message. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - - - - Queues a notification message for display in a snackbar. - - Message. - Subsequent, duplicate messages queued within a short time span will - be discarded. To override this behaviour and ensure the message always gets displayed set to true. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - The message will promoted to the front of the queue. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue and never considered to be a duplicate. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Provides shorthand to initialise a new for a . - - - - - Gets or sets the icon to display. - - - - - Gets the icon path data for the current . - - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Provides full information about a palette. - - - - - View a control on a 3D plane. - - - Taken from http://blogs.msdn.com/greg_schechter/archive/2007/10/26/enter-the-planerator-dead-simple-3d-in-wpf-with-a-stupid-name.aspx , Greg Schechter - Fall 2007 - - - - - Wrap this around a class that we want to catch the measure and arrange - processes occuring on, and propagate to the parent Planerator, if any. - Do this because layout invalidations don't flow up out of a - Viewport2DVisual3D object. - - - - - Defines how the popup is aligned to the toggle part of the control. - - - - - Display the popup below the toggle, and align the left edges.3 - - - - - Display the popup below the toggle, and align the right edges. - - - - - Display the popup below the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup above the toggle, and align the left edges. - - - - - Display the popup above the toggle, and align the right edges. - - - - - Display the popup above the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup to the left of the toggle, and align the top edges. - - - - - Display the popup to the left of the toggle, and align the bottom edges. - - - - - Display the popup to the left of the toggle, and align the middles. - - - - - Display the popup to the right of the toggle, and align the top edges. - - - - - Display the popup to the right of the toggle, and align the bottom edges. - - - - - Display the popup to the right of the toggle, and align the middles. - - - - - Defines what causes the to open it's popup. - - - - - Open when the toggle button is clicked. - - - - - Open when the mouse goes over the toggle button. - - - - - Open when the mouse goes over the toggle button, or the space in which the popup box would occupy should it be open. - - - - - Popup box, similar to a , but allows more customizable content. - - - - - Routed command to be used inside of a popup content to close it. - - - - - Content to display in the toggle button. - - - - - Template for . - - - - - Content to display in the toggle when it's checked (when the popup is open). Optional; if not provided the is used. - - - - - Template for . - - - - - Command to execute if toggle is checked (popup is open) and is set. - - - - - Command parameter to use in conjunction with . - - - - - Content to display in the content. - - - - - Popup content template. - - - - - Gets or sets whether the popup is currently open. - - - - - Indicates of the popup should stay open if a click occurs inside the popup. - - - - - Gets or sets how the popup is aligned in relation to the toggle. - - - - - Gets or sets what trigger causes the popup to open. - - - - - Get or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Gets or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Framework use. Provides the method used to position the popup. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Raises . - - - - - Raised when the popup is opened. - - - - - Raises . - - - - - Raised when the popup is closed. - - - - - Raises . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - A custom control implementing a rating bar. - The icon aka content may be set as a DataTemplate via the ButtonContentTemplate property. - - - - - The DependencyProperty for the RecognizesAccessKey property. - Default Value: false - - - - - Determine if Ripple should use AccessText in its style - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - Set to True to disable ripple effect - - - - - Set to True to disable ripple effect - - - - - - - Set to True to disable ripple effect - - - - - - Internal use only. - - - - - Represents a display device or multiple display devices on a single system. - Based on http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Screen.cs - - - - - Available working area on the screen. This excludes taskbars and other - docked windows. - - - - - Gets an array of all of the displays on the system. - - - - - Gets the bounds of the display. - - - - - Gets the device name associated with a display. - - - - - Gets a value indicating whether a particular display is the primary device. - - - - - Gets the primary display. - - - - - Gets the working area of the screen. - - - - - Screen instances call this property to determine - if their WorkingArea cache needs to be invalidated. - - - - - Specifies a value that indicates whether the specified object is equal to this one. - - - - - Retrieves a for the monitor that contains the specified point. - - - - - Retrieves a for the monitor that contains the largest region of the Rect. - - - - - Retrieves the working area for the monitor that is closest to the specified point. - - - - - Retrieves the working area for the monitor that contains the largest region of the specified Rect. - - - - - Retrieves the bounds of the monitor that is closest to the specified point. - - - - - Retrieves the bounds of the monitor that contains the largest region of the specified Rect. - - - - - Computes and retrieves a hash code for an object. - - - - - Called by the SystemEvents class when our display settings are - changing. We cache screen information and at this point we must - invalidate our cache. - - - - - Called by the SystemEvents class when our display settings have - changed. Here, we increment a static counter that Screen instances - can check against to invalidate their cache. - - - - - Retrieves a string representing this object. - - - - - A control that implement placeholder behavior. Can work as a simple placeholder either as a floating hint, see property. - - To set a target control you should set the HintProxy property. Use the converter which converts a control into the IHintProxy interface. - - - - - Implements a inspired by the Material Design specs (https://material.google.com/components/snackbars-toasts.html). - - - - - Defines the content of a message within a . Primary content should be set via the - standard property. Where an action is allowed, content - can be provided in . Standard button properties are - provided for actions, includiing . - - - - - Event correspond to left mouse button click on the Action button. - - - - - Add / Remove ActionClickEvent handler - - - - - Maximum total height of snackbar for the action button to be inlined. - - Default value (55) is between single line message (48) and two lined snackbar-message (66) - because tolerance is required (see issue) - - - - - - Gets or sets a value that indicates whether this message queue displays messages without discarding duplicates. - True to show every message even if there are duplicates. - - - - - The content to be displayed - - - - - Message show duration. - - - - - The content for the action button on the snackbar - - - - - Handler to be invoked when the action button is clicked - - - - - The argument to pass to the delegate. - - - - - Promote the message, pushing it in front of any message that is not promoted. - - - - - Still display this message even if it is a duplicate. - - - - - Checks if given item is a duplicate to this - - Item to check for duplicate - true if given item is a duplicate to this, false otherwise - - - - Helper properties for working with text fields. - - - - - The text box view margin property - - - - - Sets the text box view margin. - - The element. - The value. - - - - Gets the text box view margin. - - The element. - - The . - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - - - The attached WPF property for getting or setting the value for an underline decoration. - - - - - Sets the used for underline decoration. - - - - - - - Gets the used for underline decoration. - - - - - - Controls the visbility of the text field box. - - - - - Controls the visibility of the text field area box. - - - - - Controls the corner radius of the surrounding box. - - - - - Controls the corner radius of the bottom line of the surrounding box. - - - - - Controls the highlighting style of a text box. - - - - - Enables a ripple effect on focusing the text box. - - - - - Automatically inserts spelling suggestions into the text box context menu. - - - - - Controls the visbility of the clear button. - - - - - SuffixText dependency property - - - - - Applies the text box view margin. - - The text box. - The margin. - - - - The text box view margin property changed callback. - - The dependency object. - The dependency property changed event args. - - - - Called when this element gets focus. - - - - - IsDropDownOpenProperty property changed handler. - - DatePicker that changed its IsDropDownOpen. - DependencyPropertyChangedEventArgs. - - - - Set to true to stop invalid text reverting back to previous valid value. Useful in cases where you - want to display validation messages and allow the user to correct the data without it reverting. - - - - - Set to true to display seconds in the time and allow the user to select seconds. - - - - - Framework use only. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Duration of the animation - - - - - Multiplies a time span unit by the index of an item in a list. - - - Example usage is for a to have a - time delayed according to position in a list, so cascading animations can occur. - - - - - Direction of the slide wipe - - - - - Duration of the animation - - - - - Allows transitions to be disabled where supported. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - The transitioner provides an easy way to move between content with a default in-place circular transition. - - - - - Causes the the next slide to be displayed (affectively increments ). - - - - - Causes the the previous slide to be displayed (affectively decrements ). - - - - - Moves to the first slide. - - - - - Moves to the last slide. - - - - - If enabled, transition origins will be applied to wipes, according to where a transition was triggered from. For example, the mouse point where a user clicks a button. - - - - - Content control to host the content of an individual page within a . - - - - - Content control to enable easier transitions. - - - - - Gets or sets the transition to run when the content is loaded and made visible. - - - - - Delay offset to be applied to all opening effect transitions. - - - - - Allows multiple transition effects to be combined and run upon the content loading or being made visible. - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template. - - The element. - The value. - - - - Gets the additional template. - - The element. - - The . - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template selector. - - The element. - The value. - - - - Gets the additional template selector. - - The element. - - The . - - - - - To be used at level, or to be returned by - implementors when the additional template associated with a tree should not be used. - - - - - - - - - - The hint property - - - - - The hint property - - - - - The hint property - - - - - Framework use only. - - - - - Framework use only. - - - - - - - Framework use only. - - - - - This custom popup can be used by validation error templates or something else. - It provides some additional nice features: - - repositioning if host-window size or location changed - - repositioning if host-window gets maximized and vice versa - - it's only topmost if the host-window is activated - - - - - Gets/sets if the popup can be closed by left mouse button down. - - - - - Causes the popup to update it's position according to it's current settings. - - - - - SetWindowPos options - - - - diff --git a/BackgroundUploadHelper/default-bg.png b/BackgroundUploadHelper/default-bg.png deleted file mode 100644 index 581b673..0000000 Binary files a/BackgroundUploadHelper/default-bg.png and /dev/null differ diff --git a/BackgroundUploadHelper/image.ico b/BackgroundUploadHelper/image.ico deleted file mode 100644 index 7574bcf..0000000 Binary files a/BackgroundUploadHelper/image.ico and /dev/null differ diff --git a/BackgroundUploadHelper/image.png b/BackgroundUploadHelper/image.png deleted file mode 100644 index f31bc0f..0000000 Binary files a/BackgroundUploadHelper/image.png and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Debug/App.g.cs b/BackgroundUploadHelper/obj/Debug/App.g.cs deleted file mode 100644 index fce6f3e..0000000 --- a/BackgroundUploadHelper/obj/Debug/App.g.cs +++ /dev/null @@ -1,86 +0,0 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E03D4A60605EBEAC601D4D57CD5C3F5FC4AA5F33594F52EBD7C3D92FB539F215" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// App - /// - public partial class App : System.Windows.Application { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - BackgroundUploadHelper.App app = new BackgroundUploadHelper.App(); - app.InitializeComponent(); - app.Run(); - } - } -} - diff --git a/BackgroundUploadHelper/obj/Debug/App.g.i.cs b/BackgroundUploadHelper/obj/Debug/App.g.i.cs deleted file mode 100644 index fce6f3e..0000000 --- a/BackgroundUploadHelper/obj/Debug/App.g.i.cs +++ /dev/null @@ -1,86 +0,0 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E03D4A60605EBEAC601D4D57CD5C3F5FC4AA5F33594F52EBD7C3D92FB539F215" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// App - /// - public partial class App : System.Windows.Application { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - BackgroundUploadHelper.App app = new BackgroundUploadHelper.App(); - app.InitializeComponent(); - app.Run(); - } - } -} - diff --git a/BackgroundUploadHelper/obj/Debug/BackgroundUploadHelper_MarkupCompile.lref b/BackgroundUploadHelper/obj/Debug/BackgroundUploadHelper_MarkupCompile.lref deleted file mode 100644 index 1756bbe..0000000 --- a/BackgroundUploadHelper/obj/Debug/BackgroundUploadHelper_MarkupCompile.lref +++ /dev/null @@ -1,4 +0,0 @@ - -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\App.xaml;; -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\MainWindow.xaml;; - diff --git a/BackgroundUploadHelper/obj/Debug/MainWindow.g.cs b/BackgroundUploadHelper/obj/Debug/MainWindow.g.cs deleted file mode 100644 index 1ad36f4..0000000 --- a/BackgroundUploadHelper/obj/Debug/MainWindow.g.cs +++ /dev/null @@ -1,157 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6859F4199FBF9B96E073DF0BC8D3B39230337F8D95ADB1CCED106A1072743639" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 30 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal MaterialDesignThemes.Wpf.Card ImagePanel; - - #line default - #line hidden - - - #line 32 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Media.ImageBrush PreviewImage; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button ChooseFileButton; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button UploadFileButton; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); - - #line default - #line hidden - return; - case 2: - this.ImagePanel = ((MaterialDesignThemes.Wpf.Card)(target)); - - #line 30 "..\..\MainWindow.xaml" - this.ImagePanel.Drop += new System.Windows.DragEventHandler(this.ImagePanel_Drop); - - #line default - #line hidden - return; - case 3: - this.PreviewImage = ((System.Windows.Media.ImageBrush)(target)); - return; - case 4: - this.ChooseFileButton = ((System.Windows.Controls.Button)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.ChooseFileButton.Click += new System.Windows.RoutedEventHandler(this.ChooseFileButton_Click); - - #line default - #line hidden - return; - case 5: - this.UploadFileButton = ((System.Windows.Controls.Button)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.UploadFileButton.Click += new System.Windows.RoutedEventHandler(this.UploadFileButton_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/BackgroundUploadHelper/obj/Debug/MainWindow.g.i.cs b/BackgroundUploadHelper/obj/Debug/MainWindow.g.i.cs deleted file mode 100644 index 1ad36f4..0000000 --- a/BackgroundUploadHelper/obj/Debug/MainWindow.g.i.cs +++ /dev/null @@ -1,157 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6859F4199FBF9B96E073DF0BC8D3B39230337F8D95ADB1CCED106A1072743639" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 30 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal MaterialDesignThemes.Wpf.Card ImagePanel; - - #line default - #line hidden - - - #line 32 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Media.ImageBrush PreviewImage; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button ChooseFileButton; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button UploadFileButton; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); - - #line default - #line hidden - return; - case 2: - this.ImagePanel = ((MaterialDesignThemes.Wpf.Card)(target)); - - #line 30 "..\..\MainWindow.xaml" - this.ImagePanel.Drop += new System.Windows.DragEventHandler(this.ImagePanel_Drop); - - #line default - #line hidden - return; - case 3: - this.PreviewImage = ((System.Windows.Media.ImageBrush)(target)); - return; - case 4: - this.ChooseFileButton = ((System.Windows.Controls.Button)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.ChooseFileButton.Click += new System.Windows.RoutedEventHandler(this.ChooseFileButton_Click); - - #line default - #line hidden - return; - case 5: - this.UploadFileButton = ((System.Windows.Controls.Button)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.UploadFileButton.Click += new System.Windows.RoutedEventHandler(this.UploadFileButton_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/BackgroundUploadHelper/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/BackgroundUploadHelper/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll deleted file mode 100644 index acd3879..0000000 Binary files a/BackgroundUploadHelper/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/App.baml b/BackgroundUploadHelper/obj/Release/App.baml deleted file mode 100644 index 5e8f7ca..0000000 Binary files a/BackgroundUploadHelper/obj/Release/App.baml and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.csproj.FileListAbsolute.txt b/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.csproj.FileListAbsolute.txt deleted file mode 100644 index ea606b1..0000000 --- a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,24 +0,0 @@ -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\BackgroundUploadHelper.exe.config -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\BackgroundUploadHelper.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\BackgroundUploadHelper.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\MaterialDesignThemes.Wpf.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.csprojAssemblyReference.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\MainWindow.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\App.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper_MarkupCompile.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper_MarkupCompile.lref -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\App.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\MainWindow.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.g.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.Properties.Resources.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.csproj.GenerateResource.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.csproj.Fody.CopyLocal.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.csproj.CopyComplete -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\obj\Release\BackgroundUploadHelper.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\Costura.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\MaterialDesignColors.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\MaterialDesignThemes.Wpf.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\Costura.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\MaterialDesignColors.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\bin\Release\MaterialDesignThemes.Wpf.pdb diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.exe b/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.exe deleted file mode 100644 index a319b40..0000000 Binary files a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.exe and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.g.resources b/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.g.resources deleted file mode 100644 index 4dd1c45..0000000 Binary files a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.g.resources and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.i.lref b/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.i.lref deleted file mode 100644 index f74c848..0000000 --- a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.i.lref +++ /dev/null @@ -1,4 +0,0 @@ - - -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\MainWindow.xaml;; - diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.lref b/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.lref deleted file mode 100644 index 1756bbe..0000000 --- a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper_MarkupCompile.lref +++ /dev/null @@ -1,4 +0,0 @@ - -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\App.xaml;; -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\BackgroundUploadHelper\MainWindow.xaml;; - diff --git a/BackgroundUploadHelper/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed b/BackgroundUploadHelper/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed deleted file mode 100644 index d718db0..0000000 Binary files a/BackgroundUploadHelper/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed b/BackgroundUploadHelper/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed deleted file mode 100644 index d9fe526..0000000 Binary files a/BackgroundUploadHelper/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed b/BackgroundUploadHelper/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed deleted file mode 100644 index 7579d68..0000000 Binary files a/BackgroundUploadHelper/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed b/BackgroundUploadHelper/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed deleted file mode 100644 index d555a15..0000000 Binary files a/BackgroundUploadHelper/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed b/BackgroundUploadHelper/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed deleted file mode 100644 index 6280104..0000000 Binary files a/BackgroundUploadHelper/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/MainWindow.baml b/BackgroundUploadHelper/obj/Release/MainWindow.baml deleted file mode 100644 index 064d526..0000000 Binary files a/BackgroundUploadHelper/obj/Release/MainWindow.baml and /dev/null differ diff --git a/BackgroundUploadHelper/obj/Release/MainWindow.g.cs b/BackgroundUploadHelper/obj/Release/MainWindow.g.cs deleted file mode 100644 index 1ad36f4..0000000 --- a/BackgroundUploadHelper/obj/Release/MainWindow.g.cs +++ /dev/null @@ -1,157 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6859F4199FBF9B96E073DF0BC8D3B39230337F8D95ADB1CCED106A1072743639" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 30 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal MaterialDesignThemes.Wpf.Card ImagePanel; - - #line default - #line hidden - - - #line 32 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Media.ImageBrush PreviewImage; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button ChooseFileButton; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button UploadFileButton; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); - - #line default - #line hidden - return; - case 2: - this.ImagePanel = ((MaterialDesignThemes.Wpf.Card)(target)); - - #line 30 "..\..\MainWindow.xaml" - this.ImagePanel.Drop += new System.Windows.DragEventHandler(this.ImagePanel_Drop); - - #line default - #line hidden - return; - case 3: - this.PreviewImage = ((System.Windows.Media.ImageBrush)(target)); - return; - case 4: - this.ChooseFileButton = ((System.Windows.Controls.Button)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.ChooseFileButton.Click += new System.Windows.RoutedEventHandler(this.ChooseFileButton_Click); - - #line default - #line hidden - return; - case 5: - this.UploadFileButton = ((System.Windows.Controls.Button)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.UploadFileButton.Click += new System.Windows.RoutedEventHandler(this.UploadFileButton_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/BackgroundUploadHelper/obj/Release/MainWindow.g.i.cs b/BackgroundUploadHelper/obj/Release/MainWindow.g.i.cs deleted file mode 100644 index 1ad36f4..0000000 --- a/BackgroundUploadHelper/obj/Release/MainWindow.g.i.cs +++ /dev/null @@ -1,157 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6859F4199FBF9B96E073DF0BC8D3B39230337F8D95ADB1CCED106A1072743639" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace BackgroundUploadHelper { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 30 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal MaterialDesignThemes.Wpf.Card ImagePanel; - - #line default - #line hidden - - - #line 32 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Media.ImageBrush PreviewImage; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button ChooseFileButton; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button UploadFileButton; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((BackgroundUploadHelper.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); - - #line default - #line hidden - return; - case 2: - this.ImagePanel = ((MaterialDesignThemes.Wpf.Card)(target)); - - #line 30 "..\..\MainWindow.xaml" - this.ImagePanel.Drop += new System.Windows.DragEventHandler(this.ImagePanel_Drop); - - #line default - #line hidden - return; - case 3: - this.PreviewImage = ((System.Windows.Media.ImageBrush)(target)); - return; - case 4: - this.ChooseFileButton = ((System.Windows.Controls.Button)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.ChooseFileButton.Click += new System.Windows.RoutedEventHandler(this.ChooseFileButton_Click); - - #line default - #line hidden - return; - case 5: - this.UploadFileButton = ((System.Windows.Controls.Button)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.UploadFileButton.Click += new System.Windows.RoutedEventHandler(this.UploadFileButton_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/BackgroundUploadHelper/packages.config b/BackgroundUploadHelper/packages.config deleted file mode 100644 index be4dc9c..0000000 --- a/BackgroundUploadHelper/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/ColorpickerWPF/Code/ColorPalette.cs b/ColorpickerWPF/Code/ColorPalette.cs new file mode 100644 index 0000000..9018ae6 --- /dev/null +++ b/ColorpickerWPF/Code/ColorPalette.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Media; +using System.Xml.Serialization; + +namespace ColorPickerWPF.Code +{ + [Serializable] + public class ColorPalette + { + public List BuiltInColors { get; set; } + + public List CustomColors { get; set; } + + [XmlIgnore] + protected const int NumColorsFirstSwatch = 39; + [XmlIgnore] + protected const int NumColorsCustomSwatch = 44; + [XmlIgnore] + protected const int NumColorsSecondSwatch = 112; + + public ColorPalette() + { + BuiltInColors = new List(); + CustomColors = new List(); + } + + public void InitializeDefaults() + { + BuiltInColors.Clear(); + BuiltInColors.AddRange( + GetColorSwatchItems( + new List() + { +/* Colors.Black, + Colors.Red, + Colors.DarkOrange, + Colors.Yellow, + Colors.LawnGreen, + Colors.Blue, + Colors.Purple, + Colors.DeepPink, + Colors.Aqua, + Colors.SaddleBrown, + Colors.Wheat, + Colors.BurlyWood, + Colors.Teal,*/ + + + Color.FromArgb(255,255, 0, 0), + Color.FromArgb(255,255, 64, 0), + Color.FromArgb(255,255, 128, 0), + Color.FromArgb(255,255, 191, 0), + Color.FromArgb(255,255, 255, 0), + Color.FromArgb(255,191, 255, 0), + Color.FromArgb(255,128, 255, 0), + Color.FromArgb(255,64, 255, 0), + Color.FromArgb(255,0, 255, 0), + Color.FromArgb(255,0, 255, 64), + Color.FromArgb(255,0, 255, 128), + Color.FromArgb(255,0, 255, 191), + Color.FromArgb(255,0, 255, 255), + + Color.FromArgb(255,0, 191, 255), + Color.FromArgb(255,0, 128, 255), + Color.FromArgb(255,0, 64, 255), + Color.FromArgb(255,0, 0, 255), + Color.FromArgb(255,64, 0, 255), + Color.FromArgb(255,128, 0, 255), + Color.FromArgb(255,191, 0, 255), + Color.FromArgb(255,255, 0, 255), + Color.FromArgb(255,255, 0, 191), + Color.FromArgb(255,255, 0, 128), + Color.FromArgb(255,255, 0, 64), + Colors.White, + Colors.Black, + + Colors.Tan, + Color.FromArgb(255,128, 0, 0), + Color.FromArgb(255,128, 64, 0), + Color.FromArgb(255,128, 128, 0), + Color.FromArgb(255,64, 128, 0), + Color.FromArgb(255,0, 128, 0), + Color.FromArgb(255,0, 128, 64), + Color.FromArgb(255,0, 128, 128), + Color.FromArgb(255,0, 64, 128), + Color.FromArgb(255,0, 0, 128), + Color.FromArgb(255,64, 0, 128), + Color.FromArgb(255,128, 0, 128), + Color.FromArgb(255,128, 0, 64), + + + Colors.Transparent, + Colors.Transparent, + Colors.Transparent, + + Color.FromArgb(255, 5, 5, 5), + Color.FromArgb(255, 15, 15, 15), + Color.FromArgb(255, 35, 35, 35), + Color.FromArgb(255, 55, 55, 55), + Color.FromArgb(255, 75, 75, 75), + Color.FromArgb(255, 95, 95, 95), + Color.FromArgb(255, 115, 115, 115), + Color.FromArgb(255, 135, 135, 135), + Color.FromArgb(255, 155, 155, 155), + Color.FromArgb(255, 175, 175, 175), + Color.FromArgb(255, 195, 195, 195), + Color.FromArgb(255, 215, 215, 215), + Color.FromArgb(255, 235, 235, 235), + })); + + CustomColors.Clear(); + CustomColors.AddRange(Enumerable.Repeat(Colors.White, NumColorsCustomSwatch) + .Select(x => new ColorSwatchItem() { Color = x, HexString = x.ToHexString() }) + .ToList()); + } + + + protected List GetColorSwatchItems(List colors) + { + return colors.Select(x => new ColorSwatchItem() { Color = x, HexString = x.ToHexString() }).ToList(); + } + } +} diff --git a/ColorpickerWPF/Code/ColorPickerDialogOptions.cs b/ColorpickerWPF/Code/ColorPickerDialogOptions.cs new file mode 100644 index 0000000..9424f47 --- /dev/null +++ b/ColorpickerWPF/Code/ColorPickerDialogOptions.cs @@ -0,0 +1,12 @@ +using System; + +namespace ColorPickerWPF.Code +{ + [Flags] + public enum ColorPickerDialogOptions + { + None, + SimpleView, + LoadCustomPalette + } +} diff --git a/ColorpickerWPF/Code/ColorSwatchItem.cs b/ColorpickerWPF/Code/ColorSwatchItem.cs new file mode 100644 index 0000000..5838934 --- /dev/null +++ b/ColorpickerWPF/Code/ColorSwatchItem.cs @@ -0,0 +1,10 @@ +using System.Windows.Media; + +namespace ColorPickerWPF.Code +{ + public class ColorSwatchItem + { + public Color Color { get; set; } + public string HexString { get; set; } + } +} diff --git a/ColorpickerWPF/Code/Util.cs b/ColorpickerWPF/Code/Util.cs new file mode 100644 index 0000000..4b06e71 --- /dev/null +++ b/ColorpickerWPF/Code/Util.cs @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows.Media.Imaging; +using System.Xml; +using System.Xml.Serialization; +using Color = System.Windows.Media.Color; + +namespace ColorPickerWPF.Code +{ + internal static class Util + { + [DllImport("shlwapi.dll")] + public static extern int ColorHLSToRGB(int H, int L, int S); + + public static Color ColorFromHSL(int H, int S, int L) + { + int colorInt = ColorHLSToRGB(H, L, S); + byte[] bytes = BitConverter.GetBytes(colorInt); + return Color.FromArgb(255, bytes[0], bytes[1], bytes[2]); + } + + + public static string ToHexString(this Color c) + { + return "#" + c.A.ToString("X2") + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2"); + } + + public static Color ColorFromHexString(string hex) + { + return Color.FromRgb( + Convert.ToByte(hex.Substring(1, 2), 16), + Convert.ToByte(hex.Substring(3, 2), 16), + Convert.ToByte(hex.Substring(5, 2), 16)); + } + + public static bool IsDialogFlagSet(this ColorPickerDialogOptions flags, ColorPickerDialogOptions flag) + { + if ((flags & flag) == flag) + { + return true; + } + return false; + } + + + public static BitmapImage GetBitmapImage(BitmapSource bitmapSource) + { + JpegBitmapEncoder encoder = new JpegBitmapEncoder(); + MemoryStream memoryStream = new MemoryStream(); + BitmapImage bImg = new BitmapImage(); + + encoder.Frames.Add(BitmapFrame.Create(bitmapSource)); + encoder.Save(memoryStream); + + memoryStream.Position = 0; + bImg.BeginInit(); + bImg.StreamSource = memoryStream; + bImg.EndInit(); + + memoryStream.Close(); + + return bImg; + } + + public static float GetHue(this System.Windows.Media.Color c) + { + System.Drawing.Color color = System.Drawing.Color.FromArgb(c.A, c.R, c.G, c.B); + return color.GetHue(); + } + + public static float GetBrightness(this System.Windows.Media.Color c) + { + System.Drawing.Color color = System.Drawing.Color.FromArgb(c.A, c.R, c.G, c.B); + return color.GetBrightness(); + } + + public static float GetSaturation(this System.Windows.Media.Color c) + { + System.Drawing.Color color = System.Drawing.Color.FromArgb(c.A, c.R, c.G, c.B); + return color.GetSaturation(); + } + + public static Color FromAhsb(int alpha, float hue, float saturation, float brightness) + { + + if (0 > alpha || 255 < alpha) + { + throw new ArgumentOutOfRangeException("alpha", alpha, + "Value must be within a range of 0 - 255."); + } + if (0f > hue || 360f < hue) + { + throw new ArgumentOutOfRangeException("hue", hue, + "Value must be within a range of 0 - 360."); + } + if (0f > saturation || 1f < saturation) + { + throw new ArgumentOutOfRangeException("saturation", saturation, + "Value must be within a range of 0 - 1."); + } + if (0f > brightness || 1f < brightness) + { + throw new ArgumentOutOfRangeException("brightness", brightness, + "Value must be within a range of 0 - 1."); + } + + if (0 == saturation) + { + return Color.FromArgb((byte)alpha, Convert.ToByte(brightness * 255), + Convert.ToByte(brightness * 255), Convert.ToByte(brightness * 255)); + } + + float fMax, fMid, fMin; + int iSextant; + byte iMax, iMid, iMin; + + if (0.5 < brightness) + { + fMax = brightness - (brightness * saturation) + saturation; + fMin = brightness + (brightness * saturation) - saturation; + } + else + { + fMax = brightness + (brightness * saturation); + fMin = brightness - (brightness * saturation); + } + + iSextant = (int)Math.Floor(hue / 60f); + if (300f <= hue) + { + hue -= 360f; + } + hue /= 60f; + hue -= 2f * (float)Math.Floor(((iSextant + 1f) % 6f) / 2f); + if (0 == iSextant % 2) + { + fMid = hue * (fMax - fMin) + fMin; + } + else + { + fMid = fMin - hue * (fMax - fMin); + } + + iMax = Convert.ToByte(fMax * 255); + iMid = Convert.ToByte(fMid * 255); + iMin = Convert.ToByte(fMin * 255); + + switch (iSextant) + { + case 1: + return Color.FromArgb((byte)alpha, iMid, iMax, iMin); + case 2: + return Color.FromArgb((byte)alpha, iMin, iMax, iMid); + case 3: + return Color.FromArgb((byte)alpha, iMin, iMid, iMax); + case 4: + return Color.FromArgb((byte)alpha, iMid, iMin, iMax); + case 5: + return Color.FromArgb((byte)alpha, iMax, iMin, iMid); + default: + return Color.FromArgb((byte)alpha, iMax, iMid, iMin); + } + } + + // https://stackoverflow.com/questions/5091455/web-color-list-in-c-sharp-application + public static List GetWebColors() + { + Type colors = typeof(System.Drawing.Color); + PropertyInfo[] colorInfo = colors.GetProperties(BindingFlags.Public | + BindingFlags.Static); + List list = new List(); + foreach (PropertyInfo info in colorInfo) + { + System.Drawing.Color c = System.Drawing.Color.FromName(info.Name); + list.Add(Color.FromArgb(c.A, c.R, c.G, c.B)); + } + + + return list; + } + + + public static void SaveToXml(this T obj, string filename) + { + string xml = obj.GetXmlText(); + + File.WriteAllText(filename, xml); + } + + public static string GetXmlText(this T obj) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + + StringWriter sww = new StringWriter(); + + XmlWriterSettings settings = new XmlWriterSettings() + { + Indent = true, + IndentChars = " ", + NewLineOnAttributes = false, + //OmitXmlDeclaration = true + }; + XmlWriter writer = XmlWriter.Create(sww, settings); + + xmlSerializer.Serialize(writer, obj); + string xml = sww.ToString(); + + writer.Close(); + writer.Dispose(); + + + return xml; + } + + public static T LoadFromXml(this T obj, string filename) + { + T result = default(T); + if (File.Exists(filename)) + { + StreamReader sr = new StreamReader(filename); + XmlTextReader xr = new XmlTextReader(sr); + + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + + result = (T)xmlSerializer.Deserialize(xr); + + xr.Close(); + sr.Close(); + xr.Dispose(); + sr.Dispose(); + } + return result; + } + + public static T LoadFromXmlText(this T obj, string xml) + { + T result = default(T); + if (!String.IsNullOrEmpty(xml)) + { + XmlReader xr = XmlReader.Create(new StringReader(xml)); + + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + + result = (T)xmlSerializer.Deserialize(xr); + + xr.Close(); + xr.Dispose(); + } + return result; + } + + } +} diff --git a/ColorpickerWPF/ColorPickRow.xaml b/ColorpickerWPF/ColorPickRow.xaml new file mode 100644 index 0000000..0293e9c --- /dev/null +++ b/ColorpickerWPF/ColorPickRow.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ColorpickerWPF/ColorPickerWindow.xaml.cs b/ColorpickerWPF/ColorPickerWindow.xaml.cs new file mode 100644 index 0000000..2b40ab4 --- /dev/null +++ b/ColorpickerWPF/ColorPickerWindow.xaml.cs @@ -0,0 +1,103 @@ +using ColorPickerWPF.Code; +using SourceChord.FluentWPF; +using System.Windows; +using System.Windows.Media; + +namespace ColorPickerWPF +{ + /// + /// Interaction logic for ColorPickerWindow.xaml + /// + public partial class ColorPickerWindow : AcrylicWindow + { + protected readonly int WidthMax = 574; + protected readonly int WidthMin = 330; + protected bool SimpleMode { get; set; } + public ColorPickerWindow() + { + InitializeComponent(); + DataContext = this; + } + + public static bool ShowDialog(out Color color, Color currentColor, ColorPickerDialogOptions flags = ColorPickerDialogOptions.None, ColorPickerControl.ColorPickerChangeHandler customPreviewEventHandler = null) + { + if ((flags & ColorPickerDialogOptions.LoadCustomPalette) == ColorPickerDialogOptions.LoadCustomPalette) + { + ColorPickerSettings.UsingCustomPalette = true; + } + + ColorPickerWindow instance = new ColorPickerWindow(); + + instance.ColorPicker.SetColor(currentColor); + + color = currentColor; + + if ((flags & ColorPickerDialogOptions.SimpleView) == ColorPickerDialogOptions.SimpleView) + { + instance.ToggleSimpleAdvancedView(); + } + + if (ColorPickerSettings.UsingCustomPalette) + { + } + + if (customPreviewEventHandler != null) + { + instance.ColorPicker.OnPickColor += customPreviewEventHandler; + } + + bool? result = instance.ShowDialog(); + if (result.HasValue && result.Value) + { + color = instance.ColorPicker.Color; + return true; + } + + return false; + } + + private void OKButton_Click(object sender, RoutedEventArgs e) + { + DialogResult = true; + Hide(); + } + + private void CloseButton_Click(object sender, RoutedEventArgs e) + { + DialogResult = false; + Hide(); + } + + private void MinMaxViewButton_OnClick(object sender, RoutedEventArgs e) + { + if (SimpleMode) + { + SimpleMode = false; + ExpandTxt.Text = "Simple"; + Width = WidthMax; + } + else + { + SimpleMode = true; + ExpandTxt.Text = "Advanced"; + Width = WidthMin; + } + } + + public void ToggleSimpleAdvancedView() + { + if (SimpleMode) + { + SimpleMode = false; + ExpandTxt.Text = "Simple"; + Width = WidthMax; + } + else + { + SimpleMode = true; + ExpandTxt.Text = "Advanced"; + Width = WidthMin; + } + } + } +} diff --git a/ColorpickerWPF/CompactPickerControl.xaml b/ColorpickerWPF/CompactPickerControl.xaml new file mode 100644 index 0000000..0a750a1 --- /dev/null +++ b/ColorpickerWPF/CompactPickerControl.xaml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/ColorpickerWPF/CompactPickerControl.xaml.cs b/ColorpickerWPF/CompactPickerControl.xaml.cs new file mode 100644 index 0000000..cf87029 --- /dev/null +++ b/ColorpickerWPF/CompactPickerControl.xaml.cs @@ -0,0 +1,140 @@ +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace ColorPickerWPF.Controls +{ + /// + /// Interaction logic for CompactPickerControl.xaml + /// + public partial class CompactPickerControl : UserControl + { + public static readonly DependencyProperty PickedColorProperty = DependencyProperty.Register("PickedColor", typeof(string), typeof(CompactPickerControl), new FrameworkPropertyMetadata("#000000", FrameworkPropertyMetadataOptions.AffectsRender, PropertyChangedCallback)); + + private static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + CompactPickerControl input = (CompactPickerControl)d; + + if (e.NewValue is string col) + { + + input.PickedColor = col; + if (input.ColorBox.Text != input.PickedColor) + { + input.ColorBox.Text = input.PickedColor; + } + if (input.PickedColor.Replace("#", "").Length == 6) + { + try + { + input.Color = (System.Windows.Media.Color)ColorConverter.ConvertFromString(input.PickedColor); + + input.ColorIcon.Background = new SolidColorBrush(input.Color); + } + catch (Exception ee) + { + Debug.WriteLine(ee.Message); + } + } + + } + } + + private void SetColor() + { + if (PickedColor.Replace("#", "").Length == 6) + { + try + { + Color = (System.Windows.Media.Color)ColorConverter.ConvertFromString(PickedColor); + ColorIcon.Background = new SolidColorBrush(Color); + Debug.WriteLine(PickedColor); + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + } + } + + public CompactPickerControl() + { + InitializeComponent(); + //this.DataContext = this; + } + private void ColorBox_OnChanged(object sender, TextChangedEventArgs e) + { + TextBox colorBox = sender as TextBox; + PickedColor = colorBox.Text; + SetColor(); + + } + + private void ColorBox_OnLoaded(object sender, RoutedEventArgs e) + { + ColorBox.Text = PickedColor; + } + + public string PickedColor + { + get => (string)GetValue(PickedColorProperty); + set => SetValue(PickedColorProperty, value); + } + + private Color color; + + public Color Color + { + get => color; + set + { + color = value; + } + } + + private void EditBtn_OnClick(object sender, RoutedEventArgs e) + { + ColorPickerWindow picker = new ColorPickerWindow(); + Color color; + bool showWindow = ColorPickerWindow.ShowDialog(out color, HexToColor(ColorBox.Text)); + string ccc = $"#{color.R:X2}{color.G:X2}{color.B:X2}"; + PickedColor = ccc; + ColorBox.Text = PickedColor; + SetColor(); + } + + public static System.Windows.Media.Color HexToColor(String hex) + { + //remove the # at the front + hex = hex.Replace("#", ""); + + if (string.IsNullOrWhiteSpace(hex)) + { + return Colors.Transparent; + } + + byte a = 255; + byte r = 255; + byte g = 255; + byte b = 255; + + int start = 0; + + //handle ARGB strings (8 characters long) + if (hex.Length == 8) + { + a = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); + start = 2; + } + + //convert RGB characters to bytes + r = byte.Parse(hex.Substring(start, 2), System.Globalization.NumberStyles.HexNumber); + g = byte.Parse(hex.Substring(start + 2, 2), System.Globalization.NumberStyles.HexNumber); + b = byte.Parse(hex.Substring(start + 4, 2), System.Globalization.NumberStyles.HexNumber); + + return System.Windows.Media.Color.FromArgb(a, r, g, b); + } + } +} diff --git a/ColorpickerWPF/PalettePickerControl.xaml b/ColorpickerWPF/PalettePickerControl.xaml new file mode 100644 index 0000000..7e40d95 --- /dev/null +++ b/ColorpickerWPF/PalettePickerControl.xaml @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/ColorpickerWPF/PalettePickerControl.xaml.cs b/ColorpickerWPF/PalettePickerControl.xaml.cs new file mode 100644 index 0000000..1a65c81 --- /dev/null +++ b/ColorpickerWPF/PalettePickerControl.xaml.cs @@ -0,0 +1,173 @@ +using ColorPickerWPF.Code; +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace ColorPickerWPF.Controls +{ + /// + /// Interaction logic for PalettePickerControl.xaml + /// + public partial class PalettePickerControl : UserControl + { + public static readonly DependencyProperty PickedColorProperty = DependencyProperty.Register("PickedColor", typeof(string), typeof(PalettePickerControl), new FrameworkPropertyMetadata("#000000", FrameworkPropertyMetadataOptions.AffectsRender, PropertyChangedCallback)); + + private static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + PalettePickerControl input = (PalettePickerControl)d; + + if (e.NewValue is string col) + { + + input.PickedColor = col; + if (input.ColorBox.Text != input.PickedColor) + { + input.ColorBox.Text = input.PickedColor; + } + if (input.PickedColor.Replace("#", "").Length == 6) + { + try + { + input.Color = (System.Windows.Media.Color)ColorConverter.ConvertFromString(input.PickedColor); + + input.ColorIcon.Background = new SolidColorBrush(input.Color); + + input.ColorBox.Background = new SolidColorBrush(input.Color); + + float lightness = input.Color.GetBrightness(); + + if (lightness > 0.75) + { + input.ColorBox.Foreground = new SolidColorBrush(Colors.Black); + input.PenIcon.Foreground = new SolidColorBrush(Colors.Black); + } + else + { + input.ColorBox.Foreground = new SolidColorBrush(Colors.White); + input.PenIcon.Foreground = new SolidColorBrush(Colors.White); + } + + } + catch (Exception ee) + { + Debug.WriteLine(ee.Message); + } + } + + } + } + + private void SetColor() + { + if (PickedColor.Replace("#", "").Length == 6) + { + try + { + Color = (System.Windows.Media.Color)ColorConverter.ConvertFromString(PickedColor); + ColorIcon.Background = new SolidColorBrush(Color); + ColorBox.Background = new SolidColorBrush(Color); + + float lightness = Color.GetBrightness(); + + if (lightness > 0.75) + { + ColorBox.Foreground = new SolidColorBrush(Colors.Black); + PenIcon.Foreground = new SolidColorBrush(Colors.Black); + } + else + { + ColorBox.Foreground = new SolidColorBrush(Colors.White); + PenIcon.Foreground = new SolidColorBrush(Colors.White); + } + + Debug.WriteLine(PickedColor); + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + } + } + + public PalettePickerControl() + { + InitializeComponent(); + //this.DataContext = this; + } + private void ColorBox_OnChanged(object sender, TextChangedEventArgs e) + { + TextBox colorBox = sender as TextBox; + PickedColor = colorBox.Text; + SetColor(); + + } + + private void ColorBox_OnLoaded(object sender, RoutedEventArgs e) + { + ColorBox.Text = PickedColor; + } + + public string PickedColor + { + get => (string)GetValue(PickedColorProperty); + set => SetValue(PickedColorProperty, value); + } + + private Color color; + + public Color Color + { + get => color; + set + { + color = value; + } + } + + private void EditBtn_OnClick(object sender, RoutedEventArgs e) + { + ColorPickerWindow picker = new ColorPickerWindow(); + Color color; + bool showWindow = ColorPickerWindow.ShowDialog(out color, HexToColor(ColorBox.Text)); + string ccc = $"#{color.R:X2}{color.G:X2}{color.B:X2}"; + PickedColor = ccc; + ColorBox.Text = PickedColor; + SetColor(); + } + + public static System.Windows.Media.Color HexToColor(String hex) + { + //remove the # at the front + hex = hex.Replace("#", ""); + + if (string.IsNullOrWhiteSpace(hex)) + { + return Colors.Transparent; + } + + byte a = 255; + byte r = 255; + byte g = 255; + byte b = 255; + + int start = 0; + + //handle ARGB strings (8 characters long) + if (hex.Length == 8) + { + a = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); + start = 2; + } + + //convert RGB characters to bytes + r = byte.Parse(hex.Substring(start, 2), System.Globalization.NumberStyles.HexNumber); + g = byte.Parse(hex.Substring(start + 2, 2), System.Globalization.NumberStyles.HexNumber); + b = byte.Parse(hex.Substring(start + 4, 2), System.Globalization.NumberStyles.HexNumber); + + return System.Windows.Media.Color.FromArgb(a, r, g, b); + } + } +} diff --git a/ColorpickerWPF/Properties/AssemblyInfo.cs b/ColorpickerWPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6a2dd7d --- /dev/null +++ b/ColorpickerWPF/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("ColorPickerWPF")] +[assembly: AssemblyDescription("Color picker control for WPF")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("DMW")] +[assembly: AssemblyProduct("ColorPickerWPF")] +[assembly: AssemblyCopyright("Copyright © 2017 Licensed under MIT")] +[assembly: AssemblyTrademark("DMW")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.9.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("402643B4-06DB-4BC5-B8B1-96478AF6D7F5")] + diff --git a/BackgroundUploadHelper/Properties/Resources.Designer.cs b/ColorpickerWPF/Properties/Resources.Designer.cs similarity index 81% rename from BackgroundUploadHelper/Properties/Resources.Designer.cs rename to ColorpickerWPF/Properties/Resources.Designer.cs index aa3e6d3..80f8c36 100644 --- a/BackgroundUploadHelper/Properties/Resources.Designer.cs +++ b/ColorpickerWPF/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace BackgroundUploadHelper.Properties -{ - - +namespace ColorPickerWPF.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace BackgroundUploadHelper.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BackgroundUploadHelper.Properties.Resources", typeof(Resources).Assembly); + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ColorPickerWPF.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/BackgroundUploadHelper/Properties/Resources.resx b/ColorpickerWPF/Properties/Resources.resx similarity index 100% rename from BackgroundUploadHelper/Properties/Resources.resx rename to ColorpickerWPF/Properties/Resources.resx diff --git a/ColorpickerWPF/Resources/colorpicker1.png b/ColorpickerWPF/Resources/colorpicker1.png new file mode 100644 index 0000000..9682652 Binary files /dev/null and b/ColorpickerWPF/Resources/colorpicker1.png differ diff --git a/ColorpickerWPF/Resources/colorpicker2.png b/ColorpickerWPF/Resources/colorpicker2.png new file mode 100644 index 0000000..d9826f4 Binary files /dev/null and b/ColorpickerWPF/Resources/colorpicker2.png differ diff --git a/ColorpickerWPF/Resources/icon.png b/ColorpickerWPF/Resources/icon.png new file mode 100644 index 0000000..f40746b Binary files /dev/null and b/ColorpickerWPF/Resources/icon.png differ diff --git a/ColorpickerWPF/Resources/icon64.png b/ColorpickerWPF/Resources/icon64.png new file mode 100644 index 0000000..491a191 Binary files /dev/null and b/ColorpickerWPF/Resources/icon64.png differ diff --git a/ColorpickerWPF/SliderRow.xaml b/ColorpickerWPF/SliderRow.xaml new file mode 100644 index 0000000..1348fd1 --- /dev/null +++ b/ColorpickerWPF/SliderRow.xaml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ColorpickerWPF/SliderRow.xaml.cs b/ColorpickerWPF/SliderRow.xaml.cs new file mode 100644 index 0000000..27d4589 --- /dev/null +++ b/ColorpickerWPF/SliderRow.xaml.cs @@ -0,0 +1,59 @@ +using System.Windows; +using System.Windows.Controls; + +namespace ColorPickerWPF +{ + /// + /// Interaction logic for SliderRow.xaml + /// + public partial class SliderRow : UserControl + { + public delegate void SliderRowValueChangedHandler(double value); + + public event SliderRowValueChangedHandler OnValueChanged; + + public string FormatString { get; set; } + + protected bool UpdatingValues = false; + + public SliderRow() + { + FormatString = "F2"; + + InitializeComponent(); + } + + private void Slider_OnValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + // Set textbox + double value = Slider.Value; + + if (!UpdatingValues) + { + UpdatingValues = true; + TextBox.Text = value.ToString(FormatString); + OnValueChanged?.Invoke(value); + UpdatingValues = false; + } + } + + private void TextBox_OnTextChanged(object sender, TextChangedEventArgs e) + { + if (!UpdatingValues) + { + string text = TextBox.Text; + bool ok = false; + double parsedValue = 0; + + ok = double.TryParse(text, out parsedValue); + if (ok) + { + UpdatingValues = true; + Slider.Value = parsedValue; + OnValueChanged?.Invoke(parsedValue); + UpdatingValues = false; + } + } + } + } +} diff --git a/ColorpickerWPF/app.config b/ColorpickerWPF/app.config new file mode 100644 index 0000000..f4f2a84 --- /dev/null +++ b/ColorpickerWPF/app.config @@ -0,0 +1,5 @@ + + + + + diff --git a/ColorpickerWPF/packages.config b/ColorpickerWPF/packages.config new file mode 100644 index 0000000..ba6708f --- /dev/null +++ b/ColorpickerWPF/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DeviceExcludeTool/App.config b/DeviceExcludeTool/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/DeviceExcludeTool/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/App.xaml b/DeviceExcludeTool/App.xaml deleted file mode 100644 index d360c6c..0000000 --- a/DeviceExcludeTool/App.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/AppSettings.cs b/DeviceExcludeTool/AppSettings.cs deleted file mode 100644 index d832b20..0000000 --- a/DeviceExcludeTool/AppSettings.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace DeviceExcludeTool -{ - public class AppSettings - { - #region Constants - - public const int CURRENT_VERSION = 1; - - #endregion - - #region Properties & Fields - public string Lang { get; set; } = "en"; - public int Version { get; set; } = 0; - public double UpdateRate { get; set; } = 30.0; - - public int StartDelay { get; set; } = 0; - - public string ApiKey { get; set; } = null; - - public bool MinimizeToTray { get; set; } = false; - - public bool EnableDiscordRPC { get; set; } = true; - public bool RunAsAdmin { get; set; } = false; - public int DeviceTypes { get; set; } = -1; - - public bool EnableClient { get; set; } = false; - - public bool EnableServer { get; set; } = false; - - public string BackgroundImg { get; set; } = "default"; - - public string versionURL { get; set; } = "https://fanman03.com/inc/version.json"; - - public string updateURL { get; set; } = "http://fanman03.com/dlmgr/click.php?id=jnsync_latest"; - - public bool ShowHelperConsole { get; set; } = false; - - #endregion - } -} diff --git a/DeviceExcludeTool/DeviceExcludeTool.csproj b/DeviceExcludeTool/DeviceExcludeTool.csproj deleted file mode 100644 index 88d77c6..0000000 --- a/DeviceExcludeTool/DeviceExcludeTool.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - Debug - AnyCPU - {34947C89-2B73-42D6-822D-6CC07BD98B88} - WinExe - DeviceExcludeTool - DeviceExcludeTool - v4.7.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - code.ico - - - - ..\RGBSync+\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll - - - ..\RGBSync+\packages\MaterialDesignColors.1.2.6\lib\net45\MaterialDesignColors.dll - - - ..\RGBSync+\packages\MaterialDesignThemes.3.1.3\lib\net45\MaterialDesignThemes.Wpf.dll - - - ..\RGBSync+\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - - - ..\RGBSync+\packages\System.ValueTuple.4.4.0\lib\net47\System.ValueTuple.dll - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/MainWindow.xaml b/DeviceExcludeTool/MainWindow.xaml deleted file mode 100644 index 65c178c..0000000 --- a/DeviceExcludeTool/MainWindow.xaml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Device Exclude Tool - Check the boxes of only the device types that you want JackNet RGB Sync to load. - Keyboard - Mouse - Headset - Mousepad - Headset Stand - Keypad - Speaker - Unknown - - Mainboard - Graphics Card - DRAM - Fan - Cooler - LED Strip - LED Matrix - - All - - - - - diff --git a/DeviceExcludeTool/MainWindow.xaml.cs b/DeviceExcludeTool/MainWindow.xaml.cs deleted file mode 100644 index c8c2157..0000000 --- a/DeviceExcludeTool/MainWindow.xaml.cs +++ /dev/null @@ -1,249 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Diagnostics; -using System.IO; -using System.Windows; - -namespace DeviceExcludeTool -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window - { - public static int finalValue; - - private const string PATH_APPSETTINGS = "AppSettings.json"; - - public bool restartMainExe; - - AppSettings appsettings; - - public MainWindow() - { - InitializeComponent(); - - try { appsettings = JsonConvert.DeserializeObject(File.ReadAllText(PATH_APPSETTINGS)); } - catch (Exception ex) - { - appsettings = new AppSettings(); - Console.WriteLine(ex.Message); - /* File doesn't exist or is corrupt - just create a new one. */ - } - - Process[] processes = Process.GetProcessesByName("RGBSync+"); - if (processes.Length == 0) - { - restartMainExe = false; - } - else - { - foreach (var process in processes) - { - process.Kill(); - } - restartMainExe = true; - } - - resultBox.Text = appsettings.DeviceTypes.ToString(); - } - - private void WriteBtn_Click(object sender, RoutedEventArgs e) - { - appsettings.DeviceTypes = finalValue; - File.WriteAllText(PATH_APPSETTINGS, JsonConvert.SerializeObject(appsettings)); - } - - private void UpdateBtn_Click(object sender, RoutedEventArgs e) - { - finalValue = 0; - if (keyboard.IsChecked == true) - { - finalValue = finalValue | 1 << 0; - } - if (mouse.IsChecked == true) - { - finalValue = finalValue | 1 << 1; - } - if (headset.IsChecked == true) - { - finalValue = finalValue | 1 << 2; - } - if (mousepad.IsChecked == true) - { - finalValue = finalValue | 1 << 3; - } - if (ledstrip.IsChecked == true) - { - finalValue = finalValue | 1 << 4; - } - if (ledmatrix.IsChecked == true) - { - finalValue = finalValue | 1 << 5; - } - if (mainboard.IsChecked == true) - { - finalValue = finalValue | 1 << 6; - } - if (gpu.IsChecked == true) - { - finalValue = finalValue | 1 << 7; - } - if (dram.IsChecked == true) - { - finalValue = finalValue | 1 << 8; - } - if (headsetstand.IsChecked == true) - { - finalValue = finalValue | 1 << 9; - } - if (keypad.IsChecked == true) - { - finalValue = finalValue | 1 << 10; - } - if (fan.IsChecked == true) - { - finalValue = finalValue | 1 << 11; - } - if (speaker.IsChecked == true) - { - finalValue = finalValue | 1 << 12; - } - if (cooler.IsChecked == true) - { - finalValue = finalValue | 1 << 13; - } - if (unknown.IsChecked == true) - { - finalValue = finalValue | 1 << 31; - } - if (all.IsChecked == true) - { - finalValue = -1; - } - - resultBox.Text = finalValue.ToString(); - } - - private void all_Checked(object sender, RoutedEventArgs e) - { - keyboard.IsChecked = true; - keyboard.IsEnabled = false; - - mouse.IsChecked = true; - mouse.IsEnabled = false; - - headset.IsChecked = true; - headset.IsEnabled = false; - - mousepad.IsChecked = true; - mousepad.IsEnabled = false; - - ledstrip.IsChecked = true; - ledstrip.IsEnabled = false; - - ledmatrix.IsChecked = true; - ledmatrix.IsEnabled = false; - - mainboard.IsChecked = true; - mainboard.IsEnabled = false; - - gpu.IsChecked = true; - gpu.IsEnabled = false; - - headsetstand.IsChecked = true; - headsetstand.IsEnabled = false; - - keypad.IsChecked = true; - keypad.IsEnabled = false; - - speaker.IsChecked = true; - speaker.IsEnabled = false; - - unknown.IsChecked = true; - unknown.IsEnabled = false; - - dram.IsChecked = true; - dram.IsEnabled = false; - - fan.IsChecked = true; - fan.IsEnabled = false; - - cooler.IsChecked = true; - cooler.IsEnabled = false; - } - - private void all_Unchecked(object sender, RoutedEventArgs e) - { - keyboard.IsChecked = false; - keyboard.IsEnabled = true; - - mouse.IsChecked = false; - mouse.IsEnabled = true; - - headset.IsChecked = false; - headset.IsEnabled = true; - - mousepad.IsChecked = false; - mousepad.IsEnabled = true; - - ledstrip.IsChecked = false; - ledstrip.IsEnabled = true; - - ledmatrix.IsChecked = false; - ledmatrix.IsEnabled = true; - - mainboard.IsChecked = false; - mainboard.IsEnabled = true; - - gpu.IsChecked = false; - gpu.IsEnabled = true; - - headsetstand.IsChecked = false; - headsetstand.IsEnabled = true; - - speaker.IsChecked = false; - speaker.IsEnabled = true; - - keypad.IsChecked = false; - keypad.IsEnabled = true; - - unknown.IsChecked = false; - unknown.IsEnabled = true; - - dram.IsChecked = false; - dram.IsEnabled = true; - - fan.IsChecked = false; - fan.IsEnabled = true; - - cooler.IsChecked = false; - cooler.IsEnabled = true; - } - private void AppWindow_Closed(object sender, EventArgs e) - { - if (restartMainExe) - { - Process[] processes = Process.GetProcessesByName("RGBSync+"); - if (processes.Length == 0) - { - string ExeName = "RGBSync+.exe"; - Process.Start(ExeName); - } - } - } - - private void AppWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) - { - if (restartMainExe) - { - Process[] processes = Process.GetProcessesByName("RGBSync+"); - if (processes.Length == 0) - { - string ExeName = "RGBSync+.exe"; - Process.Start(ExeName); - } - } - } - } -} diff --git a/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe b/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe deleted file mode 100644 index c6f7160..0000000 Binary files a/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe and /dev/null differ diff --git a/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe.config b/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe.config deleted file mode 100644 index 56efbc7..0000000 --- a/DeviceExcludeTool/bin/Debug/DeviceExcludeTool.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/bin/Debug/MaterialDesignThemes.Wpf.xml b/DeviceExcludeTool/bin/Debug/MaterialDesignThemes.Wpf.xml deleted file mode 100644 index 4990299..0000000 --- a/DeviceExcludeTool/bin/Debug/MaterialDesignThemes.Wpf.xml +++ /dev/null @@ -1,1644 +0,0 @@ - - - - MaterialDesignThemes.Wpf - - - - - this is a simple utility to add and remove a single adorner to an element since there is no built-in way to do that in xaml. - see here - - - - - Helper properties for working with for make round corner. - - - - - Controls the corner radius of the surrounding box. - - - - - A card is a content control, styled according to Material Design guidelines. - - - - - Indicates if the delete button should be visible. - - - - - Event correspond to delete button left mouse button click - - - - - Add / Remove DeleteClickEvent handler - - - - - This override method is called when the control is clicked by mouse or keyboard - - - - - User a colour zone to easily switch the background and foreground colours, from selected Material Design palette or custom ones. - - - - - By default ComboBox uses the wrapper popup. Popup can be switched to classic Windows desktop view by means of this attached property. - - - - - By default the selected item is hidden from the drop down list, as per Material Design specifications. - To revert to a more classic Windows desktop behaviour, and show the currently selected item again in the drop - down, set this attached propety to true. - - - - - Help us format the content of a header button in a calendar. - - - Expected items, in the following order: - 1) DateTime Calendar.DisplayDate - 2) DateTime? Calendar.SelectedDate - - - - - Converter for control. Can be extended by method. - - - - - Helps coerce the correct item container style for a , according to whether the list is displaying in standard mode, or using a , such as a . - - - - - Item container style to use when is null. - - - - - Item container style to use when is not null, typically when a is applied. - - - - - Returns the item container to use for a . - - Should be a or instance. - - - - - - - - 1 - Content presenter render size, - 2 - Clipping border padding (main control padding) - - - - - - - - - - Set the maximum length for the text field. - - Not a dprop, as is only applied once. - - - - Cancel the close. - - - - - Indicates if the close has already been cancelled. - - - - - Gets the parameter originally provided to / - - - - - Allows interaction with the current dialog session. - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - The data context from the sender element (typically a ) - is applied to the content. - - - - - The data context from the is applied to the content. - - - - - The data context is explicitly set to null. - - - - - Routed command to be used somewhere inside an instance to trigger showing of the dialog. Content can be passed to the dialog via a . - - - - - Routed command to be used inside dialog content to close a dialog. Use a to indicate the result of the parameter. - - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Identifier which is used in conjunction with to determine where a dialog should be shown. - - - - - Returns a DialogSession for the currently open dialog for managing it programmatically. If no dialog is open, CurrentSession will return null - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - Indicates whether the dialog will close if the user clicks off the dialog, on the obscured background. - - - - - Parameter to provide to close handlers if an close due to click away is instigated. - - - - - Allows association of a snackbar, so that notifications can be paused whilst a dialog is being displayed. - - - - - Set the theme (light/dark) for the dialog. - - - - - Represents the overlay brush that is used to dim the background behind the dialog - - - - - Raised when a dialog is opened. - - - - - Attached property which can be used on the which instigated the to process the event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Raised just before a dialog is closed. - - - - - Attached property which can be used on the which instigated the to process the closing event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Attempts to focus the content of a popup. - - The popup content. - - - - Helper extensions for showing dialogs. - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Allows interation with the current dialog session. - - - - - Allows an open dialog to be managed. Use is only permitted during a single display operation. - - - - - Indicates if the dialog session has ended. Once ended no further method calls will be permitted. - - - Client code cannot set this directly, this is internally managed. To end the dialog session use . - - - - - The parameter passed to the and return by - - - - - Gets the which is currently displayed, so this could be a view model or a UI element. - - - - - Update the current content in the dialog. - - - - - - Closes the dialog. - - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Closes the dialog. - - Result parameter which will be returned in or from method. - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Returns full visual ancestry, starting at the leaf. - - - - - - - The hint property - - - - - Sets the hint. - - The element. - The value. - - - - Gets the hint. - - The element. - - The . - - - - - The hint opacity property - - - - - Gets the text box view margin. - - The element. - - The . - - - - - Sets the hint opacity. - - The element. - The value. - - - - The color for the text of a focused control. - - - - - Gets the color for the text of a focused control. - - - - - Sets the color for the text of a focused control. - - - - - The color for the background of a focused control. - - - - - Gets the color for the background of a focused control. - - - - - Sets the color for the background of a focused control. - - - - - The HelperText property - - - - - Sets the HelperText. - - The element. - The value. - - - - Gets the HelperText. - - The element. - - The . - - - - - Displays an icon image/path, according to the specified name. - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Gets or sets the name of icon being displayed. - - - - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - This interface is the adapter from UiControl (like , and others) to - - You should implement this interface in order to use SmartHint for your own control. - - - - - Checks to see if the targeted control can be deemed as logically - empty, even if not null, affecting the current hint display. - - - - - - Targeted control has keyboard focus - - - - - - Queues a notification message for display in a snackbar. - - Message. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - - - - Queues a notification message for display in a snackbar. - - Message. - Subsequent, duplicate messages queued within a short time span will - be discarded. To override this behaviour and ensure the message always gets displayed set to true. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - The message will promoted to the front of the queue. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue and never considered to be a duplicate. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Provides shorthand to initialise a new for a . - - - - - Gets or sets the icon to display. - - - - - Gets the icon path data for the current . - - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Provides full information about a palette. - - - - - View a control on a 3D plane. - - - Taken from http://blogs.msdn.com/greg_schechter/archive/2007/10/26/enter-the-planerator-dead-simple-3d-in-wpf-with-a-stupid-name.aspx , Greg Schechter - Fall 2007 - - - - - Wrap this around a class that we want to catch the measure and arrange - processes occuring on, and propagate to the parent Planerator, if any. - Do this because layout invalidations don't flow up out of a - Viewport2DVisual3D object. - - - - - Defines how the popup is aligned to the toggle part of the control. - - - - - Display the popup below the toggle, and align the left edges.3 - - - - - Display the popup below the toggle, and align the right edges. - - - - - Display the popup below the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup above the toggle, and align the left edges. - - - - - Display the popup above the toggle, and align the right edges. - - - - - Display the popup above the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup to the left of the toggle, and align the top edges. - - - - - Display the popup to the left of the toggle, and align the bottom edges. - - - - - Display the popup to the left of the toggle, and align the middles. - - - - - Display the popup to the right of the toggle, and align the top edges. - - - - - Display the popup to the right of the toggle, and align the bottom edges. - - - - - Display the popup to the right of the toggle, and align the middles. - - - - - Defines what causes the to open it's popup. - - - - - Open when the toggle button is clicked. - - - - - Open when the mouse goes over the toggle button. - - - - - Open when the mouse goes over the toggle button, or the space in which the popup box would occupy should it be open. - - - - - Popup box, similar to a , but allows more customizable content. - - - - - Routed command to be used inside of a popup content to close it. - - - - - Content to display in the toggle button. - - - - - Template for . - - - - - Content to display in the toggle when it's checked (when the popup is open). Optional; if not provided the is used. - - - - - Template for . - - - - - Command to execute if toggle is checked (popup is open) and is set. - - - - - Command parameter to use in conjunction with . - - - - - Content to display in the content. - - - - - Popup content template. - - - - - Gets or sets whether the popup is currently open. - - - - - Indicates of the popup should stay open if a click occurs inside the popup. - - - - - Gets or sets how the popup is aligned in relation to the toggle. - - - - - Gets or sets what trigger causes the popup to open. - - - - - Get or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Gets or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Framework use. Provides the method used to position the popup. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Raises . - - - - - Raised when the popup is opened. - - - - - Raises . - - - - - Raised when the popup is closed. - - - - - Raises . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - A custom control implementing a rating bar. - The icon aka content may be set as a DataTemplate via the ButtonContentTemplate property. - - - - - The DependencyProperty for the RecognizesAccessKey property. - Default Value: false - - - - - Determine if Ripple should use AccessText in its style - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - Set to True to disable ripple effect - - - - - Set to True to disable ripple effect - - - - - - - Set to True to disable ripple effect - - - - - - Internal use only. - - - - - Represents a display device or multiple display devices on a single system. - Based on http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Screen.cs - - - - - Available working area on the screen. This excludes taskbars and other - docked windows. - - - - - Gets an array of all of the displays on the system. - - - - - Gets the bounds of the display. - - - - - Gets the device name associated with a display. - - - - - Gets a value indicating whether a particular display is the primary device. - - - - - Gets the primary display. - - - - - Gets the working area of the screen. - - - - - Screen instances call this property to determine - if their WorkingArea cache needs to be invalidated. - - - - - Specifies a value that indicates whether the specified object is equal to this one. - - - - - Retrieves a for the monitor that contains the specified point. - - - - - Retrieves a for the monitor that contains the largest region of the Rect. - - - - - Retrieves the working area for the monitor that is closest to the specified point. - - - - - Retrieves the working area for the monitor that contains the largest region of the specified Rect. - - - - - Retrieves the bounds of the monitor that is closest to the specified point. - - - - - Retrieves the bounds of the monitor that contains the largest region of the specified Rect. - - - - - Computes and retrieves a hash code for an object. - - - - - Called by the SystemEvents class when our display settings are - changing. We cache screen information and at this point we must - invalidate our cache. - - - - - Called by the SystemEvents class when our display settings have - changed. Here, we increment a static counter that Screen instances - can check against to invalidate their cache. - - - - - Retrieves a string representing this object. - - - - - A control that implement placeholder behavior. Can work as a simple placeholder either as a floating hint, see property. - - To set a target control you should set the HintProxy property. Use the converter which converts a control into the IHintProxy interface. - - - - - Implements a inspired by the Material Design specs (https://material.google.com/components/snackbars-toasts.html). - - - - - Defines the content of a message within a . Primary content should be set via the - standard property. Where an action is allowed, content - can be provided in . Standard button properties are - provided for actions, includiing . - - - - - Event correspond to left mouse button click on the Action button. - - - - - Add / Remove ActionClickEvent handler - - - - - Maximum total height of snackbar for the action button to be inlined. - - Default value (55) is between single line message (48) and two lined snackbar-message (66) - because tolerance is required (see issue) - - - - - - Gets or sets a value that indicates whether this message queue displays messages without discarding duplicates. - True to show every message even if there are duplicates. - - - - - The content to be displayed - - - - - Message show duration. - - - - - The content for the action button on the snackbar - - - - - Handler to be invoked when the action button is clicked - - - - - The argument to pass to the delegate. - - - - - Promote the message, pushing it in front of any message that is not promoted. - - - - - Still display this message even if it is a duplicate. - - - - - Checks if given item is a duplicate to this - - Item to check for duplicate - true if given item is a duplicate to this, false otherwise - - - - Helper properties for working with text fields. - - - - - The text box view margin property - - - - - Sets the text box view margin. - - The element. - The value. - - - - Gets the text box view margin. - - The element. - - The . - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - - - The attached WPF property for getting or setting the value for an underline decoration. - - - - - Sets the used for underline decoration. - - - - - - - Gets the used for underline decoration. - - - - - - Controls the visbility of the text field box. - - - - - Controls the visibility of the text field area box. - - - - - Controls the corner radius of the surrounding box. - - - - - Controls the corner radius of the bottom line of the surrounding box. - - - - - Controls the highlighting style of a text box. - - - - - Enables a ripple effect on focusing the text box. - - - - - Automatically inserts spelling suggestions into the text box context menu. - - - - - Controls the visbility of the clear button. - - - - - SuffixText dependency property - - - - - Applies the text box view margin. - - The text box. - The margin. - - - - The text box view margin property changed callback. - - The dependency object. - The dependency property changed event args. - - - - Called when this element gets focus. - - - - - IsDropDownOpenProperty property changed handler. - - DatePicker that changed its IsDropDownOpen. - DependencyPropertyChangedEventArgs. - - - - Set to true to stop invalid text reverting back to previous valid value. Useful in cases where you - want to display validation messages and allow the user to correct the data without it reverting. - - - - - Set to true to display seconds in the time and allow the user to select seconds. - - - - - Framework use only. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Duration of the animation - - - - - Multiplies a time span unit by the index of an item in a list. - - - Example usage is for a to have a - time delayed according to position in a list, so cascading animations can occur. - - - - - Direction of the slide wipe - - - - - Duration of the animation - - - - - Allows transitions to be disabled where supported. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - The transitioner provides an easy way to move between content with a default in-place circular transition. - - - - - Causes the the next slide to be displayed (affectively increments ). - - - - - Causes the the previous slide to be displayed (affectively decrements ). - - - - - Moves to the first slide. - - - - - Moves to the last slide. - - - - - If enabled, transition origins will be applied to wipes, according to where a transition was triggered from. For example, the mouse point where a user clicks a button. - - - - - Content control to host the content of an individual page within a . - - - - - Content control to enable easier transitions. - - - - - Gets or sets the transition to run when the content is loaded and made visible. - - - - - Delay offset to be applied to all opening effect transitions. - - - - - Allows multiple transition effects to be combined and run upon the content loading or being made visible. - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template. - - The element. - The value. - - - - Gets the additional template. - - The element. - - The . - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template selector. - - The element. - The value. - - - - Gets the additional template selector. - - The element. - - The . - - - - - To be used at level, or to be returned by - implementors when the additional template associated with a tree should not be used. - - - - - - - - - - The hint property - - - - - The hint property - - - - - The hint property - - - - - Framework use only. - - - - - Framework use only. - - - - - - - Framework use only. - - - - - This custom popup can be used by validation error templates or something else. - It provides some additional nice features: - - repositioning if host-window size or location changed - - repositioning if host-window gets maximized and vice versa - - it's only topmost if the host-window is activated - - - - - Gets/sets if the popup can be closed by left mouse button down. - - - - - Causes the popup to update it's position according to it's current settings. - - - - - SetWindowPos options - - - - diff --git a/DeviceExcludeTool/bin/Debug/Newtonsoft.Json.xml b/DeviceExcludeTool/bin/Debug/Newtonsoft.Json.xml deleted file mode 100644 index aa245c5..0000000 --- a/DeviceExcludeTool/bin/Debug/Newtonsoft.Json.xml +++ /dev/null @@ -1,11262 +0,0 @@ - - - - Newtonsoft.Json - - - - - Represents a BSON Oid (object id). - - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Initializes a new instance of the class. - - The Oid value. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized BSON data. - - - - - Gets or sets a value indicating whether binary data reading should be compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating BSON data. - - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Initializes a new instance of the class. - - The to write to. - - - - Initializes a new instance of the class. - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a JSON array. - - - - - Writes the beginning of a JSON object. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to a single parameterized constructor, then to the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a parameterized constructor. - - - - - Converts a binary value to and from a base 64 string value. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Creates a custom object. - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from the ISO 8601 date format (e.g. "2008-04-12T12:53Z"). - - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Converts a to and from a JavaScript Date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - The default value is false. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets the naming strategy used to resolve how enum text is written. - - The naming strategy used to resolve how enum text is written. - - - - Gets or sets a value indicating whether integer values are allowed when serializing and deserializing. - The default value is true. - - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - true if the written enum text will be camel case; otherwise, false. - - - - Initializes a new instance of the class. - - The naming strategy used to resolve how enum text is written. - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from Unix epoch time - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts XML to and from JSON. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produced multiple root elements. - - The name of the deserialized root element. - - - - Gets or sets a value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attribute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Gets or sets a value indicating whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - true if special characters are encoded; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - true if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - The default JSON name table implementation. - - - - - Initializes a new instance of the class. - - - - - Gets a string containing the same characters as the specified range of characters in the given array. - - The character array containing the name to find. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - A string containing the same characters as the specified range of characters in the given array. - - - - Adds the specified string into name table. - - The string to add. - This method is not thread-safe. - The resolved string. - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that it is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and set members to their default value when deserializing. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a of property. - - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Provides an interface for using pooled arrays. - - The array type content. - - - - Rent an array from the pool. This array must be returned when it is no longer needed. - - The minimum required length of the array. The returned array may be longer. - The rented array from the pool. This array must be returned when it is no longer needed. - - - - Return an array to the pool. - - The array that is being returned. - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, when returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, when returns false). - - - - Instructs the how to serialize the collection. - - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items. - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Instructs the how to serialize the object. - - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets or sets the collection's items converter. - - The collection's items converter. - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Provides methods for converting between .NET types and JSON types. - - - - - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - The string escape handling. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output should be formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output should be formatted. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - - - Serializes the to a JSON string. - - The node to serialize. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to serialize. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by , - writes a Json.NET array attribute for collections, and encodes special characters. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - - A value to indicate whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - The deserialized . - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by , - writes a Json.NET array attribute for collections, and encodes special characters. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - - A value to indicate whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - The deserialized . - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Converts an object to and from JSON. - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. If there is no existing value then null will be used. - The existing value has a value. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Instructs the to use the specified when serializing the member or class. - - - - - Gets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - - - - - Initializes a new instance of the class. - - Type of the . - - - - Initializes a new instance of the class. - - Type of the . - Parameter list to use when constructing the . Can be null. - - - - Represents a collection of . - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Initializes a new instance of the class. - - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Base class for a table of atomized string objects. - - - - - Gets a string containing the same characters as the specified range of characters in the given array. - - The character array containing the name to find. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - A string containing the same characters as the specified range of characters in the given array. - - - - Instructs the how to serialize the object. - - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets the missing member handling used when deserializing this object. - - The missing member handling. - - - - Gets or sets how the object's properties with null values are handled during serialization and deserialization. - - How the object's properties with null values are handled during serialization and deserialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to always serialize the member with the specified name. - - - - - Gets or sets the type used when serializing the property's collection items. - - The collection's items type. - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously skips the children of the current token. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Specifies the state of the reader. - - - - - A read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader is in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the source should be closed when this reader is closed. - - - true to close the source when this reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. - The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Gets or sets how time zones are handled when reading JSON. - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Gets or sets how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets the .NET type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Reads the next JSON token from the source. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the current token and value. - - The new token. - The value. - A flag indicating whether the position index inside an array should be updated. - - - - Sets the state based on current token type. - - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the reader's state to . - If is set to true, the source is also closed. - - - - - The exception thrown when an error occurs while reading JSON text. - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Instructs the to always serialize the member, and to require that the member has a value. - - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - The default value is . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - The default value is . - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - The default value is . - - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - The default value is . - - - - - Gets or sets how null values are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how default values are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how objects are created during deserialization. - The default value is . - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - The default value is . - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - The default value is . - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - The default value is . - - - - - Gets or sets how dates are written to JSON text. - The default value is . - - - - - Gets or sets how time zones are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - The default value is . - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - The default value is . - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON text. - The default value is . - - - - - Gets or sets how strings are escaped when writing JSON text. - The default value is . - - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". - - - - - Gets or sets the culture used when reading JSON. - The default value is . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - A null value means there is no maximum. - The default value is null. - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - The default value is false. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings - from . - - - A new instance. - The will not use default settings - from . - - - - - Creates a new instance using the specified . - The will not use default settings - from . - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings - from . - - - - - Creates a new instance. - The will use default settings - from . - - - A new instance. - The will use default settings - from . - - - - - Creates a new instance using the specified . - The will use default settings - from as well as the specified . - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings - from as well as the specified . - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to read values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to read values from. - The target object to populate values onto. - - - - Deserializes the JSON structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Specifies the settings on a object. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) are handled. - The default value is . - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - The default value is . - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - The default value is . - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - The default value is . - - Null value handling. - - - - Gets or sets how default values are handled during serialization and deserialization. - The default value is . - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - The default value is . - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - The default value is . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - The default value is . - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - The default value is . - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets a function that creates the used by the serializer when resolving references. - - A function that creates the used by the serializer when resolving references. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - A null value means there is no maximum. - The default value is null. - - - - - Indicates how JSON text output is formatted. - The default value is . - - - - - Gets or sets how dates are written to JSON text. - The default value is . - - - - - Gets or sets how time zones are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - The default value is . - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON. - The default value is . - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - The default value is . - - - - - Gets or sets how strings are escaped when writing JSON text. - The default value is . - - - - - Gets or sets the culture used when reading JSON. - The default value is . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - The default value is false. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Initializes a new instance of the class with the specified . - - The containing the JSON data to read. - - - - Gets or sets the reader's property name table. - - - - - Gets or sets the reader's character buffer pool. - - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, returns false). - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Gets or sets the writer's character array pool. - - - - - Gets or sets how many s to write for each level in the hierarchy when is set to . - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to . - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - Initializes a new instance of the class using the specified . - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying . - - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Specifies the type of JSON token. - - - - - This is returned by the if a read method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - - Represents a reader that provides validation. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the .NET type for the current JSON token. - - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a []. - - - A [] or null if the next JSON token is null. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the current token. - - The to read the token from. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the token and its value. - - The to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously ets the state of the . - - The being written. - The value being written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Gets or sets a value indicating whether the destination should be closed when this writer is closed. - - - true to close the destination when this writer is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether the JSON should be auto-completed when this writer is closed. - - - true to auto-complete the JSON when this writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Gets or sets a value indicating how JSON text output should be formatted. - - - - - Gets or sets how dates are written to JSON text. - - - - - Gets or sets how time zones are handled when writing JSON text. - - - - - Gets or sets how strings are escaped when writing JSON text. - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Gets or sets how and values are formatted when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the destination and also flushes the destination. - - - - - Closes this writer. - If is set to true, the destination is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the end of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current JSON object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - - - - Writes the token. - - The to write. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Sets the state of the . - - The being written. - The value being written. - - - - The exception thrown when an error occurs while writing JSON text. - - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Specifies how JSON comments are handled when loading JSON. - - - - - Ignore comments. - - - - - Load comments as a with type . - - - - - Specifies how duplicate property names are handled when loading JSON. - - - - - Replace the existing value when there is a duplicate property. The value of the last property in the JSON object will be used. - - - - - Ignore the new value when there is a duplicate property. The value of the first property in the JSON object will be used. - - - - - Throw a when a duplicate property is encountered. - - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, and the descendants of every token in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every token in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every token in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every token in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every token in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a collection of objects. - - The type of token. - - - - Gets the of with the specified key. - - - - - - Represents a JSON array. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads an from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - - - - - Returns an enumerator that iterates through the collection. - - - A of that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - - - - Removes all items from the . - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies the elements of the to an array, starting at a particular array index. - - The array. - Index of the array. - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - - - Represents a JSON constructor. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a token that can contain other tokens. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An of containing the descendant tokens of the . - - - - Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. - - An of containing this token, and all the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates a that can be used to add tokens to the . - - A that is ready to have content written to it. - - - - Replaces the child nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Merge the specified content into this . - - The content to be merged. - - - - Merge the specified content into this using . - - The content to be merged. - The used to merge the content. - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens. - - - - Represents a collection of objects. - - The type of token. - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the of with the specified key. - - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Represents a JSON object. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets the node type for this . - - The type. - - - - Gets an of of this object's properties. - - An of of this object's properties. - - - - Gets a with the specified name. - - The property name. - A with the specified name or null. - - - - Gets the with the specified name. - The exact name will be searched for first and if no matching property is found then - the will be used to match a property. - - The property name. - One of the enumeration values that specifies how the strings will be compared. - A matched with the specified name or null. - - - - Gets a of of this object's property values. - - A of of this object's property values. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Determines whether the JSON object has the specified property name. - - Name of the property. - true if the JSON object has the specified property name; otherwise, false. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries to get the with the specified property name. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Represents a JSON property. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. - When the or - - methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Represents a raw JSON string. - - - - - Asynchronously creates an instance of with the content of the reader's current token. - - The reader. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns an instance of with the content of the reader's current token. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Specifies the settings used when loading JSON. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how JSON comments are handled when loading JSON. - The default value is . - - The JSON comment handling. - - - - Gets or sets how JSON line info is handled when loading JSON. - The default value is . - - The JSON line info handling. - - - - Gets or sets how duplicate property names in JSON objects are handled when loading JSON. - The default value is . - - The JSON duplicate property name handling. - - - - Specifies the settings used when merging JSON. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the method used when merging JSON arrays. - - The method used when merging JSON arrays. - - - - Gets or sets how null value properties are merged. - - How null value properties are merged. - - - - Gets or sets the comparison used to match property names while merging. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - The comparison used to match property names while merging. - - - - Represents an abstract JSON token. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Writes this token to a asynchronously. - - A into which this method will write. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of tokens that contain this token, and the ancestors of this token. - - A collection of tokens that contain this token, and the ancestors of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - ToString() returns a non-JSON string value for tokens with a type of . - If you want the JSON for all token types then you should use . - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output should be formatted. - A collection of s which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to []. - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from [] to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Creates a for this token. - - A that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object. - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - Creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JSONPath expression. Selects the token that matches the object path. - - - A that contains a JSONPath expression. - - A , or null. - - - - Selects a using a JSONPath expression. Selects the token that matches the object path. - - - A that contains a JSONPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JSONPath expression. - - - A that contains a JSONPath expression. - - An of that contains the selected elements. - - - - Selects a collection of elements using a JSONPath expression. - - - A that contains a JSONPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An of that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Adds an object to the annotation list of this . - - The annotation to add. - - - - Get the first annotation object of the specified type from this . - - The type of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets the first annotation object of the specified type from this . - - The of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets a collection of annotations of the specified type for this . - - The type of the annotations to retrieve. - An that contains the annotations for this . - - - - Gets a collection of annotations of the specified type for this . - - The of the annotations to retrieve. - An of that contains the annotations that match the specified type for this . - - - - Removes the annotations of the specified type from this . - - The type of annotations to remove. - - - - Removes the annotations of the specified type from this . - - The of annotations to remove. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Gets the at the reader's current position. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Initializes a new instance of the class. - - The token to read from. - The initial path of the token. It is prepended to the returned . - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the path of the current JSON token. - - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Gets the at the writer's current position. - - - - - Gets the token being written. - - The token being written. - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying . - - - - - Closes this writer. - If is set to true, the JSON is auto-completed. - - - Setting to true has no additional effect, since the underlying is a type that cannot be closed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes a value. - An error will be raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Creates a null value. - - A null value. - - - - Creates a undefined value. - - A undefined value. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Writes this token to a . - - A into which this method will write. - A collection of s which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - ToString() returns a non-JSON string value for tokens with a type of . - If you want the JSON for all token types then you should use . - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not of the same type as this instance. - - - - - Specifies how line information is handled when loading JSON. - - - - - Ignore line information. - - - - - Load line information. - - - - - Specifies how JSON arrays are merged together. - - - - Concatenate arrays. - - - Union arrays, skipping items that already exist. - - - Replace all array items. - - - Merge array items together, matched by index. - - - - Specifies how null value properties are merged. - - - - - The content's null value properties will be ignored during merging. - - - - - The content's null value properties will be merged. - - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Do not try to read metadata properties. - - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement . - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - The property is not required but it cannot be a null value. - - - - - - Contains the JSON schema extension methods. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - The validation event handler. - - - - - An in-memory representation of a JSON Schema. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read-only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisible by. - - A number that the value should be divisible by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the minimum attribute (). - - A flag indicating whether the value can not equal the number defined by the minimum attribute (). - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the maximum attribute (). - - A flag indicating whether the value can not equal the number defined by the maximum attribute (). - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallowed types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains JSON Schema. - - A that contains JSON Schema. - A populated from the string that contains JSON Schema. - - - - Load a from a string that contains JSON Schema using the specified . - - A that contains JSON Schema. - The resolver. - A populated from the string that contains JSON Schema. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - - Returns detailed information about the schema exception. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - - Generates a from a specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - - Resolves from an id. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - - The value types allowed by the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - - Specifies undefined schema Id handling options for the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - - Returns detailed information related to the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - - Represents the callback method that will handle JSON schema validation events and the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - A camel case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Resolves member mappings for a type, camel casing property names. - - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Used by to resolve a for a given . - - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing types. - - - true if the IsSpecified members will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore ShouldSerialize members when serializing and deserializing types. - - - true if the ShouldSerialize members will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized. - - The naming strategy used to resolve how property names and dictionary keys are serialized. - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Resolved name of the property. - - - - Resolves the name of the extension data. By default no changes are made to extension data names. - - Name of the extension data. - Resolved name of the extension data. - - - - Resolves the key of the dictionary. By default is used to resolve dictionary keys. - - Key of the dictionary. - Resolved key of the dictionary. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - The default naming strategy. Property names and dictionary keys are unchanged. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - Initializes a new instance of the class. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer that writes to the application's instances. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Provides data for the Error event. - - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides methods to get attributes. - - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Used by to resolve a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that was resolved from the reference. - - - - Gets the reference for the specified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - Allows users to control class loading and mandate what class to load. - - - - - When implemented, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object - The type of the object the formatter creates a new instance of. - - - - When implemented, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Contract details for a used by the . - - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the collection values. - - true if the creator has a parameter with the collection values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets the internally resolved for the contract's type. - This converter is used as a fallback converter when no other converter is resolved. - Setting will always override this converter. - - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non-public. - - true if the default object creator is non-public; otherwise, false. - - - - Contract details for a used by the . - - - - - Gets or sets the dictionary key resolver. - - The dictionary key resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the dictionary values. - - true if the creator has a parameter with the dictionary values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object constructor. - - The object constructor. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets the missing member handling used when deserializing this object. - - The missing member handling. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets or sets how the object's properties with null values are handled during serialization and deserialization. - - How the object's properties with null values are handled during serialization and deserialization. - - - - Gets the object's properties. - - The object's properties. - - - - Gets a collection of instances that define the parameters used with . - - - - - Gets or sets the function used to create the object. When set this function will override . - This function is called with a collection of arguments which are defined by the collection. - - The function used to create the object. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Gets or sets the extension data value type. - - - - - Gets or sets the extension data name resolver. - - The extension data name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the for this property. - - The for this property. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes precedence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets a value indicating whether has a value specified. - - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets a predicate used to determine whether the property should be deserialized. - - A predicate used to determine whether the property should be deserialized. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Lookup and create an instance of the type described by the argument. - - The type to create. - Optional arguments to pass to an initializing constructor of the JsonConverter. - If null, the default constructor is used. - - - - A kebab case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - A base class for resolving how property names and dictionary keys are serialized. - - - - - A flag indicating whether dictionary keys should be processed. - Defaults to false. - - - - - A flag indicating whether extension data names should be processed. - Defaults to false. - - - - - A flag indicating whether explicitly specified property names, - e.g. a property name customized with a , should be processed. - Defaults to false. - - - - - Gets the serialized name for a given property name. - - The initial property name. - A flag indicating whether the property has had a name explicitly specified. - The serialized property name. - - - - Gets the serialized name for a given extension data name. - - The initial extension data name. - The serialized extension data name. - - - - Gets the serialized key for a given dictionary key. - - The initial dictionary key. - The serialized dictionary key. - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Hash code calculation - - - - - - Object equality implementation - - - - - - - Compare to another NamingStrategy - - - - - - - Represents a method that constructs an object. - - The object type to create. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Provides methods to get attributes from a , , or . - - - - - Initializes a new instance of the class. - - The instance to get attributes for. This parameter should be a , , or . - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - A snake case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Indicates the method that will be used during deserialization for locating and loading assemblies. - - - - - In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method of the class is used to load the assembly. - - - - - In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the class is used to load the assembly. - - - - - Specifies type name handling options for the . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - Note that this doesn't include the root serialized object by default. To include the root object's type name in JSON - you must specify a root type object with - or . - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic . - - The list to add to. - The collection of elements to add. - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Helper class for serializing immutable collections. - Note that this is used by all builds, even those that don't support immutable collections, in case the DLL is GACed - https://github.com/JamesNK/Newtonsoft.Json/issues/652 - - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Builds a string. Unlike this class lets you reuse its internal buffer. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls result in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - An array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - Specifies that an output will not be null even if the corresponding type allows it. - - - Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. - - - Initializes the attribute with the specified return value condition. - - The return value condition. If the method returns this value, the associated parameter will not be null. - - - - Gets the return value condition. - - - Specifies that an output may be null even if the corresponding type disallows it. - - - Specifies that null is allowed as an input even if the corresponding type disallows it. - - - - Specifies that the method will not return if the associated Boolean parameter is passed the specified value. - - - - - Initializes a new instance of the class. - - - The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to - the associated parameter matches this value. - - - - Gets the condition parameter value. - - - diff --git a/DeviceExcludeTool/bin/Debug/System.ValueTuple.xml b/DeviceExcludeTool/bin/Debug/System.ValueTuple.xml deleted file mode 100644 index cee38ed..0000000 --- a/DeviceExcludeTool/bin/Debug/System.ValueTuple.xml +++ /dev/null @@ -1,2269 +0,0 @@ - - - - System.ValueTuple - - - - Provides extension methods for tuples to interoperate with language support for tuples in C#. - - - Deconstructs a tuple with 21 elements into separate variables. - The 21-element tuple to deconstruct into 21 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The value of the twenty-first element, or value.Rest.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - The type of the twenty-first element. - - - Deconstructs a tuple with 20 elements into separate variables. - The 20-element tuple to deconstruct into 20 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - - - Deconstructs a tuple with 19 elements into separate variables. - The 19-element tuple to deconstruct into 19 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - - - Deconstructs a tuple with 18 elements into separate variables. - The 18-element tuple to deconstruct into 18 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - - - Deconstructs a tuple with 17 elements into separate variables. - The 17-element tuple to deconstruct into 17 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - - - Deconstructs a tuple with 16 elements into separate variables. - The 16-element tuple to deconstruct into 16 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - - - Deconstructs a tuple with 15 elements into separate variables. - The 15-element tuple to deconstruct into 15 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - - - Deconstructs a tuple with 14 elements into separate variables. - The 14-element tuple to deconstruct into 14 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - - - Deconstructs a tuple with 13 elements into separate variables. - The 13-element tuple to deconstruct into 13 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - - - Deconstructs a tuple with 12 elements into separate variables. - The 12-element tuple to deconstruct into 12 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - - - Deconstructs a tuple with 11 elements into separate variables. - The 11-element tuple to deconstruct into 11 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - - - Deconstructs a tuple with 10 elements into separate variables. - The 10-element tuple to deconstruct into 10 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - - - Deconstructs a tuple with 9 elements into separate variables. - The 9-element tuple to deconstruct into 9 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - - - Deconstructs a tuple with 8 elements into separate variables. - The 8-element tuple to deconstruct into 8 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - - - Deconstructs a tuple with 7 elements into separate variables. - The 7-element tuple to deconstruct into 7 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - - - Deconstructs a tuple with 6 elements into separate variables. - The 6-element tuple to deconstruct into 6 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - - - Deconstructs a tuple with 5 elements into separate variables. - The 5-element tuple to deconstruct into 5 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - - - Deconstructs a tuple with 4 elements into separate variables. - The 4-element tuple to deconstruct into 4 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - - - Deconstructs a tuple with 3 elements into separate variables. - The 3-element tuple to deconstruct into 3 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The type of the first element. - The type of the second element. - The type of the third element. - - - Deconstructs a tuple with 2 elements into separate variables. - The 2-element tuple to deconstruct into 2 separate variables. - The value of the first element. - The value of the second element. - The type of the first element. - The type of the second element. - - - Deconstructs a tuple with 1 element into a separate variable. - The 1-element tuple to deconstruct into a separate variable. - The value of the single element. - The type of the single element. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The converted tuple. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The converted value tuple instance. - - - Represents a value tuple with a single component. - The type of the value tuple's only element. - - - Initializes a new instance. - The value tuple's first element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 2 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 3 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 4 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 5 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 6 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 7 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents an n-value tuple, where n is 8 or greater. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - Any generic value tuple instance that defines the types of the tuple's remaining elements. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - An instance of any value tuple type that contains the values of the value's tuple's remaining elements. - rest is not a generic value tuple type. - - - Compares the current instance to a specified instance - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Gets the current instance's remaining elements. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Provides static methods for creating value tuples. - - - Compares the current instance with a specified object. - The object to compare with the current instance. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Creates a new value tuple with zero components. - A new value tuple with no components. - - - Creates a new value tuple with 8 components (an octuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The value of the value tuple's eighth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - The type of the value tuple's eighth component. - A value tuple with 8 components. - - - Creates a new value tuple with 7 components (a septuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - A value tuple with 7 components. - - - Creates a new value tuple with 6 components (a sexuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - A value tuple with 6 components. - - - Creates a new value tuple with 5 components (a quintuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - A value tuple with 5 components. - - - Creates a new value tuple with 4 components (a quadruple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - A value tuple with 4 components. - - - Creates a new value tuple with 3 components (a triple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - A value tuple with 3 components. - - - Creates a new value tuple with 2 components (a pair). - The value of the value tuple's first component. - The value of the value tuple's second component. - The type of the value tuple's first component. - The type of the value tuple's second component. - A value tuple with 2 components. - - - Creates a new value tuple with 1 component (a singleton). - The value of the value tuple's only component. - The type of the value tuple's only component. - A value tuple with 1 component. - - - Determines whether two instances are equal. This method always returns true. - The value tuple to compare with the current instance. - This method always returns true. - - - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare to the current instance. - true if obj is a instance; otherwise, false. - - - Returns the hash code for the current instance. - The hash code for the current instance. - - - Returns the string representation of this instance. - This method always returns "()". - - - Compares the current instance to a specified object. - The object to compare with the current instance. - An object that provides custom rules for comparison. This parameter is ignored. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for this instance. - An object whose method computes the hash code. This parameter is ignored. - The hash code for this instance. - - - Compares this instance with a specified object and returns an indication of their relative values. - The object to compare with the current instance - 0 if other is a instance; otherwise, 1 if other is null. - other is not a instance. - - - Indicates that the use of a value tuple on a member is meant to be treated as a tuple with element names. - - - - - - Initializes a new instance of the class. - A string array that specifies, in a pre-order depth-first traversal of a type's construction, which value tuple occurrences are meant to carry element names. - - - Specifies, in a pre-order depth-first traversal of a type's construction, which value tuple elements are meant to carry element names. - An array that indicates which value tuple elements are meant to carry element names. - -
-
\ No newline at end of file diff --git a/DeviceExcludeTool/bin/Release/AppSettings.json b/DeviceExcludeTool/bin/Release/AppSettings.json deleted file mode 100644 index a9c76f9..0000000 --- a/DeviceExcludeTool/bin/Release/AppSettings.json +++ /dev/null @@ -1 +0,0 @@ -{"Lang":"en","Version":0,"UpdateRate":30.0,"StartDelay":0,"ApiKey":null,"MinimizeToTray":false,"EnableDiscordRPC":true,"RunAsAdmin":false,"DeviceTypes":0,"EnableClient":false,"EnableServer":false,"BackgroundImg":"default","versionURL":"https://fanman03.com/inc/version.json","updateURL":"http://fanman03.com/dlmgr/click.php?id=jnsync_latest","ShowHelperConsole":false} \ No newline at end of file diff --git a/DeviceExcludeTool/bin/Release/Costura.dll b/DeviceExcludeTool/bin/Release/Costura.dll deleted file mode 100644 index 27d80be..0000000 Binary files a/DeviceExcludeTool/bin/Release/Costura.dll and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/Costura.xml b/DeviceExcludeTool/bin/Release/Costura.xml deleted file mode 100644 index 7e9ca15..0000000 --- a/DeviceExcludeTool/bin/Release/Costura.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Costura - - - - - Contains methods for interacting with the Costura system. - - - - - Call this to Initialize the Costura system. - - - - diff --git a/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe b/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe deleted file mode 100644 index 4033ccf..0000000 Binary files a/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe.config b/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe.config deleted file mode 100644 index 56efbc7..0000000 --- a/DeviceExcludeTool/bin/Release/DeviceExcludeTool.exe.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/bin/Release/MaterialDesignColors.dll b/DeviceExcludeTool/bin/Release/MaterialDesignColors.dll deleted file mode 100644 index 9e8e732..0000000 Binary files a/DeviceExcludeTool/bin/Release/MaterialDesignColors.dll and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.dll b/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.dll deleted file mode 100644 index 8638ec5..0000000 Binary files a/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.dll and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.xml b/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.xml deleted file mode 100644 index 4990299..0000000 --- a/DeviceExcludeTool/bin/Release/MaterialDesignThemes.Wpf.xml +++ /dev/null @@ -1,1644 +0,0 @@ - - - - MaterialDesignThemes.Wpf - - - - - this is a simple utility to add and remove a single adorner to an element since there is no built-in way to do that in xaml. - see here - - - - - Helper properties for working with for make round corner. - - - - - Controls the corner radius of the surrounding box. - - - - - A card is a content control, styled according to Material Design guidelines. - - - - - Indicates if the delete button should be visible. - - - - - Event correspond to delete button left mouse button click - - - - - Add / Remove DeleteClickEvent handler - - - - - This override method is called when the control is clicked by mouse or keyboard - - - - - User a colour zone to easily switch the background and foreground colours, from selected Material Design palette or custom ones. - - - - - By default ComboBox uses the wrapper popup. Popup can be switched to classic Windows desktop view by means of this attached property. - - - - - By default the selected item is hidden from the drop down list, as per Material Design specifications. - To revert to a more classic Windows desktop behaviour, and show the currently selected item again in the drop - down, set this attached propety to true. - - - - - Help us format the content of a header button in a calendar. - - - Expected items, in the following order: - 1) DateTime Calendar.DisplayDate - 2) DateTime? Calendar.SelectedDate - - - - - Converter for control. Can be extended by method. - - - - - Helps coerce the correct item container style for a , according to whether the list is displaying in standard mode, or using a , such as a . - - - - - Item container style to use when is null. - - - - - Item container style to use when is not null, typically when a is applied. - - - - - Returns the item container to use for a . - - Should be a or instance. - - - - - - - - 1 - Content presenter render size, - 2 - Clipping border padding (main control padding) - - - - - - - - - - Set the maximum length for the text field. - - Not a dprop, as is only applied once. - - - - Cancel the close. - - - - - Indicates if the close has already been cancelled. - - - - - Gets the parameter originally provided to / - - - - - Allows interaction with the current dialog session. - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - The data context from the sender element (typically a ) - is applied to the content. - - - - - The data context from the is applied to the content. - - - - - The data context is explicitly set to null. - - - - - Routed command to be used somewhere inside an instance to trigger showing of the dialog. Content can be passed to the dialog via a . - - - - - Routed command to be used inside dialog content to close a dialog. Use a to indicate the result of the parameter. - - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Shows a modal dialog. To use, a instance must be in a visual tree (typically this may be specified towards the root of a Window's XAML). - - Content to show (can be a control or view model). - of the instance where the dialog should be shown. Typically this will match an identifer set in XAML. null is allowed. - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - Task result is the parameter used to close the dialog, typically what is passed to the command. - - - - Identifier which is used in conjunction with to determine where a dialog should be shown. - - - - - Returns a DialogSession for the currently open dialog for managing it programmatically. If no dialog is open, CurrentSession will return null - - - - - Defines how a data context is sourced for a dialog if a - is passed as the command parameter when using . - - - - - Indicates whether the dialog will close if the user clicks off the dialog, on the obscured background. - - - - - Parameter to provide to close handlers if an close due to click away is instigated. - - - - - Allows association of a snackbar, so that notifications can be paused whilst a dialog is being displayed. - - - - - Set the theme (light/dark) for the dialog. - - - - - Represents the overlay brush that is used to dim the background behind the dialog - - - - - Raised when a dialog is opened. - - - - - Attached property which can be used on the which instigated the to process the event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Raised just before a dialog is closed. - - - - - Attached property which can be used on the which instigated the to process the closing event. - - - - - Callback fired when the event is fired, allowing the event to be processed from a binding/view model. - - - - - Attempts to focus the content of a popup. - - The popup content. - - - - Helper extensions for showing dialogs. - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the first found in a given . - - Window on which the modal dialog should be displayed. Must contain a . - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - As a depth first traversal of the window's visual tree is performed, it is not safe to use this method in a situtation where a screen has multiple s. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Shows a dialog using the parent/ancestor of the a given . - - Dependency object which should be a visual child of a , where the dialog will be shown. - Content to show (can be a control or view model). - Allows access to opened event which would otherwise have been subscribed to on a instance. - Allows access to closing event which would otherwise have been subscribed to on a instance. - - Thrown is a is not found when conducting a depth first traversal of visual tree. - - - - - - Allows interation with the current dialog session. - - - - - Allows an open dialog to be managed. Use is only permitted during a single display operation. - - - - - Indicates if the dialog session has ended. Once ended no further method calls will be permitted. - - - Client code cannot set this directly, this is internally managed. To end the dialog session use . - - - - - The parameter passed to the and return by - - - - - Gets the which is currently displayed, so this could be a view model or a UI element. - - - - - Update the current content in the dialog. - - - - - - Closes the dialog. - - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Closes the dialog. - - Result parameter which will be returned in or from method. - Thrown if the dialog session has ended, or a close operation is currently in progress. - - - - Returns full visual ancestry, starting at the leaf. - - - - - - - The hint property - - - - - Sets the hint. - - The element. - The value. - - - - Gets the hint. - - The element. - - The . - - - - - The hint opacity property - - - - - Gets the text box view margin. - - The element. - - The . - - - - - Sets the hint opacity. - - The element. - The value. - - - - The color for the text of a focused control. - - - - - Gets the color for the text of a focused control. - - - - - Sets the color for the text of a focused control. - - - - - The color for the background of a focused control. - - - - - Gets the color for the background of a focused control. - - - - - Sets the color for the background of a focused control. - - - - - The HelperText property - - - - - Sets the HelperText. - - The element. - The value. - - - - Gets the HelperText. - - The element. - - The . - - - - - Displays an icon image/path, according to the specified name. - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Gets or sets the name of icon being displayed. - - - - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - This interface is the adapter from UiControl (like , and others) to - - You should implement this interface in order to use SmartHint for your own control. - - - - - Checks to see if the targeted control can be deemed as logically - empty, even if not null, affecting the current hint display. - - - - - - Targeted control has keyboard focus - - - - - - Queues a notification message for display in a snackbar. - - Message. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - - - - Queues a notification message for display in a snackbar. - - Message. - Subsequent, duplicate messages queued within a short time span will - be discarded. To override this behaviour and ensure the message always gets displayed set to true. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - The message will promoted to the front of the queue. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue and never considered to be a duplicate. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will be promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Queues a notification message for display in a snackbar. - - Message. - Content for the action button. - Call back to be executed if user clicks the action button. - Argument to pass to . - The message will promoted to the front of the queue. - The message will never be considered a duplicate. - Message show duration override. - - - - Provides shorthand to initialise a new for a . - - - - - Gets or sets the icon to display. - - - - - Gets the icon path data for the current . - - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - - ****************************************** - This code is auto generated. Do not amend. - ****************************************** - - List of available icons for use with . - - - All icons sourced from Material Design Icons Font - https://materialdesignicons.com/ - in accordance of - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE. - - - - - Provides full information about a palette. - - - - - View a control on a 3D plane. - - - Taken from http://blogs.msdn.com/greg_schechter/archive/2007/10/26/enter-the-planerator-dead-simple-3d-in-wpf-with-a-stupid-name.aspx , Greg Schechter - Fall 2007 - - - - - Wrap this around a class that we want to catch the measure and arrange - processes occuring on, and propagate to the parent Planerator, if any. - Do this because layout invalidations don't flow up out of a - Viewport2DVisual3D object. - - - - - Defines how the popup is aligned to the toggle part of the control. - - - - - Display the popup below the toggle, and align the left edges.3 - - - - - Display the popup below the toggle, and align the right edges. - - - - - Display the popup below the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup above the toggle, and align the left edges. - - - - - Display the popup above the toggle, and align the right edges. - - - - - Display the popup above the toggle, and align the center of the popup with the center of the toggle. - - - - - Display the popup to the left of the toggle, and align the top edges. - - - - - Display the popup to the left of the toggle, and align the bottom edges. - - - - - Display the popup to the left of the toggle, and align the middles. - - - - - Display the popup to the right of the toggle, and align the top edges. - - - - - Display the popup to the right of the toggle, and align the bottom edges. - - - - - Display the popup to the right of the toggle, and align the middles. - - - - - Defines what causes the to open it's popup. - - - - - Open when the toggle button is clicked. - - - - - Open when the mouse goes over the toggle button. - - - - - Open when the mouse goes over the toggle button, or the space in which the popup box would occupy should it be open. - - - - - Popup box, similar to a , but allows more customizable content. - - - - - Routed command to be used inside of a popup content to close it. - - - - - Content to display in the toggle button. - - - - - Template for . - - - - - Content to display in the toggle when it's checked (when the popup is open). Optional; if not provided the is used. - - - - - Template for . - - - - - Command to execute if toggle is checked (popup is open) and is set. - - - - - Command parameter to use in conjunction with . - - - - - Content to display in the content. - - - - - Popup content template. - - - - - Gets or sets whether the popup is currently open. - - - - - Indicates of the popup should stay open if a click occurs inside the popup. - - - - - Gets or sets how the popup is aligned in relation to the toggle. - - - - - Gets or sets what trigger causes the popup to open. - - - - - Get or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Gets or sets how to unfurl controls when opening the popups. Only child elements of type are animated. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup horizontal offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Get or sets the popup vertical offset in relation to the button. - - - - - Framework use. Provides the method used to position the popup. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Event raised when the checked toggled content (if set) is clicked. - - - - - Raises . - - - - - Raised when the popup is opened. - - - - - Raises . - - - - - Raised when the popup is closed. - - - - - Raises . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - A custom control implementing a rating bar. - The icon aka content may be set as a DataTemplate via the ButtonContentTemplate property. - - - - - The DependencyProperty for the RecognizesAccessKey property. - Default Value: false - - - - - Determine if Ripple should use AccessText in its style - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - - Set to true to cause the ripple to originate from the centre of the - content. Otherwise the effect will originate from the mouse down position. - - - - - - Set to True to disable ripple effect - - - - - Set to True to disable ripple effect - - - - - - - Set to True to disable ripple effect - - - - - - Internal use only. - - - - - Represents a display device or multiple display devices on a single system. - Based on http://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Screen.cs - - - - - Available working area on the screen. This excludes taskbars and other - docked windows. - - - - - Gets an array of all of the displays on the system. - - - - - Gets the bounds of the display. - - - - - Gets the device name associated with a display. - - - - - Gets a value indicating whether a particular display is the primary device. - - - - - Gets the primary display. - - - - - Gets the working area of the screen. - - - - - Screen instances call this property to determine - if their WorkingArea cache needs to be invalidated. - - - - - Specifies a value that indicates whether the specified object is equal to this one. - - - - - Retrieves a for the monitor that contains the specified point. - - - - - Retrieves a for the monitor that contains the largest region of the Rect. - - - - - Retrieves the working area for the monitor that is closest to the specified point. - - - - - Retrieves the working area for the monitor that contains the largest region of the specified Rect. - - - - - Retrieves the bounds of the monitor that is closest to the specified point. - - - - - Retrieves the bounds of the monitor that contains the largest region of the specified Rect. - - - - - Computes and retrieves a hash code for an object. - - - - - Called by the SystemEvents class when our display settings are - changing. We cache screen information and at this point we must - invalidate our cache. - - - - - Called by the SystemEvents class when our display settings have - changed. Here, we increment a static counter that Screen instances - can check against to invalidate their cache. - - - - - Retrieves a string representing this object. - - - - - A control that implement placeholder behavior. Can work as a simple placeholder either as a floating hint, see property. - - To set a target control you should set the HintProxy property. Use the converter which converts a control into the IHintProxy interface. - - - - - Implements a inspired by the Material Design specs (https://material.google.com/components/snackbars-toasts.html). - - - - - Defines the content of a message within a . Primary content should be set via the - standard property. Where an action is allowed, content - can be provided in . Standard button properties are - provided for actions, includiing . - - - - - Event correspond to left mouse button click on the Action button. - - - - - Add / Remove ActionClickEvent handler - - - - - Maximum total height of snackbar for the action button to be inlined. - - Default value (55) is between single line message (48) and two lined snackbar-message (66) - because tolerance is required (see issue) - - - - - - Gets or sets a value that indicates whether this message queue displays messages without discarding duplicates. - True to show every message even if there are duplicates. - - - - - The content to be displayed - - - - - Message show duration. - - - - - The content for the action button on the snackbar - - - - - Handler to be invoked when the action button is clicked - - - - - The argument to pass to the delegate. - - - - - Promote the message, pushing it in front of any message that is not promoted. - - - - - Still display this message even if it is a duplicate. - - - - - Checks if given item is a duplicate to this - - Item to check for duplicate - true if given item is a duplicate to this, false otherwise - - - - Helper properties for working with text fields. - - - - - The text box view margin property - - - - - Sets the text box view margin. - - The element. - The value. - - - - Gets the text box view margin. - - The element. - - The . - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - Controls the visibility of the underline decoration. - - - - - - - The attached WPF property for getting or setting the value for an underline decoration. - - - - - Sets the used for underline decoration. - - - - - - - Gets the used for underline decoration. - - - - - - Controls the visbility of the text field box. - - - - - Controls the visibility of the text field area box. - - - - - Controls the corner radius of the surrounding box. - - - - - Controls the corner radius of the bottom line of the surrounding box. - - - - - Controls the highlighting style of a text box. - - - - - Enables a ripple effect on focusing the text box. - - - - - Automatically inserts spelling suggestions into the text box context menu. - - - - - Controls the visbility of the clear button. - - - - - SuffixText dependency property - - - - - Applies the text box view margin. - - The text box. - The margin. - - - - The text box view margin property changed callback. - - The dependency object. - The dependency property changed event args. - - - - Called when this element gets focus. - - - - - IsDropDownOpenProperty property changed handler. - - DatePicker that changed its IsDropDownOpen. - DependencyPropertyChangedEventArgs. - - - - Set to true to stop invalid text reverting back to previous valid value. Useful in cases where you - want to display validation messages and allow the user to correct the data without it reverting. - - - - - Set to true to display seconds in the time and allow the user to select seconds. - - - - - Framework use only. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - - - Allows on (IsChecked) content to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Allows an on (IsChecked) template to be provided on supporting styles. - - - - - Duration of the animation - - - - - Multiplies a time span unit by the index of an item in a list. - - - Example usage is for a to have a - time delayed according to position in a list, so cascading animations can occur. - - - - - Direction of the slide wipe - - - - - Duration of the animation - - - - - Allows transitions to be disabled where supported. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - Allows transitions to be disabled where supported. Note this is an inheritable property. - - - - - The transitioner provides an easy way to move between content with a default in-place circular transition. - - - - - Causes the the next slide to be displayed (affectively increments ). - - - - - Causes the the previous slide to be displayed (affectively decrements ). - - - - - Moves to the first slide. - - - - - Moves to the last slide. - - - - - If enabled, transition origins will be applied to wipes, according to where a transition was triggered from. For example, the mouse point where a user clicks a button. - - - - - Content control to host the content of an individual page within a . - - - - - Content control to enable easier transitions. - - - - - Gets or sets the transition to run when the content is loaded and made visible. - - - - - Delay offset to be applied to all opening effect transitions. - - - - - Allows multiple transition effects to be combined and run upon the content loading or being made visible. - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template. - - The element. - The value. - - - - Gets the additional template. - - The element. - - The . - - - - - Allows additional rendering for each tree node, outside of the rippled part of the node which responsds to user selection. - - - The content to be rendered is the same of the ; i.e the Header property, or - some other content such as a view model, typically when using a . - - - - - Sets the additional template selector. - - The element. - The value. - - - - Gets the additional template selector. - - The element. - - The . - - - - - To be used at level, or to be returned by - implementors when the additional template associated with a tree should not be used. - - - - - - - - - - The hint property - - - - - The hint property - - - - - The hint property - - - - - Framework use only. - - - - - Framework use only. - - - - - - - Framework use only. - - - - - This custom popup can be used by validation error templates or something else. - It provides some additional nice features: - - repositioning if host-window size or location changed - - repositioning if host-window gets maximized and vice versa - - it's only topmost if the host-window is activated - - - - - Gets/sets if the popup can be closed by left mouse button down. - - - - - Causes the popup to update it's position according to it's current settings. - - - - - SetWindowPos options - - - - diff --git a/DeviceExcludeTool/bin/Release/Newtonsoft.Json.dll b/DeviceExcludeTool/bin/Release/Newtonsoft.Json.dll deleted file mode 100644 index e4a6339..0000000 Binary files a/DeviceExcludeTool/bin/Release/Newtonsoft.Json.dll and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/Newtonsoft.Json.xml b/DeviceExcludeTool/bin/Release/Newtonsoft.Json.xml deleted file mode 100644 index aa245c5..0000000 --- a/DeviceExcludeTool/bin/Release/Newtonsoft.Json.xml +++ /dev/null @@ -1,11262 +0,0 @@ - - - - Newtonsoft.Json - - - - - Represents a BSON Oid (object id). - - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Initializes a new instance of the class. - - The Oid value. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized BSON data. - - - - - Gets or sets a value indicating whether binary data reading should be compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating BSON data. - - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Initializes a new instance of the class. - - The to write to. - - - - Initializes a new instance of the class. - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a JSON array. - - - - - Writes the beginning of a JSON object. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to a single parameterized constructor, then to the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a parameterized constructor. - - - - - Converts a binary value to and from a base 64 string value. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Creates a custom object. - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from the ISO 8601 date format (e.g. "2008-04-12T12:53Z"). - - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Converts a to and from a JavaScript Date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - The default value is false. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets the naming strategy used to resolve how enum text is written. - - The naming strategy used to resolve how enum text is written. - - - - Gets or sets a value indicating whether integer values are allowed when serializing and deserializing. - The default value is true. - - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - true if the written enum text will be camel case; otherwise, false. - - - - Initializes a new instance of the class. - - The naming strategy used to resolve how enum text is written. - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - - Initializes a new instance of the class. - - The of the used to write enum text. - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - true if integers are allowed when serializing and deserializing; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from Unix epoch time - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts XML to and from JSON. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produced multiple root elements. - - The name of the deserialized root element. - - - - Gets or sets a value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attribute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Gets or sets a value indicating whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - true if special characters are encoded; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - true if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - The default JSON name table implementation. - - - - - Initializes a new instance of the class. - - - - - Gets a string containing the same characters as the specified range of characters in the given array. - - The character array containing the name to find. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - A string containing the same characters as the specified range of characters in the given array. - - - - Adds the specified string into name table. - - The string to add. - This method is not thread-safe. - The resolved string. - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that it is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and set members to their default value when deserializing. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a of property. - - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Provides an interface for using pooled arrays. - - The array type content. - - - - Rent an array from the pool. This array must be returned when it is no longer needed. - - The minimum required length of the array. The returned array may be longer. - The rented array from the pool. This array must be returned when it is no longer needed. - - - - Return an array to the pool. - - The array that is being returned. - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, when returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, when returns false). - - - - Instructs the how to serialize the collection. - - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items. - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Instructs the how to serialize the object. - - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets or sets the collection's items converter. - - The collection's items converter. - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Provides methods for converting between .NET types and JSON types. - - - - - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - The string escape handling. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output should be formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output should be formatted. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - - - Serializes the to a JSON string. - - The node to serialize. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to serialize. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by , - writes a Json.NET array attribute for collections, and encodes special characters. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - - A value to indicate whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - The deserialized . - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by , - writes a Json.NET array attribute for collections, and encodes special characters. - - The JSON string. - The name of the root element to append when deserializing. - - A value to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - - A value to indicate whether to encode special characters when converting JSON to XML. - If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify - XML namespaces, attributes or processing directives. Instead special characters are encoded and written - as part of the XML element name. - - The deserialized . - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Converts an object to and from JSON. - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. If there is no existing value then null will be used. - The existing value has a value. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Instructs the to use the specified when serializing the member or class. - - - - - Gets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - - - - - Initializes a new instance of the class. - - Type of the . - - - - Initializes a new instance of the class. - - Type of the . - Parameter list to use when constructing the . Can be null. - - - - Represents a collection of . - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Initializes a new instance of the class. - - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Base class for a table of atomized string objects. - - - - - Gets a string containing the same characters as the specified range of characters in the given array. - - The character array containing the name to find. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - A string containing the same characters as the specified range of characters in the given array. - - - - Instructs the how to serialize the object. - - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets the missing member handling used when deserializing this object. - - The missing member handling. - - - - Gets or sets how the object's properties with null values are handled during serialization and deserialization. - - How the object's properties with null values are handled during serialization and deserialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to always serialize the member with the specified name. - - - - - Gets or sets the type used when serializing the property's collection items. - - The collection's items type. - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously skips the children of the current token. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Specifies the state of the reader. - - - - - A read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader is in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the source should be closed when this reader is closed. - - - true to close the source when this reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. - The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Gets or sets how time zones are handled when reading JSON. - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Gets or sets how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets the .NET type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Reads the next JSON token from the source. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the current token and value. - - The new token. - The value. - A flag indicating whether the position index inside an array should be updated. - - - - Sets the state based on current token type. - - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the reader's state to . - If is set to true, the source is also closed. - - - - - The exception thrown when an error occurs while reading JSON text. - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Instructs the to always serialize the member, and to require that the member has a value. - - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - The default value is . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - The default value is . - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - The default value is . - - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - The default value is . - - - - - Gets or sets how null values are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how default values are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how objects are created during deserialization. - The default value is . - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - The default value is . - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - The default value is . - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - The default value is . - - - - - Gets or sets how dates are written to JSON text. - The default value is . - - - - - Gets or sets how time zones are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - The default value is . - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - The default value is . - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON text. - The default value is . - - - - - Gets or sets how strings are escaped when writing JSON text. - The default value is . - - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". - - - - - Gets or sets the culture used when reading JSON. - The default value is . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - A null value means there is no maximum. - The default value is null. - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - The default value is false. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings - from . - - - A new instance. - The will not use default settings - from . - - - - - Creates a new instance using the specified . - The will not use default settings - from . - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings - from . - - - - - Creates a new instance. - The will use default settings - from . - - - A new instance. - The will use default settings - from . - - - - - Creates a new instance using the specified . - The will use default settings - from as well as the specified . - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings - from as well as the specified . - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to read values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to read values from. - The target object to populate values onto. - - - - Deserializes the JSON structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Specifies the settings on a object. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) are handled. - The default value is . - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - The default value is . - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - The default value is . - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - The default value is . - - Null value handling. - - - - Gets or sets how default values are handled during serialization and deserialization. - The default value is . - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - The default value is . - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - The default value is . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - The default value is . - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - The default value is . - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - The default value is . - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets a function that creates the used by the serializer when resolving references. - - A function that creates the used by the serializer when resolving references. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - A null value means there is no maximum. - The default value is null. - - - - - Indicates how JSON text output is formatted. - The default value is . - - - - - Gets or sets how dates are written to JSON text. - The default value is . - - - - - Gets or sets how time zones are handled during serialization and deserialization. - The default value is . - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - The default value is . - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON. - The default value is . - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - The default value is . - - - - - Gets or sets how strings are escaped when writing JSON text. - The default value is . - - - - - Gets or sets the culture used when reading JSON. - The default value is . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - The default value is false. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Initializes a new instance of the class with the specified . - - The containing the JSON data to read. - - - - Gets or sets the reader's property name table. - - - - - Gets or sets the reader's character buffer pool. - - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, returns false). - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Gets or sets the writer's character array pool. - - - - - Gets or sets how many s to write for each level in the hierarchy when is set to . - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to . - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - Initializes a new instance of the class using the specified . - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying . - - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Specifies the type of JSON token. - - - - - This is returned by the if a read method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - - Represents a reader that provides validation. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the .NET type for the current JSON token. - - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a []. - - - A [] or null if the next JSON token is null. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the current token. - - The to read the token from. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the token and its value. - - The to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Asynchronously ets the state of the . - - The being written. - The value being written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asynchronicity. - - - - Gets or sets a value indicating whether the destination should be closed when this writer is closed. - - - true to close the destination when this writer is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether the JSON should be auto-completed when this writer is closed. - - - true to auto-complete the JSON when this writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Gets or sets a value indicating how JSON text output should be formatted. - - - - - Gets or sets how dates are written to JSON text. - - - - - Gets or sets how time zones are handled when writing JSON text. - - - - - Gets or sets how strings are escaped when writing JSON text. - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Gets or sets how and values are formatted when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the destination and also flushes the destination. - - - - - Closes this writer. - If is set to true, the destination is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the end of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current JSON object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - - - - Writes the token. - - The to write. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Sets the state of the . - - The being written. - The value being written. - - - - The exception thrown when an error occurs while writing JSON text. - - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Specifies how JSON comments are handled when loading JSON. - - - - - Ignore comments. - - - - - Load comments as a with type . - - - - - Specifies how duplicate property names are handled when loading JSON. - - - - - Replace the existing value when there is a duplicate property. The value of the last property in the JSON object will be used. - - - - - Ignore the new value when there is a duplicate property. The value of the first property in the JSON object will be used. - - - - - Throw a when a duplicate property is encountered. - - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, and the descendants of every token in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every token in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every token in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every token in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every token in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a collection of objects. - - The type of token. - - - - Gets the of with the specified key. - - - - - - Represents a JSON array. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads an from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - - - - - Returns an enumerator that iterates through the collection. - - - A of that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - - - - Removes all items from the . - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies the elements of the to an array, starting at a particular array index. - - The array. - Index of the array. - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - - - Represents a JSON constructor. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a token that can contain other tokens. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An of containing the descendant tokens of the . - - - - Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. - - An of containing this token, and all the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates a that can be used to add tokens to the . - - A that is ready to have content written to it. - - - - Replaces the child nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Merge the specified content into this . - - The content to be merged. - - - - Merge the specified content into this using . - - The content to be merged. - The used to merge the content. - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens. - - - - Represents a collection of objects. - - The type of token. - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the of with the specified key. - - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Represents a JSON object. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets the node type for this . - - The type. - - - - Gets an of of this object's properties. - - An of of this object's properties. - - - - Gets a with the specified name. - - The property name. - A with the specified name or null. - - - - Gets the with the specified name. - The exact name will be searched for first and if no matching property is found then - the will be used to match a property. - - The property name. - One of the enumeration values that specifies how the strings will be compared. - A matched with the specified name or null. - - - - Gets a of of this object's property values. - - A of of this object's property values. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Determines whether the JSON object has the specified property name. - - Name of the property. - true if the JSON object has the specified property name; otherwise, false. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries to get the with the specified property name. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Represents a JSON property. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. - When the or - - methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Represents a raw JSON string. - - - - - Asynchronously creates an instance of with the content of the reader's current token. - - The reader. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns an instance of with the content of the reader's current token. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Specifies the settings used when loading JSON. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how JSON comments are handled when loading JSON. - The default value is . - - The JSON comment handling. - - - - Gets or sets how JSON line info is handled when loading JSON. - The default value is . - - The JSON line info handling. - - - - Gets or sets how duplicate property names in JSON objects are handled when loading JSON. - The default value is . - - The JSON duplicate property name handling. - - - - Specifies the settings used when merging JSON. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the method used when merging JSON arrays. - - The method used when merging JSON arrays. - - - - Gets or sets how null value properties are merged. - - How null value properties are merged. - - - - Gets or sets the comparison used to match property names while merging. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - The comparison used to match property names while merging. - - - - Represents an abstract JSON token. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Writes this token to a asynchronously. - - A into which this method will write. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of tokens that contain this token, and the ancestors of this token. - - A collection of tokens that contain this token, and the ancestors of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - ToString() returns a non-JSON string value for tokens with a type of . - If you want the JSON for all token types then you should use . - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output should be formatted. - A collection of s which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to []. - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from [] to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Creates a for this token. - - A that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object. - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - Creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JSONPath expression. Selects the token that matches the object path. - - - A that contains a JSONPath expression. - - A , or null. - - - - Selects a using a JSONPath expression. Selects the token that matches the object path. - - - A that contains a JSONPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JSONPath expression. - - - A that contains a JSONPath expression. - - An of that contains the selected elements. - - - - Selects a collection of elements using a JSONPath expression. - - - A that contains a JSONPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An of that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Adds an object to the annotation list of this . - - The annotation to add. - - - - Get the first annotation object of the specified type from this . - - The type of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets the first annotation object of the specified type from this . - - The of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets a collection of annotations of the specified type for this . - - The type of the annotations to retrieve. - An that contains the annotations for this . - - - - Gets a collection of annotations of the specified type for this . - - The of the annotations to retrieve. - An of that contains the annotations that match the specified type for this . - - - - Removes the annotations of the specified type from this . - - The type of annotations to remove. - - - - Removes the annotations of the specified type from this . - - The of annotations to remove. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Gets the at the reader's current position. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Initializes a new instance of the class. - - The token to read from. - The initial path of the token. It is prepended to the returned . - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the path of the current JSON token. - - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Gets the at the writer's current position. - - - - - Gets the token being written. - - The token being written. - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying . - - - - - Closes this writer. - If is set to true, the JSON is auto-completed. - - - Setting to true has no additional effect, since the underlying is a type that cannot be closed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes a value. - An error will be raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Creates a null value. - - A null value. - - - - Creates a undefined value. - - A undefined value. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Writes this token to a . - - A into which this method will write. - A collection of s which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - ToString() returns a non-JSON string value for tokens with a type of . - If you want the JSON for all token types then you should use . - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not of the same type as this instance. - - - - - Specifies how line information is handled when loading JSON. - - - - - Ignore line information. - - - - - Load line information. - - - - - Specifies how JSON arrays are merged together. - - - - Concatenate arrays. - - - Union arrays, skipping items that already exist. - - - Replace all array items. - - - Merge array items together, matched by index. - - - - Specifies how null value properties are merged. - - - - - The content's null value properties will be ignored during merging. - - - - - The content's null value properties will be merged. - - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Do not try to read metadata properties. - - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement . - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - The property is not required but it cannot be a null value. - - - - - - Contains the JSON schema extension methods. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - The validation event handler. - - - - - An in-memory representation of a JSON Schema. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read-only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisible by. - - A number that the value should be divisible by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the minimum attribute (). - - A flag indicating whether the value can not equal the number defined by the minimum attribute (). - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the maximum attribute (). - - A flag indicating whether the value can not equal the number defined by the maximum attribute (). - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallowed types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains JSON Schema. - - A that contains JSON Schema. - A populated from the string that contains JSON Schema. - - - - Load a from a string that contains JSON Schema using the specified . - - A that contains JSON Schema. - The resolver. - A populated from the string that contains JSON Schema. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - - Returns detailed information about the schema exception. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - - Generates a from a specified . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - - Resolves from an id. - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - - The value types allowed by the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - - Specifies undefined schema Id handling options for the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - - Returns detailed information related to the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - - Represents the callback method that will handle JSON schema validation events and the . - - - JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. - - - - - - A camel case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Resolves member mappings for a type, camel casing property names. - - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Used by to resolve a for a given . - - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing types. - - - true if the IsSpecified members will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore ShouldSerialize members when serializing and deserializing types. - - - true if the ShouldSerialize members will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized. - - The naming strategy used to resolve how property names and dictionary keys are serialized. - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Resolved name of the property. - - - - Resolves the name of the extension data. By default no changes are made to extension data names. - - Name of the extension data. - Resolved name of the extension data. - - - - Resolves the key of the dictionary. By default is used to resolve dictionary keys. - - Key of the dictionary. - Resolved key of the dictionary. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - The default naming strategy. Property names and dictionary keys are unchanged. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - Initializes a new instance of the class. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer that writes to the application's instances. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Provides data for the Error event. - - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides methods to get attributes. - - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Used by to resolve a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that was resolved from the reference. - - - - Gets the reference for the specified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - Allows users to control class loading and mandate what class to load. - - - - - When implemented, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object - The type of the object the formatter creates a new instance of. - - - - When implemented, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Contract details for a used by the . - - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the collection values. - - true if the creator has a parameter with the collection values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets the internally resolved for the contract's type. - This converter is used as a fallback converter when no other converter is resolved. - Setting will always override this converter. - - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non-public. - - true if the default object creator is non-public; otherwise, false. - - - - Contract details for a used by the . - - - - - Gets or sets the dictionary key resolver. - - The dictionary key resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the dictionary values. - - true if the creator has a parameter with the dictionary values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object constructor. - - The object constructor. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets the missing member handling used when deserializing this object. - - The missing member handling. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets or sets how the object's properties with null values are handled during serialization and deserialization. - - How the object's properties with null values are handled during serialization and deserialization. - - - - Gets the object's properties. - - The object's properties. - - - - Gets a collection of instances that define the parameters used with . - - - - - Gets or sets the function used to create the object. When set this function will override . - This function is called with a collection of arguments which are defined by the collection. - - The function used to create the object. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Gets or sets the extension data value type. - - - - - Gets or sets the extension data name resolver. - - The extension data name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the for this property. - - The for this property. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes precedence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets a value indicating whether has a value specified. - - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets a predicate used to determine whether the property should be deserialized. - - A predicate used to determine whether the property should be deserialized. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Lookup and create an instance of the type described by the argument. - - The type to create. - Optional arguments to pass to an initializing constructor of the JsonConverter. - If null, the default constructor is used. - - - - A kebab case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - A base class for resolving how property names and dictionary keys are serialized. - - - - - A flag indicating whether dictionary keys should be processed. - Defaults to false. - - - - - A flag indicating whether extension data names should be processed. - Defaults to false. - - - - - A flag indicating whether explicitly specified property names, - e.g. a property name customized with a , should be processed. - Defaults to false. - - - - - Gets the serialized name for a given property name. - - The initial property name. - A flag indicating whether the property has had a name explicitly specified. - The serialized property name. - - - - Gets the serialized name for a given extension data name. - - The initial extension data name. - The serialized extension data name. - - - - Gets the serialized key for a given dictionary key. - - The initial dictionary key. - The serialized dictionary key. - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Hash code calculation - - - - - - Object equality implementation - - - - - - - Compare to another NamingStrategy - - - - - - - Represents a method that constructs an object. - - The object type to create. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Provides methods to get attributes from a , , or . - - - - - Initializes a new instance of the class. - - The instance to get attributes for. This parameter should be a , , or . - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - A snake case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Indicates the method that will be used during deserialization for locating and loading assemblies. - - - - - In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method of the class is used to load the assembly. - - - - - In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the class is used to load the assembly. - - - - - Specifies type name handling options for the . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - Note that this doesn't include the root serialized object by default. To include the root object's type name in JSON - you must specify a root type object with - or . - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic . - - The list to add to. - The collection of elements to add. - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Helper class for serializing immutable collections. - Note that this is used by all builds, even those that don't support immutable collections, in case the DLL is GACed - https://github.com/JamesNK/Newtonsoft.Json/issues/652 - - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Builds a string. Unlike this class lets you reuse its internal buffer. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls result in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - An array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - Specifies that an output will not be null even if the corresponding type allows it. - - - Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. - - - Initializes the attribute with the specified return value condition. - - The return value condition. If the method returns this value, the associated parameter will not be null. - - - - Gets the return value condition. - - - Specifies that an output may be null even if the corresponding type disallows it. - - - Specifies that null is allowed as an input even if the corresponding type disallows it. - - - - Specifies that the method will not return if the associated Boolean parameter is passed the specified value. - - - - - Initializes a new instance of the class. - - - The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to - the associated parameter matches this value. - - - - Gets the condition parameter value. - - - diff --git a/DeviceExcludeTool/bin/Release/System.ValueTuple.dll b/DeviceExcludeTool/bin/Release/System.ValueTuple.dll deleted file mode 100644 index 2e81d9c..0000000 Binary files a/DeviceExcludeTool/bin/Release/System.ValueTuple.dll and /dev/null differ diff --git a/DeviceExcludeTool/bin/Release/System.ValueTuple.xml b/DeviceExcludeTool/bin/Release/System.ValueTuple.xml deleted file mode 100644 index cee38ed..0000000 --- a/DeviceExcludeTool/bin/Release/System.ValueTuple.xml +++ /dev/null @@ -1,2269 +0,0 @@ - - - - System.ValueTuple - - - - Provides extension methods for tuples to interoperate with language support for tuples in C#. - - - Deconstructs a tuple with 21 elements into separate variables. - The 21-element tuple to deconstruct into 21 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The value of the twenty-first element, or value.Rest.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - The type of the twenty-first element. - - - Deconstructs a tuple with 20 elements into separate variables. - The 20-element tuple to deconstruct into 20 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - - - Deconstructs a tuple with 19 elements into separate variables. - The 19-element tuple to deconstruct into 19 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - - - Deconstructs a tuple with 18 elements into separate variables. - The 18-element tuple to deconstruct into 18 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - - - Deconstructs a tuple with 17 elements into separate variables. - The 17-element tuple to deconstruct into 17 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - - - Deconstructs a tuple with 16 elements into separate variables. - The 16-element tuple to deconstruct into 16 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - - - Deconstructs a tuple with 15 elements into separate variables. - The 15-element tuple to deconstruct into 15 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - - - Deconstructs a tuple with 14 elements into separate variables. - The 14-element tuple to deconstruct into 14 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - - - Deconstructs a tuple with 13 elements into separate variables. - The 13-element tuple to deconstruct into 13 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - - - Deconstructs a tuple with 12 elements into separate variables. - The 12-element tuple to deconstruct into 12 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - - - Deconstructs a tuple with 11 elements into separate variables. - The 11-element tuple to deconstruct into 11 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - - - Deconstructs a tuple with 10 elements into separate variables. - The 10-element tuple to deconstruct into 10 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - - - Deconstructs a tuple with 9 elements into separate variables. - The 9-element tuple to deconstruct into 9 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - - - Deconstructs a tuple with 8 elements into separate variables. - The 8-element tuple to deconstruct into 8 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - - - Deconstructs a tuple with 7 elements into separate variables. - The 7-element tuple to deconstruct into 7 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - - - Deconstructs a tuple with 6 elements into separate variables. - The 6-element tuple to deconstruct into 6 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - - - Deconstructs a tuple with 5 elements into separate variables. - The 5-element tuple to deconstruct into 5 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - - - Deconstructs a tuple with 4 elements into separate variables. - The 4-element tuple to deconstruct into 4 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - - - Deconstructs a tuple with 3 elements into separate variables. - The 3-element tuple to deconstruct into 3 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The type of the first element. - The type of the second element. - The type of the third element. - - - Deconstructs a tuple with 2 elements into separate variables. - The 2-element tuple to deconstruct into 2 separate variables. - The value of the first element. - The value of the second element. - The type of the first element. - The type of the second element. - - - Deconstructs a tuple with 1 element into a separate variable. - The 1-element tuple to deconstruct into a separate variable. - The value of the single element. - The type of the single element. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The converted tuple. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The converted value tuple instance. - - - Represents a value tuple with a single component. - The type of the value tuple's only element. - - - Initializes a new instance. - The value tuple's first element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 2 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 3 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 4 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 5 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 6 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 7 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents an n-value tuple, where n is 8 or greater. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - Any generic value tuple instance that defines the types of the tuple's remaining elements. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - An instance of any value tuple type that contains the values of the value's tuple's remaining elements. - rest is not a generic value tuple type. - - - Compares the current instance to a specified instance - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Gets the current instance's remaining elements. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Provides static methods for creating value tuples. - - - Compares the current instance with a specified object. - The object to compare with the current instance. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Creates a new value tuple with zero components. - A new value tuple with no components. - - - Creates a new value tuple with 8 components (an octuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The value of the value tuple's eighth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - The type of the value tuple's eighth component. - A value tuple with 8 components. - - - Creates a new value tuple with 7 components (a septuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - A value tuple with 7 components. - - - Creates a new value tuple with 6 components (a sexuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - A value tuple with 6 components. - - - Creates a new value tuple with 5 components (a quintuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - A value tuple with 5 components. - - - Creates a new value tuple with 4 components (a quadruple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - A value tuple with 4 components. - - - Creates a new value tuple with 3 components (a triple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - A value tuple with 3 components. - - - Creates a new value tuple with 2 components (a pair). - The value of the value tuple's first component. - The value of the value tuple's second component. - The type of the value tuple's first component. - The type of the value tuple's second component. - A value tuple with 2 components. - - - Creates a new value tuple with 1 component (a singleton). - The value of the value tuple's only component. - The type of the value tuple's only component. - A value tuple with 1 component. - - - Determines whether two instances are equal. This method always returns true. - The value tuple to compare with the current instance. - This method always returns true. - - - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare to the current instance. - true if obj is a instance; otherwise, false. - - - Returns the hash code for the current instance. - The hash code for the current instance. - - - Returns the string representation of this instance. - This method always returns "()". - - - Compares the current instance to a specified object. - The object to compare with the current instance. - An object that provides custom rules for comparison. This parameter is ignored. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for this instance. - An object whose method computes the hash code. This parameter is ignored. - The hash code for this instance. - - - Compares this instance with a specified object and returns an indication of their relative values. - The object to compare with the current instance - 0 if other is a instance; otherwise, 1 if other is null. - other is not a instance. - - - Indicates that the use of a value tuple on a member is meant to be treated as a tuple with element names. - - - - - - Initializes a new instance of the class. - A string array that specifies, in a pre-order depth-first traversal of a type's construction, which value tuple occurrences are meant to carry element names. - - - Specifies, in a pre-order depth-first traversal of a type's construction, which value tuple elements are meant to carry element names. - An array that indicates which value tuple elements are meant to carry element names. - -
-
\ No newline at end of file diff --git a/DeviceExcludeTool/code.ico b/DeviceExcludeTool/code.ico deleted file mode 100644 index e81e0d3..0000000 Binary files a/DeviceExcludeTool/code.ico and /dev/null differ diff --git a/DeviceExcludeTool/code.png b/DeviceExcludeTool/code.png deleted file mode 100644 index e1af908..0000000 Binary files a/DeviceExcludeTool/code.png and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/App.baml b/DeviceExcludeTool/obj/Debug/App.baml deleted file mode 100644 index d6d1902..0000000 Binary files a/DeviceExcludeTool/obj/Debug/App.baml and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/App.g.cs b/DeviceExcludeTool/obj/Debug/App.g.cs deleted file mode 100644 index 8b879c1..0000000 --- a/DeviceExcludeTool/obj/Debug/App.g.cs +++ /dev/null @@ -1,86 +0,0 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DEA223A73506C67FC2BFD4F79F59060FAE687C2CD4D73880C02D021795CE241E" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// App - /// - public partial class App : System.Windows.Application { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - DeviceExcludeTool.App app = new DeviceExcludeTool.App(); - app.InitializeComponent(); - app.Run(); - } - } -} - diff --git a/DeviceExcludeTool/obj/Debug/App.g.i.cs b/DeviceExcludeTool/obj/Debug/App.g.i.cs deleted file mode 100644 index 8b879c1..0000000 --- a/DeviceExcludeTool/obj/Debug/App.g.i.cs +++ /dev/null @@ -1,86 +0,0 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DEA223A73506C67FC2BFD4F79F59060FAE687C2CD4D73880C02D021795CE241E" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// App - /// - public partial class App : System.Windows.Application { - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - DeviceExcludeTool.App app = new DeviceExcludeTool.App(); - app.InitializeComponent(); - app.Run(); - } - } -} - diff --git a/DeviceExcludeTool/obj/Debug/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed b/DeviceExcludeTool/obj/Debug/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed deleted file mode 100644 index fc50196..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed b/DeviceExcludeTool/obj/Debug/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed deleted file mode 100644 index d718db0..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed b/DeviceExcludeTool/obj/Debug/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed deleted file mode 100644 index d9fe526..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed b/DeviceExcludeTool/obj/Debug/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed deleted file mode 100644 index 7579d68..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed b/DeviceExcludeTool/obj/Debug/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed deleted file mode 100644 index d555a15..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed b/DeviceExcludeTool/obj/Debug/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed deleted file mode 100644 index 6280104..0000000 Binary files a/DeviceExcludeTool/obj/Debug/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.Properties.Resources.resources b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.Properties.Resources.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.Properties.Resources.resources and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.csproj.CopyComplete b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.csproj.FileListAbsolute.txt b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.csproj.FileListAbsolute.txt deleted file mode 100644 index 2b7608f..0000000 --- a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,20 +0,0 @@ -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\DeviceExcludeTool.exe.config -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\DeviceExcludeTool.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\DeviceExcludeTool.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\MaterialDesignThemes.Wpf.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\Newtonsoft.Json.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Debug\System.ValueTuple.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.csprojAssemblyReference.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\MainWindow.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\App.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool_MarkupCompile.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool_MarkupCompile.lref -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\App.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\MainWindow.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.g.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.Properties.Resources.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.csproj.GenerateResource.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.csproj.Fody.CopyLocal.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.csproj.CopyComplete -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Debug\DeviceExcludeTool.pdb diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.exe b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.exe deleted file mode 100644 index c6f7160..0000000 Binary files a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.exe and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.g.resources b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.g.resources deleted file mode 100644 index df58ffd..0000000 Binary files a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool.g.resources and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool_MarkupCompile.lref b/DeviceExcludeTool/obj/Debug/DeviceExcludeTool_MarkupCompile.lref deleted file mode 100644 index 9aa0386..0000000 --- a/DeviceExcludeTool/obj/Debug/DeviceExcludeTool_MarkupCompile.lref +++ /dev/null @@ -1,4 +0,0 @@ - -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\App.xaml;; -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\MainWindow.xaml;; - diff --git a/DeviceExcludeTool/obj/Debug/MainWindow.baml b/DeviceExcludeTool/obj/Debug/MainWindow.baml deleted file mode 100644 index c44abeb..0000000 Binary files a/DeviceExcludeTool/obj/Debug/MainWindow.baml and /dev/null differ diff --git a/DeviceExcludeTool/obj/Debug/MainWindow.g.cs b/DeviceExcludeTool/obj/Debug/MainWindow.g.cs deleted file mode 100644 index c587fcb..0000000 --- a/DeviceExcludeTool/obj/Debug/MainWindow.g.cs +++ /dev/null @@ -1,491 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3879D072CB4331DB2024378F396964A864E115C03CE234E680A7A6C117DE0072" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 41 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keyboard; - - #line default - #line hidden - - - #line 42 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mouse; - - #line default - #line hidden - - - #line 43 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headset; - - #line default - #line hidden - - - #line 44 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mousepad; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headsetstand; - - #line default - #line hidden - - - #line 46 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keypad; - - #line default - #line hidden - - - #line 47 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox speaker; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox unknown; - - #line default - #line hidden - - - #line 50 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mainboard; - - #line default - #line hidden - - - #line 51 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox gpu; - - #line default - #line hidden - - - #line 52 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox dram; - - #line default - #line hidden - - - #line 53 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox fan; - - #line default - #line hidden - - - #line 54 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox cooler; - - #line default - #line hidden - - - #line 55 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledstrip; - - #line default - #line hidden - - - #line 56 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledmatrix; - - #line default - #line hidden - - - #line 58 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox all; - - #line default - #line hidden - - - #line 60 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBox resultBox; - - #line default - #line hidden - - - #line 61 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button WriteBtn; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closed += new System.EventHandler(this.AppWindow_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.AppWindow_Closing); - - #line default - #line hidden - return; - case 2: - this.keyboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 3: - this.mouse = ((System.Windows.Controls.CheckBox)(target)); - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 4: - this.headset = ((System.Windows.Controls.CheckBox)(target)); - - #line 43 "..\..\MainWindow.xaml" - this.headset.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 43 "..\..\MainWindow.xaml" - this.headset.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 5: - this.mousepad = ((System.Windows.Controls.CheckBox)(target)); - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 6: - this.headsetstand = ((System.Windows.Controls.CheckBox)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 7: - this.keypad = ((System.Windows.Controls.CheckBox)(target)); - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 8: - this.speaker = ((System.Windows.Controls.CheckBox)(target)); - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 9: - this.unknown = ((System.Windows.Controls.CheckBox)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 10: - this.mainboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 11: - this.gpu = ((System.Windows.Controls.CheckBox)(target)); - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 12: - this.dram = ((System.Windows.Controls.CheckBox)(target)); - - #line 52 "..\..\MainWindow.xaml" - this.dram.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 52 "..\..\MainWindow.xaml" - this.dram.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 13: - this.fan = ((System.Windows.Controls.CheckBox)(target)); - - #line 53 "..\..\MainWindow.xaml" - this.fan.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 53 "..\..\MainWindow.xaml" - this.fan.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 14: - this.cooler = ((System.Windows.Controls.CheckBox)(target)); - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 15: - this.ledstrip = ((System.Windows.Controls.CheckBox)(target)); - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 16: - this.ledmatrix = ((System.Windows.Controls.CheckBox)(target)); - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 17: - this.all = ((System.Windows.Controls.CheckBox)(target)); - - #line 58 "..\..\MainWindow.xaml" - this.all.Checked += new System.Windows.RoutedEventHandler(this.all_Checked); - - #line default - #line hidden - - #line 58 "..\..\MainWindow.xaml" - this.all.Unchecked += new System.Windows.RoutedEventHandler(this.all_Unchecked); - - #line default - #line hidden - return; - case 18: - this.resultBox = ((System.Windows.Controls.TextBox)(target)); - return; - case 19: - this.WriteBtn = ((System.Windows.Controls.Button)(target)); - - #line 61 "..\..\MainWindow.xaml" - this.WriteBtn.Click += new System.Windows.RoutedEventHandler(this.WriteBtn_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/DeviceExcludeTool/obj/Debug/MainWindow.g.i.cs b/DeviceExcludeTool/obj/Debug/MainWindow.g.i.cs deleted file mode 100644 index c587fcb..0000000 --- a/DeviceExcludeTool/obj/Debug/MainWindow.g.i.cs +++ /dev/null @@ -1,491 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "3879D072CB4331DB2024378F396964A864E115C03CE234E680A7A6C117DE0072" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 41 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keyboard; - - #line default - #line hidden - - - #line 42 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mouse; - - #line default - #line hidden - - - #line 43 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headset; - - #line default - #line hidden - - - #line 44 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mousepad; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headsetstand; - - #line default - #line hidden - - - #line 46 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keypad; - - #line default - #line hidden - - - #line 47 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox speaker; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox unknown; - - #line default - #line hidden - - - #line 50 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mainboard; - - #line default - #line hidden - - - #line 51 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox gpu; - - #line default - #line hidden - - - #line 52 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox dram; - - #line default - #line hidden - - - #line 53 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox fan; - - #line default - #line hidden - - - #line 54 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox cooler; - - #line default - #line hidden - - - #line 55 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledstrip; - - #line default - #line hidden - - - #line 56 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledmatrix; - - #line default - #line hidden - - - #line 58 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox all; - - #line default - #line hidden - - - #line 60 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBox resultBox; - - #line default - #line hidden - - - #line 61 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button WriteBtn; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closed += new System.EventHandler(this.AppWindow_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.AppWindow_Closing); - - #line default - #line hidden - return; - case 2: - this.keyboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 3: - this.mouse = ((System.Windows.Controls.CheckBox)(target)); - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 4: - this.headset = ((System.Windows.Controls.CheckBox)(target)); - - #line 43 "..\..\MainWindow.xaml" - this.headset.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 43 "..\..\MainWindow.xaml" - this.headset.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 5: - this.mousepad = ((System.Windows.Controls.CheckBox)(target)); - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 6: - this.headsetstand = ((System.Windows.Controls.CheckBox)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 7: - this.keypad = ((System.Windows.Controls.CheckBox)(target)); - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 8: - this.speaker = ((System.Windows.Controls.CheckBox)(target)); - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 9: - this.unknown = ((System.Windows.Controls.CheckBox)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 10: - this.mainboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 11: - this.gpu = ((System.Windows.Controls.CheckBox)(target)); - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 12: - this.dram = ((System.Windows.Controls.CheckBox)(target)); - - #line 52 "..\..\MainWindow.xaml" - this.dram.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 52 "..\..\MainWindow.xaml" - this.dram.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 13: - this.fan = ((System.Windows.Controls.CheckBox)(target)); - - #line 53 "..\..\MainWindow.xaml" - this.fan.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 53 "..\..\MainWindow.xaml" - this.fan.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 14: - this.cooler = ((System.Windows.Controls.CheckBox)(target)); - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 15: - this.ledstrip = ((System.Windows.Controls.CheckBox)(target)); - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 16: - this.ledmatrix = ((System.Windows.Controls.CheckBox)(target)); - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 17: - this.all = ((System.Windows.Controls.CheckBox)(target)); - - #line 58 "..\..\MainWindow.xaml" - this.all.Checked += new System.Windows.RoutedEventHandler(this.all_Checked); - - #line default - #line hidden - - #line 58 "..\..\MainWindow.xaml" - this.all.Unchecked += new System.Windows.RoutedEventHandler(this.all_Unchecked); - - #line default - #line hidden - return; - case 18: - this.resultBox = ((System.Windows.Controls.TextBox)(target)); - return; - case 19: - this.WriteBtn = ((System.Windows.Controls.Button)(target)); - - #line 61 "..\..\MainWindow.xaml" - this.WriteBtn.Click += new System.Windows.RoutedEventHandler(this.WriteBtn_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/DeviceExcludeTool/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/DeviceExcludeTool/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll deleted file mode 100644 index 9d9300c..0000000 Binary files a/DeviceExcludeTool/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/App.baml b/DeviceExcludeTool/obj/Release/App.baml deleted file mode 100644 index 5ddf028..0000000 Binary files a/DeviceExcludeTool/obj/Release/App.baml and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed b/DeviceExcludeTool/obj/Release/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed deleted file mode 100644 index fc50196..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/0744B613618400F89511140EAB015237DF6BCD54.costura.system.valuetuple.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed b/DeviceExcludeTool/obj/Release/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed deleted file mode 100644 index 5f1a095..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed b/DeviceExcludeTool/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed deleted file mode 100644 index d718db0..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/38D44B0F40FA31124BA139ADEB6F7ADC7E53EE19.costura.materialdesignthemes.wpf.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed b/DeviceExcludeTool/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed deleted file mode 100644 index d9fe526..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/5954E332EC7732BA34C27E2D88D154D1919C1B07.costura.costura.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed b/DeviceExcludeTool/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed deleted file mode 100644 index 7579d68..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/63465CB0805E60EB7F39A7FE43D4E7DD6BD0A931.costura.materialdesigncolors.pdb.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed b/DeviceExcludeTool/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed deleted file mode 100644 index d555a15..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/762C9ACDB09BFDF40E700645131999202ABBC871.costura.materialdesigncolors.dll.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed b/DeviceExcludeTool/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed deleted file mode 100644 index 6280104..0000000 Binary files a/DeviceExcludeTool/obj/Release/Costura/FDCF583259CA1605C180C9E02BD55AC3D536CBBB.costura.materialdesignthemes.wpf.pdb.compressed and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.Properties.Resources.resources b/DeviceExcludeTool/obj/Release/DeviceExcludeTool.Properties.Resources.resources deleted file mode 100644 index 6c05a97..0000000 Binary files a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.Properties.Resources.resources and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.csproj.CopyComplete b/DeviceExcludeTool/obj/Release/DeviceExcludeTool.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.csproj.FileListAbsolute.txt b/DeviceExcludeTool/obj/Release/DeviceExcludeTool.csproj.FileListAbsolute.txt deleted file mode 100644 index 5934d13..0000000 --- a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,28 +0,0 @@ -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.csprojAssemblyReference.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\MainWindow.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool_MarkupCompile.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool_MarkupCompile.lref -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\DeviceExcludeTool.exe.config -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\DeviceExcludeTool.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\DeviceExcludeTool.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\MaterialDesignThemes.Wpf.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\Newtonsoft.Json.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\App.g.cs -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\App.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\MainWindow.baml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.g.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.Properties.Resources.resources -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.csproj.GenerateResource.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.csproj.CopyComplete -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.exe -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\System.ValueTuple.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\obj\Release\DeviceExcludeTool.csproj.Fody.CopyLocal.cache -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\Costura.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\MaterialDesignColors.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\MaterialDesignThemes.Wpf.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\Newtonsoft.Json.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\System.ValueTuple.dll -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\Costura.xml -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\MaterialDesignColors.pdb -C:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\bin\Release\MaterialDesignThemes.Wpf.pdb diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.exe b/DeviceExcludeTool/obj/Release/DeviceExcludeTool.exe deleted file mode 100644 index 4033ccf..0000000 Binary files a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.exe and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.g.resources b/DeviceExcludeTool/obj/Release/DeviceExcludeTool.g.resources deleted file mode 100644 index 8a80a67..0000000 Binary files a/DeviceExcludeTool/obj/Release/DeviceExcludeTool.g.resources and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool_Content.g.i.cs b/DeviceExcludeTool/obj/Release/DeviceExcludeTool_Content.g.i.cs deleted file mode 100644 index 89d7d9f..0000000 --- a/DeviceExcludeTool/obj/Release/DeviceExcludeTool_Content.g.i.cs +++ /dev/null @@ -1,13 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("favicon%20(1).ico")] - - diff --git a/DeviceExcludeTool/obj/Release/DeviceExcludeTool_MarkupCompile.lref b/DeviceExcludeTool/obj/Release/DeviceExcludeTool_MarkupCompile.lref deleted file mode 100644 index 9aa0386..0000000 --- a/DeviceExcludeTool/obj/Release/DeviceExcludeTool_MarkupCompile.lref +++ /dev/null @@ -1,4 +0,0 @@ - -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\App.xaml;; -FC:\Users\jacklrpendleton\source\repos\JackNetRGBSync\DeviceExcludeTool\MainWindow.xaml;; - diff --git a/DeviceExcludeTool/obj/Release/MainWindow.baml b/DeviceExcludeTool/obj/Release/MainWindow.baml deleted file mode 100644 index 47d493b..0000000 Binary files a/DeviceExcludeTool/obj/Release/MainWindow.baml and /dev/null differ diff --git a/DeviceExcludeTool/obj/Release/MainWindow.g.cs b/DeviceExcludeTool/obj/Release/MainWindow.g.cs deleted file mode 100644 index ab4b87b..0000000 --- a/DeviceExcludeTool/obj/Release/MainWindow.g.cs +++ /dev/null @@ -1,491 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F1358FD1EDC07BA2515572442D8456CD9C581CBDD0A2E2D6ACEE2236E3A18F38" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 41 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keyboard; - - #line default - #line hidden - - - #line 42 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mouse; - - #line default - #line hidden - - - #line 43 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headset; - - #line default - #line hidden - - - #line 44 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mousepad; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headsetstand; - - #line default - #line hidden - - - #line 46 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keypad; - - #line default - #line hidden - - - #line 47 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox speaker; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox unknown; - - #line default - #line hidden - - - #line 50 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mainboard; - - #line default - #line hidden - - - #line 51 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox gpu; - - #line default - #line hidden - - - #line 52 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox dram; - - #line default - #line hidden - - - #line 53 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox fan; - - #line default - #line hidden - - - #line 54 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox cooler; - - #line default - #line hidden - - - #line 55 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledstrip; - - #line default - #line hidden - - - #line 56 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledmatrix; - - #line default - #line hidden - - - #line 58 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox all; - - #line default - #line hidden - - - #line 60 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBox resultBox; - - #line default - #line hidden - - - #line 61 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button WriteBtn; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closed += new System.EventHandler(this.AppWindow_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.AppWindow_Closing); - - #line default - #line hidden - return; - case 2: - this.keyboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 3: - this.mouse = ((System.Windows.Controls.CheckBox)(target)); - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 4: - this.headset = ((System.Windows.Controls.CheckBox)(target)); - - #line 43 "..\..\MainWindow.xaml" - this.headset.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 43 "..\..\MainWindow.xaml" - this.headset.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 5: - this.mousepad = ((System.Windows.Controls.CheckBox)(target)); - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 6: - this.headsetstand = ((System.Windows.Controls.CheckBox)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 7: - this.keypad = ((System.Windows.Controls.CheckBox)(target)); - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 8: - this.speaker = ((System.Windows.Controls.CheckBox)(target)); - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 9: - this.unknown = ((System.Windows.Controls.CheckBox)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 10: - this.mainboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 11: - this.gpu = ((System.Windows.Controls.CheckBox)(target)); - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 12: - this.dram = ((System.Windows.Controls.CheckBox)(target)); - - #line 52 "..\..\MainWindow.xaml" - this.dram.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 52 "..\..\MainWindow.xaml" - this.dram.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 13: - this.fan = ((System.Windows.Controls.CheckBox)(target)); - - #line 53 "..\..\MainWindow.xaml" - this.fan.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 53 "..\..\MainWindow.xaml" - this.fan.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 14: - this.cooler = ((System.Windows.Controls.CheckBox)(target)); - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 15: - this.ledstrip = ((System.Windows.Controls.CheckBox)(target)); - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 16: - this.ledmatrix = ((System.Windows.Controls.CheckBox)(target)); - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 17: - this.all = ((System.Windows.Controls.CheckBox)(target)); - - #line 58 "..\..\MainWindow.xaml" - this.all.Checked += new System.Windows.RoutedEventHandler(this.all_Checked); - - #line default - #line hidden - - #line 58 "..\..\MainWindow.xaml" - this.all.Unchecked += new System.Windows.RoutedEventHandler(this.all_Unchecked); - - #line default - #line hidden - return; - case 18: - this.resultBox = ((System.Windows.Controls.TextBox)(target)); - return; - case 19: - this.WriteBtn = ((System.Windows.Controls.Button)(target)); - - #line 61 "..\..\MainWindow.xaml" - this.WriteBtn.Click += new System.Windows.RoutedEventHandler(this.WriteBtn_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/DeviceExcludeTool/obj/Release/MainWindow.g.i.cs b/DeviceExcludeTool/obj/Release/MainWindow.g.i.cs deleted file mode 100644 index ab4b87b..0000000 --- a/DeviceExcludeTool/obj/Release/MainWindow.g.i.cs +++ /dev/null @@ -1,491 +0,0 @@ -#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "F1358FD1EDC07BA2515572442D8456CD9C581CBDD0A2E2D6ACEE2236E3A18F38" -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; -using System; -using System.Diagnostics; -using System.Windows; -using System.Windows.Automation; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Markup; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Media.Effects; -using System.Windows.Media.Imaging; -using System.Windows.Media.Media3D; -using System.Windows.Media.TextFormatting; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.Windows.Shell; - - -namespace DeviceExcludeTool { - - - /// - /// MainWindow - /// - public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { - - - #line 41 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keyboard; - - #line default - #line hidden - - - #line 42 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mouse; - - #line default - #line hidden - - - #line 43 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headset; - - #line default - #line hidden - - - #line 44 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mousepad; - - #line default - #line hidden - - - #line 45 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox headsetstand; - - #line default - #line hidden - - - #line 46 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox keypad; - - #line default - #line hidden - - - #line 47 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox speaker; - - #line default - #line hidden - - - #line 48 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox unknown; - - #line default - #line hidden - - - #line 50 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox mainboard; - - #line default - #line hidden - - - #line 51 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox gpu; - - #line default - #line hidden - - - #line 52 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox dram; - - #line default - #line hidden - - - #line 53 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox fan; - - #line default - #line hidden - - - #line 54 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox cooler; - - #line default - #line hidden - - - #line 55 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledstrip; - - #line default - #line hidden - - - #line 56 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox ledmatrix; - - #line default - #line hidden - - - #line 58 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.CheckBox all; - - #line default - #line hidden - - - #line 60 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.TextBox resultBox; - - #line default - #line hidden - - - #line 61 "..\..\MainWindow.xaml" - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] - internal System.Windows.Controls.Button WriteBtn; - - #line default - #line hidden - - private bool _contentLoaded; - - /// - /// InitializeComponent - /// - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public void InitializeComponent() { - if (_contentLoaded) { - return; - } - _contentLoaded = true; - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/mainwindow.xaml", System.UriKind.Relative); - - #line 1 "..\..\MainWindow.xaml" - System.Windows.Application.LoadComponent(this, resourceLocater); - - #line default - #line hidden - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] - void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { - switch (connectionId) - { - case 1: - - #line 15 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closed += new System.EventHandler(this.AppWindow_Closed); - - #line default - #line hidden - - #line 16 "..\..\MainWindow.xaml" - ((DeviceExcludeTool.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.AppWindow_Closing); - - #line default - #line hidden - return; - case 2: - this.keyboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 41 "..\..\MainWindow.xaml" - this.keyboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 3: - this.mouse = ((System.Windows.Controls.CheckBox)(target)); - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 42 "..\..\MainWindow.xaml" - this.mouse.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 4: - this.headset = ((System.Windows.Controls.CheckBox)(target)); - - #line 43 "..\..\MainWindow.xaml" - this.headset.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 43 "..\..\MainWindow.xaml" - this.headset.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 5: - this.mousepad = ((System.Windows.Controls.CheckBox)(target)); - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 44 "..\..\MainWindow.xaml" - this.mousepad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 6: - this.headsetstand = ((System.Windows.Controls.CheckBox)(target)); - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 45 "..\..\MainWindow.xaml" - this.headsetstand.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 7: - this.keypad = ((System.Windows.Controls.CheckBox)(target)); - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 46 "..\..\MainWindow.xaml" - this.keypad.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 8: - this.speaker = ((System.Windows.Controls.CheckBox)(target)); - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 47 "..\..\MainWindow.xaml" - this.speaker.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 9: - this.unknown = ((System.Windows.Controls.CheckBox)(target)); - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 48 "..\..\MainWindow.xaml" - this.unknown.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 10: - this.mainboard = ((System.Windows.Controls.CheckBox)(target)); - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 50 "..\..\MainWindow.xaml" - this.mainboard.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 11: - this.gpu = ((System.Windows.Controls.CheckBox)(target)); - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 51 "..\..\MainWindow.xaml" - this.gpu.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 12: - this.dram = ((System.Windows.Controls.CheckBox)(target)); - - #line 52 "..\..\MainWindow.xaml" - this.dram.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 52 "..\..\MainWindow.xaml" - this.dram.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 13: - this.fan = ((System.Windows.Controls.CheckBox)(target)); - - #line 53 "..\..\MainWindow.xaml" - this.fan.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 53 "..\..\MainWindow.xaml" - this.fan.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 14: - this.cooler = ((System.Windows.Controls.CheckBox)(target)); - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 54 "..\..\MainWindow.xaml" - this.cooler.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 15: - this.ledstrip = ((System.Windows.Controls.CheckBox)(target)); - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 55 "..\..\MainWindow.xaml" - this.ledstrip.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 16: - this.ledmatrix = ((System.Windows.Controls.CheckBox)(target)); - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Checked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - - #line 56 "..\..\MainWindow.xaml" - this.ledmatrix.Unchecked += new System.Windows.RoutedEventHandler(this.UpdateBtn_Click); - - #line default - #line hidden - return; - case 17: - this.all = ((System.Windows.Controls.CheckBox)(target)); - - #line 58 "..\..\MainWindow.xaml" - this.all.Checked += new System.Windows.RoutedEventHandler(this.all_Checked); - - #line default - #line hidden - - #line 58 "..\..\MainWindow.xaml" - this.all.Unchecked += new System.Windows.RoutedEventHandler(this.all_Unchecked); - - #line default - #line hidden - return; - case 18: - this.resultBox = ((System.Windows.Controls.TextBox)(target)); - return; - case 19: - this.WriteBtn = ((System.Windows.Controls.Button)(target)); - - #line 61 "..\..\MainWindow.xaml" - this.WriteBtn.Click += new System.Windows.RoutedEventHandler(this.WriteBtn_Click); - - #line default - #line hidden - return; - } - this._contentLoaded = true; - } - } -} - diff --git a/DeviceExcludeTool/packages.config b/DeviceExcludeTool/packages.config deleted file mode 100644 index c1a2084..0000000 --- a/DeviceExcludeTool/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/FluentWPF/AcrylicBrush.cs b/FluentWPF/AcrylicBrush.cs new file mode 100644 index 0000000..ab36214 --- /dev/null +++ b/FluentWPF/AcrylicBrush.cs @@ -0,0 +1,79 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Data; +using System.Windows.Markup; +using System.Windows.Media; + +namespace SourceChord.FluentWPF +{ + public class AcrylicBrushExtension : MarkupExtension + { + public string TargetName { get; set; } + + public Color TintColor { get; set; } = Colors.White; + + public double TintOpacity { get; set; } = 0.0; + + public double NoiseOpacity { get; set; } = 0.03; + + + public AcrylicBrushExtension() + { + + } + + public AcrylicBrushExtension(string target) + { + this.TargetName = target; + } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + IProvideValueTarget pvt = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; + FrameworkElement target = pvt.TargetObject as FrameworkElement; + + AcrylicPanel acrylicPanel = new AcrylicPanel() + { + TintColor = this.TintColor, + TintOpacity = this.TintOpacity, + NoiseOpacity = this.NoiseOpacity, + Width = target.Width, + Height = target.Height + }; + BindingOperations.SetBinding(acrylicPanel, AcrylicPanel.TargetProperty, new Binding() { ElementName = this.TargetName }); + BindingOperations.SetBinding(acrylicPanel, AcrylicPanel.SourceProperty, new Binding() { Source = target }); + + VisualBrush brush = new VisualBrush(acrylicPanel) + { + Stretch = Stretch.None, + AlignmentX = AlignmentX.Left, + AlignmentY = AlignmentY.Top, + ViewboxUnits = BrushMappingMode.Absolute, + }; + + return brush; + } + } + + public class BrushTranslationConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return new Point(0, 0); + + UIElement parent = values[0] as UIElement; + UIElement ctrl = values[1] as UIElement; + //var pointerPos = (Point)values[2]; + Point relativePos = parent.TranslatePoint(new Point(0, 0), ctrl); + + return new TranslateTransform(relativePos.X, relativePos.Y); + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/AcrylicContextMenu.cs b/FluentWPF/AcrylicContextMenu.cs new file mode 100644 index 0000000..dd205fc --- /dev/null +++ b/FluentWPF/AcrylicContextMenu.cs @@ -0,0 +1,52 @@ +using SourceChord.FluentWPF.Utility; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Interop; + +namespace SourceChord.FluentWPF +{ + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class AcrylicContextMenu : ContextMenu + { + static AcrylicContextMenu() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(AcrylicContextMenu), new FrameworkPropertyMetadata(typeof(AcrylicContextMenu))); + } + + protected override void OnOpened(RoutedEventArgs e) + { + base.OnOpened(e); + + HwndSource hwnd = (HwndSource)HwndSource.FromVisual(this); + AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + } + } +} diff --git a/FluentWPF/AcrylicPanel.cs b/FluentWPF/AcrylicPanel.cs new file mode 100644 index 0000000..bed6c1f --- /dev/null +++ b/FluentWPF/AcrylicPanel.cs @@ -0,0 +1,123 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Media; +using System.Windows.Shapes; + +namespace SourceChord.FluentWPF +{ + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class AcrylicPanel : ContentControl + { + public FrameworkElement Target + { + get { return (FrameworkElement)GetValue(TargetProperty); } + set { SetValue(TargetProperty, value); } + } + // Using a DependencyProperty as the backing store for Target. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TargetProperty = + DependencyProperty.Register("Target", typeof(FrameworkElement), typeof(AcrylicPanel), new PropertyMetadata(null)); + + public FrameworkElement Source + { + get { return (FrameworkElement)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + // Using a DependencyProperty as the backing store for Source. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SourceProperty = + DependencyProperty.Register("Source", typeof(FrameworkElement), typeof(AcrylicPanel), new PropertyMetadata(null)); + + public Color TintColor + { + get { return (Color)GetValue(TintColorProperty); } + set { SetValue(TintColorProperty, value); } + } + // Using a DependencyProperty as the backing store for TintColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintColorProperty = + DependencyProperty.Register("TintColor", typeof(Color), typeof(AcrylicPanel), new PropertyMetadata(Colors.White)); + + public double TintOpacity + { + get { return (double)GetValue(TintOpacityProperty); } + set { SetValue(TintOpacityProperty, value); } + } + // Using a DependencyProperty as the backing store for TintOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintOpacityProperty = + DependencyProperty.Register("TintOpacity", typeof(double), typeof(AcrylicPanel), new PropertyMetadata(0.0)); + + public double NoiseOpacity + { + get { return (double)GetValue(NoiseOpacityProperty); } + set { SetValue(NoiseOpacityProperty, value); } + } + // Using a DependencyProperty as the backing store for NoiseOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty NoiseOpacityProperty = + DependencyProperty.Register("NoiseOpacity", typeof(double), typeof(AcrylicPanel), new PropertyMetadata(0.03)); + + + + static AcrylicPanel() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(AcrylicPanel), new FrameworkPropertyMetadata(typeof(AcrylicPanel))); + } + + + public AcrylicPanel() + { + this.Source = this; + } + + private bool _isChanged = false; + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + + Rectangle rect = this.GetTemplateChild("rect") as Rectangle; + if (rect != null) + { + rect.LayoutUpdated += (_, __) => + { + if (!this._isChanged) + { + this._isChanged = true; + BindingOperations.GetBindingExpressionBase(rect, Rectangle.RenderTransformProperty)?.UpdateTarget(); + + Dispatcher.BeginInvoke(new Action(() => + { + this._isChanged = false; + }), System.Windows.Threading.DispatcherPriority.DataBind); + } + }; + } + } + } +} diff --git a/FluentWPF/AcrylicPopup.cs b/FluentWPF/AcrylicPopup.cs new file mode 100644 index 0000000..29d3949 --- /dev/null +++ b/FluentWPF/AcrylicPopup.cs @@ -0,0 +1,53 @@ +using SourceChord.FluentWPF.Utility; +using System; +using System.Windows; +using System.Windows.Controls.Primitives; +using System.Windows.Interop; + +namespace SourceChord.FluentWPF +{ + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class AcrylicPopup : Popup + { + static AcrylicPopup() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(AcrylicPopup), new FrameworkPropertyMetadata(typeof(AcrylicPopup))); + } + + protected override void OnOpened(EventArgs e) + { + base.OnOpened(e); + + HwndSource hwnd = (HwndSource)HwndSource.FromVisual(this.Child); + AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + } + } +} diff --git a/FluentWPF/AcrylicToolTip.cs b/FluentWPF/AcrylicToolTip.cs new file mode 100644 index 0000000..667ba14 --- /dev/null +++ b/FluentWPF/AcrylicToolTip.cs @@ -0,0 +1,51 @@ +using SourceChord.FluentWPF.Utility; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Interop; + +namespace SourceChord.FluentWPF +{ + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class AcrylicToolTip : ToolTip + { + static AcrylicToolTip() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(AcrylicToolTip), new FrameworkPropertyMetadata(typeof(AcrylicToolTip))); + } + + protected override void OnOpened(RoutedEventArgs e) + { + base.OnOpened(e); + HwndSource hwnd = (HwndSource)HwndSource.FromVisual(this); + AcrylicHelper.EnableBlur(hwnd.Handle, AccentFlagsType.Popup); + } + } +} diff --git a/FluentWPF/AcrylicWindow.cs b/FluentWPF/AcrylicWindow.cs new file mode 100644 index 0000000..6e16176 --- /dev/null +++ b/FluentWPF/AcrylicWindow.cs @@ -0,0 +1,470 @@ +using SourceChord.FluentWPF.Utility; +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Media; +using System.Windows.Shell; + +namespace SourceChord.FluentWPF +{ + public enum AcrylicWindowStyle + { + Normal, + NoIcon, + None, + } + + public enum TitleBarMode + { + Default, + Extend, + } + + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class AcrylicWindow : Window + { + static AcrylicWindow() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(AcrylicWindow), new FrameworkPropertyMetadata(typeof(AcrylicWindow))); + + TintColorProperty = AcrylicElement.TintColorProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(Colors.White, FrameworkPropertyMetadataOptions.Inherits)); + TintOpacityProperty = AcrylicElement.TintOpacityProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(0.6, FrameworkPropertyMetadataOptions.Inherits)); + NoiseOpacityProperty = AcrylicElement.NoiseOpacityProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(0.03, FrameworkPropertyMetadataOptions.Inherits)); + FallbackColorProperty = AcrylicElement.FallbackColorProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(Colors.LightGray, FrameworkPropertyMetadataOptions.Inherits)); + ExtendViewIntoTitleBarProperty = AcrylicElement.ExtendViewIntoTitleBarProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits)); + AcrylicWindowStyleProperty = AcrylicElement.AcrylicWindowStyleProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(AcrylicWindowStyle.Normal, FrameworkPropertyMetadataOptions.Inherits)); + TitleBarProperty = AcrylicElement.TitleBarProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits)); + TitleBarModeProperty = AcrylicElement.TitleBarModeProperty.AddOwner(typeof(AcrylicWindow), new FrameworkPropertyMetadata(TitleBarMode.Default, FrameworkPropertyMetadataOptions.Inherits)); + } + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + EnableBlur(this); + + FrameworkElement caption = this.GetTemplateChild("captionGrid") as FrameworkElement; + if (caption != null) + { + caption.SizeChanged += (s, e) => + { + WindowChrome chrome = WindowChrome.GetWindowChrome(this); + chrome.CaptionHeight = e.NewSize.Height; + }; + } + } + + internal static void EnableBlur(Window win) + { + WindowInteropHelper windowHelper = new WindowInteropHelper(win); + + // ウィンドウに半透明のアクリル効果を適用する + AcrylicHelper.EnableBlur(windowHelper.Handle); + + // タイトルバーの各種ボタンで利用するコマンドの設定 + win.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, (_, __) => { SystemCommands.CloseWindow(win); })); + win.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, (_, __) => { SystemCommands.MinimizeWindow(win); })); + win.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, (_, __) => { SystemCommands.MaximizeWindow(win); })); + win.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, (_, __) => { SystemCommands.RestoreWindow(win); })); + + + // WPFのSizeToContentのバグ対策 + // (WindowChrome使用時に、SizeToContentのウィンドウサイズ計算が正しく行われない) + void onContentRendered(object sender, EventArgs e) + { + if (win.SizeToContent != SizeToContent.Manual) + { + win.InvalidateMeasure(); + } + + win.ContentRendered -= onContentRendered; + } + win.ContentRendered += onContentRendered; + } + + #region Dependency Property + + public Color TintColor + { + get { return (Color)GetValue(TintColorProperty); } + set { SetValue(TintColorProperty, value); } + } + + // Using a DependencyProperty as the backing store for TintColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintColorProperty; + public static Color GetTintColor(DependencyObject obj) + { + return (Color)obj.GetValue(AcrylicElement.TintColorProperty); + } + + public static void SetTintColor(DependencyObject obj, Color value) + { + obj.SetValue(AcrylicElement.TintColorProperty, value); + } + + + public double TintOpacity + { + get { return (double)GetValue(TintOpacityProperty); } + set { SetValue(TintOpacityProperty, value); } + } + + // Using a DependencyProperty as the backing store for TintOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintOpacityProperty; + public static double GetTintOpacity(DependencyObject obj) + { + return (double)obj.GetValue(AcrylicElement.TintOpacityProperty); + } + + public static void SetTintOpacity(DependencyObject obj, double value) + { + obj.SetValue(AcrylicElement.TintOpacityProperty, value); + } + + + + public double NoiseOpacity + { + get { return (double)GetValue(NoiseOpacityProperty); } + set { SetValue(NoiseOpacityProperty, value); } + } + + // Using a DependencyProperty as the backing store for NoiseOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty NoiseOpacityProperty; + public static double GetNoiseOpacity(DependencyObject obj) + { + return (double)obj.GetValue(AcrylicElement.NoiseOpacityProperty); + } + + public static void SetNoiseOpacity(DependencyObject obj, double value) + { + obj.SetValue(AcrylicElement.NoiseOpacityProperty, value); + } + + + public Color FallbackColor + { + get { return (Color)GetValue(FallbackColorProperty); } + set { SetValue(FallbackColorProperty, value); } + } + + // Using a DependencyProperty as the backing store for FallbackColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty FallbackColorProperty; + public static Color GetFallbackColor(DependencyObject obj) + { + return (Color)obj.GetValue(AcrylicElement.FallbackColorProperty); + } + + public static void SetFallbackColor(DependencyObject obj, Color value) + { + obj.SetValue(AcrylicElement.FallbackColorProperty, value); + } + + + public bool ExtendViewIntoTitleBar + { + get { return (bool)GetValue(ExtendViewIntoTitleBarProperty); } + set { SetValue(ExtendViewIntoTitleBarProperty, value); } + } + + // Using a DependencyProperty as the backing store for ExtendViewIntoTitleBar. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ExtendViewIntoTitleBarProperty; + public static bool GetExtendViewIntoTitleBar(DependencyObject obj) + { + return (bool)obj.GetValue(AcrylicElement.ExtendViewIntoTitleBarProperty); + } + + public static void SetExtendViewIntoTitleBar(DependencyObject obj, bool value) + { + obj.SetValue(AcrylicElement.ExtendViewIntoTitleBarProperty, value); + } + + + public AcrylicWindowStyle AcrylicWindowStyle + { + get { return (AcrylicWindowStyle)GetValue(AcrylicWindowStyleProperty); } + set { SetValue(AcrylicWindowStyleProperty, value); } + } + + // Using a DependencyProperty as the backing store for AcrylicWindowStyle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty AcrylicWindowStyleProperty; + public static AcrylicWindowStyle GetAcrylicWindowStyle(DependencyObject obj) + { + return (AcrylicWindowStyle)obj.GetValue(AcrylicElement.AcrylicWindowStyleProperty); + } + + public static void SetAcrylicWindowStyle(DependencyObject obj, AcrylicWindowStyle value) + { + obj.SetValue(AcrylicElement.AcrylicWindowStyleProperty, value); + } + + public FrameworkElement TitleBar + { + get { return (FrameworkElement)GetValue(TitleBarProperty); } + set { SetValue(TitleBarProperty, value); } + } + + // Using a DependencyProperty as the backing store for TitleBar. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TitleBarProperty; + public static FrameworkElement GetTitleBar(DependencyObject obj) + { + return (FrameworkElement)obj.GetValue(AcrylicElement.TitleBarProperty); + } + + public static void SetTitleBar(DependencyObject obj, FrameworkElement value) + { + obj.SetValue(AcrylicElement.TitleBarProperty, value); + } + + public TitleBarMode TitleBarMode + { + get { return (TitleBarMode)GetValue(TitleBarModeProperty); } + set { SetValue(TitleBarModeProperty, value); } + } + + // Using a DependencyProperty as the backing store for TitleBarMode. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TitleBarModeProperty; + public static TitleBarMode GetTitleBarMode(DependencyObject obj) + { + return (TitleBarMode)obj.GetValue(AcrylicElement.TitleBarModeProperty); + } + + public static void SetTitleBarMode(DependencyObject obj, TitleBarMode value) + { + obj.SetValue(AcrylicElement.TitleBarModeProperty, value); + } + + #endregion + + + #region Attached Property + + + public static bool GetEnabled(DependencyObject obj) + { + return (bool)obj.GetValue(EnabledProperty); + } + + public static void SetEnabled(DependencyObject obj, bool value) + { + obj.SetValue(EnabledProperty, value); + } + + // Using a DependencyProperty as the backing store for Enabled. This enables animation, styling, binding, etc... + public static readonly DependencyProperty EnabledProperty = + DependencyProperty.RegisterAttached("Enabled", typeof(bool), typeof(AcrylicWindow), new PropertyMetadata(false, OnEnableChanged)); + + private static void OnEnableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + Window win = d as Window; + if (win == null) { return; } + + bool value = (bool)e.NewValue; + if (value) + { + ResourceDictionary dic = new ResourceDictionary() { Source = new Uri("pack://application:,,,/FluentWPF;component/Styles/Window.xaml") }; + Style style = dic["AcrylicWindowStyle"] as Style; + win.Style = style; + + win.Loaded += (_, __) => { EnableBlur(win); }; + if (win.IsLoaded) EnableBlur(win); + } + } + #endregion + } + + internal class AcrylicElement + { + + + public static Color GetTintColor(DependencyObject obj) + { + return (Color)obj.GetValue(TintColorProperty); + } + + public static void SetTintColor(DependencyObject obj, Color value) + { + obj.SetValue(TintColorProperty, value); + } + + // Using a DependencyProperty as the backing store for TintColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintColorProperty = + DependencyProperty.RegisterAttached("TintColor", typeof(Color), typeof(AcrylicElement), new FrameworkPropertyMetadata(Colors.White, FrameworkPropertyMetadataOptions.Inherits)); + + + + + public static double GetTintOpacity(DependencyObject obj) + { + return (double)obj.GetValue(TintOpacityProperty); + } + + public static void SetTintOpacity(DependencyObject obj, double value) + { + obj.SetValue(TintOpacityProperty, value); + } + + // Using a DependencyProperty as the backing store for TintOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TintOpacityProperty = + DependencyProperty.RegisterAttached("TintOpacity", typeof(double), typeof(AcrylicElement), new PropertyMetadata(0.6)); + + + + + public static double GetNoiseOpacity(DependencyObject obj) + { + return (double)obj.GetValue(NoiseOpacityProperty); + } + + public static void SetNoiseOpacity(DependencyObject obj, double value) + { + obj.SetValue(NoiseOpacityProperty, value); + } + + // Using a DependencyProperty as the backing store for NoiseOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty NoiseOpacityProperty = + DependencyProperty.RegisterAttached("NoiseOpacity", typeof(double), typeof(AcrylicElement), new PropertyMetadata(0.03)); + + + + + public static Color GetFallbackColor(DependencyObject obj) + { + return (Color)obj.GetValue(FallbackColorProperty); + } + + public static void SetFallbackColor(DependencyObject obj, Color value) + { + obj.SetValue(FallbackColorProperty, value); + } + + // Using a DependencyProperty as the backing store for FallbackColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty FallbackColorProperty = + DependencyProperty.RegisterAttached("FallbackColor", typeof(Color), typeof(AcrylicElement), new FrameworkPropertyMetadata(Colors.LightGray, FrameworkPropertyMetadataOptions.Inherits)); + + + public static bool GetExtendViewIntoTitleBar(DependencyObject obj) + { + return (bool)obj.GetValue(ExtendViewIntoTitleBarProperty); + } + + public static void SetExtendViewIntoTitleBar(DependencyObject obj, bool value) + { + obj.SetValue(ExtendViewIntoTitleBarProperty, value); + } + + // Using a DependencyProperty as the backing store for ExtendViewIntoTitleBar. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ExtendViewIntoTitleBarProperty = + DependencyProperty.RegisterAttached("ExtendViewIntoTitleBar", typeof(bool), typeof(AcrylicElement), new PropertyMetadata(false)); + + + public static AcrylicWindowStyle GetAcrylicWindowStyle(DependencyObject obj) + { + return (AcrylicWindowStyle)obj.GetValue(AcrylicWindowStyleProperty); + } + + public static void AcrylicWindowStyleBar(DependencyObject obj, AcrylicWindowStyle value) + { + obj.SetValue(AcrylicWindowStyleProperty, value); + } + + // Using a DependencyProperty as the backing store for AcrylicWindowStyle. This enables animation, styling, binding, etc... + public static readonly DependencyProperty AcrylicWindowStyleProperty = + DependencyProperty.RegisterAttached("AcrylicWindowStyle", typeof(AcrylicWindowStyle), typeof(AcrylicElement), new PropertyMetadata(AcrylicWindowStyle.Normal)); + + + public static FrameworkElement GetTitleBar(DependencyObject obj) + { + return (FrameworkElement)obj.GetValue(TitleBarProperty); + } + + public static void SetTitleBar(DependencyObject obj, FrameworkElement value) + { + obj.SetValue(TitleBarProperty, value); + } + + // Using a DependencyProperty as the backing store for TitleBar. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TitleBarProperty = + DependencyProperty.RegisterAttached("TitleBar", typeof(FrameworkElement), typeof(AcrylicElement), new PropertyMetadata(null)); + + + public static TitleBarMode GetTitleBarMode(DependencyObject obj) + { + return (TitleBarMode)obj.GetValue(TitleBarModeProperty); + } + + public static void SetTitleBarMode(DependencyObject obj, TitleBarMode value) + { + obj.SetValue(TitleBarModeProperty, value); + } + + // Using a DependencyProperty as the backing store for TitleBarMode. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TitleBarModeProperty = + DependencyProperty.RegisterAttached("TitleBarMode", typeof(TitleBarMode), typeof(AcrylicElement), new PropertyMetadata(TitleBarMode.Default)); + } + + + public class IsNullConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value == null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class ColorToSolidColorBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + Color col = (Color)value; + return new SolidColorBrush(col); + } + catch + { + return Brushes.Transparent; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/Animations/BrushAnimation.cs b/FluentWPF/Animations/BrushAnimation.cs new file mode 100644 index 0000000..d0a9ba6 --- /dev/null +++ b/FluentWPF/Animations/BrushAnimation.cs @@ -0,0 +1,84 @@ +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Media.Animation; + +namespace SourceChord.FluentWPF.Animations +{ + public class BrushAnimation : AnimationTimeline + { + public override Type TargetPropertyType => typeof(Brush); + + public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock) + { + if (!animationClock.CurrentProgress.HasValue) + return Brushes.Transparent; + + // From/Toが設定されていない場合は、デフォルト値を使う + Brush originValue = this.From ?? defaultOriginValue as Brush; + Brush dstValue = this.To ?? defaultDestinationValue as Brush; + + double progress = animationClock.CurrentProgress.Value; + if (progress == 0) + return originValue; + if (progress == 1) + return dstValue; + + // Easingを適用 + IEasingFunction easingFunction = this.EasingFunction; + if (easingFunction != null) + { + progress = easingFunction.Ease(progress); + } + + return new VisualBrush(new Border() + { + Width = 1, + Height = 1, + Background = originValue, + Child = new Border() + { + Background = dstValue, + Opacity = progress, + } + }); + } + + protected override Freezable CreateInstanceCore() + { + return new BrushAnimation(); + } + + + public Brush From + { + get { return (Brush)GetValue(FromProperty); } + set { SetValue(FromProperty, value); } + } + // Using a DependencyProperty as the backing store for From. This enables animation, styling, binding, etc... + public static readonly DependencyProperty FromProperty = + DependencyProperty.Register("From", typeof(Brush), typeof(BrushAnimation), new PropertyMetadata(null)); + + + public Brush To + { + get { return (Brush)GetValue(ToProperty); } + set { SetValue(ToProperty, value); } + } + // Using a DependencyProperty as the backing store for To. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ToProperty = + DependencyProperty.Register("To", typeof(Brush), typeof(BrushAnimation), new PropertyMetadata(null)); + + + public IEasingFunction EasingFunction + { + get { return (IEasingFunction)GetValue(EasingFunctionProperty); } + set { SetValue(EasingFunctionProperty, value); } + } + // Using a DependencyProperty as the backing store for EasingFunction. This enables animation, styling, binding, etc... + public static readonly DependencyProperty EasingFunctionProperty = + DependencyProperty.Register("EasingFunction", typeof(IEasingFunction), typeof(BrushAnimation), new PropertyMetadata(null)); + + } +} diff --git a/FluentWPF/Assets/Images/noise.png b/FluentWPF/Assets/Images/noise.png new file mode 100644 index 0000000..5ee8a02 Binary files /dev/null and b/FluentWPF/Assets/Images/noise.png differ diff --git a/FluentWPF/Assets/Images/noiseBlack.png b/FluentWPF/Assets/Images/noiseBlack.png new file mode 100644 index 0000000..6b93734 Binary files /dev/null and b/FluentWPF/Assets/Images/noiseBlack.png differ diff --git a/FluentWPF/Assets/Images/noiseWhite.png b/FluentWPF/Assets/Images/noiseWhite.png new file mode 100644 index 0000000..473556a Binary files /dev/null and b/FluentWPF/Assets/Images/noiseWhite.png differ diff --git a/FluentWPF/Converters/HeightToRadiusConverter.cs b/FluentWPF/Converters/HeightToRadiusConverter.cs new file mode 100644 index 0000000..cfb8466 --- /dev/null +++ b/FluentWPF/Converters/HeightToRadiusConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace SourceChord.FluentWPF.Converters +{ + public class HeightToRadiusConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double height = (double)value; + return height / 2; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/Converters/RectConverter.cs b/FluentWPF/Converters/RectConverter.cs new file mode 100644 index 0000000..35b6cf6 --- /dev/null +++ b/FluentWPF/Converters/RectConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Data; + +namespace SourceChord.FluentWPF.Converters +{ + public class RectConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return null; + double width = (double)values[0]; + double height = (double)values[1]; + + return new Rect(0, 0, width, height); + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/DropShadowPanel.cs b/FluentWPF/DropShadowPanel.cs new file mode 100644 index 0000000..3d9ed59 --- /dev/null +++ b/FluentWPF/DropShadowPanel.cs @@ -0,0 +1,373 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Media; +using System.Windows.Media.Effects; +using System.Windows.Shapes; + +namespace SourceChord.FluentWPF +{ + public enum ShadowMode + { + Content = 0, + Inner, + Outer, + } + + public class DropShadowPanel : Decorator + { + + + public Brush Background + { + get { return (Brush)GetValue(BackgroundProperty); } + set { SetValue(BackgroundProperty, value); } + } + // Using a DependencyProperty as the backing store for Background. This enables animation, styling, binding, etc... + public static readonly DependencyProperty BackgroundProperty = + DependencyProperty.Register("Background", typeof(Brush), typeof(DropShadowPanel), new PropertyMetadata(null)); + + + + public double BlurRadius + { + get { return (double)GetValue(BlurRadiusProperty); } + set { SetValue(BlurRadiusProperty, value); } + } + // Using a DependencyProperty as the backing store for BlurRadius. This enables animation, styling, binding, etc... + public static readonly DependencyProperty BlurRadiusProperty = + DependencyProperty.Register("BlurRadius", typeof(double), typeof(DropShadowPanel), new PropertyMetadata(20.0)); + + + public Color Color + { + get { return (Color)GetValue(ColorProperty); } + set { SetValue(ColorProperty, value); } + } + // Using a DependencyProperty as the backing store for Color. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ColorProperty = + DependencyProperty.Register("Color", typeof(Color), typeof(DropShadowPanel), new PropertyMetadata(Colors.Black)); + + + public double Direction + { + get { return (double)GetValue(DirectionProperty); } + set { SetValue(DirectionProperty, value); } + } + // Using a DependencyProperty as the backing store for Direction. This enables animation, styling, binding, etc... + public static readonly DependencyProperty DirectionProperty = + DependencyProperty.Register("Direction", typeof(double), typeof(DropShadowPanel), new PropertyMetadata(315.0)); + + public double ShadowOpacity + { + get { return (double)GetValue(ShadowOpacityProperty); } + set { SetValue(ShadowOpacityProperty, value); } + } + // Using a DependencyProperty as the backing store for ShadowOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ShadowOpacityProperty = + DependencyProperty.Register("ShadowOpacity", typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.8)); + + + public RenderingBias RenderingBias + { + get { return (RenderingBias)GetValue(RenderingBiasProperty); } + set { SetValue(RenderingBiasProperty, value); } + } + // Using a DependencyProperty as the backing store for RenderingBias. This enables animation, styling, binding, etc... + public static readonly DependencyProperty RenderingBiasProperty = + DependencyProperty.Register("RenderingBias", typeof(RenderingBias), typeof(DropShadowPanel), new PropertyMetadata(RenderingBias.Performance)); + + + public double ShadowDepth + { + get { return (double)GetValue(ShadowDepthProperty); } + set { SetValue(ShadowDepthProperty, value); } + } + // Using a DependencyProperty as the backing store for ShadowDepth. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ShadowDepthProperty = + DependencyProperty.Register("ShadowDepth", typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0)); + + + + + public ShadowMode ShadowMode + { + get { return (ShadowMode)GetValue(ShadowModeProperty); } + set { SetValue(ShadowModeProperty, value); } + } + // Using a DependencyProperty as the backing store for ShadowMode. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ShadowModeProperty = + DependencyProperty.Register("ShadowMode", typeof(ShadowMode), typeof(DropShadowPanel), new PropertyMetadata(ShadowMode.Content)); + + + + private ContainerVisual _internalVisual; + + public DropShadowPanel() + { + + } + + private ContainerVisual InternalVisual + { + get + { + if (this._internalVisual == null) + { + this._internalVisual = new ContainerVisual(); + AddVisualChild(this._internalVisual); + } + return this._internalVisual; + } + } + + private UIElement InternalChild + { + get + { + VisualCollection children = this.InternalVisual.Children; + if (children.Count != 0) return children[0] as UIElement; + else return null; + } + set + { + VisualCollection children = this.InternalVisual.Children; + if (children.Count != 0) children.Clear(); + children.Add(value); + } + } + + public override UIElement Child + { + get { return this.InternalChild; } + set + { + UIElement old = this.InternalChild; + + if (old != value) + { + // 古い要素をLogicalTreeから取り除く + RemoveLogicalChild(old); + + UIElement ic = this.CreateInternalVisual(value); + + if (ic != null) + { + AddLogicalChild(ic); + } + + this.InternalChild = ic; + + InvalidateMeasure(); + } + } + } + + protected internal UIElement CreateInternalVisual(UIElement value) + { + DropShadowEffect effect = new System.Windows.Media.Effects.DropShadowEffect(); + BindingOperations.SetBinding(effect, DropShadowEffect.BlurRadiusProperty, new Binding("BlurRadius") { Source = this }); + BindingOperations.SetBinding(effect, DropShadowEffect.ColorProperty, new Binding("Color") { Source = this }); + BindingOperations.SetBinding(effect, DropShadowEffect.DirectionProperty, new Binding("Direction") { Source = this }); + BindingOperations.SetBinding(effect, DropShadowEffect.OpacityProperty, new Binding("ShadowOpacity") { Source = this }); + BindingOperations.SetBinding(effect, DropShadowEffect.RenderingBiasProperty, new Binding("RenderingBias") { Source = this }); + BindingOperations.SetBinding(effect, DropShadowEffect.ShadowDepthProperty, new Binding("ShadowDepth") { Source = this }); + + // DropShadowのモード切替用にトリガーを設定 + Style st = new Style(); + + // ShadowMode.Contentの場合は、ContentをVisualBrushとして扱ってContentの形状に応じた影を作る + VisualBrush brush = new VisualBrush(value) + { + TileMode = TileMode.None, + Stretch = Stretch.None, + AlignmentX = AlignmentX.Left, + AlignmentY = AlignmentY.Top, + ViewboxUnits = BrushMappingMode.Absolute + }; + DataTrigger contentTrigger = new DataTrigger() + { + Binding = new Binding("ShadowMode") { Source = this }, + Value = ShadowMode.Content, + }; + contentTrigger.Setters.Add(new Setter() + { + Property = Rectangle.FillProperty, + Value = brush + }); + st.Triggers.Add(contentTrigger); + + + // ShadowMode.Outerの場合は、影はコントロールの外側にだけ表示 + DataTrigger outerTrigger = new DataTrigger() + { + Binding = new Binding("ShadowMode") { Source = this }, + Value = ShadowMode.Outer, + }; + outerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.ClipProperty, + Value = new MultiBinding() + { + Bindings = + { + new Binding("ActualWidth") { Source = this }, + new Binding("ActualHeight") { Source = this }, + new Binding("BlurRadius") { Source = this }, + }, + Converter = new ClipInnerRectConverter() + } + }); + outerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.FillProperty, + Value = Brushes.White + }); + st.Triggers.Add(outerTrigger); + + // ShadowMode.Innerの場合は、影はコントロールの内側にだけ表示 + DataTrigger innerTrigger = new DataTrigger() + { + Binding = new Binding("ShadowMode") { Source = this }, + Value = ShadowMode.Inner, + }; + innerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.StrokeProperty, + Value = Brushes.White + }); + innerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.StrokeThicknessProperty, + Value = new Binding("BlurRadius") { Source = this } + }); + innerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.MarginProperty, + Value = new Binding("BlurRadius") { Source = this, Converter = new NegativeMarginConverter() } + }); + innerTrigger.Setters.Add(new Setter() + { + Property = Rectangle.ClipProperty, + Value = new MultiBinding() + { + Bindings = + { + new Binding("ActualWidth") { Source = this }, + new Binding("ActualHeight") { Source = this }, + new Binding("BlurRadius") { Source = this }, + }, + Converter = new ClipOuterRectConverter() + } + }); + st.Triggers.Add(innerTrigger); + + Rectangle border = new Rectangle() + { + Effect = effect, + Style = st, + }; + + Grid grid = new Grid(); + BindingOperations.SetBinding(grid, Grid.BackgroundProperty, new Binding("Background") { Source = this }); + grid.Children.Add(border); + if (value != null) + { + grid.Children.Add(value); + } + + return grid; + } + + // 常に1を返しておく + protected override int VisualChildrenCount => 1; + + protected override Visual GetVisualChild(int index) + { + if (index != 0) + { + throw new ArgumentOutOfRangeException(); + } + return this.InternalVisual; + } + + protected override IEnumerator LogicalChildren + { + get + { + if (this.InternalChild == null) + { + return null; + } + + List list = new List(); + list.Add(this.InternalChild); + return list.GetEnumerator(); + } + } + } + + internal class ClipInnerRectConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return null; + + double width = (double)values[0]; + double height = (double)values[1]; + double outerMargin = (double)values[2]; + + RectangleGeometry region = new RectangleGeometry(new Rect(-outerMargin, -outerMargin, width + (outerMargin * 2), height + (outerMargin * 2))); + RectangleGeometry clip = new RectangleGeometry(new Rect(0, 0, width, height)); + + GeometryGroup group = new GeometryGroup(); + group.Children.Add(region); + group.Children.Add(clip); + + return group; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + internal class ClipOuterRectConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return null; + + double width = (double)values[0]; + double height = (double)values[1]; + double margin = (double)values[2]; + + return new RectangleGeometry(new Rect(margin, margin, width, height)); + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + internal class NegativeMarginConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + double margin = (double)value; + return new Thickness(-margin); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/Extensions.cs b/FluentWPF/Extensions.cs new file mode 100644 index 0000000..b08333e --- /dev/null +++ b/FluentWPF/Extensions.cs @@ -0,0 +1,82 @@ +using System.Windows; +using System.Windows.Media; + +namespace SourceChord.FluentWPF +{ + public static class Extensions + { + + //header text + public static readonly DependencyProperty HeaderProperty = DependencyProperty.RegisterAttached("Header", typeof(string), typeof(Extensions), new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHeader(UIElement element, string value) + { + element.SetValue(HeaderProperty, value); + } + public static string GetHeader(UIElement element) + { + return (string)element.GetValue(HeaderProperty); + } + + + + + + //header size + public static readonly DependencyProperty HeaderSizeProperty = DependencyProperty.RegisterAttached("HeaderSize", typeof(double), typeof(Extensions), new FrameworkPropertyMetadata(14.0, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHeaderSize(UIElement element, double value) + { + element.SetValue(HeaderSizeProperty, value); + } + public static double GetHeaderSize(UIElement element) + { + return (double)element.GetValue(HeaderSizeProperty); + } + + + + //Header ForegroundBrush + public static readonly DependencyProperty HeaderForegroundBrushProperty = DependencyProperty.RegisterAttached("HeaderForegroundBrush", typeof(Brush), typeof(Extensions), new FrameworkPropertyMetadata(Brushes.Black, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetHeaderForegroundBrush(UIElement element, Brush value) + { + element.SetValue(HeaderForegroundBrushProperty, value); + } + public static Brush GetHeaderForegroundBrush(UIElement element) + { + return (Brush)element.GetValue(HeaderForegroundBrushProperty); + } + + + + //Placeholder text + public static readonly DependencyProperty PlaceholderTextProperty = DependencyProperty.RegisterAttached("PlaceholderText", typeof(string), typeof(Extensions), new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetPlaceholderText(UIElement element, string value) + { + element.SetValue(PlaceholderTextProperty, value); + } + public static string GetPlaceholderText(UIElement element) + { + return (string)element.GetValue(PlaceholderTextProperty); + } + + + //Placeholder ForegroundBrush + public static readonly DependencyProperty PlaceholderForegroundBrushProperty = DependencyProperty.RegisterAttached("PlaceholderForegroundBrush", typeof(Brush), typeof(Extensions), new FrameworkPropertyMetadata(Brushes.DimGray, FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetPlaceholderForegroundBrush(UIElement element, Brush value) + { + element.SetValue(PlaceholderForegroundBrushProperty, value); + } + public static Brush GetPlaceholderForegroundBrush(UIElement element) + { + return (Brush)element.GetValue(PlaceholderForegroundBrushProperty); + } + + } + + + +} diff --git a/FluentWPF/FluentWPF.csproj b/FluentWPF/FluentWPF.csproj new file mode 100644 index 0000000..392b442 --- /dev/null +++ b/FluentWPF/FluentWPF.csproj @@ -0,0 +1,63 @@ + + + + Library + net45;netcoreapp3.0 + true + SourceChord.FluentWPF + + 8.0 + + + + + https://github.com/sourcechord/FluentWPF + https://raw.githubusercontent.com/sourcechord/FluentWPF/master/logo.png + WPF XAML Fluent Design Theme Library + LICENSE + 0.8.0 + Fluent Design System for WPF + Copyright © 2017 + SourceChord + 0.8.0.6 + 0.8.0.6 + FluentWPF + + + + + + + + + + + + + + + + + + + True + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/ParallaxView.cs b/FluentWPF/ParallaxView.cs new file mode 100644 index 0000000..9b13bee --- /dev/null +++ b/FluentWPF/ParallaxView.cs @@ -0,0 +1,162 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Media; + +namespace SourceChord.FluentWPF +{ + /// + /// このカスタム コントロールを XAML ファイルで使用するには、手順 1a または 1b の後、手順 2 に従います。 + /// + /// 手順 1a) 現在のプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF" + /// + /// + /// 手順 1b) 異なるプロジェクトに存在する XAML ファイルでこのカスタム コントロールを使用する場合 + /// この XmlNamespace 属性を使用場所であるマークアップ ファイルのルート要素に + /// 追加します: + /// + /// xmlns:MyNamespace="clr-namespace:SourceChord.FluentWPF;assembly=SourceChord.FluentWPF" + /// + /// また、XAML ファイルのあるプロジェクトからこのプロジェクトへのプロジェクト参照を追加し、 + /// リビルドして、コンパイル エラーを防ぐ必要があります: + /// + /// ソリューション エクスプローラーで対象のプロジェクトを右クリックし、 + /// [参照の追加] の [プロジェクト] を選択してから、このプロジェクトを参照し、選択します。 + /// + /// + /// 手順 2) + /// コントロールを XAML ファイルで使用します。 + /// + /// + /// + /// + public class ParallaxView : ContentControl + { + static ParallaxView() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ParallaxView), new FrameworkPropertyMetadata(typeof(ParallaxView))); + } + + + + public double VerticalShift + { + get { return (double)GetValue(VerticalShiftProperty); } + set { SetValue(VerticalShiftProperty, value); } + } + // Using a DependencyProperty as the backing store for VerticalShift. This enables animation, styling, binding, etc... + public static readonly DependencyProperty VerticalShiftProperty = + DependencyProperty.Register("VerticalShift", typeof(double), typeof(ParallaxView), new PropertyMetadata(0.0)); + + + + public double HorizontalShift + { + get { return (double)GetValue(HorizontalShiftProperty); } + set { SetValue(HorizontalShiftProperty, value); } + } + // Using a DependencyProperty as the backing store for HorizontalShift. This enables animation, styling, binding, etc... + public static readonly DependencyProperty HorizontalShiftProperty = + DependencyProperty.Register("HorizontalShift", typeof(double), typeof(ParallaxView), new PropertyMetadata(0.0)); + + + public Thickness OffsetMargin + { + get { return (Thickness)GetValue(OffsetMarginProperty); } + private set { SetValue(OffsetMarginProperty, value); } + } + // Using a DependencyProperty as the backing store for OffsetMargin. This enables animation, styling, binding, etc... + public static readonly DependencyProperty OffsetMarginProperty = + DependencyProperty.Register("OffsetMargin", typeof(Thickness), typeof(ParallaxView), new PropertyMetadata(new Thickness(0))); + + + private void OnScrollUpdated(ScrollViewer scrollViewer) + { + double posX = scrollViewer.ScrollableWidth == 0 ? 0 : scrollViewer.HorizontalOffset / scrollViewer.ScrollableWidth; + double posY = scrollViewer.ScrollableHeight == 0 ? 0 : scrollViewer.VerticalOffset / scrollViewer.ScrollableHeight; + + this.OffsetMargin = new Thickness(-posX * HorizontalShift, -posY * VerticalShift, 0, 0); + } + + public UIElement Source + { + get { return (UIElement)GetValue(SourceProperty); } + set { SetValue(SourceProperty, value); } + } + // Using a DependencyProperty as the backing store for Source. This enables animation, styling, binding, etc... + public static readonly DependencyProperty SourceProperty = + DependencyProperty.Register("Source", typeof(UIElement), typeof(ParallaxView), new PropertyMetadata(null, OnSourceChanged)); + + private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + // Sourceが設定されたら、VisualTreeを辿りScrollViewerを探す。 + // ⇒見つかったScrollViewerの各種プロパティと、このParallaxViewのオフセット値をバインディングする。 + ParallaxView parallax = d as ParallaxView; + FrameworkElement ctrl = e.NewValue as FrameworkElement; + ctrl.Loaded += (_, __) => + { + ScrollViewer viewer = GetScrollViewer(ctrl); + + if (viewer != null) + { + viewer.ScrollChanged += (sender, ___) => { parallax.OnScrollUpdated(sender as ScrollViewer); }; + viewer.SizeChanged += (sender, ___) => { parallax.OnScrollUpdated(sender as ScrollViewer); }; + } + }; + + } + + + private static ScrollViewer GetScrollViewer(DependencyObject obj) + { + ScrollViewer viewer = obj as ScrollViewer ?? FindVisualChild(obj); + return viewer; + } + + private static childItem FindVisualChild(DependencyObject obj) + where childItem : DependencyObject + { + for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) + { + DependencyObject child = VisualTreeHelper.GetChild(obj, i); + if (child != null && child is childItem) + return (childItem)child; + else + { + childItem childOfChild = FindVisualChild(child); + if (childOfChild != null) + return childOfChild; + } + } + return null; + } + } + + public class AddValueConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + double sum = 0; + foreach (object v in values) + { + bool isInvalid = v == DependencyProperty.UnsetValue; + if (isInvalid) continue; + + double value = (double)v; + sum += value; + } + return sum; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/FluentWPF/PointerTracker.cs b/FluentWPF/PointerTracker.cs new file mode 100644 index 0000000..8d13660 --- /dev/null +++ b/FluentWPF/PointerTracker.cs @@ -0,0 +1,335 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Data; +using System.Windows.Markup; +using System.Windows.Media; + +namespace SourceChord.FluentWPF +{ + public static class PointerTracker + { + + public static double GetX(DependencyObject obj) + { + return (double)obj.GetValue(XProperty); + } + private static void SetX(DependencyObject obj, double value) + { + obj.SetValue(XProperty, value); + } + // Using a DependencyProperty as the backing store for X. This enables animation, styling, binding, etc... + public static readonly DependencyProperty XProperty = + DependencyProperty.RegisterAttached("X", typeof(double), typeof(PointerTracker), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.Inherits)); + + + public static double GetY(DependencyObject obj) + { + return (double)obj.GetValue(YProperty); + } + private static void SetY(DependencyObject obj, double value) + { + obj.SetValue(YProperty, value); + } + // Using a DependencyProperty as the backing store for Y. This enables animation, styling, binding, etc... + public static readonly DependencyProperty YProperty = + DependencyProperty.RegisterAttached("Y", typeof(double), typeof(PointerTracker), new FrameworkPropertyMetadata(double.NaN, FrameworkPropertyMetadataOptions.Inherits)); + + + public static Point GetPosition(DependencyObject obj) + { + return (Point)obj.GetValue(PositionProperty); + } + private static void SetPosition(DependencyObject obj, Point value) + { + obj.SetValue(PositionProperty, value); + } + // Using a DependencyProperty as the backing store for Position. This enables animation, styling, binding, etc... + public static readonly DependencyProperty PositionProperty = + DependencyProperty.RegisterAttached("Position", typeof(Point), typeof(PointerTracker), new FrameworkPropertyMetadata(new Point(0, 0), FrameworkPropertyMetadataOptions.Inherits)); + + + public static bool GetIsEnter(DependencyObject obj) + { + return (bool)obj.GetValue(IsEnterProperty); + } + private static void SetIsEnter(DependencyObject obj, bool value) + { + obj.SetValue(IsEnterProperty, value); + } + // Using a DependencyProperty as the backing store for IsEnter. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IsEnterProperty = + DependencyProperty.RegisterAttached("IsEnter", typeof(bool), typeof(PointerTracker), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.Inherits)); + + + + public static UIElement GetRootObject(DependencyObject obj) + { + return (UIElement)obj.GetValue(RootObjectProperty); + } + private static void SetRootObject(DependencyObject obj, UIElement value) + { + obj.SetValue(RootObjectProperty, value); + } + // Using a DependencyProperty as the backing store for RootObject. This enables animation, styling, binding, etc... + public static readonly DependencyProperty RootObjectProperty = + DependencyProperty.RegisterAttached("RootObject", typeof(UIElement), typeof(PointerTracker), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.Inherits)); + + + + + public static bool GetEnabled(DependencyObject obj) + { + return (bool)obj.GetValue(EnabledProperty); + } + public static void SetEnabled(DependencyObject obj, bool value) + { + obj.SetValue(EnabledProperty, value); + } + // Using a DependencyProperty as the backing store for Enabled. This enables animation, styling, binding, etc... + public static readonly DependencyProperty EnabledProperty = + DependencyProperty.RegisterAttached("Enabled", typeof(bool), typeof(PointerTracker), new PropertyMetadata(false, OnEnabledChanged)); + + private static void OnEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + UIElement ctrl = d as UIElement; + bool newValue = (bool)e.NewValue; + bool oldValue = (bool)e.OldValue; + if (ctrl == null) return; + + // 無効になった場合の処理 + if (oldValue && !newValue) + { + ctrl.MouseEnter -= Ctrl_MouseEnter; + ctrl.PreviewMouseMove -= Ctrl_PreviewMouseMove; + ctrl.MouseLeave -= Ctrl_MouseLeave; + + ctrl.ClearValue(PointerTracker.RootObjectProperty); + } + + + // 有効になった場合の処理 + if (!oldValue && newValue) + { + ctrl.MouseEnter += Ctrl_MouseEnter; + ctrl.PreviewMouseMove += Ctrl_PreviewMouseMove; + ctrl.MouseLeave += Ctrl_MouseLeave; + + SetRootObject(ctrl, ctrl); + } + } + + private static void Ctrl_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) + { + UIElement ctrl = sender as UIElement; + if (ctrl != null) + { + SetIsEnter(ctrl, true); + } + } + + private static void Ctrl_PreviewMouseMove(object sender, System.Windows.Input.MouseEventArgs e) + { + UIElement ctrl = sender as UIElement; + if (ctrl != null && GetIsEnter(ctrl)) + { + Point pos = e.GetPosition(ctrl); + + SetX(ctrl, pos.X); + SetY(ctrl, pos.Y); + SetPosition(ctrl, pos); + } + } + + private static void Ctrl_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) + { + UIElement ctrl = sender as UIElement; + if (ctrl != null) + { + SetIsEnter(ctrl, false); + } + } + } + + public class RelativePositionConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Any(o => o == DependencyProperty.UnsetValue || o == null)) return new Point(0, 0); + + UIElement parent = values[0] as UIElement; + UIElement ctrl = values[1] as UIElement; + Point pointerPos = (Point)values[2]; + Point relativePos = parent.TranslatePoint(pointerPos, ctrl); + + return relativePos; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class OpacityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + bool isEnter = (bool)value; + double opacity = (double)parameter; + return isEnter ? opacity : 0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class RevealBrushExtension : MarkupExtension + { + public RevealBrushExtension() + { + + } + + public Color Color { get; set; } = Colors.Black; + public double Opacity { get; set; } = 1; + + public double Size { get; set; } = 100; + + public override object ProvideValue(IServiceProvider serviceProvider) + { + IProvideValueTarget pvt = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; + DependencyObject target = pvt.TargetObject as DependencyObject; + + // 円形のグラデーション表示をするブラシを作成 + Color bgColor = Color.FromArgb(0, this.Color.R, this.Color.G, this.Color.B); + RadialGradientBrush brush = new RadialGradientBrush(this.Color, bgColor); + brush.MappingMode = BrushMappingMode.Absolute; + brush.RadiusX = this.Size; + brush.RadiusY = this.Size; + + // カーソルが領域外にある場合は、透明にする。 + Binding opacityBinding = new Binding("Opacity") + { + Source = target, + Path = new PropertyPath(PointerTracker.IsEnterProperty), + Converter = new OpacityConverter(), + ConverterParameter = this.Opacity + }; + BindingOperations.SetBinding(brush, RadialGradientBrush.OpacityProperty, opacityBinding); + + // グラデーションの中心位置をバインディング + MultiBinding binding = new MultiBinding(); + binding.Converter = new RelativePositionConverter(); + binding.Bindings.Add(new Binding() { Source = target, Path = new PropertyPath(PointerTracker.RootObjectProperty) }); + binding.Bindings.Add(new Binding() { Source = target }); + binding.Bindings.Add(new Binding() { Source = target, Path = new PropertyPath(PointerTracker.PositionProperty) }); + + BindingOperations.SetBinding(brush, RadialGradientBrush.CenterProperty, binding); + BindingOperations.SetBinding(brush, RadialGradientBrush.GradientOriginProperty, binding); + return brush; + } + } + + public class RevealElement + { + + public static Brush GetMouseOverForeground(DependencyObject obj) + { + return (Brush)obj.GetValue(MouseOverForegroundProperty); + } + public static void SetMouseOverForeground(DependencyObject obj, Brush value) + { + obj.SetValue(MouseOverForegroundProperty, value); + } + // Using a DependencyProperty as the backing store for MouseOverForeground. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MouseOverForegroundProperty = + DependencyProperty.RegisterAttached("MouseOverForeground", typeof(Brush), typeof(RevealElement), new FrameworkPropertyMetadata(Brushes.Black, FrameworkPropertyMetadataOptions.Inherits)); + + + public static Brush GetMouseOverBackground(DependencyObject obj) + { + return (Brush)obj.GetValue(MouseOverBackgroundProperty); + } + public static void SetMouseOverBackground(DependencyObject obj, Brush value) + { + obj.SetValue(MouseOverBackgroundProperty, value); + } + // Using a DependencyProperty as the backing store for MouseOverBackground. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MouseOverBackgroundProperty = + DependencyProperty.RegisterAttached("MouseOverBackground", typeof(Brush), typeof(RevealElement), new FrameworkPropertyMetadata(Brushes.White, FrameworkPropertyMetadataOptions.Inherits)); + + + + + public static double GetBorderRadius(DependencyObject obj) + { + return (double)obj.GetValue(BorderRadiusProperty); + } + public static void SetBorderRadius(DependencyObject obj, double value) + { + obj.SetValue(BorderRadiusProperty, value); + } + // Using a DependencyProperty as the backing store for BorderRadius. This enables animation, styling, binding, etc... + public static readonly DependencyProperty BorderRadiusProperty = + DependencyProperty.RegisterAttached("BorderRadius", typeof(double), typeof(RevealElement), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.Inherits)); + + + + public static double GetBorderOpacity(DependencyObject obj) + { + return (double)obj.GetValue(BorderOpacityProperty); + } + public static void SetBorderOpacity(DependencyObject obj, double value) + { + obj.SetValue(BorderOpacityProperty, value); + } + // Using a DependencyProperty as the backing store for BorderOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty BorderOpacityProperty = + DependencyProperty.RegisterAttached("BorderOpacity", typeof(double), typeof(RevealElement), new PropertyMetadata(0.0)); + + + public static double GetMouseOverBorderOpacity(DependencyObject obj) + { + return (double)obj.GetValue(MouseOverBorderOpacityProperty); + } + public static void SetMouseOverBorderOpacity(DependencyObject obj, double value) + { + obj.SetValue(MouseOverBorderOpacityProperty, value); + } + // Using a DependencyProperty as the backing store for MouseOverBorderOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty MouseOverBorderOpacityProperty = + DependencyProperty.RegisterAttached("MouseOverBorderOpacity", typeof(double), typeof(RevealElement), new PropertyMetadata(0.5)); + + + public static double GetPressBorderOpacity(DependencyObject obj) + { + return (double)obj.GetValue(PressBorderOpacityProperty); + } + public static void SetPressBorderOpacity(DependencyObject obj, double value) + { + obj.SetValue(PressBorderOpacityProperty, value); + } + // Using a DependencyProperty as the backing store for PressBorderOpacity. This enables animation, styling, binding, etc... + public static readonly DependencyProperty PressBorderOpacityProperty = + DependencyProperty.RegisterAttached("PressBorderOpacity", typeof(double), typeof(RevealElement), new PropertyMetadata(0.5)); + + + public static Brush GetPressTintBrush(DependencyObject obj) + { + return (Brush)obj.GetValue(PressTintBrushProperty); + } + public static void SetPressTintBrush(DependencyObject obj, Brush value) + { + obj.SetValue(PressTintBrushProperty, value); + } + // Using a DependencyProperty as the backing store for PressTintBrush. This enables animation, styling, binding, etc... + public static readonly DependencyProperty PressTintBrushProperty = + DependencyProperty.RegisterAttached("PressTintBrush", typeof(Brush), typeof(RevealElement), new PropertyMetadata(Brushes.Gray)); + + + } +} diff --git a/FluentWPF/Properties/AssemblyInfo.cs b/FluentWPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ea0bc9e --- /dev/null +++ b/FluentWPF/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +using System.Runtime.InteropServices; +using System.Windows; + + + +// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから +// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 +// その型の ComVisible 属性を true に設定してください。 +[assembly: ComVisible(false)] + +//ローカライズ可能なアプリケーションのビルドを開始するには、 +//.csproj ファイルの CultureYouAreCodingWith を +// 内部で設定します。たとえば、 +//ソース ファイルで英語を使用している場合、 を en-US に設定します。次に、 +//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を +//プロジェクト ファイルの UICulture 設定と一致するよう更新します。 + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所 + //(リソースがページ、 + // またはアプリケーション リソース ディクショナリに見つからない場合に使用されます) + ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所 + //(リソースがページ、 + // アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます) +)] + + + diff --git a/FluentWPF/Properties/Resources.Designer.cs b/FluentWPF/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b379d14 --- /dev/null +++ b/FluentWPF/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 +// +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 +// +//------------------------------------------------------------------------------ + +namespace SourceChord.FluentWPF.Properties { + using System; + + + /// + /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 + /// + // このクラスは StronglyTypedResourceBuilder クラスが ResGen + // または Visual Studio のようなツールを使用して自動生成されました。 + // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に + // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SourceChord.FluentWPF.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、 + /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/DeviceExcludeTool/Properties/Resources.resx b/FluentWPF/Properties/Resources.resx similarity index 100% rename from DeviceExcludeTool/Properties/Resources.resx rename to FluentWPF/Properties/Resources.resx diff --git a/SDK_Debug/Properties/Settings.Designer.cs b/FluentWPF/Properties/Settings.Designer.cs similarity index 58% rename from SDK_Debug/Properties/Settings.Designer.cs rename to FluentWPF/Properties/Settings.Designer.cs index cdd52fb..99f0685 100644 --- a/SDK_Debug/Properties/Settings.Designer.cs +++ b/FluentWPF/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// このコードはツールによって生成されました。 +// ランタイム バージョン:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 +// コードが再生成されるときに損失したりします。 // //------------------------------------------------------------------------------ -namespace SDK_Debug.Properties -{ - - +namespace SourceChord.FluentWPF.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/BackgroundUploadHelper/Properties/Settings.settings b/FluentWPF/Properties/Settings.settings similarity index 100% rename from BackgroundUploadHelper/Properties/Settings.settings rename to FluentWPF/Properties/Settings.settings diff --git a/FluentWPF/Resources/AccentColors.cs b/FluentWPF/Resources/AccentColors.cs new file mode 100644 index 0000000..23610bf --- /dev/null +++ b/FluentWPF/Resources/AccentColors.cs @@ -0,0 +1,207 @@ +using SourceChord.FluentWPF.Utility; +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows.Media; + +namespace SourceChord.FluentWPF +{ + public class AccentColors : ThemeHandler + { + [DllImport("uxtheme.dll", EntryPoint = "#95", CharSet = CharSet.Unicode)] + internal static extern uint GetImmersiveColorFromColorSetEx(uint dwImmersiveColorSet, uint dwImmersiveColorType, bool bIgnoreHighContrast, uint dwHighContrastCacheMode); + [DllImport("uxtheme.dll", EntryPoint = "#96", CharSet = CharSet.Unicode)] + internal static extern uint GetImmersiveColorTypeFromName(string name); + [DllImport("uxtheme.dll", EntryPoint = "#98", CharSet = CharSet.Unicode)] + internal static extern uint GetImmersiveUserColorSetPreference(bool bForceCheckRegistry, bool bSkipCheckOnFail); + + + private static readonly int WM_DWMCOLORIZATIONCOLORCHANGED = 0x0320; + + + + static AccentColors() + { + AccentColors.Instance = new AccentColors(); + Initialize(); + } + + public AccentColors() + { + + } + + protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == WM_DWMCOLORIZATIONCOLORCHANGED) + { + // 再取得 + Initialize(); + } + + return IntPtr.Zero; + } + + public static Color GetColorByTypeName(string name) + { + uint colorSet = GetImmersiveUserColorSetPreference(false, false); + uint colorType = GetImmersiveColorTypeFromName(name); + uint rawColor = GetImmersiveColorFromColorSetEx(colorSet, colorType, false, 0); + + byte[] bytes = BitConverter.GetBytes(rawColor); + return Color.FromArgb(bytes[3], bytes[0], bytes[1], bytes[2]); + } + + + #region Colors + private static Color immersiveSystemAccent; + public static Color ImmersiveSystemAccent + { + get { return immersiveSystemAccent; } + private set { if (!object.Equals(immersiveSystemAccent, value)) { immersiveSystemAccent = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentDark1; + public static Color ImmersiveSystemAccentDark1 + { + get { return immersiveSystemAccentDark1; } + private set { if (!object.Equals(immersiveSystemAccentDark1, value)) { immersiveSystemAccentDark1 = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentDark2; + public static Color ImmersiveSystemAccentDark2 + { + get { return immersiveSystemAccentDark2; } + private set { if (!object.Equals(immersiveSystemAccentDark2, value)) { immersiveSystemAccentDark2 = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentDark3; + public static Color ImmersiveSystemAccentDark3 + { + get { return immersiveSystemAccentDark3; } + private set { if (!object.Equals(immersiveSystemAccentDark3, value)) { immersiveSystemAccentDark3 = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentLight1; + public static Color ImmersiveSystemAccentLight1 + { + get { return immersiveSystemAccentLight1; } + private set { if (!object.Equals(immersiveSystemAccentLight1, value)) { immersiveSystemAccentLight1 = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentLight2; + public static Color ImmersiveSystemAccentLight2 + { + get { return immersiveSystemAccentLight2; } + private set { if (!object.Equals(immersiveSystemAccentLight2, value)) { immersiveSystemAccentLight2 = value; OnStaticPropertyChanged(); } } + } + + private static Color immersiveSystemAccentLight3; + public static Color ImmersiveSystemAccentLight3 + { + get { return immersiveSystemAccentLight3; } + private set { if (!object.Equals(immersiveSystemAccentLight3, value)) { immersiveSystemAccentLight3 = value; OnStaticPropertyChanged(); } } + } + #endregion + + + #region Brushes + private static Brush immersiveSystemAccentBrush; + public static Brush ImmersiveSystemAccentBrush + { + get { return immersiveSystemAccentBrush; } + private set { if (!object.Equals(immersiveSystemAccentBrush, value)) { immersiveSystemAccentBrush = value; OnStaticPropertyChanged(); } } + } + + private static Brush immersiveSystemAccentDark1Brush; + public static Brush ImmersiveSystemAccentDark1Brush + { + get { return immersiveSystemAccentDark1Brush; } + private set { if (!object.Equals(immersiveSystemAccentDark1Brush, value)) { immersiveSystemAccentDark1Brush = value; OnStaticPropertyChanged(); } } + } + private static Brush immersiveSystemAccentDark2Brush; + public static Brush ImmersiveSystemAccentDark2Brush + { + get { return immersiveSystemAccentDark2Brush; } + private set { if (!object.Equals(immersiveSystemAccentDark2Brush, value)) { immersiveSystemAccentDark2Brush = value; OnStaticPropertyChanged(); } } + } + private static Brush immersiveSystemAccentDark3Brush; + public static Brush ImmersiveSystemAccentDark3Brush + { + get { return immersiveSystemAccentDark3Brush; } + private set { if (!object.Equals(immersiveSystemAccentDark3Brush, value)) { immersiveSystemAccentDark3Brush = value; OnStaticPropertyChanged(); } } + } + + private static Brush immersiveSystemAccentLight1Brush; + public static Brush ImmersiveSystemAccentLight1Brush + { + get { return immersiveSystemAccentLight1Brush; } + private set { if (!object.Equals(immersiveSystemAccentLight1Brush, value)) { immersiveSystemAccentLight1Brush = value; OnStaticPropertyChanged(); } } + } + private static Brush immersiveSystemAccentLight2Brush; + public static Brush ImmersiveSystemAccentLight2Brush + { + get { return immersiveSystemAccentLight2Brush; } + private set { if (!object.Equals(immersiveSystemAccentLight2Brush, value)) { immersiveSystemAccentLight2Brush = value; OnStaticPropertyChanged(); } } + } + private static Brush immersiveSystemAccentLight3Brush; + public static Brush ImmersiveSystemAccentLight3Brush + { + get { return immersiveSystemAccentLight3Brush; } + private set { if (!object.Equals(immersiveSystemAccentLight3Brush, value)) { immersiveSystemAccentLight3Brush = value; OnStaticPropertyChanged(); } } + } + #endregion + + + + internal static void Initialize() + { + // 各種Color定義 + if (!SystemInfo.IsWin7()) + { + ImmersiveSystemAccent = GetColorByTypeName("ImmersiveSystemAccent"); + ImmersiveSystemAccentDark1 = GetColorByTypeName("ImmersiveSystemAccentDark1"); + ImmersiveSystemAccentDark2 = GetColorByTypeName("ImmersiveSystemAccentDark2"); + ImmersiveSystemAccentDark3 = GetColorByTypeName("ImmersiveSystemAccentDark3"); + ImmersiveSystemAccentLight1 = GetColorByTypeName("ImmersiveSystemAccentLight1"); + ImmersiveSystemAccentLight2 = GetColorByTypeName("ImmersiveSystemAccentLight2"); + ImmersiveSystemAccentLight3 = GetColorByTypeName("ImmersiveSystemAccentLight3"); + } + else + { + // Windows7の場合は、OSにテーマカラーの設定はないので、固定値を使用する。 + ImmersiveSystemAccent = (Color)ColorConverter.ConvertFromString("#FF2990CC"); + ImmersiveSystemAccentDark1 = (Color)ColorConverter.ConvertFromString("#FF2481B6"); + ImmersiveSystemAccentDark2 = (Color)ColorConverter.ConvertFromString("#FF2071A1"); + ImmersiveSystemAccentDark3 = (Color)ColorConverter.ConvertFromString("#FF205B7E"); + ImmersiveSystemAccentLight1 = (Color)ColorConverter.ConvertFromString("#FF2D9FE1"); + ImmersiveSystemAccentLight2 = (Color)ColorConverter.ConvertFromString("#FF51A5D6"); + ImmersiveSystemAccentLight3 = (Color)ColorConverter.ConvertFromString("#FF7BB1D0"); + } + + // ブラシ類の定義 + ImmersiveSystemAccentBrush = CreateBrush(ImmersiveSystemAccent); + ImmersiveSystemAccentDark1Brush = CreateBrush(ImmersiveSystemAccentDark1); + ImmersiveSystemAccentDark2Brush = CreateBrush(ImmersiveSystemAccentDark2); + ImmersiveSystemAccentDark3Brush = CreateBrush(ImmersiveSystemAccentDark3); + ImmersiveSystemAccentLight1Brush = CreateBrush(ImmersiveSystemAccentLight1); + ImmersiveSystemAccentLight2Brush = CreateBrush(ImmersiveSystemAccentLight2); + ImmersiveSystemAccentLight3Brush = CreateBrush(ImmersiveSystemAccentLight3); + } + + internal static Brush CreateBrush(Color color) + { + SolidColorBrush brush = new SolidColorBrush(color); + brush.Freeze(); + return brush; + } + + + public static event EventHandler StaticPropertyChanged; + protected static void OnStaticPropertyChanged([CallerMemberName] string propertyName = null) + { + StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/FluentWPF/Resources/ResourceDictionaryEx.cs b/FluentWPF/Resources/ResourceDictionaryEx.cs new file mode 100644 index 0000000..d1e3d7b --- /dev/null +++ b/FluentWPF/Resources/ResourceDictionaryEx.cs @@ -0,0 +1,174 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Windows; + +namespace SourceChord.FluentWPF +{ + public enum ElementTheme + { + Default, + Light, + Dark, + } + + + + public class ThemeDictionary : ResourceDictionary, INotifyPropertyChanged + { + private string themeName; + public string ThemeName + { + get { return themeName; } + set { this.themeName = value; this.OnPropertyChanged(); } + } + + + + public new Uri Source + { + get { return base.Source; } + set { base.Source = value; this.OnPropertyChanged(); } + } + + #region + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChangedEventHandler eventHandler = this.PropertyChanged; + if (eventHandler != null) + { + eventHandler(this, new PropertyChangedEventArgs(propertyName)); + } + } + #endregion + } + + public class ThemeCollection : ObservableCollection + { + private readonly IList _previousList; + + public ThemeCollection() + { + this._previousList = new List(); + this.CollectionChanged += ThemeCollection_CollectionChanged; + } + + private void ThemeCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset) + { + // Resetの場合は、全リスト要素のイベントを解除 + foreach (ThemeDictionary item in this._previousList) + { + item.PropertyChanged -= Item_PropertyChanged; + } + this._previousList.Clear(); + } + + + if (e.OldItems != null) + { + foreach (ThemeDictionary item in e.OldItems) + { + this._previousList.Remove(item); + item.PropertyChanged -= Item_PropertyChanged; + } + } + if (e.NewItems != null) + { + foreach (ThemeDictionary item in e.NewItems) + { + this._previousList.Add(item); + item.PropertyChanged += Item_PropertyChanged; + } + } + } + + private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + System.Collections.Specialized.NotifyCollectionChangedEventArgs args = new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Reset); + OnCollectionChanged(args); + } + } + + public class ResourceDictionaryEx : ResourceDictionary + { + public ThemeCollection ThemeDictionaries { get; set; } = new ThemeCollection(); + + private ElementTheme? requestedTheme; + public ElementTheme? RequestedTheme + { + get { return requestedTheme; } + set { requestedTheme = value; this.ChangeTheme(); } + } + + public ResourceDictionaryEx() + { + SystemTheme.ThemeChanged += SystemTheme_ThemeChanged; + this.ThemeDictionaries.CollectionChanged += ThemeDictionaries_CollectionChanged; + ResourceDictionaryEx.GlobalThemeChanged += ResourceDictionaryEx_GlobalThemeChanged; + } + + private void SystemTheme_ThemeChanged(object sender, EventArgs e) + { + this.ChangeTheme(); + } + + private void ThemeDictionaries_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + this.ChangeTheme(); + } + + private void ResourceDictionaryEx_GlobalThemeChanged(object sender, EventArgs e) + { + this.ChangeTheme(); + } + + + private void ChangeTheme() + { + ElementTheme? theme = this.RequestedTheme ?? ResourceDictionaryEx.GlobalTheme; + switch (theme) + { + case ElementTheme.Light: + this.ChangeTheme(ApplicationTheme.Light.ToString()); + break; + case ElementTheme.Dark: + this.ChangeTheme(ApplicationTheme.Dark.ToString()); + break; + case ElementTheme.Default: + default: + this.ChangeTheme(SystemTheme.AppTheme.ToString()); + break; + } + } + + private void ChangeTheme(string themeName) + { + this.MergedDictionaries.Clear(); + ThemeDictionary theme = this.ThemeDictionaries.OfType() + .FirstOrDefault(o => o.ThemeName == themeName); + if (theme != null) + { + this.MergedDictionaries.Add(theme); + } + } + + #region static members + private static ElementTheme? globalTheme; + public static ElementTheme? GlobalTheme + { + get { return globalTheme; } + set { globalTheme = value; GlobalThemeChanged?.Invoke(null, null); } + } + + public static event EventHandler GlobalThemeChanged; + #endregion + } + +} diff --git a/FluentWPF/Resources/SystemTheme.cs b/FluentWPF/Resources/SystemTheme.cs new file mode 100644 index 0000000..b1aace0 --- /dev/null +++ b/FluentWPF/Resources/SystemTheme.cs @@ -0,0 +1,94 @@ +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace SourceChord.FluentWPF +{ + public enum ApplicationTheme + { + Light, + Dark, + } + + public enum WindowsTheme + { + Light, + Dark, + } + + public class SystemTheme : ThemeHandler + { + private static readonly int WM_WININICHANGE = 0x001A; + private static readonly int WM_SETTINGCHANGE = WM_WININICHANGE; + + static SystemTheme() + { + SystemTheme.Instance = new SystemTheme(); + AppTheme = GetAppTheme(); + WindowsTheme = GetWindowsTheme(); + } + + protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == WM_SETTINGCHANGE) + { + string systemParmeter = Marshal.PtrToStringAuto(lParam); + if (systemParmeter == "ImmersiveColorSet") + { + // 再度レジストリから Dark/Lightの設定を取得 + AppTheme = GetAppTheme(); + WindowsTheme = GetWindowsTheme(); + SystemTheme.ThemeChanged?.Invoke(null, null); + + handled = true; + } + } + + return IntPtr.Zero; + } + + private static ApplicationTheme GetAppTheme() + { + Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", false); + // キーが存在しないときはnullが返る + if (regkey == null) return ApplicationTheme.Light; + int intValue = (int)regkey.GetValue("AppsUseLightTheme", 1); + + return intValue == 0 ? ApplicationTheme.Dark : ApplicationTheme.Light; + } + + private static WindowsTheme GetWindowsTheme() + { + Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", false); + // キーが存在しないときはnullが返る + if (regkey == null) return WindowsTheme.Light; + int intValue = (int)regkey.GetValue("SystemUsesLightTheme", 1); + + return intValue == 0 ? WindowsTheme.Dark : WindowsTheme.Light; + } + + private static ApplicationTheme appTheme; + public static ApplicationTheme AppTheme + { + get { return appTheme; } + private set { if (!object.Equals(appTheme, value)) { appTheme = value; OnStaticPropertyChanged(); } } + } + + private static WindowsTheme windowsTheme; + public static WindowsTheme WindowsTheme + { + get { return windowsTheme; } + private set { if (!object.Equals(windowsTheme, value)) { windowsTheme = value; OnStaticPropertyChanged(); } } + } + + public static event EventHandler StaticPropertyChanged; + protected static void OnStaticPropertyChanged([CallerMemberName] string propertyName = null) + { + StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName)); + } + + + public static event EventHandler ThemeChanged; + } +} diff --git a/FluentWPF/Resources/ThemeHandler.cs b/FluentWPF/Resources/ThemeHandler.cs new file mode 100644 index 0000000..7f5fbdb --- /dev/null +++ b/FluentWPF/Resources/ThemeHandler.cs @@ -0,0 +1,58 @@ +using System; +using System.Windows; +using System.Windows.Interop; + +namespace SourceChord.FluentWPF +{ + public abstract class ThemeHandler + { + protected static ThemeHandler Instance { get; set; } + + static ThemeHandler() + { + } + + public ThemeHandler() + { + // 初期化メソッドを呼ぶ + Window win = Application.Current.MainWindow; + if (win != null) + { + this.Initialize(win); + } + else + { + EventHandler handler = null; + handler = (e, args) => + { + this.Initialize(Application.Current.MainWindow); + Application.Current.Activated -= handler; + }; + Application.Current.Activated += handler; + } + } + + private void Initialize(Window win) + { + if (win.IsLoaded) + { + InitializeCore(win); + } + else + { + win.Loaded += (_, __) => + { + InitializeCore(win); + }; + } + } + + protected virtual void InitializeCore(Window win) + { + HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(win).Handle); + source.AddHook(this.WndProc); + } + + protected abstract IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled); + } +} diff --git a/FluentWPF/Styles/Brushes.xaml b/FluentWPF/Styles/Brushes.xaml new file mode 100644 index 0000000..dc2f10b --- /dev/null +++ b/FluentWPF/Styles/Brushes.xaml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Button.xaml b/FluentWPF/Styles/Button.xaml new file mode 100644 index 0000000..c57e16e --- /dev/null +++ b/FluentWPF/Styles/Button.xaml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Colors.Dark.xaml b/FluentWPF/Styles/Colors.Dark.xaml new file mode 100644 index 0000000..11da592 --- /dev/null +++ b/FluentWPF/Styles/Colors.Dark.xaml @@ -0,0 +1,43 @@ + + + #33FFFFFF + #66FFFFFF + #99FFFFFF + #CCFFFFFF + #FFFFFFFF + + + #33000000 + #66000000 + #99000000 + #CC000000 + #FF000000 + + + #FF171717 + #FF2B2B2B + #FF1F1F1F + #FF767676 + + #FFF2F2F2 + + #33000000 + #66000000 + #CC000000 + #FF000000 + + #FF858585 + #FF333333 + + #FFFFFFFF + + #19FFFFFF + #33FFFFFF + + #FF000000 + #FF1F1F1F + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Colors.Light.xaml b/FluentWPF/Styles/Colors.Light.xaml new file mode 100644 index 0000000..857b746 --- /dev/null +++ b/FluentWPF/Styles/Colors.Light.xaml @@ -0,0 +1,43 @@ + + + #33000000 + #66000000 + #99000000 + #CC000000 + #FF000000 + + + #33FFFFFF + #66FFFFFF + #99FFFFFF + #CCFFFFFF + #FFFFFFFF + + + #FFF2F2F2 + #FFF2F2F2 + #FFE6E6E6 + #FFCCCCCC + + #FF171717 + + #33000000 + #66000000 + #CC000000 + #FF000000 + + #FF7A7A7A + #FFCCCCCC + + #FFFFFFFF + + #19000000 + #33000000 + + #FFFFFFFF + #FFE6E6E6 + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Colors.xaml b/FluentWPF/Styles/Colors.xaml new file mode 100644 index 0000000..28baf92 --- /dev/null +++ b/FluentWPF/Styles/Colors.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/ComboBox.xaml b/FluentWPF/Styles/ComboBox.xaml new file mode 100644 index 0000000..1ff5a63 --- /dev/null +++ b/FluentWPF/Styles/ComboBox.xaml @@ -0,0 +1,668 @@ + + + + 2.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FluentWPF/Styles/ComboBox.xaml.cs b/FluentWPF/Styles/ComboBox.xaml.cs new file mode 100644 index 0000000..21a60f1 --- /dev/null +++ b/FluentWPF/Styles/ComboBox.xaml.cs @@ -0,0 +1,96 @@ +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; + +namespace SourceChord.FluentWPF +{ + public class ComboBoxItemVisualStateManager : VisualStateManager + { + private const string Normal = "Normal"; + internal const string PointerOver = "PointerOver"; + internal const string KeyboardFocus = "KeyboardFocus"; + private const string Disabled = "Disabled"; + internal const string Pressed = "Pressed"; + private const string Selected = "Selected"; + private const string SelectedDisabled = "SelectedDisabled"; + private const string SelectedPointerOver = "SelectedPointerOver"; + private const string SelectedPressed = "SelectedPressed"; + + protected override bool GoToStateCore(FrameworkElement control, FrameworkElement stateGroupsRoot, string stateName, VisualStateGroup group, VisualState state, bool useTransitions) + { + if (group is null || state is null) + { + return false; + } + + ComboBoxItem item = (ComboBoxItem)control; + + // If no state is defined yet, go to Normal without additional checks + if (group.CurrentState == null) + { + VisualState normal = group.States.OfType().Single(s => s.Name == Normal); + return base.GoToStateCore(item, stateGroupsRoot, Normal, group, normal, false); + } + + var status = new + { + Disabled = !item.IsEnabled, + //KeyboardFocus = item.IsKeyboardFocusWithin, + PointerOver = item.IsMouseOver || item.IsStylusOver, + Pressed = stateName == Pressed, + Selected = item.IsSelected + }; + + string nextStateName = status switch + { + { Disabled: true, Selected: true } => SelectedDisabled, + { Disabled: true } => Disabled, + { Pressed: true, Selected: true } => SelectedPressed, + { Pressed: true } => Pressed, + { PointerOver: true, Selected: true } => SelectedPointerOver, + { PointerOver: true } => PointerOver, + //{ KeyboardFocus: true } => KeyboardFocus, + { Selected: true } => Selected, + _ => Normal + }; + + // Avoid transition from state to itself (which would produce a false result either way) + if (group.CurrentState.Name == nextStateName) + { + return false; + } + + VisualState nextState = group.States.OfType().Single(s => s.Name == nextStateName); + return base.GoToStateCore(item, stateGroupsRoot, nextStateName, group, nextState, false); + } + } + + public partial class ComboBoxResourceDictionary : ResourceDictionary + { + private void ComboBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + // Prevent Pressed visual state with touch devices + if (e.StylusDevice == null) + { + VisualStateManager.GoToState((ComboBoxItem)sender, ComboBoxItemVisualStateManager.Pressed, false); + } + } + + /// + /// Handles the MouseEnter event on a . + /// It is required since the hovering is not always handled properly with the modified visual state. + /// + /// + /// + private void LayoutRoot_MouseEnter(object sender, MouseEventArgs e) + { + // Prevent PointerOver visual state with touch devices + if (e.StylusDevice == null) + { + DependencyObject item = ((FrameworkElement)sender).TemplatedParent; + VisualStateManager.GoToState((ComboBoxItem)item, ComboBoxItemVisualStateManager.PointerOver, false); + } + } + } +} diff --git a/FluentWPF/Styles/Controls.xaml b/FluentWPF/Styles/Controls.xaml new file mode 100644 index 0000000..250fa9a --- /dev/null +++ b/FluentWPF/Styles/Controls.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/ListBox.xaml b/FluentWPF/Styles/ListBox.xaml new file mode 100644 index 0000000..b90efea --- /dev/null +++ b/FluentWPF/Styles/ListBox.xaml @@ -0,0 +1,52 @@ + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Menu.xaml b/FluentWPF/Styles/Menu.xaml new file mode 100644 index 0000000..6a4cbdd --- /dev/null +++ b/FluentWPF/Styles/Menu.xaml @@ -0,0 +1,405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/ScrollBar.xaml b/FluentWPF/Styles/ScrollBar.xaml new file mode 100644 index 0000000..a9c5d16 --- /dev/null +++ b/FluentWPF/Styles/ScrollBar.xaml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/TextBlock.xaml b/FluentWPF/Styles/TextBlock.xaml new file mode 100644 index 0000000..288a9a3 --- /dev/null +++ b/FluentWPF/Styles/TextBlock.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/TextBox.xaml b/FluentWPF/Styles/TextBox.xaml new file mode 100644 index 0000000..0483cdb --- /dev/null +++ b/FluentWPF/Styles/TextBox.xaml @@ -0,0 +1,253 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Styles/Window.xaml b/FluentWPF/Styles/Window.xaml new file mode 100644 index 0000000..507a682 --- /dev/null +++ b/FluentWPF/Styles/Window.xaml @@ -0,0 +1,378 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FluentWPF/Themes/Generic.xaml b/FluentWPF/Themes/Generic.xaml new file mode 100644 index 0000000..0340385 --- /dev/null +++ b/FluentWPF/Themes/Generic.xaml @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FluentWPF/Utility/AcrylicHelper.cs b/FluentWPF/Utility/AcrylicHelper.cs new file mode 100644 index 0000000..7f0c82e --- /dev/null +++ b/FluentWPF/Utility/AcrylicHelper.cs @@ -0,0 +1,115 @@ +using System; +using System.Runtime.InteropServices; + +namespace SourceChord.FluentWPF.Utility +{ + internal enum AccentFlagsType + { + Window = 0, + Popup, + } + + [StructLayout(LayoutKind.Sequential)] + internal struct WindowCompositionAttributeData + { + public WindowCompositionAttribute Attribute; + public IntPtr Data; + public int SizeOfData; + } + + internal enum WindowCompositionAttribute + { + // ... + WCA_ACCENT_POLICY = 19 + // ... + } + + internal enum AccentState + { + ACCENT_DISABLED = 0, + ACCENT_ENABLE_GRADIENT = 1, + ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, + ACCENT_ENABLE_BLURBEHIND = 3, + ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, + ACCENT_INVALID_STATE = 5 + } + + [StructLayout(LayoutKind.Sequential)] + internal struct AccentPolicy + { + public AccentState AccentState; + public int AccentFlags; + public uint GradientColor; + public int AnimationId; + } + + internal static class AcrylicHelper + { + [DllImport("user32.dll")] + internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); + + internal static void EnableBlur(IntPtr hwnd, AccentFlagsType style = AccentFlagsType.Window) + { + AccentPolicy accent = new AccentPolicy(); + int accentStructSize = Marshal.SizeOf(accent); + // ウィンドウ背景のぼかしを行うのはWindows10の場合のみ + // OSのバージョンに従い、AccentStateを切り替える + VersionInfo currentVersion = SystemInfo.Version.Value; + if (currentVersion >= VersionInfos.Windows10_1903) + { + // Windows10 1903以降では、ACCENT_ENABLE_ACRYLICBLURBEHINDを用いると、ウィンドウのドラッグ移動などでマウス操作に追従しなくなる。 + // SetWindowCompositionAttribute関数の動作が修正されるまで、ACCENT_ENABLE_ACRYLICBLURBEHINDは使用しない。 + accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND; + } + else if (currentVersion >= VersionInfos.Windows10_1809) + { + accent.AccentState = AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND; + } + else if (currentVersion >= VersionInfos.Windows10) + { + accent.AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND; + } + else + { + accent.AccentState = AccentState.ACCENT_ENABLE_TRANSPARENTGRADIENT; + } + + accent.AccentState = AccentState.ACCENT_ENABLE_ACRYLICBLURBEHIND; + + if (style == AccentFlagsType.Window) + { + accent.AccentFlags = 2; + } + else + { + accent.AccentFlags = 0x20 | 0x40 | 0x80 | 0x100; + +/* Unmerged change from project 'FluentWPF (netcoreapp3.0)' +Before: + } + + //accent.GradientColor = 0x99FFFFFF; // 60%の透明度が基本 +After: + } + + //accent.GradientColor = 0x99FFFFFF; // 60%の透明度が基本 +*/ + } + + //accent.GradientColor = 0x99FFFFFF; // 60%の透明度が基本 + accent.GradientColor = 0x00FFFFFF; // Tint Colorはここでは設定せず、Bindingで外部から変えられるようにXAML側のレイヤーとして定義 + + IntPtr accentPtr = Marshal.AllocHGlobal(accentStructSize); + Marshal.StructureToPtr(accent, accentPtr, false); + + WindowCompositionAttributeData data = new WindowCompositionAttributeData(); + data.Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY; + data.SizeOfData = accentStructSize; + data.Data = accentPtr; + + SetWindowCompositionAttribute(hwnd, ref data); + + Marshal.FreeHGlobal(accentPtr); + } + } +} diff --git a/FluentWPF/Utility/IconHelper.cs b/FluentWPF/Utility/IconHelper.cs new file mode 100644 index 0000000..2535968 --- /dev/null +++ b/FluentWPF/Utility/IconHelper.cs @@ -0,0 +1,67 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace SourceChord.FluentWPF.Utility +{ + internal class IconHelper + { + private static ImageSource appIcon; + public static ImageSource AppIcon + { + get + { + if (appIcon == null) + { + string path = System.Reflection.Assembly.GetEntryAssembly().Location; + appIcon = GetIcon(path); + } + return appIcon; + } + protected set { appIcon = value; } + } + + public static ImageSource GetIcon(string path) + { + uint flags = SHGFI_ICON | SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON; + + int ret = SHGetFileInfo(path, + FILE_ATTRIBUTE_NORMAL, + out SHFILEINFO shfi, + (uint)Marshal.SizeOf(typeof(SHFILEINFO)), + flags); + + if (ret != 0) + { + return System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(shfi.hIcon, + Int32Rect.Empty, + BitmapSizeOptions.FromEmptyOptions()); + } + return null; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public struct SHFILEINFO + { + public IntPtr hIcon; + public int iIcon; + public uint dwAttributes; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] + public string szDisplayName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] + public string szTypeName; + } + + [DllImport("shell32.dll", CharSet = CharSet.Auto)] + public static extern int SHGetFileInfo(string pszPath, uint dwFileAttributes, out SHFILEINFO psfi, uint cbFileInfo, uint uFlags); + + private const uint FILE_ATTRIBUTE_NORMAL = 0x00000080; + + private const uint SHGFI_ICON = 0x000000100; + private const uint SHGFI_LARGEICON = 0x000000000; + private const uint SHGFI_SMALLICON = 0x000000001; + private const uint SHGFI_USEFILEATTRIBUTES = 0x000000010; + } +} diff --git a/FluentWPF/Utility/SystemInfo.cs b/FluentWPF/Utility/SystemInfo.cs new file mode 100644 index 0000000..073ce59 --- /dev/null +++ b/FluentWPF/Utility/SystemInfo.cs @@ -0,0 +1,55 @@ +using System; + +namespace SourceChord.FluentWPF.Utility +{ + internal class SystemInfo + { + public static Lazy Version { get; private set; } = new Lazy(() => GetVersionInfo()); + + internal static VersionInfo GetVersionInfo() + { + Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\", false); + // キーが存在しないときはnullが返る + if (regkey == null) return default(VersionInfo); + + // Windows10以降は、以下のレジストリ値でOSバージョンを判断する + object majorValue = regkey.GetValue("CurrentMajorVersionNumber"); + object minorValue = regkey.GetValue("CurrentMinorVersionNumber"); + string buildValue = (string)regkey.GetValue("CurrentBuild", 7600); + bool canReadBuild = int.TryParse(buildValue, out int build); + + // Windows10用のレジストリ値が取れない場合は以下の値を使う + // ※この方法だと、Windows8/8.1の区別がつかない。 + Version defaultVersion = System.Environment.OSVersion.Version; + + if (majorValue is int major && minorValue is int minor && canReadBuild) + { + return new VersionInfo(major, minor, build); + } + else + { + return new VersionInfo(defaultVersion.Major, defaultVersion.Minor, defaultVersion.Revision); + } + } + + /// + /// 実行環境のOSがWindows10か否かを判定 + /// + /// + internal static bool IsWin10() + { + return Version.Value.Major == 10; + } + + + internal static bool IsWin7() + { + return Version.Value.Major == 6 && Version.Value.Minor == 1; + } + + internal static bool IsWin8x() + { + return Version.Value.Major == 6 && (Version.Value.Minor == 2 || Version.Value.Minor == 3); + } + } +} diff --git a/FluentWPF/Utility/VersionInfo.cs b/FluentWPF/Utility/VersionInfo.cs new file mode 100644 index 0000000..fc3ec8a --- /dev/null +++ b/FluentWPF/Utility/VersionInfo.cs @@ -0,0 +1,99 @@ +using System; + +namespace SourceChord.FluentWPF.Utility +{ + internal struct VersionInfo : IEquatable, IComparable, IComparable + { + public int Major; + public int Minor; + public int Build; + + public VersionInfo(int major, int minor, int build) + { + this.Major = major; + this.Minor = minor; + this.Build = build; + } + + public bool Equals(VersionInfo other) + { + return this.Major == other.Major && this.Minor == other.Minor && this.Build == other.Build; + } + + public override bool Equals(object obj) + { + return (obj is VersionInfo other) && this.Equals(other); + } + + public override int GetHashCode() + { + return this.Major.GetHashCode() ^ this.Minor.GetHashCode() ^ this.Build.GetHashCode(); + } + + public static bool operator ==(VersionInfo left, VersionInfo right) + { + return left.Equals(right); + } + + public static bool operator !=(VersionInfo left, VersionInfo right) + { + return !(left == right); + } + + + public int CompareTo(VersionInfo other) + { + if (this.Major != other.Major) + { + return this.Major.CompareTo(other.Major); + } + else if (this.Minor != other.Minor) + { + return this.Minor.CompareTo(other.Minor); + } + else if (this.Build != other.Build) + { + return this.Build.CompareTo(other.Build); + } + else + { + return 0; + } + } + + public int CompareTo(object obj) + { + if (!(obj is VersionInfo other)) + { + throw new ArgumentException(); + } + + return this.CompareTo(other); + } + + public static bool operator <(VersionInfo left, VersionInfo right) + { + return left.CompareTo(right) < 0; + } + + public static bool operator <=(VersionInfo left, VersionInfo right) + { + return left.CompareTo(right) <= 0; + } + + public static bool operator >(VersionInfo left, VersionInfo right) + { + return left.CompareTo(right) > 0; + } + + public static bool operator >=(VersionInfo left, VersionInfo right) + { + return left.CompareTo(right) >= 0; + } + + public override string ToString() + { + return $"{this.Major}.{this.Minor}.{this.Build}"; + } + } +} diff --git a/FluentWPF/Utility/VersionInfos.cs b/FluentWPF/Utility/VersionInfos.cs new file mode 100644 index 0000000..d221e0b --- /dev/null +++ b/FluentWPF/Utility/VersionInfos.cs @@ -0,0 +1,20 @@ +namespace SourceChord.FluentWPF.Utility +{ + internal sealed class VersionInfos + { + public static VersionInfo Windows7 { get { return new VersionInfo(6, 1, 7600); } } + public static VersionInfo Windows7_SP1 { get { return new VersionInfo(6, 1, 7601); } } + + public static VersionInfo Windows8 { get { return new VersionInfo(6, 2, 9200); } } + public static VersionInfo Windows8_1 { get { return new VersionInfo(6, 3, 9600); } } + + public static VersionInfo Windows10 { get { return new VersionInfo(10, 0, 10240); } } + public static VersionInfo Windows10_1511 { get { return new VersionInfo(10, 0, 10586); } } + public static VersionInfo Windows10_1607 { get { return new VersionInfo(10, 0, 14393); } } + public static VersionInfo Windows10_1703 { get { return new VersionInfo(10, 0, 15063); } } + public static VersionInfo Windows10_1709 { get { return new VersionInfo(10, 0, 16299); } } + public static VersionInfo Windows10_1803 { get { return new VersionInfo(10, 0, 17134); } } + public static VersionInfo Windows10_1809 { get { return new VersionInfo(10, 0, 17763); } } + public static VersionInfo Windows10_1903 { get { return new VersionInfo(10, 0, 18362); } } + } +} diff --git a/Launcher/App.config b/Launcher/App.config new file mode 100644 index 0000000..db632eb --- /dev/null +++ b/Launcher/App.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Launcher/App.xaml b/Launcher/App.xaml new file mode 100644 index 0000000..812095b --- /dev/null +++ b/Launcher/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/Launcher/App.xaml.cs b/Launcher/App.xaml.cs new file mode 100644 index 0000000..3c3c673 --- /dev/null +++ b/Launcher/App.xaml.cs @@ -0,0 +1,18 @@ +using System.Windows; + +namespace Launcher +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public App() + { + + + //Core.UpgradingWindow.Show(); + } + + } +} diff --git a/Launcher/BaseViewModel.cs b/Launcher/BaseViewModel.cs new file mode 100644 index 0000000..fcbd93f --- /dev/null +++ b/Launcher/BaseViewModel.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Launcher +{ + public class BaseViewModel : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + internal bool Set(ref T variable, T value, [CallerMemberName] String propertyName = "") + { + if (variable == null && value != null || variable != null && value == null || (variable != null && value != null && !variable.Equals(value))) + { + variable = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + return true; + } + else + { + return false; + } + } + } +} diff --git a/Launcher/Controls/BlurredDecorationWindow.cs b/Launcher/Controls/BlurredDecorationWindow.cs new file mode 100644 index 0000000..51e02dc --- /dev/null +++ b/Launcher/Controls/BlurredDecorationWindow.cs @@ -0,0 +1,81 @@ +//using System.Windows; +//using System.Windows.Controls; +//using System.Windows.Input; +//using System.Windows.Media; + +//namespace Launcher.Controls +//{ +// [TemplatePart(Name = "PART_Decoration", Type = typeof(FrameworkElement))] +// [TemplatePart(Name = "PART_Content", Type = typeof(FrameworkElement))] +// [TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))] +// [TemplatePart(Name = "PART_MinimizeButton", Type = typeof(Button))] +// [TemplatePart(Name = "PART_IconButton", Type = typeof(Button))] +// public class BlurredDecorationWindow : Window +// { +// #region DependencyProperties +// // ReSharper disable InconsistentNaming + +// public static readonly DependencyProperty BackgroundImageProperty = DependencyProperty.Register( +// "BackgroundImage", typeof(ImageSource), typeof(BlurredDecorationWindow), new PropertyMetadata(default(ImageSource))); + +// public ImageSource BackgroundImage +// { +// get => (ImageSource)GetValue(BackgroundImageProperty); +// set => SetValue(BackgroundImageProperty, value); +// } + +// public static readonly DependencyProperty DecorationHeightProperty = DependencyProperty.Register( +// "DecorationHeight", typeof(double), typeof(BlurredDecorationWindow), new PropertyMetadata(20.0)); + +// public double DecorationHeight +// { +// get => (double)GetValue(DecorationHeightProperty); +// set => SetValue(DecorationHeightProperty, value); +// } + +// public static readonly DependencyProperty IconToolTipProperty = DependencyProperty.Register( +// "IconToolTip", typeof(string), typeof(BlurredDecorationWindow), new PropertyMetadata(default(string))); + +// public string IconToolTip +// { +// get => (string)GetValue(IconToolTipProperty); +// set => SetValue(IconToolTipProperty, value); +// } + +// public static readonly DependencyProperty IconCommandProperty = DependencyProperty.Register( +// "IconCommand", typeof(ICommand), typeof(BlurredDecorationWindow), new PropertyMetadata(default(ICommand))); + +// public ICommand IconCommand +// { +// get => (ICommand)GetValue(IconCommandProperty); +// set => SetValue(IconCommandProperty, value); +// } + +// // ReSharper restore InconsistentNaming +// #endregion + +// #region Constructors + +// static BlurredDecorationWindow() +// { +// DefaultStyleKeyProperty.OverrideMetadata(typeof(BlurredDecorationWindow), new FrameworkPropertyMetadata(typeof(BlurredDecorationWindow))); +// } + +// #endregion + +// #region Methods + +// public override void OnApplyTemplate() +// { +// base.OnApplyTemplate(); + +// if (GetTemplateChild("PART_Decoration") is FrameworkElement decoration) +// decoration.MouseLeftButtonDown += (sender, args) => DragMove(); + +// if (GetTemplateChild("PART_IconButton") is Button iconButton) +// iconButton.Click += (sender, args) => IconCommand?.Execute(null); +// } + +// #endregion +// } +//} diff --git a/Launcher/Controls/ColorSelector.cs b/Launcher/Controls/ColorSelector.cs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/Launcher/Controls/ColorSelector.cs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/RGBSync+/Controls/Form.cs b/Launcher/Controls/Form.cs similarity index 97% rename from RGBSync+/Controls/Form.cs rename to Launcher/Controls/Form.cs index 2d8e939..e8d6816 100644 --- a/RGBSync+/Controls/Form.cs +++ b/Launcher/Controls/Form.cs @@ -1,212 +1,212 @@ -using System; -using System.Windows; -using System.Windows.Controls; - -namespace RGBSyncPlus.Controls -{ - public class Form : Panel - { - #region DependencyProperties - // ReSharper disable InconsistentNaming - - public static readonly DependencyProperty RowHeightProperty = DependencyProperty.Register("RowHeight", typeof(double), typeof(Form), - new FrameworkPropertyMetadata(24.0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public double RowHeight - { - get => (double)GetValue(RowHeightProperty); - set - { - if (value < 0) throw new ArgumentOutOfRangeException(nameof(RowHeight), "Row height can't be negative"); - SetValue(RowHeightProperty, value); - } - } - - public static readonly DependencyProperty LabelWidthProperty = DependencyProperty.Register("LabelWidth", typeof(double), typeof(Form), - new FrameworkPropertyMetadata(100.0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public double LabelWidth - { - get => (double)GetValue(LabelWidthProperty); - set - { - if (value < 0) throw new ArgumentOutOfRangeException(nameof(RowHeight), "Label width can't be negative"); - SetValue(LabelWidthProperty, value); - } - } - - public static readonly DependencyProperty ElementSpacingProperty = DependencyProperty.Register("ElementSpacing", typeof(double), typeof(Form), - new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public double ElementSpacing - { - get => (double)GetValue(ElementSpacingProperty); - set => SetValue(ElementSpacingProperty, value); - } - - public static readonly DependencyProperty RowSpacingProperty = DependencyProperty.Register("RowSpacing", typeof(double), typeof(Form), - new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public double RowSpacing - { - get => (double)GetValue(RowSpacingProperty); - set => SetValue(RowSpacingProperty, value); - } - - // ReSharper restore InconsistentNaming - #endregion - - #region AttachedProperties - // ReSharper disable InconsistentNaming - - public static readonly DependencyProperty IsLabelProperty = DependencyProperty.RegisterAttached("IsLabel", typeof(bool), typeof(Form), - new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public static void SetIsLabel(UIElement element, bool value) => element.SetValue(IsLabelProperty, value); - public static bool GetIsLabel(UIElement element) => (bool)element.GetValue(IsLabelProperty); - - public static readonly DependencyProperty LineBreaksProperty = DependencyProperty.RegisterAttached("LineBreaks", typeof(int), typeof(Form), - new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public static void SetLineBreaks(UIElement element, int value) => element.SetValue(LineBreaksProperty, value); - public static int GetLineBreaks(UIElement element) => (int)element.GetValue(LineBreaksProperty); - - public static readonly DependencyProperty RowSpanProperty = DependencyProperty.RegisterAttached("RowSpan", typeof(int), typeof(Form), - new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public static void SetRowSpan(DependencyObject element, int value) => element.SetValue(RowSpanProperty, value); - public static int GetRowSpan(DependencyObject element) => (int)element.GetValue(RowSpanProperty); - - public static readonly DependencyProperty FillProperty = DependencyProperty.RegisterAttached("Fill", typeof(bool), typeof(Form), - new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); - - public static void SetFill(DependencyObject element, bool value) => element.SetValue(FillProperty, value); - public static bool GetFill(DependencyObject element) => (bool)element.GetValue(FillProperty); - - // ReSharper restore InconsistentNaming - #endregion - - #region Methods - - protected override Size MeasureOverride(Size availableSize) - { - if (InternalChildren.Count == 0) return new Size(0, 0); - - FormLayout layout = new FormLayout(RowHeight, LabelWidth, ElementSpacing, RowSpacing); - - foreach (UIElement child in InternalChildren) - { - child.Measure(availableSize); - layout.AddElement(child, 0); - } - - return new Size(layout.Width, layout.Height); - } - - protected override Size ArrangeOverride(Size finalSize) - { - if (InternalChildren.Count == 0) return new Size(0, 0); - - FormLayout layout = new FormLayout(RowHeight, LabelWidth, ElementSpacing, RowSpacing); - - foreach (UIElement child in InternalChildren) - child.Arrange(layout.AddElement(child, finalSize.Width)); - - return new Size(finalSize.Width, layout.Height); - } - - #endregion - - #region Data - - private class FormLayout - { - #region Properties & Fields - - private readonly double _rowHeight; - private readonly double _labelWidth; - private readonly double _elementSpacing; - private readonly double _rowSpacing; - - private double _currentRowWidth; - - private int _newRows = 0; - private int _rows = -1; - private double _currentMaxWidth; - public double Width => Math.Max((Math.Max(_currentMaxWidth, _currentRowWidth) - _elementSpacing), 0); - public double Height => ((_rows + 1) * _rowHeight) + (_rows * _rowSpacing); - - #endregion - - #region Constructors - - public FormLayout(double rowHeight, double labelWidth, double elementSpacing, double rowSpacing) - { - this._rowHeight = rowHeight; - this._labelWidth = labelWidth; - this._elementSpacing = elementSpacing; - this._rowSpacing = rowSpacing; - } - - #endregion - - #region Methods - - public Rect AddElement(UIElement element, double targetWidth) - { - bool isLabel = GetIsLabel(element); - int lineBreaks = GetLineBreaks(element); - int rowSpan = GetRowSpan(element); - - double elementWidth = isLabel ? _labelWidth : element.DesiredSize.Width; - double height = _rowHeight; - - if (_newRows > 0) - { - AddLineBreaks(_newRows); - _newRows = 0; - } - - if (lineBreaks > 0) AddLineBreaks(lineBreaks); - else if (isLabel) AddLineBreaks(1); - else if (_rows < 0) _rows = 0; - - if (!isLabel && (_currentRowWidth < _labelWidth)) - _currentRowWidth = _labelWidth + _elementSpacing; - - if (rowSpan > 1) - { - height = (rowSpan * _rowHeight) + ((rowSpan - 1) * _rowSpacing); - _newRows = Math.Max(_newRows, rowSpan - 1); - } - - if (element is FrameworkElement fe) - fe.MaxHeight = height; - - double width = elementWidth; - if ((targetWidth >= 1) && GetFill(element)) - width = targetWidth - _currentRowWidth; - - Rect rect = new Rect(new Point(_currentRowWidth, (_rows * _rowHeight) + (_rows * _rowSpacing)), new Size(width, height)); - - _currentRowWidth += width + _elementSpacing; - - return rect; - } - - private void AddLineBreaks(int count) - { - if (count <= 0) return; - - _currentMaxWidth = Math.Max(_currentMaxWidth, _currentRowWidth); - - _currentRowWidth = 0; - _rows += count; - } - - #endregion - } - - #endregion - } -} +using System; +using System.Windows; +using System.Windows.Controls; + +namespace Launcher.Controls +{ + public class Form : Panel + { + #region DependencyProperties + // ReSharper disable InconsistentNaming + + public static readonly DependencyProperty RowHeightProperty = DependencyProperty.Register("RowHeight", typeof(double), typeof(Form), + new FrameworkPropertyMetadata(24.0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public double RowHeight + { + get => (double)GetValue(RowHeightProperty); + set + { + if (value < 0) throw new ArgumentOutOfRangeException(nameof(RowHeight), "Row height can't be negative"); + SetValue(RowHeightProperty, value); + } + } + + public static readonly DependencyProperty LabelWidthProperty = DependencyProperty.Register("LabelWidth", typeof(double), typeof(Form), + new FrameworkPropertyMetadata(100.0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public double LabelWidth + { + get => (double)GetValue(LabelWidthProperty); + set + { + if (value < 0) throw new ArgumentOutOfRangeException(nameof(RowHeight), "Label width can't be negative"); + SetValue(LabelWidthProperty, value); + } + } + + public static readonly DependencyProperty ElementSpacingProperty = DependencyProperty.Register("ElementSpacing", typeof(double), typeof(Form), + new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public double ElementSpacing + { + get => (double)GetValue(ElementSpacingProperty); + set => SetValue(ElementSpacingProperty, value); + } + + public static readonly DependencyProperty RowSpacingProperty = DependencyProperty.Register("RowSpacing", typeof(double), typeof(Form), + new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public double RowSpacing + { + get => (double)GetValue(RowSpacingProperty); + set => SetValue(RowSpacingProperty, value); + } + + // ReSharper restore InconsistentNaming + #endregion + + #region AttachedProperties + // ReSharper disable InconsistentNaming + + public static readonly DependencyProperty IsLabelProperty = DependencyProperty.RegisterAttached("IsLabel", typeof(bool), typeof(Form), + new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static void SetIsLabel(UIElement element, bool value) => element.SetValue(IsLabelProperty, value); + public static bool GetIsLabel(UIElement element) => (bool)element.GetValue(IsLabelProperty); + + public static readonly DependencyProperty LineBreaksProperty = DependencyProperty.RegisterAttached("LineBreaks", typeof(int), typeof(Form), + new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static void SetLineBreaks(UIElement element, int value) => element.SetValue(LineBreaksProperty, value); + public static int GetLineBreaks(UIElement element) => (int)element.GetValue(LineBreaksProperty); + + public static readonly DependencyProperty RowSpanProperty = DependencyProperty.RegisterAttached("RowSpan", typeof(int), typeof(Form), + new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static void SetRowSpan(DependencyObject element, int value) => element.SetValue(RowSpanProperty, value); + public static int GetRowSpan(DependencyObject element) => (int)element.GetValue(RowSpanProperty); + + public static readonly DependencyProperty FillProperty = DependencyProperty.RegisterAttached("Fill", typeof(bool), typeof(Form), + new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static void SetFill(DependencyObject element, bool value) => element.SetValue(FillProperty, value); + public static bool GetFill(DependencyObject element) => (bool)element.GetValue(FillProperty); + + // ReSharper restore InconsistentNaming + #endregion + + #region Methods + + protected override Size MeasureOverride(Size availableSize) + { + if (InternalChildren.Count == 0) return new Size(0, 0); + + FormLayout layout = new FormLayout(RowHeight, LabelWidth, ElementSpacing, RowSpacing); + + foreach (UIElement child in InternalChildren) + { + child.Measure(availableSize); + layout.AddElement(child, 0); + } + + return new Size(layout.Width, layout.Height); + } + + protected override Size ArrangeOverride(Size finalSize) + { + if (InternalChildren.Count == 0) return new Size(0, 0); + + FormLayout layout = new FormLayout(RowHeight, LabelWidth, ElementSpacing, RowSpacing); + + foreach (UIElement child in InternalChildren) + child.Arrange(layout.AddElement(child, finalSize.Width)); + + return new Size(finalSize.Width, layout.Height); + } + + #endregion + + #region Data + + private class FormLayout + { + #region Properties & Fields + + private readonly double _rowHeight; + private readonly double _labelWidth; + private readonly double _elementSpacing; + private readonly double _rowSpacing; + + private double _currentRowWidth; + + private int _newRows = 0; + private int _rows = -1; + private double _currentMaxWidth; + public double Width => Math.Max((Math.Max(_currentMaxWidth, _currentRowWidth) - _elementSpacing), 0); + public double Height => ((_rows + 1) * _rowHeight) + (_rows * _rowSpacing); + + #endregion + + #region Constructors + + public FormLayout(double rowHeight, double labelWidth, double elementSpacing, double rowSpacing) + { + this._rowHeight = rowHeight; + this._labelWidth = labelWidth; + this._elementSpacing = elementSpacing; + this._rowSpacing = rowSpacing; + } + + #endregion + + #region Methods + + public Rect AddElement(UIElement element, double targetWidth) + { + bool isLabel = GetIsLabel(element); + int lineBreaks = GetLineBreaks(element); + int rowSpan = GetRowSpan(element); + + double elementWidth = isLabel ? _labelWidth : element.DesiredSize.Width; + double height = _rowHeight; + + if (_newRows > 0) + { + AddLineBreaks(_newRows); + _newRows = 0; + } + + if (lineBreaks > 0) AddLineBreaks(lineBreaks); + else if (isLabel) AddLineBreaks(1); + else if (_rows < 0) _rows = 0; + + if (!isLabel && (_currentRowWidth < _labelWidth)) + _currentRowWidth = _labelWidth + _elementSpacing; + + if (rowSpan > 1) + { + height = (rowSpan * _rowHeight) + ((rowSpan - 1) * _rowSpacing); + _newRows = Math.Max(_newRows, rowSpan - 1); + } + + if (element is FrameworkElement fe) + fe.MaxHeight = height; + + double width = elementWidth; + if ((targetWidth >= 1) && GetFill(element)) + width = targetWidth - _currentRowWidth; + + Rect rect = new Rect(new Point(_currentRowWidth, (_rows * _rowHeight) + (_rows * _rowSpacing)), new Size(width, height)); + + _currentRowWidth += width + _elementSpacing; + + return rect; + } + + private void AddLineBreaks(int count) + { + if (count <= 0) return; + + _currentMaxWidth = Math.Max(_currentMaxWidth, _currentRowWidth); + + _currentRowWidth = 0; + _rows += count; + } + + #endregion + } + + #endregion + } +} diff --git a/RGBSync+/Controls/ImageButton.cs b/Launcher/Controls/ImageButton.cs similarity index 95% rename from RGBSync+/Controls/ImageButton.cs rename to Launcher/Controls/ImageButton.cs index 2bd0f4e..04945e8 100644 --- a/RGBSync+/Controls/ImageButton.cs +++ b/Launcher/Controls/ImageButton.cs @@ -1,51 +1,51 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; - -namespace RGBSyncPlus.Controls -{ - public class ImageButton : Button - { - #region Properties & Fields - // ReSharper disable InconsistentNaming - - public static readonly DependencyProperty ImageProperty = DependencyProperty.Register( - "Image", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); - - public ImageSource Image - { - get => (ImageSource)GetValue(ImageProperty); - set => SetValue(ImageProperty, value); - } - - public static readonly DependencyProperty HoverImageProperty = DependencyProperty.Register( - "HoverImage", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); - - public ImageSource HoverImage - { - get => (ImageSource)GetValue(HoverImageProperty); - set => SetValue(HoverImageProperty, value); - } - - public static readonly DependencyProperty PressedImageProperty = DependencyProperty.Register( - "PressedImage", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); - - public ImageSource PressedImage - { - get => (ImageSource)GetValue(PressedImageProperty); - set => SetValue(PressedImageProperty, value); - } - - // ReSharper restore InconsistentNaming - #endregion - - #region Constructors - - static ImageButton() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(typeof(ImageButton))); - } - - #endregion - } -} +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +namespace Launcher.Controls +{ + public class ImageButton : Button + { + #region Properties & Fields + // ReSharper disable InconsistentNaming + + public static readonly DependencyProperty ImageProperty = DependencyProperty.Register( + "Image", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); + + public ImageSource Image + { + get => (ImageSource)GetValue(ImageProperty); + set => SetValue(ImageProperty, value); + } + + public static readonly DependencyProperty HoverImageProperty = DependencyProperty.Register( + "HoverImage", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); + + public ImageSource HoverImage + { + get => (ImageSource)GetValue(HoverImageProperty); + set => SetValue(HoverImageProperty, value); + } + + public static readonly DependencyProperty PressedImageProperty = DependencyProperty.Register( + "PressedImage", typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(default(ImageSource))); + + public ImageSource PressedImage + { + get => (ImageSource)GetValue(PressedImageProperty); + set => SetValue(PressedImageProperty, value); + } + + // ReSharper restore InconsistentNaming + #endregion + + #region Constructors + + static ImageButton() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(typeof(ImageButton))); + } + + #endregion + } +} diff --git a/Launcher/Core.cs b/Launcher/Core.cs new file mode 100644 index 0000000..299e962 --- /dev/null +++ b/Launcher/Core.cs @@ -0,0 +1,15 @@ +using SharedCode; + +namespace Launcher +{ + public static class Core + { + static Core() + { + LauncherPrefs = new LauncherPrefs(); + } + + public static LauncherPrefs LauncherPrefs; + public static UpgradingWindow UpgradingWindow { get; set; } + } +} diff --git a/Launcher/Installer.cs b/Launcher/Installer.cs new file mode 100644 index 0000000..283bcc2 --- /dev/null +++ b/Launcher/Installer.cs @@ -0,0 +1,6 @@ +namespace Launcher +{ + internal class Installer + { + } +} diff --git a/Launcher/MainWindow.xaml b/Launcher/MainWindow.xaml new file mode 100644 index 0000000..d44b474 --- /dev/null +++ b/Launcher/MainWindow.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Launcher/MainWindow.xaml.cs b/Launcher/MainWindow.xaml.cs new file mode 100644 index 0000000..c27f3d1 --- /dev/null +++ b/Launcher/MainWindow.xaml.cs @@ -0,0 +1,21 @@ +using System.Windows; + +namespace Launcher +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + + } + } +} diff --git a/Launcher/MoveToForeground.cs b/Launcher/MoveToForeground.cs new file mode 100644 index 0000000..0412235 --- /dev/null +++ b/Launcher/MoveToForeground.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; + +namespace Launcher +{ + public class MoveToForeground + { + [DllImport("User32.dll")] + private static extern int FindWindow(String ClassName, String WindowName); + + private const int SWP_NOMOVE = 0x0002; + private const int SWP_NOSIZE = 0x0001; + private const int SWP_SHOWWINDOW = 0x0040; + private const int SWP_NOACTIVATE = 0x0010; + [DllImport("user32.dll", EntryPoint = "SetWindowPos")] + public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags); + + public static void DoOnProcess(string processName) + { + Process[] allProcs = Process.GetProcessesByName(processName); + if (allProcs.Length > 0) + { + Process proc = allProcs[0]; + int hWnd = FindWindow(null, proc.MainWindowTitle.ToString()); + // Change behavior by settings the wFlags params. See http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx + CloseWindow(processName); + SetWindowPos(new IntPtr(hWnd), 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOACTIVATE); + + } + } + + private const int SW_SHOWNORMAL = 1; + private const int SW_SHOWMINIMIZED = 2; + private const int SW_SHOWMAXIMIZED = 3; + + private struct WINDOWPLACEMENT + { + public int length; + public int flags; + public int showCmd; + } + + public static void CloseWindow(string processName) + { + Process[] processes = Process.GetProcessesByName(processName); + if (processes.Length > 0) + { + foreach (Process process in processes) + { + IDictionary windows = List_Windows_By_PID(process.Id); + foreach (KeyValuePair pair in windows) + { + WINDOWPLACEMENT placement = new WINDOWPLACEMENT(); + GetWindowPlacement(pair.Key, ref placement); + + ShowWindowAsync(pair.Key, SW_SHOWMAXIMIZED); + } + } + } + } + + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); + + private delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); + + [DllImport("user32.dll", SetLastError = true)] + private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); + + [DllImport("USER32.DLL")] + private static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam); + + [DllImport("USER32.DLL")] + private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); + + [DllImport("USER32.DLL")] + private static extern int GetWindowTextLength(IntPtr hWnd); + + [DllImport("USER32.DLL")] + private static extern bool IsWindowVisible(IntPtr hWnd); + + [DllImport("USER32.DLL")] + private static extern IntPtr GetShellWindow(); + + [DllImport("USER32.DLL")] + private static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl); + + + public static IDictionary List_Windows_By_PID(int processID) + { + IntPtr hShellWindow = GetShellWindow(); + Dictionary dictWindows = new Dictionary(); + + EnumWindows(delegate (IntPtr hWnd, int lParam) + { + //ignore the shell window + if (hWnd == hShellWindow) + { + return true; + } + + //ignore non-visible windows + if (!IsWindowVisible(hWnd)) + { + return true; + } + + //ignore windows with no text + int length = GetWindowTextLength(hWnd); + if (length == 0) + { + return true; + } + + uint windowPid; + GetWindowThreadProcessId(hWnd, out windowPid); + + //ignore windows from a different process + if (windowPid != processID) + { + return true; + } + + StringBuilder stringBuilder = new StringBuilder(length); + GetWindowText(hWnd, stringBuilder, length + 1); + dictWindows.Add(hWnd, stringBuilder.ToString()); + + return true; + + }, 0); + + return dictWindows; + } + } +} diff --git a/Launcher/ProgramIcon.ico b/Launcher/ProgramIcon.ico new file mode 100644 index 0000000..b1388a7 Binary files /dev/null and b/Launcher/ProgramIcon.ico differ diff --git a/BackgroundUploadHelper/Properties/AssemblyInfo.cs b/Launcher/Properties/AssemblyInfo.cs similarity index 92% rename from BackgroundUploadHelper/Properties/AssemblyInfo.cs rename to Launcher/Properties/AssemblyInfo.cs index b403637..959cf22 100644 --- a/BackgroundUploadHelper/Properties/AssemblyInfo.cs +++ b/Launcher/Properties/AssemblyInfo.cs @@ -1,55 +1,53 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// 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("BackgroundUploadHelper")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BackgroundUploadHelper")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// 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("Launcher")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Launcher")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SDK_Debug/Properties/Resources.Designer.cs b/Launcher/Properties/Resources.Designer.cs similarity index 92% rename from SDK_Debug/Properties/Resources.Designer.cs rename to Launcher/Properties/Resources.Designer.cs index 3651df9..2139a07 100644 --- a/SDK_Debug/Properties/Resources.Designer.cs +++ b/Launcher/Properties/Resources.Designer.cs @@ -1,71 +1,70 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace SDK_Debug.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SDK_Debug.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + + +namespace Launcher.Properties +{ + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Launcher.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/SDK_Debug/Form1.resx b/Launcher/Properties/Resources.resx similarity index 90% rename from SDK_Debug/Form1.resx rename to Launcher/Properties/Resources.resx index 1af7de1..ffecec8 100644 --- a/SDK_Debug/Form1.resx +++ b/Launcher/Properties/Resources.resx @@ -1,120 +1,117 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/BackgroundUploadHelper/Properties/Settings.Designer.cs b/Launcher/Properties/Settings.Designer.cs similarity index 94% rename from BackgroundUploadHelper/Properties/Settings.Designer.cs rename to Launcher/Properties/Settings.Designer.cs index 70cdb7f..9fc0a4d 100644 --- a/BackgroundUploadHelper/Properties/Settings.Designer.cs +++ b/Launcher/Properties/Settings.Designer.cs @@ -1,30 +1,29 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace BackgroundUploadHelper.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + + +namespace Launcher.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Launcher/Properties/Settings.settings b/Launcher/Properties/Settings.settings new file mode 100644 index 0000000..8f2fd95 --- /dev/null +++ b/Launcher/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Launcher/Resources/RGBSync+.xaml b/Launcher/Resources/RGBSync+.xaml new file mode 100644 index 0000000..62ab919 --- /dev/null +++ b/Launcher/Resources/RGBSync+.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + diff --git a/Launcher/Styles/CachedResourceDictionary.cs b/Launcher/Styles/CachedResourceDictionary.cs new file mode 100644 index 0000000..abd2ee9 --- /dev/null +++ b/Launcher/Styles/CachedResourceDictionary.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Windows; + +namespace Launcher.Styles +{ + public class CachedResourceDictionary : ResourceDictionary + { + #region Properties & Fields + + // ReSharper disable InconsistentNaming + private static readonly List _cachedDictionaries = new List(); + private static readonly ResourceDictionary _innerDictionary = new ResourceDictionary(); + // ReSharper restore + + public new Uri Source + { + get => null; + set + { + lock (_innerDictionary) + { + UpdateCache(value); + + MergedDictionaries.Clear(); + MergedDictionaries.Add(_innerDictionary); + } + } + } + + #endregion + + #region Methods + + private static void UpdateCache(Uri source) + { + string uriPath = source.OriginalString; + if (_cachedDictionaries.Contains(uriPath)) return; + + _cachedDictionaries.Add(uriPath); + + try + { + ResourceDictionary newDictionary = new ResourceDictionary { Source = new Uri(uriPath, source.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative) }; + CopyDictionaryEntries(newDictionary, _innerDictionary); + } + catch { } + } + + private static void CopyDictionaryEntries(IDictionary source, IDictionary target) + { + foreach (object key in source.Keys) + if (!target.Contains(key)) + target.Add(key, source[key]); + } + + #endregion + } +} \ No newline at end of file diff --git a/Launcher/SyncStudio.Launcher.csproj b/Launcher/SyncStudio.Launcher.csproj new file mode 100644 index 0000000..0d5edb4 --- /dev/null +++ b/Launcher/SyncStudio.Launcher.csproj @@ -0,0 +1,278 @@ + + + + + + Debug + AnyCPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A} + WinExe + Launcher + RSSLauncher + v4.7.2 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + ProgramIcon.ico + + + + ..\RGBSync+\packages\Costura.Fody.5.0.0-alpha0281\lib\netstandard1.0\Costura.dll + + + ..\RGBSync+\packages\FluentWPF.0.8.0\lib\net45\FluentWPF.dll + + + ..\RGBSync+\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + ..\RGBSync+\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + ..\RGBSync+\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll + True + True + + + + ..\RGBSync+\packages\System.Console.4.3.0\lib\net46\System.Console.dll + True + True + + + + ..\RGBSync+\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + ..\RGBSync+\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + + + ..\RGBSync+\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + + + ..\RGBSync+\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\RGBSync+\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True + + + + ..\RGBSync+\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + True + True + + + ..\RGBSync+\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\RGBSync+\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + ..\RGBSync+\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll + True + True + + + ..\RGBSync+\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll + True + True + + + ..\RGBSync+\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + True + True + + + ..\RGBSync+\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + + + + ..\RGBSync+\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll + True + True + + + ..\RGBSync+\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + + ..\RGBSync+\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll + True + True + + + ..\RGBSync+\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll + True + True + + + ..\RGBSync+\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + ..\RGBSync+\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\RGBSync+\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\RGBSync+\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\RGBSync+\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\RGBSync+\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll + True + True + + + + + + + + 4.0 + + + ..\RGBSync+\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + + + + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + UpgradingWindow.xaml + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/Launcher/UpdateCheck.cs b/Launcher/UpdateCheck.cs new file mode 100644 index 0000000..164435a --- /dev/null +++ b/Launcher/UpdateCheck.cs @@ -0,0 +1,244 @@ +using Newtonsoft.Json; +using SharedCode; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; + +namespace Launcher +{ + public class UpdateCheck + { + public bool Complete = false; + public UpgradingWindow UpgradingWindow; + public async Task Execute(LauncherPrefs.ReleaseType releaseType, UpgradingWindow upgrading, string destFolder) + { + UpgradingWindow = upgrading; + UpgradingWindow.Show(); + UpgradingWindow.UpdateLayout(); + UpgradingWindow.UpdateDefaultStyle(); + + UpgradingWindow.vm.Message = "Checking For Update..."; + await Task.Delay(1000); + string url = ""; + string regexPattern = ""; + + // try + { + switch (releaseType) + { + case LauncherPrefs.ReleaseType.CI: + url = "http://cdn.ezmuze.co.uk/rgbsync/"; + regexPattern = @"\'/rgbsync(.*?)\'"; + break; + + case LauncherPrefs.ReleaseType.Beta: + url = "https://cdn.rgbsync.com/prerelease/"; + regexPattern = @"\'/prerelease(.*?)\'"; + break; + + case LauncherPrefs.ReleaseType.Release: + url = "https://cdn.rgbsync.com/release/"; + regexPattern = @"\'/release(.*?)\'"; + break; + + } + + string html = ""; + using (HttpClient client = new HttpClient()) + { + html = client.GetStringAsync(url).Result; + } + + MatchCollection urls = Regex.Matches(html, regexPattern); + + // MessageBox.Show(urls[0].ToString()); + Dictionary usableUrls = urls.Cast().ToDictionary(match => (url + (match.Value.Substring(2, (match.Value).Length - 3).Split('/').Last())), match => int.Parse(match.Value.Split('_').Last().Split('.').First())); + + Debug.WriteLine(usableUrls); + + int maxReleaseNumber = usableUrls.Values.Max(); + + if (Core.LauncherPrefs.ReleaseInstalled != maxReleaseNumber || Core.LauncherPrefs.ReleaseTypeInstalled != releaseType) + { + + try + { + if (File.Exists(destFolder + "\\RGBSync+.exe")) + { + if (!Directory.Exists(destFolder + "\\.old")) + { + DirectoryInfo dir = Directory.CreateDirectory(destFolder + "\\old"); + + dir.Attributes = FileAttributes.Directory | FileAttributes.Hidden; + } + + File.Move("RGBSync+.exe", destFolder + "\\.old\\oldrss_" + Guid.NewGuid() + ".exe"); + File.Delete("oldrss.exe"); + } + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + + if (Directory.Exists(".old")) + { + Thread.Sleep(1000); + foreach (string f in Directory.GetFiles(destFolder + "\\.old\\")) + { + try + { + File.Delete(f); + } + catch + { + } + } + } + + if (Directory.Exists(destFolder + "\\.old")) + { + Thread.Sleep(1000); + + if (Directory.GetFiles(destFolder + "\\.old\\").Length == 0) + { + Directory.Delete(destFolder + "\\.old", true); + } + } + + vm.Message = "Installing " + releaseType + " release " + maxReleaseNumber; + + string zipPath = destFolder + "\\" + releaseType + "_" + maxReleaseNumber + ".zip"; + + WebClient wc = new WebClient(); + wc.DownloadProgressChanged += client_DownloadProgressChanged; + wc.DownloadFileCompleted += (sender, e) => + { + if (Directory.Exists(destFolder + "\\temp")) + { + Directory.Delete(destFolder + "\\temp", true); + } + + Directory.CreateDirectory(destFolder + "\\temp"); + + vm.Message = "Extracting..."; + ZipFile.ExtractToDirectory(zipPath, destFolder + "\\temp"); + + DirectoryCopy(destFolder + "\\temp", destFolder, true); + + File.Delete(zipPath); + try + { + Directory.Delete(destFolder + "\\temp", true); + } + catch + { + } + + UpgradingWindow.Dispatcher.BeginInvoke(new Action(() => + { + UpgradingWindow.Hide(); + UpgradingWindow.Close(); + })); + + Complete = true; + + Core.LauncherPrefs.ReleaseInstalled = maxReleaseNumber; + Core.LauncherPrefs.ReleaseTypeInstalled = releaseType; + + string json = JsonConvert.SerializeObject(Core.LauncherPrefs); + File.WriteAllText(destFolder + "\\LauncherPrefs.json", json); + + + if (Directory.Exists(destFolder + "\\.old")) + { + Thread.Sleep(1000); + + if (Directory.GetFiles(destFolder + "\\.old\\").Length == 0) + { + Directory.Delete(destFolder + "\\.old", true); + } + } + + + }; + + wc.DownloadFileAsync(new Uri(usableUrls.First(x => x.Value == maxReleaseNumber).Key), zipPath); + } + else + { + Complete = true; + } + } + //catch (Exception e) + //{ + // Complete = true; + //} + + } + + private static void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs) + { + // Get the subdirectories for the specified directory. + DirectoryInfo dir = new DirectoryInfo(sourceDirName); + + if (!dir.Exists) + { + throw new DirectoryNotFoundException("Source directory does not exist or could not be found: " + sourceDirName); + } + + DirectoryInfo[] dirs = dir.GetDirectories(); + // If the destination directory doesn't exist, create it. + if (!string.IsNullOrWhiteSpace(destDirName) && !Directory.Exists(destDirName)) + { + Directory.CreateDirectory(destDirName); + } + + // Get the files in the directory and copy them to the new location. + FileInfo[] files = dir.GetFiles(); + foreach (FileInfo file in files) + { + string temppath = Path.Combine(destDirName, file.Name); + Debug.WriteLine("Copying to " + temppath); + try + { + file.CopyTo(temppath, true); + } + catch + { + } + } + + // If copying subdirectories, copy them and their contents to new location. + if (copySubDirs) + { + foreach (DirectoryInfo subdir in dirs) + { + string temppath = Path.Combine(destDirName, subdir.Name); + DirectoryCopy(subdir.FullName, temppath, copySubDirs); + } + } + } + + private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) + { + double bytesIn = double.Parse(e.BytesReceived.ToString()); + double totalBytes = double.Parse(e.TotalBytesToReceive.ToString()); + double percentage = bytesIn / totalBytes * 100; + + vm.Message = "Downloaded " + (e.BytesReceived / 1000000).ToString() + " MB of " + (e.TotalBytesToReceive / 1000000).ToString() + " MB."; + + vm.Percentage = 100 - (int)percentage; + } + + private UpgradingViewModel vm => UpgradingWindow.vm; + } +} diff --git a/Launcher/UpgradingViewModel.cs b/Launcher/UpgradingViewModel.cs new file mode 100644 index 0000000..51a3419 --- /dev/null +++ b/Launcher/UpgradingViewModel.cs @@ -0,0 +1,19 @@ +namespace Launcher +{ + public class UpgradingViewModel : BaseViewModel + { + private string message; + public string Message + { + get => message; + set => Set(ref message, value); + } + + private int percentage = 100; + public int Percentage + { + get => percentage; + set => Set(ref percentage, value); + } + } +} diff --git a/Launcher/UpgradingWindow.xaml b/Launcher/UpgradingWindow.xaml new file mode 100644 index 0000000..1d6b8d6 --- /dev/null +++ b/Launcher/UpgradingWindow.xaml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Launcher/UpgradingWindow.xaml.cs b/Launcher/UpgradingWindow.xaml.cs new file mode 100644 index 0000000..2db01db --- /dev/null +++ b/Launcher/UpgradingWindow.xaml.cs @@ -0,0 +1,119 @@ +using Newtonsoft.Json; +using SharedCode; +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Input; + +namespace Launcher +{ + /// + /// Interaction logic for UpgradingWindow.xaml + /// + public partial class UpgradingWindow + { + public UpgradingWindow() + { + InitializeComponent(); + vm = this.DataContext as UpgradingViewModel; + Core.UpgradingWindow = this; + } + + public UpgradingViewModel vm; + + private async void AcrylicWindow_Loaded(object sender, RoutedEventArgs e) + { + Thread.Sleep(100); + await StartCheck(); + } + + public static string BaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\RGBSyncStudio"; + + private async Task StartCheck() + { + + if (!Directory.Exists(BaseFolder)) + { + Directory.CreateDirectory(BaseFolder); + + // Installer.AddShortcut(); + } + + Process[] processlist = Process.GetProcesses(); + + if (processlist.Any(x => x.ProcessName == "RGBSync+")) + { + try + { + Process proc = processlist.First(x => x.ProcessName == "RGBSync+"); + proc.Kill(); + proc.Dispose(); + proc = null; + } + catch + { + } + } + + if (File.Exists(BaseFolder + "\\launcherPrefs.json")) + { + Core.LauncherPrefs = JsonConvert.DeserializeObject(File.ReadAllText(BaseFolder + "\\launcherPrefs.json")); + } + + UpdateCheck check = new UpdateCheck(); + await check.Execute(Core.LauncherPrefs.ReleaseBranch, this, BaseFolder); + while (!check.Complete) + { + await Task.Delay(100); + } + + Process p = new Process(); + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.StartInfo.FileName = BaseFolder + "\\RGBSync+.exe"; + p.StartInfo.WorkingDirectory = BaseFolder; + p.StartInfo.UseShellExecute = false; + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardError = true; + + if (Core.LauncherPrefs.RunAsAdmin) + { + if (System.Environment.OSVersion.Version.Major >= 6) + { + p.StartInfo.Verb = "runas"; + } + } + + p.Start(); + + + + await Task.Delay(2000); + + System.Windows.Application.Current.Shutdown(); + } + + private void UpgradingWindow_OnKeyDown(object sender, KeyEventArgs e) + { + if ((e.Key == Key.LeftShift) && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))) + { + try + { + LoadingText.Text = "Resetting app..."; + Directory.Delete(BaseFolder, true); + Thread.Sleep(200); + Process.Start(Assembly.GetExecutingAssembly().Location); + Environment.Exit(-1); + } + catch + { + + } + } + } + } +} diff --git a/Launcher/obj/Launcher.csproj.nuget.dgspec.json b/Launcher/obj/Launcher.csproj.nuget.dgspec.json new file mode 100644 index 0000000..80f4457 --- /dev/null +++ b/Launcher/obj/Launcher.csproj.nuget.dgspec.json @@ -0,0 +1,62 @@ +{ + "format": 1, + "restore": { + "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj": {} + }, + "projects": { + "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj", + "projectName": "Launcher", + "projectPath": "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj", + "packagesPath": "C:\\Users\\james\\.nuget\\packages\\", + "outputPath": "C:\\Projects\\JackNet\\Launcher\\obj\\", + "projectStyle": "PackageReference", + "skipContentFileWrite": true, + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\" + ], + "configFilePaths": [ + "C:\\Users\\james\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "net472" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "http://nuget.arge.be/v3/index.json": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net472": { + "projectReferences": {} + } + } + }, + "frameworks": { + "net472": { + "dependencies": { + "ILMerge": { + "target": "Package", + "version": "[3.0.29, )" + } + } + } + }, + "runtimes": { + "win": { + "#import": [] + }, + "win-x64": { + "#import": [] + }, + "win-x86": { + "#import": [] + } + } + } + } +} \ No newline at end of file diff --git a/Launcher/obj/Launcher.csproj.nuget.g.props b/Launcher/obj/Launcher.csproj.nuget.g.props new file mode 100644 index 0000000..b5849f9 --- /dev/null +++ b/Launcher/obj/Launcher.csproj.nuget.g.props @@ -0,0 +1,24 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\james\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\ + PackageReference + 5.8.0 + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + C:\Users\james\.nuget\packages\ilmerge\3.0.29 + + \ No newline at end of file diff --git a/Launcher/obj/Launcher.csproj.nuget.g.targets b/Launcher/obj/Launcher.csproj.nuget.g.targets new file mode 100644 index 0000000..d212750 --- /dev/null +++ b/Launcher/obj/Launcher.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Launcher/obj/Release/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/Launcher/obj/Release/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/Launcher/obj/Release/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/Launcher/obj/Release/App.baml b/Launcher/obj/Release/App.baml new file mode 100644 index 0000000..fa33ff0 Binary files /dev/null and b/Launcher/obj/Release/App.baml differ diff --git a/DeviceExcludeTool/obj/Release/App.g.cs b/Launcher/obj/Release/App.g.cs similarity index 81% rename from DeviceExcludeTool/obj/Release/App.g.cs rename to Launcher/obj/Release/App.g.cs index 8b879c1..e79c7bd 100644 --- a/DeviceExcludeTool/obj/Release/App.g.cs +++ b/Launcher/obj/Release/App.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DEA223A73506C67FC2BFD4F79F59060FAE687C2CD4D73880C02D021795CE241E" +#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43FC86CB40D28ABADB0080C53FF4EEFBE393754AFB64952D5DF00E8A621D7FB9" //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -9,10 +9,8 @@ // //------------------------------------------------------------------------------ -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; +using Launcher; +using Launcher.Styles; using System; using System.Diagnostics; using System.Windows; @@ -35,7 +33,7 @@ using System.Windows.Shell; -namespace DeviceExcludeTool { +namespace Launcher { /// @@ -57,11 +55,11 @@ public void InitializeComponent() { _contentLoaded = true; #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); + this.StartupUri = new System.Uri("UpgradingWindow.xaml", System.UriKind.Relative); #line default #line hidden - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/app.xaml", System.UriKind.Relative); + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/app.xaml", System.UriKind.Relative); #line 1 "..\..\App.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); @@ -77,7 +75,7 @@ public void InitializeComponent() { [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public static void Main() { - DeviceExcludeTool.App app = new DeviceExcludeTool.App(); + Launcher.App app = new Launcher.App(); app.InitializeComponent(); app.Run(); } diff --git a/DeviceExcludeTool/obj/Release/App.g.i.cs b/Launcher/obj/Release/App.g.i.cs similarity index 81% rename from DeviceExcludeTool/obj/Release/App.g.i.cs rename to Launcher/obj/Release/App.g.i.cs index 8b879c1..e79c7bd 100644 --- a/DeviceExcludeTool/obj/Release/App.g.i.cs +++ b/Launcher/obj/Release/App.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DEA223A73506C67FC2BFD4F79F59060FAE687C2CD4D73880C02D021795CE241E" +#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "43FC86CB40D28ABADB0080C53FF4EEFBE393754AFB64952D5DF00E8A621D7FB9" //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -9,10 +9,8 @@ // //------------------------------------------------------------------------------ -using DeviceExcludeTool; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; +using Launcher; +using Launcher.Styles; using System; using System.Diagnostics; using System.Windows; @@ -35,7 +33,7 @@ using System.Windows.Shell; -namespace DeviceExcludeTool { +namespace Launcher { /// @@ -57,11 +55,11 @@ public void InitializeComponent() { _contentLoaded = true; #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); + this.StartupUri = new System.Uri("UpgradingWindow.xaml", System.UriKind.Relative); #line default #line hidden - System.Uri resourceLocater = new System.Uri("/DeviceExcludeTool;component/app.xaml", System.UriKind.Relative); + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/app.xaml", System.UriKind.Relative); #line 1 "..\..\App.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); @@ -77,7 +75,7 @@ public void InitializeComponent() { [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] public static void Main() { - DeviceExcludeTool.App app = new DeviceExcludeTool.App(); + Launcher.App app = new Launcher.App(); app.InitializeComponent(); app.Run(); } diff --git a/DeviceExcludeTool/obj/Debug/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed b/Launcher/obj/Release/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed similarity index 100% rename from DeviceExcludeTool/obj/Debug/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed rename to Launcher/obj/Release/Costura/1248142EB45EED3BEB0D9A2D3B8BED5FE2569B10.costura.newtonsoft.json.dll.compressed diff --git a/Launcher/obj/Release/Costura/3AC14D83B69F9747F5F06BD74C8B925AD16007BE.costura.costura.dll.compressed b/Launcher/obj/Release/Costura/3AC14D83B69F9747F5F06BD74C8B925AD16007BE.costura.costura.dll.compressed new file mode 100644 index 0000000..f015ef1 Binary files /dev/null and b/Launcher/obj/Release/Costura/3AC14D83B69F9747F5F06BD74C8B925AD16007BE.costura.costura.dll.compressed differ diff --git a/Launcher/obj/Release/Costura/4198CF1644EB220794C914522DF0EB542F10C334.costura.costura.pdb.compressed b/Launcher/obj/Release/Costura/4198CF1644EB220794C914522DF0EB542F10C334.costura.costura.pdb.compressed new file mode 100644 index 0000000..80e3f5a Binary files /dev/null and b/Launcher/obj/Release/Costura/4198CF1644EB220794C914522DF0EB542F10C334.costura.costura.pdb.compressed differ diff --git a/Launcher/obj/Release/Costura/51CE2C39CEC649E568A3987526F8C8924748E35D.costura.fluentwpf.dll.compressed b/Launcher/obj/Release/Costura/51CE2C39CEC649E568A3987526F8C8924748E35D.costura.fluentwpf.dll.compressed new file mode 100644 index 0000000..fd240fd Binary files /dev/null and b/Launcher/obj/Release/Costura/51CE2C39CEC649E568A3987526F8C8924748E35D.costura.fluentwpf.dll.compressed differ diff --git a/Launcher/obj/Release/Costura/85DC92EDD4B0049ED9049E075C4DEF8A3D64E43B.costura.system.diagnostics.diagnosticsource.dll.compressed b/Launcher/obj/Release/Costura/85DC92EDD4B0049ED9049E075C4DEF8A3D64E43B.costura.system.diagnostics.diagnosticsource.dll.compressed new file mode 100644 index 0000000..3443a62 Binary files /dev/null and b/Launcher/obj/Release/Costura/85DC92EDD4B0049ED9049E075C4DEF8A3D64E43B.costura.system.diagnostics.diagnosticsource.dll.compressed differ diff --git a/Launcher/obj/Release/GeneratedInternalTypeHelper.g.cs b/Launcher/obj/Release/GeneratedInternalTypeHelper.g.cs new file mode 100644 index 0000000..c65238f --- /dev/null +++ b/Launcher/obj/Release/GeneratedInternalTypeHelper.g.cs @@ -0,0 +1,2 @@ + + diff --git a/Launcher/obj/Release/GeneratedInternalTypeHelper.g.i.cs b/Launcher/obj/Release/GeneratedInternalTypeHelper.g.i.cs new file mode 100644 index 0000000..136dd1b --- /dev/null +++ b/Launcher/obj/Release/GeneratedInternalTypeHelper.g.i.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace XamlGeneratedNamespace { + + + /// + /// GeneratedInternalTypeHelper + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper { + + /// + /// CreateInstance + /// + protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { + return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic) + | (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture); + } + + /// + /// GetPropertyValue + /// + protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) { + return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture); + } + + /// + /// SetPropertyValue + /// + protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) { + propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture); + } + + /// + /// CreateDelegate + /// + protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) { + return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod + | (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] { + delegateType, + handler}, null))); + } + + /// + /// AddEventHandler + /// + protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) { + eventInfo.AddEventHandler(target, handler); + } + } +} + diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.Properties.Resources.resources b/Launcher/obj/Release/Launcher.Properties.Resources.resources similarity index 100% rename from BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.Properties.Resources.resources rename to Launcher/obj/Release/Launcher.Properties.Resources.resources diff --git a/BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.csproj.CopyComplete b/Launcher/obj/Release/Launcher.csproj.CopyComplete similarity index 100% rename from BackgroundUploadHelper/obj/Release/BackgroundUploadHelper.csproj.CopyComplete rename to Launcher/obj/Release/Launcher.csproj.CopyComplete diff --git a/Launcher/obj/Release/Launcher.csproj.FileListAbsolute.txt b/Launcher/obj/Release/Launcher.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..bc00467 --- /dev/null +++ b/Launcher/obj/Release/Launcher.csproj.FileListAbsolute.txt @@ -0,0 +1,57 @@ +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\bin\Release\RSSLauncher.exe.config +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\bin\Release\RSSLauncher.exe +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\bin\Release\RSSLauncher.pdb +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\bin\Release\Newtonsoft.Json.xml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\bin\Release\System.Diagnostics.DiagnosticSource.xml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.csprojAssemblyReference.cache +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\MainWindow.g.cs +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\UpgradingWindow.g.cs +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\App.g.cs +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\GeneratedInternalTypeHelper.g.cs +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\RSSLauncher_MarkupCompile.cache +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\RSSLauncher_MarkupCompile.lref +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\App.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\MainWindow.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Resources\RGBSync+.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\BlurredDecorationWindow.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\Button.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\CheckBox.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\ColorSelector.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\ComboBox.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\Form.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\FrameworkElement.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\GroupBox.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Styles\RainbowDefault\Scrollbar.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\UpgradingWindow.baml +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\RSSLauncher.g.resources +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.Properties.Resources.resources +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.csproj.GenerateResource.cache +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.csproj.CoreCompileInputs.cache +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.csproj.Fody.CopyLocal.cache +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\Launcher.csproj.CopyComplete +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\RSSLauncher.exe +C:\Users\jacklrpendleton\Source\Repos\JackNetRGBSync\Launcher\obj\Release\RSSLauncher.pdb +C:\Projects\RGB Sync Studio\Launcher\bin\Release\RSSLauncher.exe.config +C:\Projects\RGB Sync Studio\Launcher\bin\Release\RSSLauncher.exe +C:\Projects\RGB Sync Studio\Launcher\bin\Release\RSSLauncher.pdb +C:\Projects\RGB Sync Studio\Launcher\bin\Release\Newtonsoft.Json.xml +C:\Projects\RGB Sync Studio\Launcher\bin\Release\System.Diagnostics.DiagnosticSource.xml +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.csprojAssemblyReference.cache +C:\Projects\RGB Sync Studio\Launcher\obj\Release\MainWindow.g.cs +C:\Projects\RGB Sync Studio\Launcher\obj\Release\UpgradingWindow.g.cs +C:\Projects\RGB Sync Studio\Launcher\obj\Release\App.g.cs +C:\Projects\RGB Sync Studio\Launcher\obj\Release\GeneratedInternalTypeHelper.g.cs +C:\Projects\RGB Sync Studio\Launcher\obj\Release\RSSLauncher_MarkupCompile.cache +C:\Projects\RGB Sync Studio\Launcher\obj\Release\RSSLauncher_MarkupCompile.lref +C:\Projects\RGB Sync Studio\Launcher\obj\Release\App.baml +C:\Projects\RGB Sync Studio\Launcher\obj\Release\MainWindow.baml +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Resources\RGBSync+.baml +C:\Projects\RGB Sync Studio\Launcher\obj\Release\UpgradingWindow.baml +C:\Projects\RGB Sync Studio\Launcher\obj\Release\RSSLauncher.g.resources +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.Properties.Resources.resources +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.csproj.GenerateResource.cache +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.csproj.CoreCompileInputs.cache +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.csproj.Fody.CopyLocal.cache +C:\Projects\RGB Sync Studio\Launcher\obj\Release\Launcher.csproj.CopyComplete +C:\Projects\RGB Sync Studio\Launcher\obj\Release\RSSLauncher.exe +C:\Projects\RGB Sync Studio\Launcher\obj\Release\RSSLauncher.pdb diff --git a/Launcher/obj/Release/MainWindow.baml b/Launcher/obj/Release/MainWindow.baml new file mode 100644 index 0000000..2769704 Binary files /dev/null and b/Launcher/obj/Release/MainWindow.baml differ diff --git a/BackgroundUploadHelper/obj/Release/App.g.i.cs b/Launcher/obj/Release/MainWindow.g.cs similarity index 58% rename from BackgroundUploadHelper/obj/Release/App.g.i.cs rename to Launcher/obj/Release/MainWindow.g.cs index fce6f3e..d527133 100644 --- a/BackgroundUploadHelper/obj/Release/App.g.i.cs +++ b/Launcher/obj/Release/MainWindow.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E03D4A60605EBEAC601D4D57CD5C3F5FC4AA5F33594F52EBD7C3D92FB539F215" +#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "65CB06C1269B19E503D2169223C203F68E6B78D0973ED387F1CACA881850D12B" //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -9,10 +9,7 @@ // //------------------------------------------------------------------------------ -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; +using Launcher; using System; using System.Diagnostics; using System.Windows; @@ -35,13 +32,13 @@ using System.Windows.Shell; -namespace BackgroundUploadHelper { +namespace Launcher { /// - /// App + /// MainWindow /// - public partial class App : System.Windows.Application { + public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { private bool _contentLoaded; @@ -55,31 +52,34 @@ public void InitializeComponent() { return; } _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/mainwindow.xaml", System.UriKind.Relative); - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" + #line 1 "..\..\MainWindow.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); #line default #line hidden } - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - BackgroundUploadHelper.App app = new BackgroundUploadHelper.App(); - app.InitializeComponent(); - app.Run(); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + switch (connectionId) + { + case 1: + + #line 8 "..\..\MainWindow.xaml" + ((Launcher.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); + + #line default + #line hidden + return; + } + this._contentLoaded = true; } } } diff --git a/BackgroundUploadHelper/obj/Release/App.g.cs b/Launcher/obj/Release/MainWindow.g.i.cs similarity index 58% rename from BackgroundUploadHelper/obj/Release/App.g.cs rename to Launcher/obj/Release/MainWindow.g.i.cs index fce6f3e..d527133 100644 --- a/BackgroundUploadHelper/obj/Release/App.g.cs +++ b/Launcher/obj/Release/MainWindow.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "E03D4A60605EBEAC601D4D57CD5C3F5FC4AA5F33594F52EBD7C3D92FB539F215" +#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "65CB06C1269B19E503D2169223C203F68E6B78D0973ED387F1CACA881850D12B" //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -9,10 +9,7 @@ // //------------------------------------------------------------------------------ -using BackgroundUploadHelper; -using MaterialDesignThemes.Wpf; -using MaterialDesignThemes.Wpf.Converters; -using MaterialDesignThemes.Wpf.Transitions; +using Launcher; using System; using System.Diagnostics; using System.Windows; @@ -35,13 +32,13 @@ using System.Windows.Shell; -namespace BackgroundUploadHelper { +namespace Launcher { /// - /// App + /// MainWindow /// - public partial class App : System.Windows.Application { + public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { private bool _contentLoaded; @@ -55,31 +52,34 @@ public void InitializeComponent() { return; } _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/mainwindow.xaml", System.UriKind.Relative); - #line 6 "..\..\App.xaml" - this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative); - - #line default - #line hidden - System.Uri resourceLocater = new System.Uri("/BackgroundUploadHelper;component/app.xaml", System.UriKind.Relative); - - #line 1 "..\..\App.xaml" + #line 1 "..\..\MainWindow.xaml" System.Windows.Application.LoadComponent(this, resourceLocater); #line default #line hidden } - /// - /// Application Entry Point. - /// - [System.STAThreadAttribute()] [System.Diagnostics.DebuggerNonUserCodeAttribute()] [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] - public static void Main() { - BackgroundUploadHelper.App app = new BackgroundUploadHelper.App(); - app.InitializeComponent(); - app.Run(); + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + switch (connectionId) + { + case 1: + + #line 8 "..\..\MainWindow.xaml" + ((Launcher.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); + + #line default + #line hidden + return; + } + this._contentLoaded = true; } } } diff --git a/StartupHelper/obj/Debug/StartupHelper.exe b/Launcher/obj/Release/RSSLauncher.exe similarity index 51% rename from StartupHelper/obj/Debug/StartupHelper.exe rename to Launcher/obj/Release/RSSLauncher.exe index a311050..9ca095f 100644 Binary files a/StartupHelper/obj/Debug/StartupHelper.exe and b/Launcher/obj/Release/RSSLauncher.exe differ diff --git a/Launcher/obj/Release/RSSLauncher.g.resources b/Launcher/obj/Release/RSSLauncher.g.resources new file mode 100644 index 0000000..05b3e7e Binary files /dev/null and b/Launcher/obj/Release/RSSLauncher.g.resources differ diff --git a/Launcher/obj/Release/RSSLauncher_MarkupCompile.lref b/Launcher/obj/Release/RSSLauncher_MarkupCompile.lref new file mode 100644 index 0000000..56b0d81 --- /dev/null +++ b/Launcher/obj/Release/RSSLauncher_MarkupCompile.lref @@ -0,0 +1,6 @@ +C:\Projects\RGB Sync Studio\Launcher\obj\Release\GeneratedInternalTypeHelper.g.cs +FC:\Projects\RGB Sync Studio\Launcher\App.xaml;; +FC:\Projects\RGB Sync Studio\Launcher\MainWindow.xaml;; +FC:\Projects\RGB Sync Studio\Launcher\Resources\RGBSync+.xaml;; +FC:\Projects\RGB Sync Studio\Launcher\UpgradingWindow.xaml;; + diff --git a/Launcher/obj/Release/Resources/RGBSync+.baml b/Launcher/obj/Release/Resources/RGBSync+.baml new file mode 100644 index 0000000..edaa0e7 Binary files /dev/null and b/Launcher/obj/Release/Resources/RGBSync+.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/BlurredDecorationWindow.baml b/Launcher/obj/Release/Styles/RainbowDefault/BlurredDecorationWindow.baml new file mode 100644 index 0000000..e8981d0 Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/BlurredDecorationWindow.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/Button.baml b/Launcher/obj/Release/Styles/RainbowDefault/Button.baml new file mode 100644 index 0000000..add35b3 Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/Button.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/CheckBox.baml b/Launcher/obj/Release/Styles/RainbowDefault/CheckBox.baml new file mode 100644 index 0000000..2439959 Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/CheckBox.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/ColorSelector.baml b/Launcher/obj/Release/Styles/RainbowDefault/ColorSelector.baml new file mode 100644 index 0000000..1a9900a Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/ColorSelector.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/ComboBox.baml b/Launcher/obj/Release/Styles/RainbowDefault/ComboBox.baml new file mode 100644 index 0000000..d841353 Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/ComboBox.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/Form.baml b/Launcher/obj/Release/Styles/RainbowDefault/Form.baml new file mode 100644 index 0000000..c2bba6c Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/Form.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/FrameworkElement.baml b/Launcher/obj/Release/Styles/RainbowDefault/FrameworkElement.baml new file mode 100644 index 0000000..0e86f62 Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/FrameworkElement.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/GroupBox.baml b/Launcher/obj/Release/Styles/RainbowDefault/GroupBox.baml new file mode 100644 index 0000000..03c50fb Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/GroupBox.baml differ diff --git a/Launcher/obj/Release/Styles/RainbowDefault/Scrollbar.baml b/Launcher/obj/Release/Styles/RainbowDefault/Scrollbar.baml new file mode 100644 index 0000000..56bfa9f Binary files /dev/null and b/Launcher/obj/Release/Styles/RainbowDefault/Scrollbar.baml differ diff --git a/DeviceExcludeTool/obj/Release/TempPE/Properties.Resources.Designer.cs.dll b/Launcher/obj/Release/TempPE/Properties.Resources.Designer.cs.dll similarity index 58% rename from DeviceExcludeTool/obj/Release/TempPE/Properties.Resources.Designer.cs.dll rename to Launcher/obj/Release/TempPE/Properties.Resources.Designer.cs.dll index d3fab47..32180f6 100644 Binary files a/DeviceExcludeTool/obj/Release/TempPE/Properties.Resources.Designer.cs.dll and b/Launcher/obj/Release/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/Launcher/obj/Release/UpgradingWindow.baml b/Launcher/obj/Release/UpgradingWindow.baml new file mode 100644 index 0000000..d7f0408 Binary files /dev/null and b/Launcher/obj/Release/UpgradingWindow.baml differ diff --git a/Launcher/obj/Release/UpgradingWindow.g.cs b/Launcher/obj/Release/UpgradingWindow.g.cs new file mode 100644 index 0000000..9c26aa5 --- /dev/null +++ b/Launcher/obj/Release/UpgradingWindow.g.cs @@ -0,0 +1,291 @@ +#pragma checksum "..\..\UpgradingWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0DE70CD8F4BA24483C8253C36F12854B442C59FFFDC63F7A156CEB7DE9221F9F" +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +using Launcher; +using SourceChord.FluentWPF; +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace Launcher { + + + /// + /// UpgradingWindow + /// + public partial class UpgradingWindow : SourceChord.FluentWPF.AcrylicWindow, System.Windows.Markup.IComponentConnector { + + + #line 27 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.TextBlock LoadingText; + + #line default + #line hidden + + + #line 28 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.ProgressBar ProgressBar; + + #line default + #line hidden + + + #line 39 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Media.GradientStop PbStop1; + + #line default + #line hidden + + + #line 51 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.Canvas Layer_1; + + #line default + #line hidden + + + #line 99 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path54; + + #line default + #line hidden + + + #line 104 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path56; + + #line default + #line hidden + + + #line 109 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path58; + + #line default + #line hidden + + + #line 114 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path60; + + #line default + #line hidden + + + #line 119 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path86; + + #line default + #line hidden + + + #line 124 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path88; + + #line default + #line hidden + + + #line 129 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path90; + + #line default + #line hidden + + + #line 134 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path92; + + #line default + #line hidden + + + #line 139 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path94; + + #line default + #line hidden + + + #line 144 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path96; + + #line default + #line hidden + + + #line 149 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path98; + + #line default + #line hidden + + + #line 154 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path100; + + #line default + #line hidden + + + #line 159 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path102; + + #line default + #line hidden + + + #line 164 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path104; + + #line default + #line hidden + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/upgradingwindow.xaml", System.UriKind.Relative); + + #line 1 "..\..\UpgradingWindow.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + switch (connectionId) + { + case 1: + + #line 10 "..\..\UpgradingWindow.xaml" + ((Launcher.UpgradingWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.UpgradingWindow_OnKeyDown); + + #line default + #line hidden + + #line 11 "..\..\UpgradingWindow.xaml" + ((Launcher.UpgradingWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.AcrylicWindow_Loaded); + + #line default + #line hidden + return; + case 2: + this.LoadingText = ((System.Windows.Controls.TextBlock)(target)); + return; + case 3: + this.ProgressBar = ((System.Windows.Controls.ProgressBar)(target)); + return; + case 4: + this.PbStop1 = ((System.Windows.Media.GradientStop)(target)); + return; + case 5: + this.Layer_1 = ((System.Windows.Controls.Canvas)(target)); + return; + case 6: + this.path54 = ((System.Windows.Shapes.Path)(target)); + return; + case 7: + this.path56 = ((System.Windows.Shapes.Path)(target)); + return; + case 8: + this.path58 = ((System.Windows.Shapes.Path)(target)); + return; + case 9: + this.path60 = ((System.Windows.Shapes.Path)(target)); + return; + case 10: + this.path86 = ((System.Windows.Shapes.Path)(target)); + return; + case 11: + this.path88 = ((System.Windows.Shapes.Path)(target)); + return; + case 12: + this.path90 = ((System.Windows.Shapes.Path)(target)); + return; + case 13: + this.path92 = ((System.Windows.Shapes.Path)(target)); + return; + case 14: + this.path94 = ((System.Windows.Shapes.Path)(target)); + return; + case 15: + this.path96 = ((System.Windows.Shapes.Path)(target)); + return; + case 16: + this.path98 = ((System.Windows.Shapes.Path)(target)); + return; + case 17: + this.path100 = ((System.Windows.Shapes.Path)(target)); + return; + case 18: + this.path102 = ((System.Windows.Shapes.Path)(target)); + return; + case 19: + this.path104 = ((System.Windows.Shapes.Path)(target)); + return; + } + this._contentLoaded = true; + } + } +} + diff --git a/Launcher/obj/Release/UpgradingWindow.g.i.cs b/Launcher/obj/Release/UpgradingWindow.g.i.cs new file mode 100644 index 0000000..9c26aa5 --- /dev/null +++ b/Launcher/obj/Release/UpgradingWindow.g.i.cs @@ -0,0 +1,291 @@ +#pragma checksum "..\..\UpgradingWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0DE70CD8F4BA24483C8253C36F12854B442C59FFFDC63F7A156CEB7DE9221F9F" +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +using Launcher; +using SourceChord.FluentWPF; +using System; +using System.Diagnostics; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Effects; +using System.Windows.Media.Imaging; +using System.Windows.Media.Media3D; +using System.Windows.Media.TextFormatting; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Shell; + + +namespace Launcher { + + + /// + /// UpgradingWindow + /// + public partial class UpgradingWindow : SourceChord.FluentWPF.AcrylicWindow, System.Windows.Markup.IComponentConnector { + + + #line 27 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.TextBlock LoadingText; + + #line default + #line hidden + + + #line 28 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.ProgressBar ProgressBar; + + #line default + #line hidden + + + #line 39 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Media.GradientStop PbStop1; + + #line default + #line hidden + + + #line 51 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Controls.Canvas Layer_1; + + #line default + #line hidden + + + #line 99 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path54; + + #line default + #line hidden + + + #line 104 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path56; + + #line default + #line hidden + + + #line 109 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path58; + + #line default + #line hidden + + + #line 114 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path60; + + #line default + #line hidden + + + #line 119 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path86; + + #line default + #line hidden + + + #line 124 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path88; + + #line default + #line hidden + + + #line 129 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path90; + + #line default + #line hidden + + + #line 134 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path92; + + #line default + #line hidden + + + #line 139 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path94; + + #line default + #line hidden + + + #line 144 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path96; + + #line default + #line hidden + + + #line 149 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path98; + + #line default + #line hidden + + + #line 154 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path100; + + #line default + #line hidden + + + #line 159 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path102; + + #line default + #line hidden + + + #line 164 "..\..\UpgradingWindow.xaml" + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] + internal System.Windows.Shapes.Path path104; + + #line default + #line hidden + + private bool _contentLoaded; + + /// + /// InitializeComponent + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() { + if (_contentLoaded) { + return; + } + _contentLoaded = true; + System.Uri resourceLocater = new System.Uri("/RSSLauncher;component/upgradingwindow.xaml", System.UriKind.Relative); + + #line 1 "..\..\UpgradingWindow.xaml" + System.Windows.Application.LoadComponent(this, resourceLocater); + + #line default + #line hidden + } + + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { + switch (connectionId) + { + case 1: + + #line 10 "..\..\UpgradingWindow.xaml" + ((Launcher.UpgradingWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.UpgradingWindow_OnKeyDown); + + #line default + #line hidden + + #line 11 "..\..\UpgradingWindow.xaml" + ((Launcher.UpgradingWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.AcrylicWindow_Loaded); + + #line default + #line hidden + return; + case 2: + this.LoadingText = ((System.Windows.Controls.TextBlock)(target)); + return; + case 3: + this.ProgressBar = ((System.Windows.Controls.ProgressBar)(target)); + return; + case 4: + this.PbStop1 = ((System.Windows.Media.GradientStop)(target)); + return; + case 5: + this.Layer_1 = ((System.Windows.Controls.Canvas)(target)); + return; + case 6: + this.path54 = ((System.Windows.Shapes.Path)(target)); + return; + case 7: + this.path56 = ((System.Windows.Shapes.Path)(target)); + return; + case 8: + this.path58 = ((System.Windows.Shapes.Path)(target)); + return; + case 9: + this.path60 = ((System.Windows.Shapes.Path)(target)); + return; + case 10: + this.path86 = ((System.Windows.Shapes.Path)(target)); + return; + case 11: + this.path88 = ((System.Windows.Shapes.Path)(target)); + return; + case 12: + this.path90 = ((System.Windows.Shapes.Path)(target)); + return; + case 13: + this.path92 = ((System.Windows.Shapes.Path)(target)); + return; + case 14: + this.path94 = ((System.Windows.Shapes.Path)(target)); + return; + case 15: + this.path96 = ((System.Windows.Shapes.Path)(target)); + return; + case 16: + this.path98 = ((System.Windows.Shapes.Path)(target)); + return; + case 17: + this.path100 = ((System.Windows.Shapes.Path)(target)); + return; + case 18: + this.path102 = ((System.Windows.Shapes.Path)(target)); + return; + case 19: + this.path104 = ((System.Windows.Shapes.Path)(target)); + return; + } + this._contentLoaded = true; + } + } +} + diff --git a/Launcher/obj/project.assets.json b/Launcher/obj/project.assets.json new file mode 100644 index 0000000..e129976 --- /dev/null +++ b/Launcher/obj/project.assets.json @@ -0,0 +1,118 @@ +{ + "version": 3, + "targets": { + ".NETFramework,Version=v4.7.2": { + "ILMerge/3.0.29": { + "type": "package", + "build": { + "build/ILMerge.props": {} + } + } + }, + ".NETFramework,Version=v4.7.2/win": { + "ILMerge/3.0.29": { + "type": "package", + "build": { + "build/ILMerge.props": {} + } + } + }, + ".NETFramework,Version=v4.7.2/win-x64": { + "ILMerge/3.0.29": { + "type": "package", + "build": { + "build/ILMerge.props": {} + } + } + }, + ".NETFramework,Version=v4.7.2/win-x86": { + "ILMerge/3.0.29": { + "type": "package", + "build": { + "build/ILMerge.props": {} + } + } + } + }, + "libraries": { + "ILMerge/3.0.29": { + "sha512": "+LXIFY4L84Ve3cVgmd8tOEwFCppJynP0gY2cTmyj/8XjFaQPqaiN6jdYOrIJwtzYw3ayf69IY5vor6XXRxoigA==", + "type": "package", + "path": "ilmerge/3.0.29", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/ILMerge.props", + "docs/ilmerge-manual.md", + "ilmerge.3.0.29.nupkg.sha512", + "ilmerge.nuspec", + "tools/net452/ILMerge.exe", + "tools/net452/System.Compiler.dll" + ] + } + }, + "projectFileDependencyGroups": { + ".NETFramework,Version=v4.7.2": [ + "ILMerge >= 3.0.29" + ] + }, + "packageFolders": { + "C:\\Users\\james\\.nuget\\packages\\": {}, + "C:\\Microsoft\\Xamarin\\NuGet\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj", + "projectName": "Launcher", + "projectPath": "C:\\Projects\\JackNet\\Launcher\\Launcher.csproj", + "packagesPath": "C:\\Users\\james\\.nuget\\packages\\", + "outputPath": "C:\\Projects\\JackNet\\Launcher\\obj\\", + "projectStyle": "PackageReference", + "skipContentFileWrite": true, + "fallbackFolders": [ + "C:\\Microsoft\\Xamarin\\NuGet\\" + ], + "configFilePaths": [ + "C:\\Users\\james\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" + ], + "originalTargetFrameworks": [ + "net472" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "http://nuget.arge.be/v3/index.json": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net472": { + "projectReferences": {} + } + } + }, + "frameworks": { + "net472": { + "dependencies": { + "ILMerge": { + "target": "Package", + "version": "[3.0.29, )" + } + } + } + }, + "runtimes": { + "win": { + "#import": [] + }, + "win-x64": { + "#import": [] + }, + "win-x86": { + "#import": [] + } + } + } +} \ No newline at end of file diff --git a/Launcher/packages.config b/Launcher/packages.config new file mode 100644 index 0000000..c0a7357 --- /dev/null +++ b/Launcher/packages.config @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MarkdownUI.WPF/BaseMarkDownViewModel.cs b/MarkdownUI.WPF/BaseMarkDownViewModel.cs new file mode 100644 index 0000000..f96fd21 --- /dev/null +++ b/MarkdownUI.WPF/BaseMarkDownViewModel.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace MarkdownUI.WPF +{ + public class VirtualProperty + { + public string Name { get; set; } + public string Value { get; set; } + + public override string ToString() + { + return $"{Name}:{Value}"; + } + } + + public class VirtualCollectionItem + { + public string Name { get; set; } + public List Props { get; set; } = new List(); + public List Items { get; set; } = new List(); + } + public class VirtualViewModel + { + public string Name { get; set; } + public List Props { get; set; } = new List(); + public List Collections { get; set; } = new List(); + } + public static class VMHelpers + { + public static VirtualViewModel CreateVirtualViewModel(Type vmType, string name = "base") + { + PropertyInfo[] props = vmType.GetProperties(); + + foreach (var prop in props) + { + Console.WriteLine("{0}={1}", prop.Name, prop.PropertyType); + } + + VirtualViewModel vvm = new VirtualViewModel(); + vvm.Name = name; + foreach (var prop in props) + { + if (prop.PropertyType.FullName == "System.String") + { + var virtualProperty = new VirtualProperty + { + Name = prop.Name + }; + + vvm.Props.Add(virtualProperty); + } + else + { + + Type type = prop.PropertyType; + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>)) + { + Type itemType = type.GetGenericArguments()[0]; // use this... + + + var evm = CreateVirtualViewModel(itemType, prop.Name); + VirtualCollectionItem vci = new VirtualCollectionItem + { + Name = prop.Name, + Props = evm.Props, + Items = new List() + }; + vvm.Collections.Add(vci); + } + } + } + + return vvm; + } + } + + public class MarkDownViewModel + { + public VirtualViewModel GetVirtualViewModel() + { + VirtualViewModel vvm = VMHelpers.CreateVirtualViewModel(this.GetType()); + + + foreach (VirtualProperty virtualProperty in vvm.Props) + { + object thing = this.GetType().GetProperty(virtualProperty.Name).GetValue(this); + virtualProperty.Value = thing.ToString(); + + } + + foreach (VirtualCollectionItem virtualCollectionItem in vvm.Collections) + { + object thing = this.GetType().GetProperty(virtualCollectionItem.Name).GetValue(this); + IEnumerable iThing = thing as IEnumerable; + + virtualCollectionItem.Items.Clear(); + foreach (object markDownViewModel in iThing) + { + VirtualViewModel item = new VirtualViewModel(); + foreach (VirtualProperty virtualProperty in virtualCollectionItem.Props) + { + var prp = markDownViewModel.GetType().GetProperty(virtualProperty.Name); + object newthing = prp.GetValue(markDownViewModel); + + item.Props.Add(new VirtualProperty + { + Name = virtualProperty.Name, + Value = newthing.ToString() + }); + + } + virtualCollectionItem.Items.Add(item); + } + } + + return vvm; + } + //should be string,generic or string,object, lets use strings for now + public Dictionary bindings = new Dictionary(); + public Dictionary>> updateUIBindings = new Dictionary>>(); + + //should be generic, lets use strings for now + public bool Set(ref string backingProperty, string newValue, [CallerMemberName] string callerMemberName = "") + { + if (backingProperty == null && newValue == null) + { + //do nothing + return false; + } + + if ((backingProperty == null && newValue != null) || (backingProperty != null && newValue == null) || !backingProperty.Equals(newValue)) + { + if (bindings.ContainsKey(callerMemberName)) + { + bindings.Remove(callerMemberName); + } + + bindings.Add(callerMemberName, newValue); + backingProperty = newValue; + + if (updateUIBindings.ContainsKey(callerMemberName)) + { + foreach (var inv in updateUIBindings[callerMemberName]) + { + inv?.Invoke(newValue); + } + } + + } + return false; + } + } +} diff --git a/MarkdownUI.WPF/MarkdownHandler.cs b/MarkdownUI.WPF/MarkdownHandler.cs new file mode 100644 index 0000000..f90c00b --- /dev/null +++ b/MarkdownUI.WPF/MarkdownHandler.cs @@ -0,0 +1,1121 @@ +using Microsoft.Toolkit.Parsers.Markdown; +using Microsoft.Toolkit.Parsers.Markdown.Blocks; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace MarkdownUI.WPF +{ + public class MarkdownUIHandler + { + public MarkdownUIHandler() + { + + } + + public MarkdownUIHandler(string body, MarkDownViewModel viewmodel, ResourceDictionary resourceDictionary) + { + Markdown = body; + ViewModel = viewmodel; + this.resourceDictionary = resourceDictionary; + } + + private ResourceDictionary resourceDictionary; + public string Markdown { get; set; } + public MarkDownViewModel ViewModel { get; internal set; } + public void Read(string path) + { + Markdown = File.ReadAllText(path); + } + + public void Load(string body) + { + Markdown = body; + } + + private void ProcessInline(TextBlock panel, MarkdownInline inline) + { + try + { + var tp = inline.GetType(); + // Debug.WriteLine(tp); + + switch (inline) + { + case TextRunInline textRun: + { + panel.Inlines.Add(textRun.Text); + break; + } + + case BoldTextInline boldText: + { + TextBlock tb = new TextBlock(); + //tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownBold")); + tb.FontWeight = FontWeights.Bold; + + foreach (var il in boldText.Inlines) + { + ProcessInline(tb, il); + } + + panel.Inlines.Add(tb); + + break; + } + + case ItalicTextInline italic: + { + TextBlock tb = new TextBlock(); + //tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownParagraph")); + tb.FontStyle = FontStyles.Italic; + + foreach (var il in italic.Inlines) + { + ProcessInline(tb, il); + } + + panel.Inlines.Add(tb); + + break; + } + + case MarkdownLinkInline linkInline: + { + Debug.WriteLine(linkInline.Url); + + + + TextBlock buttonTextBlock = new TextBlock(); + buttonTextBlock.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownParagraph")); + foreach (var il in linkInline.Inlines) + { + ProcessInline(buttonTextBlock, il); + } + + Button but = new Button(); + but.HorizontalAlignment = HorizontalAlignment.Left; + + + + but.Content = buttonTextBlock; + + if (!linkInline.Url.StartsWith("http")) + { + but.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownButton")); + but.Click += (object sender, RoutedEventArgs e) => + { + var asm = Assembly.GetAssembly(ViewModel.GetType()); + MethodInfo[] mi = ViewModel.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance); + Debug.Write("Executing " + linkInline.Url + " method"); + foreach (var t in mi) + { + Debug.WriteLine(t.Name.ToString()); + } + MethodInfo thisOne = mi.First(x => x.Name == linkInline.Url); + thisOne?.Invoke(ViewModel, null); + }; + } + else + { + buttonTextBlock.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownHrefTextBlock")); + but.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownHref")); + but.Click += (object sender, RoutedEventArgs e) => NavigateToUrl(linkInline.Url); + } + + panel.Inlines.Add(but); + + break; + } + + case ImageInline imageInline: + { + Image image = new Image(); + image.Source = new BitmapImage(new Uri(imageInline.Url)); + image.ToolTip = imageInline.Tooltip; + if (imageInline.ImageWidth > 0) + { + image.Width = imageInline.ImageWidth; + } + + if (imageInline.ImageHeight > 0) + { + image.Height = imageInline.ImageHeight; + } + + image.HorizontalAlignment = HorizontalAlignment.Left; + image.VerticalAlignment = VerticalAlignment.Top; + + panel.Inlines.Add(image); + + break; + } + + case CodeInline codeInline: + { + TextBlock tb = new TextBlock(); + tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownCode")); + + tb.Text = codeInline.Text; + + panel.Inlines.Add(tb); + break; + } + case InputInline inputInline: + { + switch (inputInline.InputType.ToLower()) + { + case "text": + { + + TextBox tb = new TextBox(); + tb.HorizontalAlignment = HorizontalAlignment.Left; + tb.Width = 300; + tb.Text = GetVMValue(inputInline.BoundTo); + + + + if (RequireArgs(inputInline.Args, "width")) + { + tb.Width = int.Parse(inputInline.Args["width"]); + } + + Debug.WriteLine(inputInline.BoundTo); + MarkDownViewModel vm = GetVM(inputInline.BoundTo); + + if (vm == null) + { + Debug.WriteLine("Couldnt ascertain VM"); + } + else + { + if (GetPropName(inputInline.BoundTo) != null && + !vm.updateUIBindings.ContainsKey(GetPropName(inputInline.BoundTo))) + { + vm.updateUIBindings.Add(GetPropName(inputInline.BoundTo), + new List>()); + } + + vm.updateUIBindings[GetPropName(inputInline.BoundTo)].Add( + (newString) => { tb.Text = newString; }); + + tb.TextChanged += (object sender, TextChangedEventArgs e) => + { + Type myType = vm.GetType(); + PropertyInfo myPropInfo = + myType.GetProperty(GetPropName(inputInline.BoundTo)); + if (myPropInfo != null) + { + myPropInfo.SetValue(vm, tb.Text, null); + } + else + { + string dummy = Guid.NewGuid().ToString(); + ViewModel.Set(ref dummy, tb.Text, inputInline.BoundTo); + } + }; + } + + panel.Inlines.Add(tb); + break; + } + + case "label": + { + TextBlock tb = new TextBlock(); + tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownParagraph")); + + tb.Text = GetVMValue(inputInline.BoundTo); + + if (RequireArgs(inputInline.Args, "width")) + { + tb.Width = int.Parse(inputInline.Args["width"]); + } + MarkDownViewModel vm = GetVM(inputInline.BoundTo); + + if (GetPropName(inputInline.BoundTo) != null && !vm.updateUIBindings.ContainsKey(GetPropName(inputInline.BoundTo))) + { + vm.updateUIBindings.Add(GetPropName(inputInline.BoundTo), new List>()); + } + + vm.updateUIBindings[GetPropName(inputInline.BoundTo)].Add( + (newString) => + { + tb.Text = newString; + }); + + + panel.Inlines.Add(tb); + break; + } + + case "slider": + { + + Slider tb = new Slider(); + tb.HorizontalAlignment = HorizontalAlignment.Left; + tb.Width = 300; + tb.Value = double.Parse(GetVMValue(inputInline.BoundTo)); + tb.Minimum = 0; + tb.Maximum = 100; + + if (RequireArgs(inputInline.Args, "width")) tb.Width = int.Parse(inputInline.Args["width"]); + if (RequireArgs(inputInline.Args, "min")) tb.Minimum = int.Parse(inputInline.Args["min"]); + if (RequireArgs(inputInline.Args, "max")) tb.Minimum = int.Parse(inputInline.Args["max"]); + + + MarkDownViewModel vm = GetVM(inputInline.BoundTo); + + if (GetPropName(inputInline.BoundTo) != null && !vm.updateUIBindings.ContainsKey(GetPropName(inputInline.BoundTo))) + { + vm.updateUIBindings.Add(GetPropName(inputInline.BoundTo), new List>()); + } + + vm.updateUIBindings[GetPropName(inputInline.BoundTo)].Add( + (newString) => + { + tb.Value = double.Parse(newString); + }); + + tb.ValueChanged += (object sender, RoutedPropertyChangedEventArgs e) => + { + Type myType = vm.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(GetPropName(inputInline.BoundTo)); + myPropInfo.SetValue(vm, tb.Value.ToString(), null); + }; + + panel.Inlines.Add(tb); + break; + } + + case "dropdown": + { + if (RequireArgs(inputInline.Args, "source")) + { + ComboBox tb = new ComboBox(); + if (RequireArgs(inputInline.Args, "width")) tb.Width = int.Parse(inputInline.Args["width"]); + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(inputInline.BoundTo); + + var tx = myPropInfo.GetValue(ViewModel); + + List doop = (tx as IEnumerable).Cast().ToList(); + List doop2 = (tx as IEnumerable).Cast().ToList(); + + List prps = new List(); + string fname = inputInline.Args["source"]; + foreach (var op in doop2) + { + Type myType2 = op.GetType(); + PropertyInfo myPropInfo2 = myType2.GetProperty(fname); + if (myPropInfo2 != null) + { + var herp = myPropInfo2.GetValue(op); + + Debug.WriteLine(herp); + prps.Add((string)herp); + tb.Items.Add(herp); + } + } + + + + if (RequireArgs(inputInline.Args, "selected")) + { + string selectedPropName = inputInline.Args["selected"]; + + var tt = GetVMValue(selectedPropName); + + if (prps.Contains(tt)) + { + tb.SelectedIndex = prps.IndexOf(tt); + } + + tb.SelectionChanged += (object sender, SelectionChangedEventArgs e) => + { + int selected = tb.SelectedIndex; + string i1 = (string)tb.SelectedItem; + string i2 = prps[tb.SelectedIndex]; + SetVMValue(selectedPropName, i1); + }; + } + + + panel.Inlines.Add(tb); + } + break; + } + } + + break; + } + + case SuperscriptTextInline superScript: + { + Debug.WriteLine(superScript); + + int tt = 0; + foreach (var i in superScript.Inlines) + { + Debug.WriteLine(tt + " : " + i.GetType() + "/" + i.ToString()); + tt++; + } + + if (superScript.Inlines.Count > 1 && superScript.Inlines.First() is CodeInline codeInline) + { + string cmd = codeInline.Text; + Dictionary args = new Dictionary(); + for (int i = 1; i < superScript.Inlines.Count; i = i + 2) + { + if (superScript.Inlines[i] is TextRunInline trl) + { + if (trl.Text.EndsWith("=")) + { + if (superScript.Inlines.Count > i) + { + if (superScript.Inlines[i + 1] is CodeInline ci) + { + args.Add(trl.Text.Substring(0, trl.Text.Length - 1).Trim(), ci.Text); + } + } + } + } + } + + Debug.WriteLine(args); + + switch (cmd.ToLower()) + { + + case "input": + { + if (RequireArgs(args, "binding")) + { + + TextBox tb = new TextBox(); + tb.HorizontalAlignment = HorizontalAlignment.Left; + tb.Width = 300; + tb.Text = GetVMValue(args["binding"]); + + if (RequireArgs(args, "width")) + { + tb.Width = int.Parse(args["width"]); + } + + + MarkDownViewModel vm = GetVM(args["binding"]); + + if (!vm.updateUIBindings.ContainsKey(GetPropName(args["binding"]))) + { + vm.updateUIBindings.Add(GetPropName(args["binding"]), new List>()); + } + + vm.updateUIBindings[GetPropName(args["binding"])].Add( + (newString) => + { + tb.Text = newString; + }); + + tb.TextChanged += (object sender, TextChangedEventArgs e) => + { + Type myType = vm.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(GetPropName(args["binding"])); + myPropInfo.SetValue(vm, tb.Text, null); + }; + + panel.Inlines.Add(tb); + + } + break; + } + + case "slider": + { + if (RequireArgs(args, "binding")) + { + Slider sl = new Slider(); + sl.Minimum = 0; + sl.Maximum = 100; + sl.HorizontalAlignment = HorizontalAlignment.Left; + sl.Width = 300; + + if (RequireArgs(args, "width")) + { + sl.Width = int.Parse(args["width"]); + } + + if (RequireArgs(args, "min")) + { + sl.Minimum = int.Parse(args["min"]); + } + + if (RequireArgs(args, "max")) + { + sl.Maximum = int.Parse(args["max"]); + } + + if (!ViewModel.updateUIBindings.ContainsKey(args["binding"])) + { + ViewModel.updateUIBindings.Add(args["binding"], new List>()); + } + + ViewModel.updateUIBindings[args["binding"]].Add( + (newString) => + { + int vl = 0; + if (int.TryParse(newString, out vl)) + { + sl.Value = vl; + } + }); + + sl.ValueChanged += (object sender, RoutedPropertyChangedEventArgs e) => + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(args["binding"]); + myPropInfo.SetValue(ViewModel, sl.Value.ToString(), null); + }; + + panel.Inlines.Add(sl); + } + break; + } + } + } + + break; + } + + //case CommentInline commentInline: + // { + // Debug.WriteLine(commentInline); + // break; + // } + + default: + + Debug.WriteLine("WTF IS '" + tp + "'"); + break; + } + } + catch { } + } + + + + private bool RequireArgs(Dictionary args, params string[] requiredArgs) + { + foreach (var s in requiredArgs) + { + if (!args.ContainsKey(s)) return false; + } + + return true; + } + + private void NavigateToUrl(string url) + { + Process.Start(new ProcessStartInfo(url)); + } + + private void AddInlinesToStackPanel(StackPanel stackPanel, IList inlines) + { + TextBlock test = new TextBlock(); + test.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownParagraph")); + + + foreach (var inline in inlines) + { + ProcessInline(test, inline); + } + + stackPanel.Children.Add(test); + } + + private void OldAddInlinesToStackPanel(StackPanel stackPanel, IList inlines, MarkdownInlineType style = MarkdownInlineType.TextRun) + { + foreach (var i2 in inlines) + { + MarkdownInlineType style2 = i2.Type; + + Debug.WriteLine("----------------------------------------------------------------------------------- " + style2); + + var lines = i2.ToString().Split('\n'); + foreach (var i in lines) + { + StackPanel stack = new StackPanel(); + stack.Orientation = Orientation.Horizontal; + + string st2 = i.ToString().Replace("\r", "").Trim(); + + var tp = st2.Split(new string[] { ">>" }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()); + + foreach (var st in tp) + { + if (st.StartsWith("<<")) + { + string body = st.Substring(2).Trim(); + string[] parts = body.Split(':'); + + string cmd = parts[1].Split('~').First(); + List prms = parts[1].Split('>').First().Split('~').ToList(); + prms.RemoveAt(0); + + switch (cmd.ToLower()) + { + case "button": + { + Button but = new Button(); + but.HorizontalAlignment = HorizontalAlignment.Left; + but.Content = prms[0]; + but.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownButton")); + but.Click += (object sender, RoutedEventArgs e) => + { + var asm = Assembly.GetAssembly(ViewModel.GetType()); + MethodInfo[] mi = ViewModel.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance); + MethodInfo thisOne = mi.First(x => x.Name.ToLower() == prms[1].ToLower()); + thisOne?.Invoke(ViewModel, null); + }; + + stack.Children.Add(but); + break; + } + + case "text": + { + TextBox tb = new TextBox(); + tb.HorizontalAlignment = HorizontalAlignment.Left; + tb.Width = 300; + tb.Text = GetVMValue(prms[0]); + + MarkDownViewModel vm = GetVM(prms[0]); + + if (!vm.updateUIBindings.ContainsKey(GetPropName(prms[0]))) + { + vm.updateUIBindings.Add(GetPropName(prms[0]), new List>()); + } + + vm.updateUIBindings[GetPropName(prms[0])].Add( + (newString) => + { + tb.Text = newString; + }); + + tb.TextChanged += (object sender, TextChangedEventArgs e) => + { + Type myType = vm.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(GetPropName(prms[0])); + myPropInfo.SetValue(vm, tb.Text, null); + }; + stack.Children.Add(tb); + break; + } + + case "slider": + { + Slider sl = new Slider(); + sl.Minimum = int.Parse(prms[1]); + sl.Maximum = int.Parse(prms[2]); + sl.HorizontalAlignment = HorizontalAlignment.Left; + sl.Width = 300; + + if (!ViewModel.updateUIBindings.ContainsKey(prms[0])) + { + ViewModel.updateUIBindings.Add(prms[0], new List>()); + } + + ViewModel.updateUIBindings[prms[0]].Add( + (newString) => + { + int vl = 0; + if (int.TryParse(newString, out vl)) + { + sl.Value = vl; + } + }); + + sl.ValueChanged += (object sender, RoutedPropertyChangedEventArgs e) => + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(prms[0]); + myPropInfo.SetValue(ViewModel, sl.Value.ToString(), null); + }; + + stack.Children.Add(sl); + break; + } + } + } + else + { + TextBlock tb = new TextBlock(); + tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownParagraph")); + + tb.Text = String.Join(" ", i); + + + if (style == MarkdownInlineType.Bold) + { + tb.FontWeight = FontWeights.ExtraBold; + } + + if (style == MarkdownInlineType.Italic) + { + tb.FontStyle = FontStyles.Italic; + } + + stack.Children.Add(tb); + } + } + + stackPanel.Children.Add(stack); + } + } + } + + + + private string GetVMValue(string propName) + { + if (propName.StartsWith("[")) + { + string pp = propName.Substring(1, propName.Length - 2); + string pname = pp.Substring(0, pp.IndexOf("[")); + + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(pname); + object derp = myPropInfo.GetValue(ViewModel); + + string index = pp.Substring(pp.IndexOf("[") + 1); + index = index.Substring(0, index.IndexOf("]")); + + + List doop2 = (derp as IEnumerable).Cast().ToList(); + + object doop3 = doop2[int.Parse(index)]; + + string subprobName = pp.Substring(pp.IndexOf(".") + 1); + + Type myType2 = doop3.GetType(); + PropertyInfo myPropInfo2 = myType2.GetProperty(subprobName); + object derpy = myPropInfo2.GetValue(doop3); + + return derpy.ToString(); + + return null; + } + else + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(propName); + if (myPropInfo == null) return null; + object derp = myPropInfo.GetValue(ViewModel); + return derp.ToString(); + } + } + + private string GetPropName(string propName) + { + if (propName.StartsWith("[")) + { + string pp = propName.Substring(1, propName.Length - 2); + string subprobName = pp.Substring(pp.IndexOf(".") + 1); + return subprobName; + } + else + { + return propName; + } + } + + private MarkDownViewModel GetVM(string propName) + { + if (propName.StartsWith("[")) + { + string pp = propName.Substring(1, propName.Length - 2); + string pname = pp.Substring(0, pp.IndexOf("[")); + + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(pname); + object derp = myPropInfo.GetValue(ViewModel); + + string index = pp.Substring(pp.IndexOf("[") + 1); + index = index.Substring(0, index.IndexOf("]")); + + + List doop2 = (derp as IEnumerable).Cast().ToList(); + + object doop3 = doop2[int.Parse(index)]; + + string subprobName = pp.Substring(pp.IndexOf(".") + 1); + + return doop3 as MarkDownViewModel; + + Type myType2 = doop3.GetType(); + PropertyInfo myPropInfo2 = myType2.GetProperty(subprobName); + object derpy = myPropInfo2.GetValue(doop3); + + return derpy as MarkDownViewModel; + + return null; + } + else + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(propName); + if (myPropInfo == null) return ViewModel; + object derp = myPropInfo.GetValue(ViewModel); + var herp = derp as MarkDownViewModel; + + if (herp == null) + { + return ViewModel; + } + else + { + return herp; + } + } + } + + private void SetVMValue(string propName, string value) + { + if (propName.StartsWith("[")) + { + string pp = propName.Substring(1, propName.Length - 2); + string pname = pp.Substring(0, pp.IndexOf("[")); + + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(pname); + object derp = myPropInfo.GetValue(ViewModel); + + string index = pp.Substring(pp.IndexOf("[") + 1); + index = index.Substring(0, index.IndexOf("]")); + + + List doop2 = (derp as IEnumerable).Cast().ToList(); + + object doop3 = doop2[int.Parse(index)]; + + string subprobName = pp.Substring(pp.IndexOf(".") + 1); + + Type myType2 = doop3.GetType(); + PropertyInfo myPropInfo2 = myType2.GetProperty(subprobName); + myPropInfo2.SetValue(doop3, value); + + } + else + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(propName); + myPropInfo.SetValue(ViewModel, value); + } + } + PropertyInfo GetProp(string propName) + { + if (propName.StartsWith("[")) + { + string pp = propName.Substring(1, propName.Length - 2); + string pname = pp.Substring(0, pp.IndexOf("[")); + + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(pname); + object derp = myPropInfo.GetValue(ViewModel); + + string index = pp.Substring(pp.IndexOf("[") + 1); + index = index.Substring(0, index.IndexOf("]")); + + + List doop2 = (derp as IEnumerable).Cast().ToList(); + + object doop3 = doop2[int.Parse(index)]; + + string subprobName = pp.Substring(pp.IndexOf(".") + 1); + + Type myType2 = doop3.GetType(); + PropertyInfo myPropInfo2 = myType2.GetProperty(subprobName); + + return myPropInfo2; + } + else + { + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(propName); + + return myPropInfo; + } + } + Style GetResource(string name) + { + object found = resourceDictionary[name]; + return (Style)found; + } + public string Unroll(string markdown) + { + var thing = Regex.Matches(markdown, "<>"); + + List finders = new List(); + + foreach (Match m in thing) + { + string p = m.Value.Substring(11, m.Value.Length - 13); + + var otherThing = markdown.IndexOf("<"); + if (otherThing >= 0) + { + + var thing2 = Regex.Matches(markdown, "(?s)(?<=<>).*?(?=<>)"); + if (thing2.Count > 0) + { + var tttt = thing2[0]; + + Type myType = ViewModel.GetType(); + PropertyInfo myPropInfo = myType.GetProperty(p); + + var tx = myPropInfo.GetValue(ViewModel); + + List doop2 = (tx as IEnumerable).Cast().ToList(); + + string newbody = ""; + for (int i = 0; i < doop2.Count; i++) + { + string item = tttt.Value.TrimStart().Replace(p, p + "[" + i + "]"); + newbody = newbody + item; + } + + markdown = markdown.Replace($"<>{tttt.Value}<>", newbody); + + //Debug.WriteLine(tx); + } + + } + finders.Add(p); + } + + Debug.WriteLine(markdown); + return markdown; + } + + public void RenderToUI(StackPanel stackPanel, [CallerMemberName] string callerMemberName = "") + { + stackPanel.Children.Clear(); + + string tmp = Markdown; + var tt = Unroll(tmp); + + MarkdownDocument document = new MarkdownDocument(); + + document.Parse(tt); + + RenderBlocks(stackPanel, document.Blocks); + } + + void RenderBlocks(StackPanel stackPanel, IList blocks) + { + + foreach (MarkdownBlock b in blocks) + { + //Debug.WriteLine(b.GetType() + " - " + b.Type); + + switch (b) + { + case HorizontalRuleBlock horizontalRuleBlock: + { + Grid gd = new Grid(); + gd.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownHorizontalRule")); + + stackPanel.Children.Add(gd); + + break; + } + + case ListBlock listBlock: + { + Grid gd = new Grid(); + + gd.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownOrderedList")); + + gd.ColumnDefinitions.Add(new ColumnDefinition()); + gd.ColumnDefinitions.Add(new ColumnDefinition()); + + bool numbered = listBlock.Style == ListStyle.Numbered; + + int ay = -1; + foreach (var l in listBlock.Items) + { + gd.RowDefinitions.Add(new RowDefinition()); + ay++; + + TextBlock tbx = new TextBlock(); + tbx.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownOrderedListIndex")); + + + if (numbered) + { + tbx.Text = (ay + 1).ToString() + "."; + } + else + { + tbx.Text = "•"; + } + + gd.Children.Add(tbx); + Grid.SetColumn(tbx, 0); + Grid.SetRow(tbx, ay); + + + StackPanel sspItem = new StackPanel(); + RenderBlocks(sspItem, l.Blocks); + + Grid.SetColumn(sspItem, 1); + Grid.SetRow(sspItem, ay); + gd.Children.Add(sspItem); + + + + + + + } + + stackPanel.Children.Add(gd); + break; + } + case QuoteBlock quoteBlock: + { + Border brd = new Border(); + brd.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownBlockQuoteBorder")); + + Grid grd = new Grid(); + grd.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownBlockQuoteGrid")); + + brd.Child = grd; + StackPanel ssp = new StackPanel(); + + RenderBlocks(ssp, quoteBlock.Blocks); + + grd.Children.Add(ssp); + + stackPanel.Children.Add(brd); + break; + } + + case HeaderBlock headerblock: + { + TextBlock tb = new TextBlock(); + tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownHeader" + headerblock.HeaderLevel)); + int fontSize = (5 - headerblock.HeaderLevel) * 12; + //tb.FontSize = fontSize; + tb.Text = String.Join("\r\n", headerblock.Inlines); + + stackPanel.Children.Add(tb); + break; + } + + case ParagraphBlock paragraph: + { + //Debug.WriteLine(paragraph); + + AddInlinesToStackPanel(stackPanel, paragraph.Inlines); + + break; + + + + } + + case TableBlock tableBlock: + { + Grid grid = new Grid(); + + foreach (var t in tableBlock.Rows) + { + grid.RowDefinitions.Add(new RowDefinition()); + } + + foreach (var t in tableBlock.ColumnDefinitions) + { + grid.ColumnDefinitions.Add(new ColumnDefinition()); + } + + int ay = 0; + foreach (var y in tableBlock.Rows) + { + int ax = 0; + foreach (var x in tableBlock.ColumnDefinitions) + { + if (y.Cells.Count >= ax) + { + try + { + StackPanel sp = new StackPanel(); + Border border = new Border(); + border.BorderBrush = Brushes.Black; + border.BorderThickness = new Thickness(1); + border.Child = sp; + grid.Children.Add(border); + + Grid.SetColumn(border, ax); + Grid.SetRow(border, ay); + + if (ax < y.Cells.Count) + { + var current = y.Cells[ax]; + + AddInlinesToStackPanel(sp, current.Inlines); + } + } + catch { } + ax++; + } + } + + ay++; + } + + stackPanel.Children.Add(grid); + + break; + } + + case CodeBlock codeBlock: + { + Grid codeBlockGrid = new Grid(); + codeBlockGrid.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownCodeGrid")); + + TextBlock tb = new TextBlock(); + tb.SetValue(FrameworkElement.StyleProperty, GetResource("MarkdownCodeBlock")); + + tb.Text = codeBlock.Text; + + codeBlockGrid.Children.Add(tb); + stackPanel.Children.Add(codeBlockGrid); + + break; + } + + default: + { + var unknownType = b.GetType(); + + Debug.WriteLine("Cant handle " + unknownType); + break; + } + } + } + } + + + } +} diff --git a/MarkdownUI.WPF/MarkdownReader.cs b/MarkdownUI.WPF/MarkdownReader.cs new file mode 100644 index 0000000..9dad6ce --- /dev/null +++ b/MarkdownUI.WPF/MarkdownReader.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace MarkdownUI.WPF +{ + public static class MarkdownReader + { + + public static string GetText(this Assembly assembly, string path) + { + var assemblyName = assembly.GetName(); + var justName = assemblyName.Name; + string fullPath = justName + "." + path; + Debug.WriteLine(fullPath); + Stream stream = assembly.GetManifestResourceStream(fullPath); + TextReader tr = new StreamReader(stream); + + return tr.ReadToEnd(); + } + + } +} diff --git a/MarkdownUI.WPF/MarkdownUI.WPF.csproj b/MarkdownUI.WPF/MarkdownUI.WPF.csproj new file mode 100644 index 0000000..dcad296 --- /dev/null +++ b/MarkdownUI.WPF/MarkdownUI.WPF.csproj @@ -0,0 +1,127 @@ + + + + + Debug + AnyCPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB} + Library + Properties + MarkdownUI.WPF + MarkdownUI.WPF + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + ..\RGBSync+\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + ..\RGBSync+\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\RGBSync+\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\RGBSync+\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MarkdownUI.WPF/MarkdownUIBundle.cs b/MarkdownUI.WPF/MarkdownUIBundle.cs new file mode 100644 index 0000000..89c6ed8 --- /dev/null +++ b/MarkdownUI.WPF/MarkdownUIBundle.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MarkdownUI.WPF +{ + public class MarkdownUIBundle + { + public string Markdown { get; set; } + public VirtualViewModel ViewModel { get; set; } + } +} diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/IParser.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/IParser.cs new file mode 100644 index 0000000..909de12 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/IParser.cs @@ -0,0 +1,23 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.Toolkit.Parsers +{ + /// + /// Parser interface. + /// + /// Type to parse into. + public interface IParser + where T : SchemaBase + { + /// + /// Parse method which all classes must implement. + /// + /// Data to parse. + /// Strong typed parsed data. + IEnumerable Parse(string data); + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/ParseHelpers.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/ParseHelpers.cs new file mode 100644 index 0000000..e191c5b --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/ParseHelpers.cs @@ -0,0 +1,38 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Core +{ + /// + /// This class offers helpers for Parsing. + /// + public static class ParseHelpers + { + /// + /// Determines if a Markdown string is blank or comprised entirely of whitespace characters. + /// + /// true if blank or white space + public static bool IsMarkdownBlankOrWhiteSpace(string str) + { + for (int i = 0; i < str.Length; i++) + { + if (!IsMarkdownWhiteSpace(str[i])) + { + return false; + } + } + + return true; + } + + /// + /// Determines if a character is a Markdown whitespace character. + /// + /// true if is white space + public static bool IsMarkdownWhiteSpace(char c) + { + return c == ' ' || c == '\t' || c == '\r' || c == '\n'; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/SchemaBase.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/SchemaBase.cs new file mode 100644 index 0000000..f896d5d --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/SchemaBase.cs @@ -0,0 +1,17 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers +{ + /// + /// Strong typed schema base class. + /// + public abstract class SchemaBase + { + /// + /// Gets or sets identifier for strong typed record. + /// + public string InternalID { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/StringValueAttribute.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/StringValueAttribute.cs new file mode 100644 index 0000000..551a034 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Core/StringValueAttribute.cs @@ -0,0 +1,30 @@ +// 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. + +using System; + +namespace Microsoft.Toolkit.Parsers.Core +{ + /// + /// The StringValue attribute is used as a helper to decorate enum values with string representations. + /// + [AttributeUsage(AttributeTargets.Field)] + public sealed class StringValueAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// Constructor accepting string value. + /// + /// String value + public StringValueAttribute(string value) + { + Value = value; + } + + /// + /// Gets property for string value. + /// + public string Value { get; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/CodeBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/CodeBlock.cs new file mode 100644 index 0000000..007162e --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/CodeBlock.cs @@ -0,0 +1,196 @@ +// 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. + +using System.Text; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a block of text that is displayed in a fixed-width font. Inline elements and + /// escape sequences are ignored inside the code block. + /// + public class CodeBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public CodeBlock() + : base(MarkdownBlockType.Code) + { + } + + /// + /// Gets or sets the source code to display. + /// + public string Text { get; set; } + + /// + /// Gets or sets the Language specified in prefix, e.g. ```c# (Github Style Parsing). + /// This does not guarantee that the Code Block has a language, or no language, some valid code might not have been prefixed, and this will still return null. + /// To ensure all Code is Highlighted (If desired), you might have to determine the language from the provided string, such as looking for key words. + /// + public string CodeLanguage { get; set; } + + /// + /// Parses a code block. + /// + /// The markdown text. + /// The location of the first character in the block. + /// The location to stop parsing. + /// The current nesting level for block quoting. + /// Set to the end of the block when the return value is non-null. + /// A parsed code block, or null if this is not a code block. + internal static CodeBlock Parse(string markdown, int start, int maxEnd, int quoteDepth, out int actualEnd) + { + StringBuilder code = null; + actualEnd = start; + bool insideCodeBlock = false; + string codeLanguage = string.Empty; + + /* + Two options here: + Either every line starts with a tab character or at least 4 spaces + Or the code block starts and ends with ``` + */ + + foreach (var lineInfo in Common.ParseLines(markdown, start, maxEnd, quoteDepth)) + { + int pos = lineInfo.StartOfLine; + if (pos < maxEnd && markdown[pos] == '`') + { + var backTickCount = 0; + while (pos < maxEnd && backTickCount < 3) + { + if (markdown[pos] == '`') + { + backTickCount++; + } + else + { + break; + } + + pos++; + } + + if (backTickCount == 3) + { + insideCodeBlock = !insideCodeBlock; + + if (!insideCodeBlock) + { + actualEnd = lineInfo.StartOfNextLine; + break; + } + else + { + // Collects the Programming Language from the end of the starting ticks. + while (pos < lineInfo.EndOfLine) + { + codeLanguage += markdown[pos]; + pos++; + } + } + } + } + + if (!insideCodeBlock) + { + // Add every line that starts with a tab character or at least 4 spaces. + if (pos < maxEnd && markdown[pos] == '\t') + { + pos++; + } + else + { + int spaceCount = 0; + while (pos < maxEnd && spaceCount < 4) + { + if (markdown[pos] == ' ') + { + spaceCount++; + } + else if (markdown[pos] == '\t') + { + spaceCount += 4; + } + else + { + break; + } + + pos++; + } + + if (spaceCount < 4) + { + // We found a line that doesn't start with a tab or 4 spaces. + // But don't end the code block until we find a non-blank line. + if (lineInfo.IsLineBlank == false) + { + break; + } + } + } + } + + // Separate each line of the code text. + if (code == null) + { + code = new StringBuilder(); + } + else + { + code.AppendLine(); + } + + if (lineInfo.IsLineBlank == false) + { + // Append the code text, excluding the first tab/4 spaces, and convert tab characters into spaces. + string lineText = markdown.Substring(pos, lineInfo.EndOfLine - pos); + int startOfLinePos = code.Length; + for (int i = 0; i < lineText.Length; i++) + { + char c = lineText[i]; + if (c == '\t') + { + code.Append(' ', 4 - ((code.Length - startOfLinePos) % 4)); + } + else + { + code.Append(c); + } + } + } + + // Update the end position. + actualEnd = lineInfo.StartOfNextLine; + } + + if (code == null) + { + // Not a valid code block. + actualEnd = start; + return null; + } + + // Blank lines should be trimmed from the start and end. + return new CodeBlock() + { + Text = code.ToString().Trim('\r', '\n'), + CodeLanguage = !string.IsNullOrWhiteSpace(codeLanguage) ? codeLanguage.Trim() : null + }; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return Text; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HeaderBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HeaderBlock.cs new file mode 100644 index 0000000..9a7d6db --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HeaderBlock.cs @@ -0,0 +1,168 @@ +// 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. + +using System; +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a heading. + /// Single-Line Header CommonMark Spec + /// Two-Line Header CommonMark Spec + /// + public class HeaderBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public HeaderBlock() + : base(MarkdownBlockType.Header) + { + } + + private int _headerLevel; + + /// + /// Gets or sets the header level (1-6). 1 is the most important header, 6 is the least important. + /// + public int HeaderLevel + { + get + { + return _headerLevel; + } + + set + { + if (value < 1 || value > 6) + { + throw new ArgumentOutOfRangeException("HeaderLevel", "The header level must be between 1 and 6 (inclusive)."); + } + + _headerLevel = value; + } + } + + /// + /// Gets or sets the contents of the block. + /// + public IList Inlines { get; set; } + + /// + /// Parses a header that starts with a hash. + /// + /// The markdown text. + /// The location of the first hash character. + /// The location of the end of the line. + /// A parsed header block, or null if this is not a header. + internal static HeaderBlock ParseHashPrefixedHeader(string markdown, int start, int end) + { + // This type of header starts with one or more '#' characters, followed by the header + // text, optionally followed by any number of hash characters. + var result = new HeaderBlock(); + + // Figure out how many consecutive hash characters there are. + int pos = start; + while (pos < end && markdown[pos] == '#' && pos - start < 6) + { + pos++; + } + + result.HeaderLevel = pos - start; + if (result.HeaderLevel == 0) + { + return null; + } + + // Ignore any hashes at the end of the line. + while (pos < end && markdown[end - 1] == '#') + { + end--; + } + + // Parse the inline content. + result.Inlines = Common.ParseInlineChildren(markdown, pos, end); + return result; + } + + /// + /// Parses a two-line header. + /// + /// The markdown text. + /// The location of the start of the first line. + /// The location of the end of the first line. + /// The location of the start of the second line. + /// The location of the end of the second line. + /// A parsed header block, or null if this is not a header. + internal static HeaderBlock ParseUnderlineStyleHeader(string markdown, int firstLineStart, int firstLineEnd, int secondLineStart, int secondLineEnd) + { + // This type of header starts with some text on the first line, followed by one or more + // underline characters ('=' or '-') on the second line. + // The second line can have whitespace after the underline characters, but not before + // or between each character. + + // Check the second line is valid. + if (secondLineEnd <= secondLineStart) + { + return null; + } + + // Figure out what the underline character is ('=' or '-'). + char underlineChar = markdown[secondLineStart]; + if (underlineChar != '=' && underlineChar != '-') + { + return null; + } + + // Read past consecutive underline characters. + int pos = secondLineStart + 1; + for (; pos < secondLineEnd; pos++) + { + char c = markdown[pos]; + if (c != underlineChar) + { + break; + } + + pos++; + } + + // The rest of the line must be whitespace. + for (; pos < secondLineEnd; pos++) + { + char c = markdown[pos]; + if (c != ' ' && c != '\t') + { + return null; + } + + pos++; + } + + var result = new HeaderBlock(); + result.HeaderLevel = underlineChar == '=' ? 1 : 2; + + // Parse the inline content. + result.Inlines = Common.ParseInlineChildren(markdown, firstLineStart, firstLineEnd); + return result; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return string.Join(string.Empty, Inlines); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HorizontalRuleBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HorizontalRuleBlock.cs new file mode 100644 index 0000000..12a3b48 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/HorizontalRuleBlock.cs @@ -0,0 +1,74 @@ +// 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. + +using Microsoft.Toolkit.Parsers.Core; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a horizontal line. + /// + public class HorizontalRuleBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public HorizontalRuleBlock() + : base(MarkdownBlockType.HorizontalRule) + { + } + + /// + /// Parses a horizontal rule. + /// + /// The markdown text. + /// The location of the start of the line. + /// The location of the end of the line. + /// A parsed horizontal rule block, or null if this is not a horizontal rule. + internal static HorizontalRuleBlock Parse(string markdown, int start, int end) + { + // A horizontal rule is a line with at least 3 stars, optionally separated by spaces + // OR a line with at least 3 dashes, optionally separated by spaces + // OR a line with at least 3 underscores, optionally separated by spaces. + char hrChar = '\0'; + int hrCharCount = 0; + int pos = start; + while (pos < end) + { + char c = markdown[pos++]; + if (c == '*' || c == '-' || c == '_') + { + // All of the non-whitespace characters on the line must match. + if (hrCharCount > 0 && c != hrChar) + { + return null; + } + + hrChar = c; + hrCharCount++; + } + else if (c == '\n') + { + break; + } + else if (!ParseHelpers.IsMarkdownWhiteSpace(c)) + { + return null; + } + } + + // Hopefully there were at least 3 stars/dashes/underscores. + return hrCharCount >= 3 ? new HorizontalRuleBlock() : null; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return "---"; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/LinkReferenceBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/LinkReferenceBlock.cs new file mode 100644 index 0000000..1313650 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/LinkReferenceBlock.cs @@ -0,0 +1,175 @@ +// 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. + +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents the target of a reference ([ref][]). + /// + public class LinkReferenceBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public LinkReferenceBlock() + : base(MarkdownBlockType.LinkReference) + { + } + + /// + /// Gets or sets the reference ID. + /// + public string Id { get; set; } + + /// + /// Gets or sets the link URL. + /// + public string Url { get; set; } + + /// + /// Gets or sets a tooltip to display on hover. + /// + public string Tooltip { get; set; } + + /// + /// Attempts to parse a reference e.g. "[example]: http://www.reddit.com 'title'". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed markdown link, or null if this is not a markdown link. + internal static LinkReferenceBlock Parse(string markdown, int start, int end) + { + // Expect a '[' character. + if (start >= end || markdown[start] != '[') + { + return null; + } + + // Find the ']' character + int pos = start + 1; + while (pos < end) + { + if (markdown[pos] == ']') + { + break; + } + + pos++; + } + + if (pos == end) + { + return null; + } + + // Extract the ID. + string id = markdown.Substring(start + 1, pos - (start + 1)); + + // Expect the ':' character. + pos++; + if (pos == end || markdown[pos] != ':') + { + return null; + } + + // Skip whitespace + pos++; + while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + if (pos == end) + { + return null; + } + + // Extract the URL. + int urlStart = pos; + while (pos < end && !ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + string url = TextRunInline.ResolveEscapeSequences(markdown, urlStart, pos); + + // Ignore leading '<' and trailing '>'. + url = url.TrimStart('<').TrimEnd('>'); + + // Skip whitespace. + pos++; + while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + string tooltip = null; + if (pos < end) + { + // Extract the tooltip. + char tooltipEndChar; + switch (markdown[pos]) + { + case '(': + tooltipEndChar = ')'; + break; + + case '"': + case '\'': + tooltipEndChar = markdown[pos]; + break; + + default: + return null; + } + + pos++; + int tooltipStart = pos; + while (pos < end && markdown[pos] != tooltipEndChar) + { + pos++; + } + + if (pos == end) + { + return null; // No end character. + } + + tooltip = markdown.Substring(tooltipStart, pos - tooltipStart); + + // Check there isn't any trailing text. + pos++; + while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + if (pos < end) + { + return null; + } + } + + // We found something! + var result = new LinkReferenceBlock(); + result.Id = id; + result.Url = url; + result.Tooltip = tooltip; + return result; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return string.Format("[{0}]: {1} {2}", Id, Url, Tooltip); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBlock.cs new file mode 100644 index 0000000..49a55d7 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBlock.cs @@ -0,0 +1,23 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// This specifies the Content of the List element. + /// + public class ListItemBlock + { + /// + /// Gets or sets the contents of the list item. + /// + public IList Blocks { get; set; } + + internal ListItemBlock() + { + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBuilder.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBuilder.cs new file mode 100644 index 0000000..13d1f61 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemBuilder.cs @@ -0,0 +1,18 @@ +// 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. + +using System.Text; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + internal class ListItemBuilder : MarkdownBlock + { + public StringBuilder Builder { get; } = new StringBuilder(); + + public ListItemBuilder() + : base(MarkdownBlockType.ListItemBuilder) + { + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemPreamble.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemPreamble.cs new file mode 100644 index 0000000..6e85591 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/ListItemPreamble.cs @@ -0,0 +1,13 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + internal class ListItemPreamble + { + public ListStyle Style { get; set; } + + public int ContentStartPos { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/NestedListInfo.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/NestedListInfo.cs new file mode 100644 index 0000000..d2473bf --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/List/NestedListInfo.cs @@ -0,0 +1,14 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + internal class NestedListInfo + { + public ListBlock List { get; set; } + + // The number of spaces at the start of the line the list first appeared. + public int SpaceCount { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ListBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ListBlock.cs new file mode 100644 index 0000000..f1e9040 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ListBlock.cs @@ -0,0 +1,405 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.RegularExpressions; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +[assembly: InternalsVisibleTo("UnitTests.UWP, PublicKey=002400000480000094000000060200000024000052534131000400000100010041753af735ae6140c9508567666c51c6ab929806adb0d210694b30ab142a060237bc741f9682e7d8d4310364b4bba4ee89cc9d3d5ce7e5583587e8ea44dca09977996582875e71fb54fa7b170798d853d5d8010b07219633bdb761d01ac924da44576d6180cdceae537973982bb461c541541d58417a3794e34f45e6f2d129e2")] + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a list, with each list item proceeded by either a number or a bullet. + /// + public class ListBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public ListBlock() + : base(MarkdownBlockType.List) + { + } + + /// + /// Gets or sets the list items. + /// + public IList Items { get; set; } + + /// + /// Gets or sets the style of the list, either numbered or bulleted. + /// + public ListStyle Style { get; set; } + + /// + /// Parses a list block. + /// + /// The markdown text. + /// The location of the first character in the block. + /// The location to stop parsing. + /// The current nesting level for block quoting. + /// Set to the end of the block when the return value is non-null. + /// A parsed list block, or null if this is not a list block. + internal static ListBlock Parse(string markdown, int start, int maxEnd, int quoteDepth, out int actualEnd) + { + var russianDolls = new List(); + int russianDollIndex = -1; + bool previousLineWasBlank = false; + bool inCodeBlock = false; + ListItemBlock currentListItem = null; + actualEnd = start; + + foreach (var lineInfo in Common.ParseLines(markdown, start, maxEnd, quoteDepth)) + { + // Is this line blank? + if (lineInfo.IsLineBlank) + { + // The line is blank, which means the next line which contains text may end the list (or it may not...). + previousLineWasBlank = true; + } + else + { + // Does the line contain a list item? + ListItemPreamble listItemPreamble = null; + if (lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine < (russianDollIndex + 2) * 4) + { + listItemPreamble = ParseItemPreamble(markdown, lineInfo.FirstNonWhitespaceChar, lineInfo.EndOfLine); + } + + if (listItemPreamble != null) + { + // Yes, this line contains a list item. + + // Determining the nesting level is done as follows: + // 1. If this is the first line, then the list is not nested. + // 2. If the number of spaces at the start of the line is equal to that of + // an existing list, then the nesting level is the same as that list. + // 3. Otherwise, if the number of spaces is 0-4, then the nesting level + // is one level deep. + // 4. Otherwise, if the number of spaces is 5-8, then the nesting level + // is two levels deep (but no deeper than one level more than the + // previous list item). + // 5. Etcetera. + ListBlock listToAddTo = null; + int spaceCount = lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine; + russianDollIndex = russianDolls.FindIndex(rd => rd.SpaceCount == spaceCount); + if (russianDollIndex >= 0) + { + // Add the new list item to an existing list. + listToAddTo = russianDolls[russianDollIndex].List; + + // Don't add new list items to items higher up in the list. + russianDolls.RemoveRange(russianDollIndex + 1, russianDolls.Count - (russianDollIndex + 1)); + } + else + { + russianDollIndex = Math.Max(1, 1 + ((spaceCount - 1) / 4)); + if (russianDollIndex < russianDolls.Count) + { + // Add the new list item to an existing list. + listToAddTo = russianDolls[russianDollIndex].List; + + // Don't add new list items to items higher up in the list. + russianDolls.RemoveRange(russianDollIndex + 1, russianDolls.Count - (russianDollIndex + 1)); + } + else + { + // Create a new list. + listToAddTo = new ListBlock { Style = listItemPreamble.Style, Items = new List() }; + if (russianDolls.Count > 0) + { + currentListItem.Blocks.Add(listToAddTo); + } + + russianDollIndex = russianDolls.Count; + russianDolls.Add(new NestedListInfo { List = listToAddTo, SpaceCount = spaceCount }); + } + } + + // Add a new list item. + currentListItem = new ListItemBlock() { Blocks = new List() }; + listToAddTo.Items.Add(currentListItem); + + // Add the rest of the line to the builder. + AppendTextToListItem(currentListItem, markdown, listItemPreamble.ContentStartPos, lineInfo.EndOfLine); + } + else + { + // No, this line contains text. + + // Is there even a list in progress? + if (currentListItem == null) + { + actualEnd = start; + return null; + } + + // This is the start of a new paragraph. + int spaceCount = lineInfo.FirstNonWhitespaceChar - lineInfo.StartOfLine; + if (spaceCount == 0) + { + break; + } + + russianDollIndex = Math.Min(russianDollIndex, (spaceCount - 1) / 4); + int linestart = Math.Min(lineInfo.FirstNonWhitespaceChar, lineInfo.StartOfLine + ((russianDollIndex + 1) * 4)); + + // 0 spaces = end of the list. + // 1-4 spaces = first level. + // 5-8 spaces = second level, etc. + if (previousLineWasBlank) + { + ListBlock listToAddTo = russianDolls[russianDollIndex].List; + currentListItem = listToAddTo.Items[listToAddTo.Items.Count - 1]; + + ListItemBuilder builder; + + // Prevents new Block creation if still in a Code Block. + if (!inCodeBlock) + { + builder = new ListItemBuilder(); + currentListItem.Blocks.Add(builder); + } + else + { + // This can only ever be a ListItemBuilder, so it is not a null reference. + builder = currentListItem.Blocks.Last() as ListItemBuilder; + + // Make up for the escaped NewLines. + builder.Builder.AppendLine(); + builder.Builder.AppendLine(); + } + + AppendTextToListItem(currentListItem, markdown, linestart, lineInfo.EndOfLine); + } + else + { + // Inline text. Ignores the 4 spaces that are used to continue the list. + AppendTextToListItem(currentListItem, markdown, linestart, lineInfo.EndOfLine, true); + } + } + + // Check for Closing Code Blocks. + if (currentListItem.Blocks.Last() is ListItemBuilder currentBlock) + { + var blockmatchcount = Regex.Matches(currentBlock.Builder.ToString(), "```").Count; + if (blockmatchcount > 0 && blockmatchcount % 2 != 0) + { + inCodeBlock = true; + } + else + { + inCodeBlock = false; + } + } + + // The line was not blank. + previousLineWasBlank = false; + } + + // Go to the next line. + actualEnd = lineInfo.EndOfLine; + } + + var result = russianDolls[0].List; + ReplaceStringBuilders(result); + return result; + } + + /// + /// Parsing helper method. + /// + /// Returns a ListItemPreamble + private static ListItemPreamble ParseItemPreamble(string markdown, int start, int maxEnd) + { + // There are two types of lists. + // A numbered list starts with a number, then a period ('.'), then a space. + // A bulleted list starts with a star ('*'), dash ('-') or plus ('+'), then a period, then a space. + ListStyle style; + if (markdown[start] == '*' || markdown[start] == '-' || markdown[start] == '+') + { + style = ListStyle.Bulleted; + start++; + } + else if (markdown[start] >= '0' && markdown[start] <= '9') + { + style = ListStyle.Numbered; + start++; + + // Skip any other digits. + while (start < maxEnd) + { + char c = markdown[start]; + if (c < '0' || c > '9') + { + break; + } + + start++; + } + + // Next should be a period ('.'). + if (start == maxEnd || markdown[start] != '.') + { + return null; + } + + start++; + } + else + { + return null; + } + + // Next should be a space. + if (start == maxEnd || (markdown[start] != ' ' && markdown[start] != '\t')) + { + return null; + } + + start++; + + // This is a valid list item. + return new ListItemPreamble { Style = style, ContentStartPos = start }; + } + + /// + /// Parsing helper method. + /// + private static void AppendTextToListItem(ListItemBlock listItem, string markdown, int start, int end, bool newLine = false) + { + ListItemBuilder listItemBuilder = null; + if (listItem.Blocks.Count > 0) + { + listItemBuilder = listItem.Blocks[listItem.Blocks.Count - 1] as ListItemBuilder; + } + + if (listItemBuilder == null) + { + // Add a new block. + listItemBuilder = new ListItemBuilder(); + listItem.Blocks.Add(listItemBuilder); + } + + var builder = listItemBuilder.Builder; + if (builder.Length >= 2 && + ParseHelpers.IsMarkdownWhiteSpace(builder[builder.Length - 2]) && + ParseHelpers.IsMarkdownWhiteSpace(builder[builder.Length - 1])) + { + builder.Length -= 2; + builder.AppendLine(); + } + else if (builder.Length > 0) + { + builder.Append(' '); + } + + if (newLine) + { + builder.Append(Environment.NewLine); + } + + builder.Append(markdown.Substring(start, end - start)); + } + + /// + /// Parsing helper. + /// + /// true if any of the list items were parsed using the block parser. + private static bool ReplaceStringBuilders(ListBlock list) + { + bool usedBlockParser = false; + foreach (var listItem in list.Items) + { + // Use the inline parser if there is one paragraph, use the block parser otherwise. + var useBlockParser = listItem.Blocks.Count(block => block.Type == MarkdownBlockType.ListItemBuilder) > 1; + + // Recursively replace any child lists. + foreach (var block in listItem.Blocks) + { + if (block is ListBlock && ReplaceStringBuilders((ListBlock)block)) + { + useBlockParser = true; + } + } + + // Parse the text content of the list items. + var newBlockList = new List(); + foreach (var block in listItem.Blocks) + { + if (block is ListItemBuilder) + { + var blockText = ((ListItemBuilder)block).Builder.ToString(); + if (useBlockParser) + { + // Parse the list item as a series of blocks. + int actualEnd; + newBlockList.AddRange(MarkdownDocument.Parse(blockText, 0, blockText.Length, quoteDepth: 0, actualEnd: out actualEnd)); + usedBlockParser = true; + } + else + { + // Don't allow blocks. + var paragraph = new ParagraphBlock(); + paragraph.Inlines = Common.ParseInlineChildren(blockText, 0, blockText.Length); + newBlockList.Add(paragraph); + } + } + else + { + newBlockList.Add(block); + } + } + + listItem.Blocks = newBlockList; + } + + return usedBlockParser; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Items == null) + { + return base.ToString(); + } + + var result = new StringBuilder(); + for (int i = 0; i < Items.Count; i++) + { + if (result.Length > 0) + { + result.AppendLine(); + } + + switch (Style) + { + case ListStyle.Bulleted: + result.Append("* "); + break; + + case ListStyle.Numbered: + result.Append(i + 1); + result.Append("."); + break; + } + + result.Append(" "); + result.Append(string.Join("\r\n", Items[i].Blocks)); + } + + return result.ToString(); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ParagraphBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ParagraphBlock.cs new file mode 100644 index 0000000..9e87112 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/ParagraphBlock.cs @@ -0,0 +1,55 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a block of text that is displayed as a single paragraph. + /// + public class ParagraphBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public ParagraphBlock() + : base(MarkdownBlockType.Paragraph) + { + } + + /// + /// Gets or sets the contents of the block. + /// + public IList Inlines { get; set; } + + /// + /// Parses paragraph text. + /// + /// The markdown text. + /// A parsed paragraph. + internal static ParagraphBlock Parse(string markdown) + { + var result = new ParagraphBlock(); + result.Inlines = Common.ParseInlineChildren(markdown, 0, markdown.Length); + return result; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return string.Join(string.Empty, Inlines); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/QuoteBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/QuoteBlock.cs new file mode 100644 index 0000000..8b5d712 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/QuoteBlock.cs @@ -0,0 +1,47 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a block that is displayed using a quote style. Quotes are used to indicate + /// that the text originated elsewhere (e.g. a previous comment). + /// + public class QuoteBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public QuoteBlock() + : base(MarkdownBlockType.Quote) + { + } + + /// + /// Gets or sets the contents of the block. + /// + public IList Blocks { get; set; } + + /// + /// Parses a quote block. + /// + /// The markdown text. + /// The location of the start of the line. + /// The location to stop parsing. + /// The current nesting level of quotes. + /// Set to the end of the block when the return value is non-null. + /// A parsed quote block. + internal static QuoteBlock Parse(string markdown, int startOfLine, int maxEnd, int quoteDepth, out int actualEnd) + { + var result = new QuoteBlock(); + + // Recursively call into the markdown block parser. + result.Blocks = MarkdownDocument.Parse(markdown, startOfLine, maxEnd, quoteDepth: quoteDepth + 1, actualEnd: out actualEnd); + + return result; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/TableBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/TableBlock.cs new file mode 100644 index 0000000..8224f45 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/TableBlock.cs @@ -0,0 +1,329 @@ +// 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. + +using System; +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Represents a block which contains tabular data. + /// + public class TableBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public TableBlock() + : base(MarkdownBlockType.Table) + { + } + + /// + /// Gets or sets the table rows. + /// + public IList Rows { get; set; } + + /// + /// Gets or sets describes the columns in the table. Rows can have more or less cells than the number + /// of columns. Rows with fewer cells should be padded with empty cells. For rows with + /// more cells, the extra cells should be hidden. + /// + public IList ColumnDefinitions { get; set; } + + /// + /// Parses a table block. + /// + /// The markdown text. + /// The location of the first character in the block. + /// The location of the end of the first line. + /// The location to stop parsing. + /// The current nesting level for block quoting. + /// Set to the end of the block when the return value is non-null. + /// A parsed table block, or null if this is not a table block. + internal static TableBlock Parse(string markdown, int start, int endOfFirstLine, int maxEnd, int quoteDepth, out int actualEnd) + { + // A table is a line of text, with at least one vertical bar (|), followed by a line of + // of text that consists of alternating dashes (-) and vertical bars (|) and optionally + // vertical bars at the start and end. The second line must have at least as many + // interior vertical bars as there are interior vertical bars on the first line. + actualEnd = start; + + // First thing to do is to check if there is a vertical bar on the line. + var barSections = markdown.Substring(start, endOfFirstLine - start).Split('|'); + + var allBarsEscaped = true; + + // we can skip the last section, because there is no bar at the end of it + for (var i = 0; i < barSections.Length - 1; i++) + { + var barSection = barSections[i]; + if (!barSection.EndsWith("\\")) + { + allBarsEscaped = false; + break; + } + } + + if (allBarsEscaped) + { + return null; + } + + var rows = new List(); + + // Parse the first row. + var firstRow = new TableRow(); + start = firstRow.Parse(markdown, start, maxEnd, quoteDepth); + rows.Add(firstRow); + + // Parse the contents of the second row. + var secondRowContents = new List(); + start = TableRow.ParseContents( + markdown, + start, + maxEnd, + quoteDepth, + requireVerticalBar: false, + contentParser: (start2, end2) => secondRowContents.Add(markdown.Substring(start2, end2 - start2))); + + // There must be at least as many columns in the second row as in the first row. + if (secondRowContents.Count < firstRow.Cells.Count) + { + return null; + } + + // Check each column definition. + // Note: excess columns past firstRowColumnCount are ignored and can contain anything. + var columnDefinitions = new List(firstRow.Cells.Count); + for (int i = 0; i < firstRow.Cells.Count; i++) + { + var cellContent = secondRowContents[i]; + if (cellContent.Length == 0) + { + return null; + } + + // The first and last characters can be '-' or ':'. + if (cellContent[0] != ':' && cellContent[0] != '-') + { + return null; + } + + if (cellContent[cellContent.Length - 1] != ':' && cellContent[cellContent.Length - 1] != '-') + { + return null; + } + + // Every other character must be '-'. + for (int j = 1; j < cellContent.Length - 1; j++) + { + if (cellContent[j] != '-') + { + return null; + } + } + + // Record the alignment. + var columnDefinition = new TableColumnDefinition(); + if (cellContent.Length > 1 && cellContent[0] == ':' && cellContent[cellContent.Length - 1] == ':') + { + columnDefinition.Alignment = ColumnAlignment.Center; + } + else if (cellContent[0] == ':') + { + columnDefinition.Alignment = ColumnAlignment.Left; + } + else if (cellContent[cellContent.Length - 1] == ':') + { + columnDefinition.Alignment = ColumnAlignment.Right; + } + + columnDefinitions.Add(columnDefinition); + } + + // Parse additional rows. + while (start < maxEnd) + { + var row = new TableRow(); + start = row.Parse(markdown, start, maxEnd, quoteDepth); + if (row.Cells.Count == 0) + { + break; + } + + rows.Add(row); + } + + actualEnd = start; + return new TableBlock { ColumnDefinitions = columnDefinitions, Rows = rows }; + } + + /// + /// Describes a column in the markdown table. + /// + public class TableColumnDefinition + { + /// + /// Gets or sets the alignment of content in a table column. + /// + public ColumnAlignment Alignment { get; set; } + } + + /// + /// Represents a single row in the table. + /// + public class TableRow + { + /// + /// Gets or sets the table cells. + /// + public IList Cells { get; set; } + + /// + /// Parses the contents of the row, ignoring whitespace at the beginning and end of each cell. + /// + /// The markdown text. + /// The position of the start of the row. + /// The maximum position of the end of the row + /// The current nesting level for block quoting. + /// Indicates whether the line must contain a vertical bar. + /// Called for each cell. + /// The position of the start of the next line. + internal static int ParseContents(string markdown, int startingPos, int maxEndingPos, int quoteDepth, bool requireVerticalBar, Action contentParser) + { + // Skip quote characters. + int pos = Common.SkipQuoteCharacters(markdown, startingPos, maxEndingPos, quoteDepth); + + // If the line starts with a '|' character, skip it. + bool lineHasVerticalBar = false; + if (pos < maxEndingPos && markdown[pos] == '|') + { + lineHasVerticalBar = true; + pos++; + } + + while (pos < maxEndingPos) + { + // Ignore any whitespace at the start of the cell (except for a newline character). + while (pos < maxEndingPos && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos]) && markdown[pos] != '\n' && markdown[pos] != '\r') + { + pos++; + } + + int startOfCellContent = pos; + + // Find the end of the cell. + bool endOfLineFound = true; + while (pos < maxEndingPos) + { + char c = markdown[pos]; + if (c == '|' && (pos == 0 || markdown[pos - 1] != '\\')) + { + lineHasVerticalBar = true; + endOfLineFound = false; + break; + } + + if (c == '\n') + { + break; + } + + if (c == '\r') + { + if (pos < maxEndingPos && markdown[pos + 1] == '\n') + { + pos++; // Swallow the complete linefeed. + } + + break; + } + + pos++; + } + + int endOfCell = pos; + + // If a vertical bar is required, and none was found, then exit early. + if (endOfLineFound && !lineHasVerticalBar && requireVerticalBar) + { + return startingPos; + } + + // Ignore any whitespace at the end of the cell. + if (endOfCell > startOfCellContent) + { + while (ParseHelpers.IsMarkdownWhiteSpace(markdown[pos - 1])) + { + pos--; + } + } + + int endOfCellContent = pos; + + if (endOfLineFound == false || endOfCellContent > startOfCellContent) + { + // Parse the contents of the cell. + contentParser(startOfCellContent, endOfCellContent); + } + + // End of input? + if (pos == maxEndingPos) + { + break; + } + + // Move to the next cell, or the next line. + pos = endOfCell + 1; + + // End of the line? + if (endOfLineFound) + { + break; + } + } + + return pos; + } + + /// + /// Called when this block type should parse out the goods. Given the markdown, a starting point, and a max ending point + /// the block should find the start of the block, find the end and parse out the middle. The end most of the time will not be + /// the max ending pos, but it sometimes can be. The function will return where it ended parsing the block in the markdown. + /// + /// the postiion parsed to + internal int Parse(string markdown, int startingPos, int maxEndingPos, int quoteDepth) + { + Cells = new List(); + return ParseContents( + markdown, + startingPos, + maxEndingPos, + quoteDepth, + requireVerticalBar: true, + contentParser: (startingPos2, maxEndingPos2) => + { + var cell = new TableCell(); + cell.Inlines = Common.ParseInlineChildren(markdown, startingPos2, maxEndingPos2); + Cells.Add(cell); + }); + } + } + + /// + /// Represents a cell in the table. + /// + public class TableCell + { + /// + /// Gets or sets the cell contents. + /// + public IList Inlines { get; set; } + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/YamlHeaderBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/YamlHeaderBlock.cs new file mode 100644 index 0000000..1cfd33c --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Blocks/YamlHeaderBlock.cs @@ -0,0 +1,163 @@ +// 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. + +using System; +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// Yaml Header. use for blog. + /// e.g. + /// --- + /// title: something + /// tag: something + /// --- + /// + public class YamlHeaderBlock : MarkdownBlock + { + /// + /// Initializes a new instance of the class. + /// + public YamlHeaderBlock() + : base(MarkdownBlockType.YamlHeader) + { + } + + /// + /// Gets or sets yaml header properties + /// + public Dictionary Children { get; set; } + + /// + /// Parse yaml header + /// + /// The markdown text. + /// The location of the first hash character. + /// The location of the end of the line. + /// The location of the actual end of the aprse. + /// Parsed class + internal static YamlHeaderBlock Parse(string markdown, int start, int end, out int realEndIndex) + { + // As yaml header, must be start a line with "---" + // and end with a line "---" + realEndIndex = start; + int lineStart = start; + if (end - start < 3) + { + return null; + } + + if (lineStart != 0 || markdown.Substring(start, 3) != "---") + { + return null; + } + + int startUnderlineIndex = Common.FindNextSingleNewLine(markdown, lineStart, end, out int startOfNextLine); + if (startUnderlineIndex - lineStart != 3) + { + return null; + } + + bool lockedFinalUnderline = false; + + // if current line not contain the ": ", check it is end of parse, if not, exit + // if next line is the end, exit + int pos = startOfNextLine; + List elements = new List(); + while (pos < end) + { + int nextUnderLineIndex = Common.FindNextSingleNewLine(markdown, pos, end, out startOfNextLine); + bool haveSeparator = markdown.Substring(pos, nextUnderLineIndex - pos).Contains(": "); + if (haveSeparator) + { + elements.Add(markdown.Substring(pos, nextUnderLineIndex - pos)); + } + else if (end - pos >= 3 && markdown.Substring(pos, 3) == "---") + { + lockedFinalUnderline = true; + realEndIndex = pos + 3; + break; + } + else if (startOfNextLine == pos + 1) + { + pos = startOfNextLine; + continue; + } + else + { + return null; + } + + pos = startOfNextLine; + } + + // if not have the end, return + if (!lockedFinalUnderline) + { + return null; + } + + // parse yaml header properties + if (elements.Count < 1) + { + return null; + } + + var result = new YamlHeaderBlock(); + result.Children = new Dictionary(); + foreach (var item in elements) + { + string[] splits = item.Split(new string[] { ": " }, StringSplitOptions.None); + if (splits.Length < 2) + { + continue; + } + else + { + string key = splits[0]; + string value = splits[1]; + if (key.Trim().Length == 0) + { + continue; + } + + value = string.IsNullOrEmpty(value.Trim()) ? string.Empty : value; + result.Children.Add(key, value); + } + } + + if (result.Children == null) + { + return null; + } + + return result; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Children == null) + { + return base.ToString(); + } + else + { + string result = string.Empty; + foreach (KeyValuePair item in Children) + { + result += item.Key + ": " + item.Value + "\n"; + } + + result.TrimEnd('\n'); + return result; + } + } + } +} diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ColumnAlignment.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ColumnAlignment.cs new file mode 100644 index 0000000..d5bfe08 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ColumnAlignment.cs @@ -0,0 +1,32 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// The alignment of content in a table column. + /// + public enum ColumnAlignment + { + /// + /// The alignment was not specified. + /// + Unspecified, + + /// + /// Content should be left aligned. + /// + Left, + + /// + /// Content should be right aligned. + /// + Right, + + /// + /// Content should be centered. + /// + Center, + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/HyperlinkType.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/HyperlinkType.cs new file mode 100644 index 0000000..3780f5f --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/HyperlinkType.cs @@ -0,0 +1,42 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// Specifies the type of Hyperlink that is used. + /// + public enum HyperlinkType + { + /// + /// A hyperlink surrounded by angle brackets (e.g. "http://www.reddit.com"). + /// + BracketedUrl, + + /// + /// A fully qualified hyperlink (e.g. "http://www.reddit.com"). + /// + FullUrl, + + /// + /// A URL without a scheme (e.g. "www.reddit.com"). + /// + PartialUrl, + + /// + /// An email address (e.g. "test@reddit.com"). + /// + Email, + + /// + /// A subreddit link (e.g. "/r/news"). + /// + Subreddit, + + /// + /// A user link (e.g. "/u/quinbd"). + /// + User, + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/InlineParseMethod.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/InlineParseMethod.cs new file mode 100644 index 0000000..d98935d --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/InlineParseMethod.cs @@ -0,0 +1,96 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + internal enum InlineParseMethod + { + /// + /// A Comment text + /// + Comment, + + /// + /// A Link Reference + /// + LinkReference, + + /// + /// A bold element + /// + Bold, + + /// + /// An bold and italic block + /// + BoldItalic, + + /// + /// A code element + /// + Code, + + /// + /// An italic block + /// + Italic, + + /// + /// A link block + /// + MarkdownLink, + + /// + /// An angle bracket link. + /// + AngleBracketLink, + + /// + /// A url block + /// + Url, + + /// + /// A reddit style link + /// + RedditLink, + + /// + /// An in line text link + /// + PartialLink, + + /// + /// An email element + /// + Email, + + /// + /// strike through element + /// + Strikethrough, + + /// + /// Super script element. + /// + Superscript, + + /// + /// Sub script element. + /// + Subscript, + + /// + /// Image element. + /// + Image, + + /// + /// Emoji element. + /// + Emoji, + + InputBox + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ListStyle.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ListStyle.cs new file mode 100644 index 0000000..9797f36 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/ListStyle.cs @@ -0,0 +1,22 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// This specifies the type of style the List will be. + /// + public enum ListStyle + { + /// + /// A list with bullets + /// + Bulleted, + + /// + /// A numbered list + /// + Numbered, + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownBlockType.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownBlockType.cs new file mode 100644 index 0000000..9443cd3 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownBlockType.cs @@ -0,0 +1,67 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// Determines the type of Block the Block element is. + /// + public enum MarkdownBlockType + { + /// + /// The root element + /// + Root, + + /// + /// A paragraph element. + /// + Paragraph, + + /// + /// A quote block + /// + Quote, + + /// + /// A code block + /// + Code, + + /// + /// A header block + /// + Header, + + /// + /// A list block + /// + List, + + /// + /// A list item block + /// + ListItemBuilder, + + /// + /// a horizontal rule block + /// + HorizontalRule, + + /// + /// A table block + /// + Table, + + /// + /// A link block + /// + LinkReference, + + /// + /// A Yaml header block + /// + YamlHeader + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownInlineType.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownInlineType.cs new file mode 100644 index 0000000..d4396aa --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Enums/MarkdownInlineType.cs @@ -0,0 +1,85 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// Determines the type of Inline the Inline Element is. + /// + public enum MarkdownInlineType + { + /// + /// A comment + /// + Comment, + + /// + /// A text run + /// + TextRun, + + /// + /// A bold run + /// + Bold, + + /// + /// An italic run + /// + Italic, + + /// + /// A link in markdown syntax + /// + MarkdownLink, + + /// + /// A raw hyper link + /// + RawHyperlink, + + /// + /// A raw subreddit link + /// + RawSubreddit, + + /// + /// A strike through run + /// + Strikethrough, + + /// + /// A superscript run + /// + Superscript, + + /// + /// A subscript run + /// + Subscript, + + /// + /// A code run + /// + Code, + + /// + /// An image + /// + Image, + + /// + /// Emoji + /// + Emoji, + + /// + /// Link Reference + /// + LinkReference, + + + InputBox + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/Common.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/Common.cs new file mode 100644 index 0000000..751c9bb --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/Common.cs @@ -0,0 +1,540 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Helpers +{ + /// + /// Helpers for Markdown. + /// + internal class Common + { + private static readonly List _triggerList = new List(); + private static readonly char[] _tripCharacters; + + static Common() + { + BoldItalicTextInline.AddTripChars(_triggerList); + BoldTextInline.AddTripChars(_triggerList); + ItalicTextInline.AddTripChars(_triggerList); + MarkdownLinkInline.AddTripChars(_triggerList); + HyperlinkInline.AddTripChars(_triggerList); + CommentInline.AddTripChars(_triggerList); + StrikethroughTextInline.AddTripChars(_triggerList); + SuperscriptTextInline.AddTripChars(_triggerList); + SubscriptTextInline.AddTripChars(_triggerList); + CodeInline.AddTripChars(_triggerList); + ImageInline.AddTripChars(_triggerList); + InputInline.AddTripChars(_triggerList); + EmojiInline.AddTripChars(_triggerList); + LinkAnchorInline.AddTripChars(_triggerList); + + // Create an array of characters to search against using IndexOfAny. + _tripCharacters = _triggerList.Select(trigger => trigger.FirstChar).Distinct().ToArray(); + } + + /// + /// This function can be called by any element parsing. Given a start and stopping point this will + /// parse all found elements out of the range. + /// + /// A list of parsed inlines. + public static List ParseInlineChildren(string markdown, int startingPos, int maxEndingPos, bool ignoreLinks = false) + { + int currentParsePosition = startingPos; + + var inlines = new List(); + while (currentParsePosition < maxEndingPos) + { + // Find the next inline element. + var parseResult = FindNextInlineElement(markdown, currentParsePosition, maxEndingPos, ignoreLinks); + + // If the element we found doesn't start at the position we are looking for there + // is text between the element and the start of the parsed element. We need to wrap + // it into a text run. + if (parseResult.Start != currentParsePosition) + { + var textRun = TextRunInline.Parse(markdown, currentParsePosition, parseResult.Start); + inlines.Add(textRun); + } + + // Add the parsed element. + inlines.Add(parseResult.ParsedElement); + + // Update the current position. + currentParsePosition = parseResult.End; + } + + return inlines; + } + + /// + /// Finds the next inline element by matching trip chars and verifying the match. + /// + /// The markdown text to parse. + /// The position to start parsing. + /// The position to stop parsing. + /// Indicates whether to parse links. + /// Returns the next element + private static InlineParseResult FindNextInlineElement(string markdown, int start, int end, bool ignoreLinks) + { + // Search for the next inline sequence. + for (int pos = start; pos < end; pos++) + { + // IndexOfAny should be the fastest way to skip characters we don't care about. + pos = markdown.IndexOfAny(_tripCharacters, pos, end - pos); + if (pos < 0) + { + break; + } + + // Find the trigger(s) that matched. + char currentChar = markdown[pos]; + foreach (InlineTripCharHelper currentTripChar in _triggerList) + { + // Check if our current char matches the suffix char. + if (currentChar == currentTripChar.FirstChar) + { + // Don't match if the previous character was a backslash. + if (pos > start && markdown[pos - 1] == '\\') + { + continue; + } + + // If we are here we have a possible match. Call into the inline class to verify. + InlineParseResult parseResult = null; + switch (currentTripChar.Method) + { + case InlineParseMethod.BoldItalic: + parseResult = BoldItalicTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Comment: + parseResult = CommentInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.LinkReference: + parseResult = LinkAnchorInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Bold: + parseResult = BoldTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Italic: + parseResult = ItalicTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.MarkdownLink: + if (!ignoreLinks) + { + parseResult = MarkdownLinkInline.Parse(markdown, pos, end); + } + + break; + + case InlineParseMethod.AngleBracketLink: + if (!ignoreLinks) + { + parseResult = HyperlinkInline.ParseAngleBracketLink(markdown, pos, end); + } + + break; + + case InlineParseMethod.Url: + if (!ignoreLinks) + { + parseResult = HyperlinkInline.ParseUrl(markdown, pos, end); + } + + break; + + case InlineParseMethod.RedditLink: + if (!ignoreLinks) + { + parseResult = HyperlinkInline.ParseRedditLink(markdown, pos, end); + } + + break; + + case InlineParseMethod.PartialLink: + if (!ignoreLinks) + { + parseResult = HyperlinkInline.ParsePartialLink(markdown, pos, end); + } + + break; + + case InlineParseMethod.Email: + if (!ignoreLinks) + { + parseResult = HyperlinkInline.ParseEmailAddress(markdown, start, pos, end); + } + + break; + + case InlineParseMethod.Strikethrough: + parseResult = StrikethroughTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Superscript: + parseResult = SuperscriptTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Subscript: + parseResult = SubscriptTextInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Code: + parseResult = CodeInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Image: + parseResult = ImageInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.InputBox: + parseResult = InputInline.Parse(markdown, pos, end); + break; + + case InlineParseMethod.Emoji: + parseResult = EmojiInline.Parse(markdown, pos, end); + break; + } + + if (parseResult != null) + { + return parseResult; + } + } + } + } + + // If we didn't find any elements we have a normal text block. + // Let us consume the entire range. + return new InlineParseResult(TextRunInline.Parse(markdown, start, end), start, end); + } + + /// + /// Returns the next \n or \r\n in the markdown. + /// + /// the next single line + public static int FindNextSingleNewLine(string markdown, int startingPos, int endingPos, out int startOfNextLine) + { + // A line can end with CRLF (\r\n) or just LF (\n). + int lineFeedPos = markdown.IndexOf('\n', startingPos); + if (lineFeedPos == -1) + { + // Trying with /r now + lineFeedPos = markdown.IndexOf('\r', startingPos); + if (lineFeedPos == -1) + { + startOfNextLine = endingPos; + return endingPos; + } + } + + startOfNextLine = lineFeedPos + 1; + + // Check if it was a CRLF. + if (lineFeedPos > startingPos && markdown[lineFeedPos - 1] == '\r') + { + return lineFeedPos - 1; + } + + return lineFeedPos; + } + + /// + /// Helper function for index of with a start and an ending. + /// + /// Pos of the searched for item + public static int IndexOf(string markdown, string search, int startingPos, int endingPos, bool reverseSearch = false) + { + // Check the ending isn't out of bounds. + if (endingPos > markdown.Length) + { + endingPos = markdown.Length; + DebuggingReporter.ReportCriticalError("IndexOf endingPos > string length"); + } + + // Figure out how long to go + int count = endingPos - startingPos; + if (count < 0) + { + return -1; + } + + // Make sure we don't go too far. + int remainingCount = markdown.Length - startingPos; + if (count > remainingCount) + { + DebuggingReporter.ReportCriticalError("IndexOf count > remaing count"); + count = remainingCount; + } + + // Check the ending. Since we use inclusive ranges we need to -1 from this for + // reverses searches. + if (reverseSearch && endingPos > 0) + { + endingPos -= 1; + } + + return reverseSearch ? markdown.LastIndexOf(search, endingPos, count, StringComparison.OrdinalIgnoreCase) : markdown.IndexOf(search, startingPos, count, StringComparison.OrdinalIgnoreCase); + } + + /// + /// Helper function for index of with a start and an ending. + /// + /// Pos of the searched for item + public static int IndexOf(string markdown, char search, int startingPos, int endingPos, bool reverseSearch = false) + { + // Check the ending isn't out of bounds. + if (endingPos > markdown.Length) + { + endingPos = markdown.Length; + DebuggingReporter.ReportCriticalError("IndexOf endingPos > string length"); + } + + // Figure out how long to go + int count = endingPos - startingPos; + if (count < 0) + { + return -1; + } + + // Make sure we don't go too far. + int remainingCount = markdown.Length - startingPos; + if (count > remainingCount) + { + DebuggingReporter.ReportCriticalError("IndexOf count > remaing count"); + count = remainingCount; + } + + // Check the ending. Since we use inclusive ranges we need to -1 from this for + // reverses searches. + if (reverseSearch && endingPos > 0) + { + endingPos -= 1; + } + + return reverseSearch ? markdown.LastIndexOf(search, endingPos, count) : markdown.IndexOf(search, startingPos, count); + } + + /// + /// Finds the next whitespace in a range. + /// + /// pos of the white space + public static int FindNextWhiteSpace(string markdown, int startingPos, int endingPos, bool ifNotFoundReturnLength) + { + int currentPos = startingPos; + while (currentPos < markdown.Length && currentPos < endingPos) + { + if (char.IsWhiteSpace(markdown[currentPos])) + { + return currentPos; + } + + currentPos++; + } + + return ifNotFoundReturnLength ? endingPos : -1; + } + + /// + /// Parses lines. + /// + /// LineInfo + public static IEnumerable ParseLines(string markdown, int start, int end, int quoteDepth) + { + int pos = start; + bool lineStartsNewParagraph = true; + + while (pos < end) + { + int startOfLine = pos; + int expectedQuotesRemaining = quoteDepth; + int nonSpacePos = pos; + char nonSpaceChar = '\0'; + while (true) + { + // Find the next non-space char. + while (nonSpacePos < end) + { + char c = markdown[nonSpacePos]; + if (c == '\r' || c == '\n') + { + // The line is either entirely whitespace, or is empty. + break; + } + + if (c != ' ' && c != '\t') + { + // The line has content. + nonSpaceChar = c; + break; + } + + nonSpacePos++; + } + + // When parsing blocks in a blockquote context, we need to count the number of + // quote characters ('>'). If there are less than expected AND this is the + // start of a new paragraph, then stop parsing. + if (expectedQuotesRemaining == 0) + { + break; + } + + if (nonSpaceChar == '>') + { + // Expected block quote characters should be ignored. + expectedQuotesRemaining--; + nonSpacePos++; + nonSpaceChar = '\0'; + startOfLine = nonSpacePos; + + // Ignore the first space after the quote character, if there is one. + if (startOfLine < end && markdown[startOfLine] == ' ') + { + startOfLine++; + nonSpacePos++; + } + } + else + { + // There were less block quote characters than expected. + // But it doesn't matter if this is not the start of a new paragraph. + if (!lineStartsNewParagraph || nonSpaceChar == '\0') + { + break; + } + + // This must be the end of the blockquote. End the current paragraph, if any. + yield break; + } + } + + // Find the end of the current line. + int endOfLine = FindNextSingleNewLine(markdown, nonSpacePos, end, out int startOfNextLine); + + // Return the line info to the caller. + yield return new LineInfo + { + StartOfLine = startOfLine, + FirstNonWhitespaceChar = nonSpacePos, + EndOfLine = endOfLine, + StartOfNextLine = startOfNextLine, + }; + + if (nonSpaceChar == '\0') + { + // The line is empty or nothing but whitespace. + lineStartsNewParagraph = true; + } + + // Repeat. + pos = startOfNextLine; + } + } + + /// + /// Skips a certain number of quote characters (>). + /// + /// Skip Quote Chars + public static int SkipQuoteCharacters(string markdown, int start, int end, int quoteDepth) + { + if (quoteDepth == 0) + { + return start; + } + + int startOfLine = start; + int nonSpacePos = start; + char nonSpaceChar = '\0'; + + while (true) + { + // Find the next non-space char. + while (nonSpacePos < end) + { + char c = markdown[nonSpacePos]; + if (c == '\r' || c == '\n') + { + // The line is either entirely whitespace, or is empty. + break; + } + + if (c != ' ' && c != '\t') + { + // The line has content. + nonSpaceChar = c; + break; + } + + nonSpacePos++; + } + + // When parsing blocks in a blockquote context, we need to count the number of + // quote characters ('>'). If there are less than expected AND this is the + // start of a new paragraph, then stop parsing. + if (quoteDepth == 0) + { + break; + } + + if (nonSpaceChar == '>') + { + // Expected block quote characters should be ignored. + quoteDepth--; + nonSpacePos++; + nonSpaceChar = '\0'; + startOfLine = nonSpacePos; + + // Ignore the first space after the quote character, if there is one. + if (startOfLine < end && markdown[startOfLine] == ' ') + { + startOfLine++; + nonSpacePos++; + } + } + else + { + // There were less block quote characters than expected. + break; + } + } + + return startOfLine; + } + + /// + /// Checks if the given URL is allowed in a markdown link. + /// + /// The URL to check. + /// true if the URL is valid; false otherwise. + public static bool IsUrlValid(string url) + { + // URLs can be relative. + if (!Uri.TryCreate(url, UriKind.Absolute, out Uri result)) + { + return true; + } + + // Check the scheme is allowed. + foreach (var scheme in MarkdownDocument.KnownSchemes) + { + if (result.Scheme.Equals(scheme)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/DebuggingReporter.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/DebuggingReporter.cs new file mode 100644 index 0000000..3f1cbce --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/DebuggingReporter.cs @@ -0,0 +1,26 @@ +// 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. + +using System.Diagnostics; + +namespace Microsoft.Toolkit.Parsers.Markdown.Helpers +{ + /// + /// Reports an error during debugging. + /// + internal class DebuggingReporter + { + /// + /// Reports a critical error. + /// + public static void ReportCriticalError(string errorText) + { + Debug.WriteLine(errorText); + if (Debugger.IsAttached) + { + Debugger.Break(); + } + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineParseResult.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineParseResult.cs new file mode 100644 index 0000000..5e479b0 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineParseResult.cs @@ -0,0 +1,36 @@ +// 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. + +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Helpers +{ + /// + /// Represents the result of parsing an inline element. + /// + internal class InlineParseResult + { + public InlineParseResult(MarkdownInline parsedElement, int start, int end) + { + ParsedElement = parsedElement; + Start = start; + End = end; + } + + /// + /// Gets the element that was parsed (can be null). + /// + public MarkdownInline ParsedElement { get; } + + /// + /// Gets the position of the first character in the parsed element. + /// + public int Start { get; } + + /// + /// Gets the position of the character after the last character in the parsed element. + /// + public int End { get; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineTripCharHelper.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineTripCharHelper.cs new file mode 100644 index 0000000..0fb92ed --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/InlineTripCharHelper.cs @@ -0,0 +1,21 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Helpers +{ + /// + /// A helper class for the trip chars. This is an optimization. If we ask each class to go + /// through the rage and look for itself we end up looping through the range n times, once + /// for each inline. This class represent a character that an inline needs to have a + /// possible match. We will go through the range once and look for everyone's trip chars, + /// and if they can make a match from the trip char then we will commit to them. + /// + internal class InlineTripCharHelper + { + // Note! Everything in first char and suffix should be lower case! + public char FirstChar { get; set; } + + public InlineParseMethod Method { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/LineInfo.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/LineInfo.cs new file mode 100644 index 0000000..aefa681 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Helpers/LineInfo.cs @@ -0,0 +1,25 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Helpers +{ + internal class LineInfo + { + public int StartOfLine { get; set; } + + public int FirstNonWhitespaceChar { get; set; } + + public int EndOfLine { get; set; } + + public bool IsLineBlank + { + get + { + return FirstNonWhitespaceChar == EndOfLine; + } + } + + public int StartOfNextLine { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldItalicTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldItalicTextInline.cs new file mode 100644 index 0000000..1f6a097 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldItalicTextInline.cs @@ -0,0 +1,119 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing bold italic text. + /// + internal class BoldItalicTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public BoldItalicTextInline() + : base(MarkdownInlineType.Bold) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.BoldItalic }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.BoldItalic }); + } + + /// + /// Attempts to parse a bold text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed bold text span, or null if this is not a bold text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + if (start >= maxEnd - 1) + { + return null; + } + + if (markdown == null || markdown.Length < 6 || start + 6 >= maxEnd) + { + return null; + } + + // Check the start sequence. + string startSequence = markdown.Substring(start, 3); + if (startSequence != "***" && startSequence != "___") + { + return null; + } + + // Find the end of the span. The end sequence (either '***' or '___') must be the same + // as the start sequence. + var innerStart = start + 3; + int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // The first character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) + { + return null; + } + + // The last character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + var bold = new BoldTextInline + { + Inlines = new List + { + new ItalicTextInline + { + Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd) + } + } + }; + return new InlineParseResult(bold, start, innerEnd + 3); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "***" + string.Join(string.Empty, Inlines) + "***"; + } + } +} diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldTextInline.cs new file mode 100644 index 0000000..f4b324a --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/BoldTextInline.cs @@ -0,0 +1,106 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span that contains bold text. + /// + public class BoldTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public BoldTextInline() + : base(MarkdownInlineType.Bold) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.Bold }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.Bold }); + } + + /// + /// Attempts to parse a bold text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed bold text span, or null if this is not a bold text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + if (start >= maxEnd - 1) + { + return null; + } + + // Check the start sequence. + string startSequence = markdown.Substring(start, 2); + if (startSequence != "**" && startSequence != "__") + { + return null; + } + + // Find the end of the span. The end sequence (either '**' or '__') must be the same + // as the start sequence. + var innerStart = start + 2; + int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // The first character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) + { + return null; + } + + // The last character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + var result = new BoldTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, innerEnd + 2); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "**" + string.Join(string.Empty, Inlines) + "**"; + } + } +} diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CodeInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CodeInline.cs new file mode 100644 index 0000000..5cf0039 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CodeInline.cs @@ -0,0 +1,110 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing code, or other text that is to be displayed using a + /// fixed-width font. + /// + public class CodeInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public CodeInline() + : base(MarkdownInlineType.Code) + { + } + + /// + /// Gets or sets the text to display as code. + /// + public string Text { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '`', Method = InlineParseMethod.Code }); + } + + /// + /// Attempts to parse an inline code span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed inline code span, or null if this is not an inline code span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Check the first char. + if (start == maxEnd || markdown[start] != '`') + { + return null; + } + + // There is an alternate syntax that starts and ends with two backticks. + // e.g. ``sdf`sdf`` would be "sdf`sdf". + int innerStart = start + 1; + int innerEnd, end; + if (innerStart < maxEnd && markdown[innerStart] == '`') + { + // Alternate double back-tick syntax. + innerStart++; + + // Find the end of the span. + innerEnd = Common.IndexOf(markdown, "``", innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + end = innerEnd + 2; + } + else + { + // Standard single backtick syntax. + + // Find the end of the span. + innerEnd = Common.IndexOf(markdown, '`', innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + end = innerEnd + 1; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // We found something! + var result = new CodeInline(); + result.Text = markdown.Substring(innerStart, innerEnd - innerStart).Trim(' ', '\t', '\r', '\n'); + return new InlineParseResult(result, start, end); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Text == null) + { + return base.ToString(); + } + + return "`" + Text + "`"; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CommentInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CommentInline.cs new file mode 100644 index 0000000..082b862 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/CommentInline.cs @@ -0,0 +1,84 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span that contains comment. + /// + internal class CommentInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public CommentInline() + : base(MarkdownInlineType.Comment) + { + } + + /// + /// Gets or sets the Content of the Comment. + /// + public string Text { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Comment }); + } + + /// + /// Attempts to parse a comment span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed bold text span, or null if this is not a bold text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + if (start >= maxEnd - 1) + { + return null; + } + + string startSequence = markdown.Substring(start); + if (!startSequence.StartsWith("') + var innerStart = start + 4; + int innerEnd = Common.IndexOf(markdown, "-->", innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + var length = innerEnd - innerStart; + var contents = markdown.Substring(innerStart, length); + + var result = new CommentInline + { + Text = contents + }; + + return new InlineParseResult(result, start, innerEnd + 3); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return ""; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.EmojiCodes.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.EmojiCodes.cs new file mode 100644 index 0000000..89fc005 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.EmojiCodes.cs @@ -0,0 +1,845 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing emoji symbol. + /// + public partial class EmojiInline + { + // Codes taken from https://gist.github.com/rxaviers/7360908 + // Ignoring not implented symbols in Segoe UI Emoji font (e.g. :bowtie:) + private static readonly Dictionary _emojiCodesDictionary = new Dictionary + { + { "smile", 0x1f604 }, + { "laughing", 0x1f606 }, + { "blush", 0x1f60a }, + { "smiley", 0x1f603 }, + { "relaxed", 0x263a }, + { "smirk", 0x1f60f }, + { "heart_eyes", 0x1f60d }, + { "kissing_heart", 0x1f618 }, + { "kissing_closed_eyes", 0x1f61a }, + { "flushed", 0x1f633 }, + { "relieved", 0x1f60c }, + { "satisfied", 0x1f606 }, + { "grin", 0x1f601 }, + { "wink", 0x1f609 }, + { "stuck_out_tongue_winking_eye", 0x1f61c }, + { "stuck_out_tongue_closed_eyes", 0x1f61d }, + { "grinning", 0x1f600 }, + { "kissing", 0x1f617 }, + { "kissing_smiling_eyes", 0x1f619 }, + { "stuck_out_tongue", 0x1f61b }, + { "sleeping", 0x1f634 }, + { "worried", 0x1f61f }, + { "frowning", 0x1f626 }, + { "anguished", 0x1f627 }, + { "open_mouth", 0x1f62e }, + { "grimacing", 0x1f62c }, + { "confused", 0x1f615 }, + { "hushed", 0x1f62f }, + { "expressionless", 0x1f611 }, + { "unamused", 0x1f612 }, + { "sweat_smile", 0x1f605 }, + { "sweat", 0x1f613 }, + { "disappointed_relieved", 0x1f625 }, + { "weary", 0x1f629 }, + { "pensive", 0x1f614 }, + { "disappointed", 0x1f61e }, + { "confounded", 0x1f616 }, + { "fearful", 0x1f628 }, + { "cold_sweat", 0x1f630 }, + { "persevere", 0x1f623 }, + { "cry", 0x1f622 }, + { "sob", 0x1f62d }, + { "joy", 0x1f602 }, + { "astonished", 0x1f632 }, + { "scream", 0x1f631 }, + { "tired_face", 0x1f62b }, + { "angry", 0x1f620 }, + { "rage", 0x1f621 }, + { "triumph", 0x1f624 }, + { "sleepy", 0x1f62a }, + { "yum", 0x1f60b }, + { "mask", 0x1f637 }, + { "sunglasses", 0x1f60e }, + { "dizzy_face", 0x1f635 }, + { "imp", 0x1f47f }, + { "smiling_imp", 0x1f608 }, + { "neutral_face", 0x1f610 }, + { "no_mouth", 0x1f636 }, + { "innocent", 0x1f607 }, + { "alien", 0x1f47d }, + { "yellow_heart", 0x1f49b }, + { "blue_heart", 0x1f499 }, + { "purple_heart", 0x1f49c }, + { "heart", 0x2764 }, + { "green_heart", 0x1f49a }, + { "broken_heart", 0x1f494 }, + { "heartbeat", 0x1f493 }, + { "heartpulse", 0x1f497 }, + { "two_hearts", 0x1f495 }, + { "revolving_hearts", 0x1f49e }, + { "cupid", 0x1f498 }, + { "sparkling_heart", 0x1f496 }, + { "sparkles", 0x2728 }, + { "star", 0x2b50 }, + { "star2", 0x1f31f }, + { "dizzy", 0x1f4ab }, + { "boom", 0x1f4a5 }, + { "collision", 0x1f4a5 }, + { "anger", 0x1f4a2 }, + { "exclamation", 0x2757 }, + { "question", 0x2753 }, + { "grey_exclamation", 0x2755 }, + { "grey_question", 0x2754 }, + { "zzz", 0x1f4a4 }, + { "dash", 0x1f4a8 }, + { "sweat_drops", 0x1f4a6 }, + { "notes", 0x1f3b6 }, + { "musical_note", 0x1f3b5 }, + { "fire", 0x1f525 }, + { "hankey", 0x1f4a9 }, + { "poop", 0x1f4a9 }, + { "+1", 0x1f44d }, + { "thumbsup", 0x1f44d }, + { "-1", 0x1f44e }, + { "thumbsdown", 0x1f44e }, + { "ok_hand", 0x1f44c }, + { "punch", 0x1f44a }, + { "facepunch", 0x1f44a }, + { "fist", 0x270a }, + { "v", 0x270c }, + { "wave", 0x1f44b }, + { "hand", 0x270b }, + { "raised_hand", 0x270b }, + { "open_hands", 0x1f450 }, + { "point_up", 0x261d }, + { "point_down", 0x1f447 }, + { "point_left", 0x1f448 }, + { "point_right", 0x1f449 }, + { "raised_hands", 0x1f64c }, + { "pray", 0x1f64f }, + { "point_up_2", 0x1f446 }, + { "clap", 0x1f44f }, + { "muscle", 0x1f4aa }, + { "metal", 0x1f918 }, + { "walking", 0x1f6b6 }, + { "runner", 0x1f3c3 }, + { "running", 0x1f3c3 }, + { "couple", 0x1f46b }, + { "family", 0x1f46a }, + { "two_men_holding_hands", 0x1f46c }, + { "two_women_holding_hands", 0x1f46d }, + { "dancer", 0x1f483 }, + { "dancers", 0x1f46f }, + { "ok_woman", 0x1f646 }, + { "no_good", 0x1f645 }, + { "information_desk_person", 0x1f481 }, + { "raising_hand", 0x1f64b }, + { "bride_with_veil", 0x1f470 }, + { "person_with_pouting_face", 0x1f64e }, + { "person_frowning", 0x1f64d }, + { "bow", 0x1f647 }, + { "couple_with_heart", 0x1f491 }, + { "massage", 0x1f486 }, + { "haircut", 0x1f487 }, + { "nail_care", 0x1f485 }, + { "boy", 0x1f466 }, + { "girl", 0x1f467 }, + { "woman", 0x1f469 }, + { "man", 0x1f468 }, + { "baby", 0x1f476 }, + { "older_woman", 0x1f475 }, + { "older_man", 0x1f474 }, + { "person_with_blond_hair", 0x1f471 }, + { "man_with_gua_pi_mao", 0x1f472 }, + { "man_with_turban", 0x1f473 }, + { "construction_worker", 0x1f477 }, + { "cop", 0x1f46e }, + { "angel", 0x1f47c }, + { "princess", 0x1f478 }, + { "smiley_cat", 0x1f63a }, + { "smile_cat", 0x1f638 }, + { "heart_eyes_cat", 0x1f63b }, + { "kissing_cat", 0x1f63d }, + { "smirk_cat", 0x1f63c }, + { "scream_cat", 0x1f640 }, + { "crying_cat_face", 0x1f63f }, + { "joy_cat", 0x1f639 }, + { "pouting_cat", 0x1f63e }, + { "japanese_ogre", 0x1f479 }, + { "japanese_goblin", 0x1f47a }, + { "see_no_evil", 0x1f648 }, + { "hear_no_evil", 0x1f649 }, + { "speak_no_evil", 0x1f64a }, + { "guardsman", 0x1f482 }, + { "skull", 0x1f480 }, + { "feet", 0x1f43e }, + { "lips", 0x1f444 }, + { "kiss", 0x1f48b }, + { "droplet", 0x1f4a7 }, + { "ear", 0x1f442 }, + { "eyes", 0x1f440 }, + { "nose", 0x1f443 }, + { "tongue", 0x1f445 }, + { "love_letter", 0x1f48c }, + { "bust_in_silhouette", 0x1f464 }, + { "busts_in_silhouette", 0x1f465 }, + { "speech_balloon", 0x1f4ac }, + { "thought_balloon", 0x1f4ad }, + { "sunny", 0x2600 }, + { "umbrella", 0x2614 }, + { "cloud", 0x2601 }, + { "snowflake", 0x2744 }, + { "snowman", 0x26c4 }, + { "zap", 0x26a1 }, + { "cyclone", 0x1f300 }, + { "foggy", 0x1f301 }, + { "ocean", 0x1f30a }, + { "cat", 0x1f431 }, + { "dog", 0x1f436 }, + { "mouse", 0x1f42d }, + { "hamster", 0x1f439 }, + { "rabbit", 0x1f430 }, + { "wolf", 0x1f43a }, + { "frog", 0x1f438 }, + { "tiger", 0x1f42f }, + { "koala", 0x1f428 }, + { "bear", 0x1f43b }, + { "pig", 0x1f437 }, + { "pig_nose", 0x1f43d }, + { "cow", 0x1f42e }, + { "boar", 0x1f417 }, + { "monkey_face", 0x1f435 }, + { "monkey", 0x1f412 }, + { "horse", 0x1f434 }, + { "racehorse", 0x1f40e }, + { "camel", 0x1f42b }, + { "sheep", 0x1f411 }, + { "elephant", 0x1f418 }, + { "panda_face", 0x1f43c }, + { "snake", 0x1f40d }, + { "bird", 0x1f426 }, + { "baby_chick", 0x1f424 }, + { "hatched_chick", 0x1f425 }, + { "hatching_chick", 0x1f423 }, + { "chicken", 0x1f414 }, + { "penguin", 0x1f427 }, + { "turtle", 0x1f422 }, + { "bug", 0x1f41b }, + { "honeybee", 0x1f41d }, + { "ant", 0x1f41c }, + { "beetle", 0x1f41e }, + { "snail", 0x1f40c }, + { "octopus", 0x1f419 }, + { "tropical_fish", 0x1f420 }, + { "fish", 0x1f41f }, + { "whale", 0x1f433 }, + { "whale2", 0x1f40b }, + { "dolphin", 0x1f42c }, + { "cow2", 0x1f404 }, + { "ram", 0x1f40f }, + { "rat", 0x1f400 }, + { "water_buffalo", 0x1f403 }, + { "tiger2", 0x1f405 }, + { "rabbit2", 0x1f407 }, + { "dragon", 0x1f409 }, + { "goat", 0x1f410 }, + { "rooster", 0x1f413 }, + { "dog2", 0x1f415 }, + { "pig2", 0x1f416 }, + { "mouse2", 0x1f401 }, + { "ox", 0x1f402 }, + { "dragon_face", 0x1f432 }, + { "blowfish", 0x1f421 }, + { "crocodile", 0x1f40a }, + { "dromedary_camel", 0x1f42a }, + { "leopard", 0x1f406 }, + { "cat2", 0x1f408 }, + { "poodle", 0x1f429 }, + { "paw_prints", 0x1f43e }, + { "bouquet", 0x1f490 }, + { "cherry_blossom", 0x1f338 }, + { "tulip", 0x1f337 }, + { "four_leaf_clover", 0x1f340 }, + { "rose", 0x1f339 }, + { "sunflower", 0x1f33b }, + { "hibiscus", 0x1f33a }, + { "maple_leaf", 0x1f341 }, + { "leaves", 0x1f343 }, + { "fallen_leaf", 0x1f342 }, + { "herb", 0x1f33f }, + { "mushroom", 0x1f344 }, + { "cactus", 0x1f335 }, + { "palm_tree", 0x1f334 }, + { "evergreen_tree", 0x1f332 }, + { "deciduous_tree", 0x1f333 }, + { "chestnut", 0x1f330 }, + { "seedling", 0x1f331 }, + { "blossom", 0x1f33c }, + { "ear_of_rice", 0x1f33e }, + { "shell", 0x1f41a }, + { "globe_with_meridians", 0x1f310 }, + { "sun_with_face", 0x1f31e }, + { "full_moon_with_face", 0x1f31d }, + { "new_moon_with_face", 0x1f31a }, + { "new_moon", 0x1f311 }, + { "waxing_crescent_moon", 0x1f312 }, + { "first_quarter_moon", 0x1f313 }, + { "waxing_gibbous_moon", 0x1f314 }, + { "full_moon", 0x1f315 }, + { "waning_gibbous_moon", 0x1f316 }, + { "last_quarter_moon", 0x1f317 }, + { "waning_crescent_moon", 0x1f318 }, + { "last_quarter_moon_with_face", 0x1f31c }, + { "first_quarter_moon_with_face", 0x1f31b }, + { "moon", 0x1f314 }, + { "earth_africa", 0x1f30d }, + { "earth_americas", 0x1f30e }, + { "earth_asia", 0x1f30f }, + { "volcano", 0x1f30b }, + { "milky_way", 0x1f30c }, + { "partly_sunny", 0x26c5 }, + { "bamboo", 0x1f38d }, + { "gift_heart", 0x1f49d }, + { "dolls", 0x1f38e }, + { "school_satchel", 0x1f392 }, + { "mortar_board", 0x1f393 }, + { "flags", 0x1f38f }, + { "fireworks", 0x1f386 }, + { "sparkler", 0x1f387 }, + { "wind_chime", 0x1f390 }, + { "rice_scene", 0x1f391 }, + { "jack_o_lantern", 0x1f383 }, + { "ghost", 0x1f47b }, + { "santa", 0x1f385 }, + { "christmas_tree", 0x1f384 }, + { "gift", 0x1f381 }, + { "bell", 0x1f514 }, + { "no_bell", 0x1f515 }, + { "tanabata_tree", 0x1f38b }, + { "tada", 0x1f389 }, + { "confetti_ball", 0x1f38a }, + { "balloon", 0x1f388 }, + { "crystal_ball", 0x1f52e }, + { "cd", 0x1f4bf }, + { "dvd", 0x1f4c0 }, + { "floppy_disk", 0x1f4be }, + { "camera", 0x1f4f7 }, + { "video_camera", 0x1f4f9 }, + { "movie_camera", 0x1f3a5 }, + { "computer", 0x1f4bb }, + { "tv", 0x1f4fa }, + { "iphone", 0x1f4f1 }, + { "phone", 0x260e }, + { "telephone", 0x260e }, + { "telephone_receiver", 0x1f4de }, + { "pager", 0x1f4df }, + { "fax", 0x1f4e0 }, + { "minidisc", 0x1f4bd }, + { "vhs", 0x1f4fc }, + { "sound", 0x1f509 }, + { "speaker", 0x1f508 }, + { "mute", 0x1f507 }, + { "loudspeaker", 0x1f4e2 }, + { "mega", 0x1f4e3 }, + { "hourglass", 0x231b }, + { "hourglass_flowing_sand", 0x23f3 }, + { "alarm_clock", 0x23f0 }, + { "watch", 0x231a }, + { "radio", 0x1f4fb }, + { "satellite", 0x1f4e1 }, + { "loop", 0x27bf }, + { "mag", 0x1f50d }, + { "mag_right", 0x1f50e }, + { "unlock", 0x1f513 }, + { "lock", 0x1f512 }, + { "lock_with_ink_pen", 0x1f50f }, + { "closed_lock_with_key", 0x1f510 }, + { "key", 0x1f511 }, + { "bulb", 0x1f4a1 }, + { "flashlight", 0x1f526 }, + { "high_brightness", 0x1f506 }, + { "low_brightness", 0x1f505 }, + { "electric_plug", 0x1f50c }, + { "battery", 0x1f50b }, + { "calling", 0x1f4f2 }, + { "email", 0x2709 }, + { "mailbox", 0x1f4eb }, + { "postbox", 0x1f4ee }, + { "bath", 0x1f6c0 }, + { "bathtub", 0x1f6c1 }, + { "shower", 0x1f6bf }, + { "toilet", 0x1f6bd }, + { "wrench", 0x1f527 }, + { "nut_and_bolt", 0x1f529 }, + { "hammer", 0x1f528 }, + { "seat", 0x1f4ba }, + { "moneybag", 0x1f4b0 }, + { "yen", 0x1f4b4 }, + { "dollar", 0x1f4b5 }, + { "pound", 0x1f4b7 }, + { "euro", 0x1f4b6 }, + { "credit_card", 0x1f4b3 }, + { "money_with_wings", 0x1f4b8 }, + { "e-mail", 0x1f4e7 }, + { "inbox_tray", 0x1f4e5 }, + { "outbox_tray", 0x1f4e4 }, + { "envelope", 0x2709 }, + { "incoming_envelope", 0x1f4e8 }, + { "postal_horn", 0x1f4ef }, + { "mailbox_closed", 0x1f4ea }, + { "mailbox_with_mail", 0x1f4ec }, + { "mailbox_with_no_mail", 0x1f4ed }, + { "door", 0x1f6aa }, + { "smoking", 0x1f6ac }, + { "bomb", 0x1f4a3 }, + { "gun", 0x1f52b }, + { "hocho", 0x1f52a }, + { "pill", 0x1f48a }, + { "syringe", 0x1f489 }, + { "page_facing_up", 0x1f4c4 }, + { "page_with_curl", 0x1f4c3 }, + { "bookmark_tabs", 0x1f4d1 }, + { "bar_chart", 0x1f4ca }, + { "chart_with_upwards_trend", 0x1f4c8 }, + { "chart_with_downwards_trend", 0x1f4c9 }, + { "scroll", 0x1f4dc }, + { "clipboard", 0x1f4cb }, + { "calendar", 0x1f4c6 }, + { "date", 0x1f4c5 }, + { "card_index", 0x1f4c7 }, + { "file_folder", 0x1f4c1 }, + { "open_file_folder", 0x1f4c2 }, + { "scissors", 0x2702 }, + { "pushpin", 0x1f4cc }, + { "paperclip", 0x1f4ce }, + { "black_nib", 0x2712 }, + { "pencil2", 0x270f }, + { "straight_ruler", 0x1f4cf }, + { "triangular_ruler", 0x1f4d0 }, + { "closed_book", 0x1f4d5 }, + { "green_book", 0x1f4d7 }, + { "blue_book", 0x1f4d8 }, + { "orange_book", 0x1f4d9 }, + { "notebook", 0x1f4d3 }, + { "notebook_with_decorative_cover", 0x1f4d4 }, + { "ledger", 0x1f4d2 }, + { "books", 0x1f4da }, + { "bookmark", 0x1f516 }, + { "name_badge", 0x1f4db }, + { "microscope", 0x1f52c }, + { "telescope", 0x1f52d }, + { "newspaper", 0x1f4f0 }, + { "football", 0x1f3c8 }, + { "basketball", 0x1f3c0 }, + { "soccer", 0x26bd }, + { "baseball", 0x26be }, + { "tennis", 0x1f3be }, + { "8ball", 0x1f3b1 }, + { "rugby_football", 0x1f3c9 }, + { "bowling", 0x1f3b3 }, + { "golf", 0x26f3 }, + { "mountain_bicyclist", 0x1f6b5 }, + { "bicyclist", 0x1f6b4 }, + { "horse_racing", 0x1f3c7 }, + { "snowboarder", 0x1f3c2 }, + { "swimmer", 0x1f3ca }, + { "surfer", 0x1f3c4 }, + { "ski", 0x1f3bf }, + { "spades", 0x2660 }, + { "hearts", 0x2665 }, + { "clubs", 0x2663 }, + { "diamonds", 0x2666 }, + { "gem", 0x1f48e }, + { "ring", 0x1f48d }, + { "trophy", 0x1f3c6 }, + { "musical_score", 0x1f3bc }, + { "musical_keyboard", 0x1f3b9 }, + { "violin", 0x1f3bb }, + { "space_invader", 0x1f47e }, + { "video_game", 0x1f3ae }, + { "black_joker", 0x1f0cf }, + { "flower_playing_cards", 0x1f3b4 }, + { "game_die", 0x1f3b2 }, + { "dart", 0x1f3af }, + { "mahjong", 0x1f004 }, + { "clapper", 0x1f3ac }, + { "memo", 0x1f4dd }, + { "pencil", 0x1f4dd }, + { "book", 0x1f4d6 }, + { "art", 0x1f3a8 }, + { "microphone", 0x1f3a4 }, + { "headphones", 0x1f3a7 }, + { "trumpet", 0x1f3ba }, + { "saxophone", 0x1f3b7 }, + { "guitar", 0x1f3b8 }, + { "shoe", 0x1f45e }, + { "sandal", 0x1f461 }, + { "high_heel", 0x1f460 }, + { "lipstick", 0x1f484 }, + { "boot", 0x1f462 }, + { "shirt", 0x1f455 }, + { "tshirt", 0x1f455 }, + { "necktie", 0x1f454 }, + { "womans_clothes", 0x1f45a }, + { "dress", 0x1f457 }, + { "running_shirt_with_sash", 0x1f3bd }, + { "jeans", 0x1f456 }, + { "kimono", 0x1f458 }, + { "bikini", 0x1f459 }, + { "ribbon", 0x1f380 }, + { "tophat", 0x1f3a9 }, + { "crown", 0x1f451 }, + { "womans_hat", 0x1f452 }, + { "mans_shoe", 0x1f45e }, + { "closed_umbrella", 0x1f302 }, + { "briefcase", 0x1f4bc }, + { "handbag", 0x1f45c }, + { "pouch", 0x1f45d }, + { "purse", 0x1f45b }, + { "eyeglasses", 0x1f453 }, + { "fishing_pole_and_fish", 0x1f3a3 }, + { "coffee", 0x2615 }, + { "tea", 0x1f375 }, + { "sake", 0x1f376 }, + { "baby_bottle", 0x1f37c }, + { "beer", 0x1f37a }, + { "beers", 0x1f37b }, + { "cocktail", 0x1f378 }, + { "tropical_drink", 0x1f379 }, + { "wine_glass", 0x1f377 }, + { "fork_and_knife", 0x1f374 }, + { "pizza", 0x1f355 }, + { "hamburger", 0x1f354 }, + { "fries", 0x1f35f }, + { "poultry_leg", 0x1f357 }, + { "meat_on_bone", 0x1f356 }, + { "spaghetti", 0x1f35d }, + { "curry", 0x1f35b }, + { "fried_shrimp", 0x1f364 }, + { "bento", 0x1f371 }, + { "sushi", 0x1f363 }, + { "fish_cake", 0x1f365 }, + { "rice_ball", 0x1f359 }, + { "rice_cracker", 0x1f358 }, + { "rice", 0x1f35a }, + { "ramen", 0x1f35c }, + { "stew", 0x1f372 }, + { "oden", 0x1f362 }, + { "dango", 0x1f361 }, + { "egg", 0x1f95a }, + { "bread", 0x1f35e }, + { "doughnut", 0x1f369 }, + { "custard", 0x1f36e }, + { "icecream", 0x1f366 }, + { "ice_cream", 0x1f368 }, + { "shaved_ice", 0x1f367 }, + { "birthday", 0x1f382 }, + { "cake", 0x1f370 }, + { "cookie", 0x1f36a }, + { "chocolate_bar", 0x1f36b }, + { "candy", 0x1f36c }, + { "lollipop", 0x1f36d }, + { "honey_pot", 0x1f36f }, + { "apple", 0x1f34e }, + { "green_apple", 0x1f34f }, + { "tangerine", 0x1f34a }, + { "lemon", 0x1f34b }, + { "cherries", 0x1f352 }, + { "grapes", 0x1f347 }, + { "watermelon", 0x1f349 }, + { "strawberry", 0x1f353 }, + { "peach", 0x1f351 }, + { "melon", 0x1f348 }, + { "banana", 0x1f34c }, + { "pear", 0x1f350 }, + { "pineapple", 0x1f34d }, + { "sweet_potato", 0x1f360 }, + { "eggplant", 0x1f346 }, + { "tomato", 0x1f345 }, + { "corn", 0x1f33d }, + { "house", 0x1f3e0 }, + { "house_with_garden", 0x1f3e1 }, + { "school", 0x1f3eb }, + { "office", 0x1f3e2 }, + { "post_office", 0x1f3e3 }, + { "hospital", 0x1f3e5 }, + { "bank", 0x1f3e6 }, + { "convenience_store", 0x1f3ea }, + { "love_hotel", 0x1f3e9 }, + { "hotel", 0x1f3e8 }, + { "wedding", 0x1f492 }, + { "church", 0x26ea }, + { "department_store", 0x1f3ec }, + { "european_post_office", 0x1f3e4 }, + { "city_sunrise", 0x1f307 }, + { "city_sunset", 0x1f306 }, + { "japanese_castle", 0x1f3ef }, + { "european_castle", 0x1f3f0 }, + { "tent", 0x26fa }, + { "factory", 0x1f3ed }, + { "tokyo_tower", 0x1f5fc }, + { "japan", 0x1f5fe }, + { "mount_fuji", 0x1f5fb }, + { "sunrise_over_mountains", 0x1f304 }, + { "sunrise", 0x1f305 }, + { "stars", 0x1f320 }, + { "statue_of_liberty", 0x1f5fd }, + { "bridge_at_night", 0x1f309 }, + { "carousel_horse", 0x1f3a0 }, + { "rainbow", 0x1f308 }, + { "ferris_wheel", 0x1f3a1 }, + { "fountain", 0x26f2 }, + { "roller_coaster", 0x1f3a2 }, + { "ship", 0x1f6a2 }, + { "speedboat", 0x1f6a4 }, + { "boat", 0x26f5 }, + { "sailboat", 0x26f5 }, + { "rowboat", 0x1f6a3 }, + { "anchor", 0x2693 }, + { "rocket", 0x1f680 }, + { "airplane", 0x2708 }, + { "helicopter", 0x1f681 }, + { "steam_locomotive", 0x1f682 }, + { "tram", 0x1f68a }, + { "mountain_railway", 0x1f69e }, + { "bike", 0x1f6b2 }, + { "aerial_tramway", 0x1f6a1 }, + { "suspension_railway", 0x1f69f }, + { "mountain_cableway", 0x1f6a0 }, + { "tractor", 0x1f69c }, + { "blue_car", 0x1f699 }, + { "oncoming_automobile", 0x1f698 }, + { "car", 0x1f697 }, + { "red_car", 0x1f697 }, + { "taxi", 0x1f695 }, + { "oncoming_taxi", 0x1f696 }, + { "articulated_lorry", 0x1f69b }, + { "bus", 0x1f68c }, + { "oncoming_bus", 0x1f68d }, + { "rotating_light", 0x1f6a8 }, + { "police_car", 0x1f693 }, + { "oncoming_police_car", 0x1f694 }, + { "fire_engine", 0x1f692 }, + { "ambulance", 0x1f691 }, + { "minibus", 0x1f690 }, + { "truck", 0x1f69a }, + { "train", 0x1f68b }, + { "station", 0x1f689 }, + { "train2", 0x1f686 }, + { "bullettrain_front", 0x1f685 }, + { "bullettrain_side", 0x1f684 }, + { "light_rail", 0x1f688 }, + { "monorail", 0x1f69d }, + { "railway_car", 0x1f683 }, + { "trolleybus", 0x1f68e }, + { "ticket", 0x1f3ab }, + { "fuelpump", 0x26fd }, + { "vertical_traffic_light", 0x1f6a6 }, + { "traffic_light", 0x1f6a5 }, + { "warning", 0x26a0 }, + { "construction", 0x1f6a7 }, + { "beginner", 0x1f530 }, + { "atm", 0x1f3e7 }, + { "slot_machine", 0x1f3b0 }, + { "busstop", 0x1f68f }, + { "barber", 0x1f488 }, + { "hotsprings", 0x2668 }, + { "checkered_flag", 0x1f3c1 }, + { "crossed_flags", 0x1f38c }, + { "izakaya_lantern", 0x1f3ee }, + { "moyai", 0x1f5ff }, + { "circus_tent", 0x1f3aa }, + { "performing_arts", 0x1f3ad }, + { "round_pushpin", 0x1f4cd }, + { "triangular_flag_on_post", 0x1f6a9 }, + { "keycap_ten", 0x1f51f }, + { "1234", 0x1f522 }, + { "symbols", 0x1f523 }, + { "arrow_backward", 0x25c0 }, + { "arrow_down", 0x2b07 }, + { "arrow_forward", 0x25b6 }, + { "arrow_left", 0x2b05 }, + { "capital_abcd", 0x1f520 }, + { "abcd", 0x1f521 }, + { "abc", 0x1f524 }, + { "arrow_lower_left", 0x2199 }, + { "arrow_lower_right", 0x2198 }, + { "arrow_right", 0x27a1 }, + { "arrow_up", 0x2b06 }, + { "arrow_upper_left", 0x2196 }, + { "arrow_upper_right", 0x2197 }, + { "arrow_double_down", 0x23ec }, + { "arrow_double_up", 0x23eb }, + { "arrow_down_small", 0x1f53d }, + { "arrow_heading_down", 0x2935 }, + { "arrow_heading_up", 0x2934 }, + { "leftwards_arrow_with_hook", 0x21a9 }, + { "arrow_right_hook", 0x21aa }, + { "left_right_arrow", 0x2194 }, + { "arrow_up_down", 0x2195 }, + { "arrow_up_small", 0x1f53c }, + { "arrows_clockwise", 0x1f503 }, + { "arrows_counterclockwise", 0x1f504 }, + { "rewind", 0x23ea }, + { "fast_forward", 0x23e9 }, + { "information_source", 0x2139 }, + { "ok", 0x1f197 }, + { "twisted_rightwards_arrows", 0x1f500 }, + { "repeat", 0x1f501 }, + { "repeat_one", 0x1f502 }, + { "new", 0x1f195 }, + { "top", 0x1f51d }, + { "up", 0x1f199 }, + { "cool", 0x1f192 }, + { "free", 0x1f193 }, + { "ng", 0x1f196 }, + { "cinema", 0x1f3a6 }, + { "koko", 0x1f201 }, + { "signal_strength", 0x1f4f6 }, + { "u5272", 0x1f239 }, + { "u5408", 0x1f234 }, + { "u55b6", 0x1f23a }, + { "u6307", 0x1f22f }, + { "u6708", 0x1f237 }, + { "u6709", 0x1f236 }, + { "u6e80", 0x1f235 }, + { "u7121", 0x1f21a }, + { "u7533", 0x1f238 }, + { "u7a7a", 0x1f233 }, + { "u7981", 0x1f232 }, + { "sa", 0x1f202 }, + { "restroom", 0x1f6bb }, + { "mens", 0x1f6b9 }, + { "womens", 0x1f6ba }, + { "baby_symbol", 0x1f6bc }, + { "no_smoking", 0x1f6ad }, + { "parking", 0x1f17f }, + { "wheelchair", 0x267f }, + { "metro", 0x1f687 }, + { "baggage_claim", 0x1f6c4 }, + { "accept", 0x1f251 }, + { "wc", 0x1f6be }, + { "potable_water", 0x1f6b0 }, + { "put_litter_in_its_place", 0x1f6ae }, + { "secret", 0x3299 }, + { "congratulations", 0x3297 }, + { "m", 0x24c2 }, + { "passport_control", 0x1f6c2 }, + { "left_luggage", 0x1f6c5 }, + { "customs", 0x1f6c3 }, + { "ideograph_advantage", 0x1f250 }, + { "cl", 0x1f191 }, + { "sos", 0x1f198 }, + { "id", 0x1f194 }, + { "no_entry_sign", 0x1f6ab }, + { "underage", 0x1f51e }, + { "no_mobile_phones", 0x1f4f5 }, + { "do_not_litter", 0x1f6af }, + { "non-potable_water", 0x1f6b1 }, + { "no_bicycles", 0x1f6b3 }, + { "no_pedestrians", 0x1f6b7 }, + { "children_crossing", 0x1f6b8 }, + { "no_entry", 0x26d4 }, + { "eight_spoked_asterisk", 0x2733 }, + { "eight_pointed_black_star", 0x2734 }, + { "heart_decoration", 0x1f49f }, + { "vs", 0x1f19a }, + { "vibration_mode", 0x1f4f3 }, + { "mobile_phone_off", 0x1f4f4 }, + { "chart", 0x1f4b9 }, + { "currency_exchange", 0x1f4b1 }, + { "aries", 0x2648 }, + { "taurus", 0x2649 }, + { "gemini", 0x264a }, + { "cancer", 0x264b }, + { "leo", 0x264c }, + { "virgo", 0x264d }, + { "libra", 0x264e }, + { "scorpius", 0x264f }, + { "sagittarius", 0x2650 }, + { "capricorn", 0x2651 }, + { "aquarius", 0x2652 }, + { "pisces", 0x2653 }, + { "ophiuchus", 0x26ce }, + { "six_pointed_star", 0x1f52f }, + { "negative_squared_cross_mark", 0x274e }, + { "a", 0x1f170 }, + { "b", 0x1f171 }, + { "ab", 0x1f18e }, + { "o2", 0x1f17e }, + { "diamond_shape_with_a_dot_inside", 0x1f4a0 }, + { "recycle", 0x267b }, + { "end", 0x1f51a }, + { "on", 0x1f51b }, + { "soon", 0x1f51c }, + { "clock1", 0x1f550 }, + { "clock130", 0x1f55c }, + { "clock10", 0x1f559 }, + { "clock1030", 0x1f565 }, + { "clock11", 0x1f55a }, + { "clock1130", 0x1f566 }, + { "clock12", 0x1f55b }, + { "clock1230", 0x1f567 }, + { "clock2", 0x1f551 }, + { "clock230", 0x1f55d }, + { "clock3", 0x1f552 }, + { "clock330", 0x1f55e }, + { "clock4", 0x1f553 }, + { "clock430", 0x1f55f }, + { "clock5", 0x1f554 }, + { "clock530", 0x1f560 }, + { "clock6", 0x1f555 }, + { "clock630", 0x1f561 }, + { "clock7", 0x1f556 }, + { "clock730", 0x1f562 }, + { "clock8", 0x1f557 }, + { "clock830", 0x1f563 }, + { "clock9", 0x1f558 }, + { "clock930", 0x1f564 }, + { "heavy_dollar_sign", 0x1f4b2 }, + { "copyright", 0x00a9 }, + { "registered", 0x00ae }, + { "tm", 0x2122 }, + { "x", 0x274c }, + { "heavy_exclamation_mark", 0x2757 }, + { "bangbang", 0x203c }, + { "interrobang", 0x2049 }, + { "o", 0x2b55 }, + { "heavy_multiplication_x", 0x2716 }, + { "heavy_plus_sign", 0x2795 }, + { "heavy_minus_sign", 0x2796 }, + { "heavy_division_sign", 0x2797 }, + { "white_flower", 0x1f4ae }, + { "100", 0x1f4af }, + { "heavy_check_mark", 0x2714 }, + { "ballot_box_with_check", 0x2611 }, + { "radio_button", 0x1f518 }, + { "link", 0x1f517 }, + { "curly_loop", 0x27b0 }, + { "wavy_dash", 0x3030 }, + { "part_alternation_mark", 0x303d }, + { "trident", 0x1f531 }, + { "white_check_mark", 0x2705 }, + { "black_square_button", 0x1f532 }, + { "white_square_button", 0x1f533 }, + { "black_circle", 0x26ab }, + { "white_circle", 0x26aa }, + { "red_circle", 0x1f534 }, + { "large_blue_circle", 0x1f535 }, + { "large_blue_diamond", 0x1f537 }, + { "large_orange_diamond", 0x1f536 }, + { "small_blue_diamond", 0x1f539 }, + { "small_orange_diamond", 0x1f538 }, + { "small_red_triangle", 0x1f53a }, + { "small_red_triangle_down", 0x1f53b }, + }; + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.cs new file mode 100644 index 0000000..ced0660 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/EmojiInline.cs @@ -0,0 +1,86 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing emoji symbol. + /// + public partial class EmojiInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public EmojiInline() + : base(MarkdownInlineType.Emoji) + { + } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = ':', Method = InlineParseMethod.Emoji }); + } + + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + if (start >= maxEnd - 1) + { + return null; + } + + // Check the start sequence. + string startSequence = markdown.Substring(start, 1); + if (startSequence != ":") + { + return null; + } + + // Find the end of the span. + var innerStart = start + 1; + int innerEnd = Common.IndexOf(markdown, startSequence, innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // The first character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) + { + return null; + } + + // The last character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + var emojiName = markdown.Substring(innerStart, innerEnd - innerStart); + + if (_emojiCodesDictionary.TryGetValue(emojiName, out var emojiCode)) + { + var result = new EmojiInline { Text = char.ConvertFromUtf32(emojiCode), Type = MarkdownInlineType.Emoji }; + return new InlineParseResult(result, start, innerEnd + 1); + } + + return null; + } + + /// + public string Text { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/HyperlinkInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/HyperlinkInline.cs new file mode 100644 index 0000000..2acf0b4 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/HyperlinkInline.cs @@ -0,0 +1,477 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a type of hyperlink where the text and the target URL cannot be controlled + /// independently. + /// + public class HyperlinkInline : MarkdownInline, IInlineLeaf, ILinkElement + { + /// + /// Initializes a new instance of the class. + /// + public HyperlinkInline() + : base(MarkdownInlineType.RawHyperlink) + { + } + + /// + /// Gets or sets the text to display. + /// + public string Text { get; set; } + + /// + /// Gets or sets the URL to link to. + /// + public string Url { get; set; } + + /// + /// Gets this type of hyperlink does not have a tooltip. + /// + string ILinkElement.Tooltip => null; + + /// + /// Gets or sets the type of hyperlink. + /// + public HyperlinkType LinkType { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.AngleBracketLink }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = ':', Method = InlineParseMethod.Url }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '/', Method = InlineParseMethod.RedditLink }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '.', Method = InlineParseMethod.PartialLink }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '@', Method = InlineParseMethod.Email }); + } + + /// + /// Attempts to parse a URL within angle brackets e.g. "http://www.reddit.com". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed URL, or null if this is not a URL. + internal static InlineParseResult ParseAngleBracketLink(string markdown, int start, int maxEnd) + { + int innerStart = start + 1; + + // Check for a known scheme e.g. "https://". + int pos = -1; + foreach (var scheme in MarkdownDocument.KnownSchemes) + { + if (maxEnd - innerStart >= scheme.Length && string.Equals(markdown.Substring(innerStart, scheme.Length), scheme, StringComparison.OrdinalIgnoreCase)) + { + // URL scheme found. + pos = innerStart + scheme.Length; + break; + } + } + + if (pos == -1) + { + return null; + } + + // Angle bracket links should not have any whitespace. + int innerEnd = markdown.IndexOfAny(new char[] { ' ', '\t', '\r', '\n', '>' }, pos, maxEnd - pos); + if (innerEnd == -1 || markdown[innerEnd] != '>') + { + return null; + } + + // There should be at least one character after the http://. + if (innerEnd == pos) + { + return null; + } + + var url = markdown.Substring(innerStart, innerEnd - innerStart); + return new InlineParseResult(new HyperlinkInline { Url = url, Text = url, LinkType = HyperlinkType.BracketedUrl }, start, innerEnd + 1); + } + + /// + /// Attempts to parse a URL e.g. "http://www.reddit.com". + /// + /// The markdown text. + /// The location of the colon character. + /// The location to stop parsing. + /// A parsed URL, or null if this is not a URL. + internal static InlineParseResult ParseUrl(string markdown, int tripPos, int maxEnd) + { + int start = -1; + + // Check for a known scheme e.g. "https://". + foreach (var scheme in MarkdownDocument.KnownSchemes) + { + int schemeStart = tripPos - scheme.Length; + if (schemeStart >= 0 && schemeStart <= maxEnd - scheme.Length && string.Equals(markdown.Substring(schemeStart, scheme.Length), scheme, StringComparison.OrdinalIgnoreCase)) + { + // URL scheme found. + start = schemeStart; + break; + } + } + + if (start == -1) + { + return null; + } + + // The previous character must be non-alphanumeric i.e. "ahttp://t.co" is not a valid URL. + if (start > 0 && char.IsLetter(markdown[start - 1])) + { + return null; + } + + // The URL must have at least one character after the http:// and at least one dot. + int pos = tripPos + 3; + if (pos > maxEnd) + { + return null; + } + + int dotIndex = markdown.IndexOf('.', pos, maxEnd - pos); + if (dotIndex == -1 || dotIndex == pos) + { + return null; + } + + // Find the end of the URL. + int end = FindUrlEnd(markdown, dotIndex + 1, maxEnd); + + var url = markdown.Substring(start, end - start); + return new InlineParseResult(new HyperlinkInline { Url = url, Text = url, LinkType = HyperlinkType.FullUrl }, start, end); + } + + /// + /// Attempts to parse a subreddit link e.g. "/r/news" or "r/news". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed subreddit or user link, or null if this is not a subreddit link. + internal static InlineParseResult ParseRedditLink(string markdown, int start, int maxEnd) + { + var result = ParseDoubleSlashLink(markdown, start, maxEnd); + if (result != null) + { + return result; + } + + return ParseSingleSlashLink(markdown, start, maxEnd); + } + + /// + /// Parse a link of the form "/r/news" or "/u/quinbd". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed subreddit or user link, or null if this is not a subreddit link. + private static InlineParseResult ParseDoubleSlashLink(string markdown, int start, int maxEnd) + { + // The minimum length is 4 characters ("/u/u"). + if (start > maxEnd - 4) + { + return null; + } + + // Determine the type of link (subreddit or user). + HyperlinkType linkType; + if (markdown[start + 1] == 'r') + { + linkType = HyperlinkType.Subreddit; + } + else if (markdown[start + 1] == 'u') + { + linkType = HyperlinkType.User; + } + else + { + return null; + } + + // Check that there is another slash. + if (markdown[start + 2] != '/') + { + return null; + } + + // Find the end of the link. + int end = FindEndOfRedditLink(markdown, start + 3, maxEnd); + + // Subreddit names must be at least two characters long, users at least one. + if (end - start < (linkType == HyperlinkType.User ? 4 : 5)) + { + return null; + } + + // We found something! + var text = markdown.Substring(start, end - start); + return new InlineParseResult(new HyperlinkInline { Text = text, Url = text, LinkType = linkType }, start, end); + } + + /// + /// Parse a link of the form "r/news" or "u/quinbd". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed subreddit or user link, or null if this is not a subreddit link. + private static InlineParseResult ParseSingleSlashLink(string markdown, int start, int maxEnd) + { + // The minimum length is 3 characters ("u/u"). + start--; + if (start < 0 || start > maxEnd - 3) + { + return null; + } + + // Determine the type of link (subreddit or user). + HyperlinkType linkType; + if (markdown[start] == 'r') + { + linkType = HyperlinkType.Subreddit; + } + else if (markdown[start] == 'u') + { + linkType = HyperlinkType.User; + } + else + { + return null; + } + + // If the link doesn't start with '/', then the previous character must be + // non-alphanumeric i.e. "bear/trap" is not a valid subreddit link. + if (start >= 1 && (char.IsLetterOrDigit(markdown[start - 1]) || markdown[start - 1] == '/')) + { + return null; + } + + // Find the end of the link. + int end = FindEndOfRedditLink(markdown, start + 2, maxEnd); + + // Subreddit names must be at least two characters long, users at least one. + if (end - start < (linkType == HyperlinkType.User ? 3 : 4)) + { + return null; + } + + // We found something! + var text = markdown.Substring(start, end - start); + return new InlineParseResult(new HyperlinkInline { Text = text, Url = "/" + text, LinkType = linkType }, start, end); + } + + /// + /// Attempts to parse a URL without a scheme e.g. "www.reddit.com". + /// + /// The markdown text. + /// The location of the dot character. + /// The location to stop parsing. + /// A parsed URL, or null if this is not a URL. + internal static InlineParseResult ParsePartialLink(string markdown, int tripPos, int maxEnd) + { + int start = tripPos - 3; + if (start < 0 || markdown[start] != 'w' || markdown[start + 1] != 'w' || markdown[start + 2] != 'w') + { + return null; + } + + // The character before the "www" must be non-alphanumeric i.e. "bwww.reddit.com" is not a valid URL. + if (start >= 1 && (char.IsLetterOrDigit(markdown[start - 1]) || markdown[start - 1] == '<')) + { + return null; + } + + // The URL must have at least one character after the www. + if (start >= maxEnd - 4) + { + return null; + } + + // Find the end of the URL. + int end = FindUrlEnd(markdown, start + 4, maxEnd); + + var url = markdown.Substring(start, end - start); + return new InlineParseResult(new HyperlinkInline { Url = "http://" + url, Text = url, LinkType = HyperlinkType.PartialUrl }, start, end); + } + + /// + /// Attempts to parse an email address e.g. "test@reddit.com". + /// + /// The markdown text. + /// The minimum start position to return. + /// The location of the at character. + /// The location to stop parsing. + /// A parsed URL, or null if this is not a URL. + internal static InlineParseResult ParseEmailAddress(string markdown, int minStart, int tripPos, int maxEnd) + { + // Search backwards until we find a character which is not a letter, digit, or one of + // these characters: '+', '-', '_', '.'. + // Note: it is intended that this code match the reddit.com markdown parser; there are + // many characters which are legal in email addresses but which aren't picked up by + // reddit (for example: '$' and '!'). + + // Special characters as per https://en.wikipedia.org/wiki/Email_address#Local-part allowed + char[] allowedchars = new char[] { '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' }; + + int start = tripPos; + while (start > minStart) + { + char c = markdown[start - 1]; + if ((c < 'a' || c > 'z') && + (c < 'A' || c > 'Z') && + (c < '0' || c > '9') && + !allowedchars.Contains(c)) + { + break; + } + + start--; + } + + // There must be at least one character before the '@'. + if (start == tripPos) + { + return null; + } + + // Search forwards until we find a character which is not a letter, digit, or one of + // these characters: '-', '_'. + // Note: it is intended that this code match the reddit.com markdown parser; + // technically underscores ('_') aren't allowed in a host name. + int dotIndex = tripPos + 1; + while (dotIndex < maxEnd) + { + char c = markdown[dotIndex]; + if ((c < 'a' || c > 'z') && + (c < 'A' || c > 'Z') && + (c < '0' || c > '9') && + c != '-' && c != '_') + { + break; + } + + dotIndex++; + } + + // We are expecting a dot. + if (dotIndex == maxEnd || markdown[dotIndex] != '.') + { + return null; + } + + // Search forwards until we find a character which is not a letter, digit, or one of + // these characters: '.', '-', '_'. + // Note: it is intended that this code match the reddit.com markdown parser; + // technically underscores ('_') aren't allowed in a host name. + int end = dotIndex + 1; + while (end < maxEnd) + { + char c = markdown[end]; + if ((c < 'a' || c > 'z') && + (c < 'A' || c > 'Z') && + (c < '0' || c > '9') && + c != '.' && c != '-' && c != '_') + { + break; + } + + end++; + } + + // There must be at least one character after the dot. + if (end == dotIndex + 1) + { + return null; + } + + // We found an email address! + var emailAddress = markdown.Substring(start, end - start); + return new InlineParseResult(new HyperlinkInline { Url = "mailto:" + emailAddress, Text = emailAddress, LinkType = HyperlinkType.Email }, start, end); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Text == null) + { + return base.ToString(); + } + + return Text; + } + + /// + /// Finds the next character that is not a letter, digit or underscore in a range. + /// + /// The markdown text. + /// The location to start searching. + /// The location to stop searching. + /// The location of the next character that is not a letter, digit or underscore. + private static int FindEndOfRedditLink(string markdown, int start, int end) + { + int pos = start; + while (pos < markdown.Length && pos < end) + { + char c = markdown[pos]; + if ((c < 'a' || c > 'z') && + (c < 'A' || c > 'Z') && + (c < '0' || c > '9') && + c != '_' && c != '/') + { + return pos; + } + + pos++; + } + + return end; + } + + /// + /// Finds the end of a URL. + /// + /// The markdown text. + /// The location to start searching. + /// The location to stop searching. + /// The location of the end of the URL. + private static int FindUrlEnd(string markdown, int start, int maxEnd) + { + // For some reason a less than character ends a URL... + int end = markdown.IndexOfAny(new char[] { ' ', '\t', '\r', '\n', '<' }, start, maxEnd - start); + if (end == -1) + { + end = maxEnd; + } + + // URLs can't end on a punctuation character. + while (end - 1 > start) + { + if (Array.IndexOf(new char[] { ')', '}', ']', '!', ';', '.', '?', ',' }, markdown[end - 1]) < 0) + { + break; + } + + end--; + } + + return end; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineContainer.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineContainer.cs new file mode 100644 index 0000000..6011380 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineContainer.cs @@ -0,0 +1,19 @@ +// 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. + +using System.Collections.Generic; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Initializes a new instance of the class. + /// + public interface IInlineContainer + { + /// + /// Gets or sets the contents of the inline. + /// + IList Inlines { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineLeaf.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineLeaf.cs new file mode 100644 index 0000000..ee13e55 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/IInlineLeaf.cs @@ -0,0 +1,17 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Initializes a new instance of the class. + /// + public interface IInlineLeaf + { + /// + /// Gets or sets the text for this run. + /// + string Text { get; set; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ILinkElement.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ILinkElement.cs new file mode 100644 index 0000000..2a2eac2 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ILinkElement.cs @@ -0,0 +1,24 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Implemented by all inline link elements. + /// + internal interface ILinkElement + { + /// + /// Gets the link URL. This can be a relative URL, but note that subreddit links will always + /// have the leading slash (i.e. the Url will be "/r/baconit" even if the text is + /// "r/baconit"). + /// + string Url { get; } + + /// + /// Gets a tooltip to display on hover. Can be null. + /// + string Tooltip { get; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ImageInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ImageInline.cs new file mode 100644 index 0000000..135dfec --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ImageInline.cs @@ -0,0 +1,259 @@ +// 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. + +using System; +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents an embedded image. + /// + public class ImageInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public ImageInline() + : base(MarkdownInlineType.Image) + { + } + + /// + /// Gets or sets the image URL. + /// + public string Url { get; set; } + + /// + /// Gets or sets the image Render URL. + /// + public string RenderUrl { get; set; } + + /// + /// Gets or sets a text to display on hover. + /// + public string Tooltip { get; set; } + + /// + public string Text { get; set; } = string.Empty; + + /// + /// Gets or sets the ID of a reference, if this is a reference-style link. + /// + public string ReferenceId { get; set; } + + /// + /// Gets image width + /// If value is greater than 0, ImageStretch is set to UniformToFill + /// If both ImageWidth and ImageHeight are greater than 0, ImageStretch is set to Fill + /// + public int ImageWidth { get; internal set; } + + /// + /// Gets image height + /// If value is greater than 0, ImageStretch is set to UniformToFill + /// If both ImageWidth and ImageHeight are greater than 0, ImageStretch is set to Fill + /// + public int ImageHeight { get; internal set; } + + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '!', Method = InlineParseMethod.Image }); + } + + /// + /// Attempts to parse an image e.g. "![Toolkit logo](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/Microsoft.Toolkit.Uwp.SampleApp/Assets/ToolkitLogo.png)". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed markdown image, or null if this is not a markdown image. + internal static InlineParseResult Parse(string markdown, int start, int end) + { + // Expect a '!' character. + if (start >= end || markdown[start] != '!') + { + return null; + } + + int pos = start + 1; + + // Then a '[' character + if (pos >= end || markdown[pos] != '[') + { + return null; + } + + pos++; + + // Find the ']' character + while (pos < end) + { + if (markdown[pos] == ']') + { + break; + } + + pos++; + } + + if (pos == end) + { + return null; + } + + // Extract the alt. + string tooltip = markdown.Substring(start + 2, pos - (start + 2)); + + // Expect the '(' character. + pos++; + + string reference = string.Empty; + string url = string.Empty; + int imageWidth = 0; + int imageHeight = 0; + + if (pos < end && markdown[pos] == '[') + { + int refstart = pos; + + // Find the reference ']' character + while (pos < end) + { + if (markdown[pos] == ']') + { + break; + } + + pos++; + } + + reference = markdown.Substring(refstart + 1, pos - refstart - 1); + } + else if (pos < end && markdown[pos] == '(') + { + while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + // Extract the URL. + int urlStart = pos; + while (pos < end && markdown[pos] != ')') + { + pos++; + } + + var imageDimensionsPos = markdown.IndexOf(" =", urlStart, pos - urlStart, StringComparison.Ordinal); + + url = imageDimensionsPos > 0 + ? TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, imageDimensionsPos) + : TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, pos); + + if (imageDimensionsPos > 0) + { + // trying to find 'x' which separates image width and height + var dimensionsSepatorPos = markdown.IndexOf("x", imageDimensionsPos + 2, pos - imageDimensionsPos - 1, StringComparison.Ordinal); + + // didn't find separator, trying to parse value as imageWidth + if (dimensionsSepatorPos == -1) + { + var imageWidthStr = markdown.Substring(imageDimensionsPos + 2, pos - imageDimensionsPos - 2); + + int.TryParse(imageWidthStr, out imageWidth); + } + else + { + var dimensions = markdown.Substring(imageDimensionsPos + 2, pos - imageDimensionsPos - 2).Split('x'); + + // got width and height + if (dimensions.Length == 2) + { + int.TryParse(dimensions[0], out imageWidth); + int.TryParse(dimensions[1], out imageHeight); + } + } + } + } + + if (pos == end) + { + return null; + } + + // We found something! + var result = new ImageInline + { + Tooltip = tooltip, + RenderUrl = url, + ReferenceId = reference, + Url = url, + Text = markdown.Substring(start, pos + 1 - start), + ImageWidth = imageWidth, + ImageHeight = imageHeight + }; + return new InlineParseResult(result, start, pos + 1); + } + + /// + /// If this is a reference-style link, attempts to converts it to a regular link. + /// + /// The document containing the list of references. + internal void ResolveReference(MarkdownDocument document) + { + if (document == null) + { + throw new ArgumentNullException("document"); + } + + if (ReferenceId == null) + { + return; + } + + // Look up the reference ID. + var reference = document.LookUpReference(ReferenceId); + if (reference == null) + { + return; + } + + // The reference was found. Check the URL is valid. + if (!Common.IsUrlValid(reference.Url)) + { + return; + } + + // Everything is cool when you're part of a team. + RenderUrl = reference.Url; + ReferenceId = null; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (ImageWidth > 0 && ImageHeight > 0) + { + return string.Format("![{0}]: {1} (Width: {2}, Height: {3})", Tooltip, Url, ImageWidth, ImageHeight); + } + + if (ImageWidth > 0) + { + return string.Format("![{0}]: {1} (Width: {2})", Tooltip, Url, ImageWidth); + } + + if (ImageHeight > 0) + { + return string.Format("![{0}]: {1} (Height: {2})", Tooltip, Url, ImageHeight); + } + + return string.Format("![{0}]: {1}", Tooltip, Url); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/InputInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/InputInline.cs new file mode 100644 index 0000000..82ecbb8 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/InputInline.cs @@ -0,0 +1,222 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents an embedded image. + /// + public class InputInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public InputInline() : base(MarkdownInlineType.InputBox) + { + } + + /// + /// Gets or sets the image URL. + /// + public string BoundTo { get; set; } + + /// + /// Gets or sets the image Render URL. + /// + public string RenderUrl { get; set; } + + /// + /// Gets or sets a text to display on hover. + /// + public string InputType { get; set; } + + /// + public string Text { get; set; } = string.Empty; + + /// + /// Gets or sets the ID of a reference, if this is a reference-style link. + /// + public string ReferenceId { get; set; } + + public Dictionary Args { get; private set; } + + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '?', Method = InlineParseMethod.InputBox }); + } + + /// + /// Attempts to parse an image e.g. "![Toolkit logo](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/Microsoft.Toolkit.Uwp.SampleApp/Assets/ToolkitLogo.png)". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed markdown image, or null if this is not a markdown image. + internal static InlineParseResult Parse(string markdown, int start, int end) + { + // Expect a '!' character. + if (start >= end || markdown[start] != '?') + { + return null; + } + + int pos = start + 1; + + // Then a '[' character + if (pos >= end || markdown[pos] != '[') + { + return null; + } + + pos++; + + // Find the ']' character + while (pos < end) + { + if (markdown[pos] == ']') + { + break; + } + + pos++; + } + + if (pos == end) + { + return null; + } + + // Extract the alt. + string tooltip = markdown.Substring(start + 2, pos - (start + 2)); + + // Expect the '(' character. + pos++; + + string reference = string.Empty; + string url = string.Empty; + Dictionary args = new Dictionary(); + + if (pos < end && markdown[pos] == '[') + { + int refstart = pos; + + // Find the reference ']' character + while (pos < end) + { + if (markdown[pos] == ']') + { + break; + } + + pos++; + } + + reference = markdown.Substring(refstart + 1, pos - refstart - 1); + } + else if (pos < end && markdown[pos] == '(') + { + while (pos < end && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + // Extract the URL. + int urlStart = pos; + while (pos < end && markdown[pos] != ')') + { + pos++; + } + + var imageDimensionsPos = markdown.IndexOf(" ", urlStart, pos - urlStart, StringComparison.Ordinal); + + url = imageDimensionsPos > 0 + ? TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, imageDimensionsPos) + : TextRunInline.ResolveEscapeSequences(markdown, urlStart + 1, pos); + + if (imageDimensionsPos > 0) + { + string remainingText = markdown.Substring(imageDimensionsPos + 1, pos - imageDimensionsPos - 1); + Debug.WriteLine(remainingText); + + + var parts = remainingText.Split(','); + foreach(var part in parts) + { + var seperator = part.IndexOf('='); + string name = part.Substring(0,seperator); + string value = part.Substring(seperator + 1); + + args.Add(name, value); + } + } + } + + if (pos == end) + { + return null; + } + + // We found something! + var result = new InputInline + { + InputType = !string.IsNullOrWhiteSpace(tooltip) ? tooltip : "Text", + RenderUrl = url, + ReferenceId = reference, + BoundTo = url, + Text = markdown.Substring(start, pos + 1 - start), + Args = args + }; + return new InlineParseResult(result, start, pos + 1); + } + + /// + /// If this is a reference-style link, attempts to converts it to a regular link. + /// + /// The document containing the list of references. + internal void ResolveReference(MarkdownDocument document) + { + if (document == null) + { + throw new ArgumentNullException("document"); + } + + if (ReferenceId == null) + { + return; + } + + // Look up the reference ID. + var reference = document.LookUpReference(ReferenceId); + if (reference == null) + { + return; + } + + // The reference was found. Check the URL is valid. + if (!Common.IsUrlValid(reference.Url)) + { + return; + } + + // Everything is cool when you're part of a team. + RenderUrl = reference.Url; + ReferenceId = null; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return string.Format("![{0}]: {1}", InputType, BoundTo); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ItalicTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ItalicTextInline.cs new file mode 100644 index 0000000..f85890d --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/ItalicTextInline.cs @@ -0,0 +1,101 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing italic text. + /// + public class ItalicTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public ItalicTextInline() + : base(MarkdownInlineType.Italic) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '*', Method = InlineParseMethod.Italic }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '_', Method = InlineParseMethod.Italic }); + } + + /// + /// Attempts to parse a italic text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed italic text span, or null if this is not a italic text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Check the first char. + char startChar = markdown[start]; + if (start == maxEnd || (startChar != '*' && startChar != '_')) + { + return null; + } + + // Find the end of the span. The end character (either '*' or '_') must be the same as + // the start character. + var innerStart = start + 1; + int innerEnd = Common.IndexOf(markdown, startChar, start + 1, maxEnd); + if (innerEnd == -1) + { + return null; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // The first character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) + { + return null; + } + + // The last character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + var result = new ItalicTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, innerEnd + 1); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "*" + string.Join(string.Empty, Inlines) + "*"; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/LinkAnchorInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/LinkAnchorInline.cs new file mode 100644 index 0000000..2963472 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/LinkAnchorInline.cs @@ -0,0 +1,124 @@ +// 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. + +using System.Collections.Generic; +using System.Xml.Linq; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span that contains a reference for links to point to. + /// + public class LinkAnchorInline : MarkdownInline + { + internal LinkAnchorInline() + : base(MarkdownInlineType.LinkReference) + { + } + + /// + /// Gets or sets the Name of this Link Reference. + /// + public string Link { get; set; } + + /// + /// Gets or sets the raw Link Reference. + /// + public string Raw { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.LinkReference }); + } + + /// + /// Attempts to parse a comment span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed bold text span, or null if this is not a bold text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + if (start >= maxEnd - 1) + { + return null; + } + + // Check the start sequence. + string startSequence = markdown.Substring(start, 2); + if (startSequence != "') + var innerStart = start + 2; + int innerEnd = Common.IndexOf(markdown, "", innerStart, maxEnd); + int trueEnd = innerEnd + 4; + if (innerEnd == -1) + { + innerEnd = Common.IndexOf(markdown, "/>", innerStart, maxEnd); + trueEnd = innerEnd + 2; + if (innerEnd == -1) + { + return null; + } + } + + // This link Reference wasn't closed properly if the next link starts before a close. + var nextLink = Common.IndexOf(markdown, " -1 && nextLink < innerEnd) + { + return null; + } + + var length = trueEnd - start; + var contents = markdown.Substring(start, length); + + string link = null; + + try + { + var xml = XElement.Parse(contents); + var attr = xml.Attribute("name"); + if (attr != null) + { + link = attr.Value; + } + } + catch + { + // Attempting to fetch link failed, ignore and continue. + } + + // Remove whitespace if it exists. + if (trueEnd + 1 <= maxEnd && markdown[trueEnd] == ' ') + { + trueEnd += 1; + } + + // We found something! + var result = new LinkAnchorInline + { + Raw = contents, + Link = link + }; + return new InlineParseResult(result, start, trueEnd); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + return Raw; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/MarkdownLinkInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/MarkdownLinkInline.cs new file mode 100644 index 0000000..acfcb92 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/MarkdownLinkInline.cs @@ -0,0 +1,287 @@ +// 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. + +using System; +using System.Collections.Generic; +using MarkdownUI.WPF; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a type of hyperlink where the text can be different from the target URL. + /// + public class MarkdownLinkInline : MarkdownInline, IInlineContainer, ILinkElement + { + /// + /// Initializes a new instance of the class. + /// + public MarkdownLinkInline() + : base(MarkdownInlineType.MarkdownLink) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Gets or sets the link URL. + /// + public string Url { get; set; } + + /// + /// Gets or sets a tooltip to display on hover. + /// + public string Tooltip { get; set; } + + /// + /// Gets or sets the ID of a reference, if this is a reference-style link. + /// + public string ReferenceId { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '[', Method = InlineParseMethod.MarkdownLink }); + } + + /// + /// Attempts to parse a markdown link e.g. "[](http://www.reddit.com)". + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed markdown link, or null if this is not a markdown link. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Expect a '[' character. + if (start == maxEnd || markdown[start] != '[') + { + return null; + } + + // Find the ']' character, keeping in mind that [test [0-9]](http://www.test.com) is allowed. + int linkTextOpen = start + 1; + int pos = linkTextOpen; + int linkTextClose; + int openSquareBracketCount = 0; + while (true) + { + linkTextClose = markdown.IndexOfAny(new char[] { '[', ']' }, pos, maxEnd - pos); + if (linkTextClose == -1) + { + return null; + } + + if (markdown[linkTextClose] == '[') + { + openSquareBracketCount++; + } + else if (openSquareBracketCount > 0) + { + openSquareBracketCount--; + } + else + { + break; + } + + pos = linkTextClose + 1; + } + + // Skip whitespace. + pos = linkTextClose + 1; + while (pos < maxEnd && ParseHelpers.IsMarkdownWhiteSpace(markdown[pos])) + { + pos++; + } + + if (pos == maxEnd) + { + return null; + } + + // Expect the '(' character or the '[' character. + int linkOpen = pos; + if (markdown[pos] == '(') + { + // Skip whitespace. + linkOpen++; + while (linkOpen < maxEnd && ParseHelpers.IsMarkdownWhiteSpace(markdown[linkOpen])) + { + linkOpen++; + } + + // Find the ')' character. + pos = linkOpen; + int linkClose = -1; + var openParenthesis = 0; + while (pos < maxEnd) + { + if (markdown[pos] == ')') + { + if (openParenthesis == 0) + { + linkClose = pos; + break; + } + else + { + openParenthesis--; + } + } + + if (markdown[pos] == '(') + { + openParenthesis++; + } + + pos++; + } + + if (pos >= maxEnd) + { + return null; + } + + int end = linkClose + 1; + + // Skip whitespace backwards. + while (linkClose > linkOpen && ParseHelpers.IsMarkdownWhiteSpace(markdown[linkClose - 1])) + { + linkClose--; + } + + // If there is no text whatsoever, then this is not a valid link. + if (linkOpen == linkClose) + { + return null; + } + + // Check if there is tooltip text. + string url; + string tooltip = null; + bool lastUrlCharIsDoubleQuote = markdown[linkClose - 1] == '"'; + int tooltipStart = Common.IndexOf(markdown, " \"", linkOpen, linkClose - 1); + if (tooltipStart == linkOpen) + { + return null; + } + + if (lastUrlCharIsDoubleQuote && tooltipStart != -1) + { + // Extract the URL (resolving any escape sequences). + url = TextRunInline.ResolveEscapeSequences(markdown, linkOpen, tooltipStart).TrimEnd(' ', '\t', '\r', '\n'); + tooltip = markdown.Substring(tooltipStart + 2, (linkClose - 1) - (tooltipStart + 2)); + } + else + { + // Extract the URL (resolving any escape sequences). + url = TextRunInline.ResolveEscapeSequences(markdown, linkOpen, linkClose); + } + + // Check the URL is okay. + if (!url.IsEmail()) + { + if (!Common.IsUrlValid(url)) + { + return null; + } + } + else + { + tooltip = url = string.Format("mailto:{0}", url); + } + + // We found a regular stand-alone link. + var result = new MarkdownLinkInline(); + result.Inlines = Common.ParseInlineChildren(markdown, linkTextOpen, linkTextClose, ignoreLinks: true); + result.Url = url.Replace(" ", "%20"); + result.Tooltip = tooltip; + return new InlineParseResult(result, start, end); + } + else if (markdown[pos] == '[') + { + // Find the ']' character. + int linkClose = Common.IndexOf(markdown, ']', pos + 1, maxEnd); + if (linkClose == -1) + { + return null; + } + + // We found a reference-style link. + var result = new MarkdownLinkInline(); + result.Inlines = Common.ParseInlineChildren(markdown, linkTextOpen, linkTextClose, ignoreLinks: true); + result.ReferenceId = markdown.Substring(linkOpen + 1, linkClose - (linkOpen + 1)); + if (result.ReferenceId == string.Empty) + { + result.ReferenceId = markdown.Substring(linkTextOpen, linkTextClose - linkTextOpen); + } + + return new InlineParseResult(result, start, linkClose + 1); + } + + return null; + } + + /// + /// If this is a reference-style link, attempts to converts it to a regular link. + /// + /// The document containing the list of references. + internal void ResolveReference(MarkdownDocument document) + { + if (document == null) + { + throw new ArgumentNullException("document"); + } + + if (ReferenceId == null) + { + return; + } + + // Look up the reference ID. + var reference = document.LookUpReference(ReferenceId); + if (reference == null) + { + return; + } + + // The reference was found. Check the URL is valid. + if (!Common.IsUrlValid(reference.Url)) + { + return; + } + + // Everything is cool when you're part of a team. + Url = reference.Url; + Tooltip = reference.Tooltip; + ReferenceId = null; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null || Url == null) + { + return base.ToString(); + } + + if (ReferenceId != null) + { + return string.Format("[{0}][{1}]", string.Join(string.Empty, Inlines), ReferenceId); + } + + return string.Format("[{0}]({1})", string.Join(string.Empty, Inlines), Url); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/StrikethroughTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/StrikethroughTextInline.cs new file mode 100644 index 0000000..f6dac4e --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/StrikethroughTextInline.cs @@ -0,0 +1,98 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing strikethrough text. + /// + public class StrikethroughTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public StrikethroughTextInline() + : base(MarkdownInlineType.Strikethrough) + { + } + + /// + /// Gets or sets The contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '~', Method = InlineParseMethod.Strikethrough }); + } + + /// + /// Attempts to parse a strikethrough text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed strikethrough text span, or null if this is not a strikethrough text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Check the start sequence. + if (start >= maxEnd - 1 || markdown.Substring(start, 2) != "~~") + { + return null; + } + + // Find the end of the span. + var innerStart = start + 2; + int innerEnd = Common.IndexOf(markdown, "~~", innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + // The span must contain at least one character. + if (innerStart == innerEnd) + { + return null; + } + + // The first character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart])) + { + return null; + } + + // The last character inside the span must NOT be a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + var result = new StrikethroughTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, innerEnd + 2); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "~~" + string.Join(string.Empty, Inlines) + "~~"; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SubscriptTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SubscriptTextInline.cs new file mode 100644 index 0000000..0992d5a --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SubscriptTextInline.cs @@ -0,0 +1,95 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing subscript text. + /// + public class SubscriptTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public SubscriptTextInline() + : base(MarkdownInlineType.Subscript) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Subscript }); + } + + /// + /// Attempts to parse a subscript text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed subscript text span, or null if this is not a subscript text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Check the first character. + // e.g. "……" + if (maxEnd - start < 5) + { + return null; + } + + if (markdown.Substring(start, 5) != "") + { + return null; + } + + int innerStart = start + 5; + int innerEnd = Common.IndexOf(markdown, "", innerStart, maxEnd); + + // if don't have the end character or no character between start and end + if (innerEnd == -1 || innerEnd == innerStart) + { + return null; + } + + // No match if the character after the caret is a space. + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart]) || ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + var result = new SubscriptTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, innerEnd + 6); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "" + string.Join(string.Empty, Inlines) + ""; + } + } +} diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SuperscriptTextInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SuperscriptTextInline.cs new file mode 100644 index 0000000..01026c2 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/SuperscriptTextInline.cs @@ -0,0 +1,147 @@ +// 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. + +using System.Collections.Generic; +using Microsoft.Toolkit.Parsers.Core; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing superscript text. + /// + public class SuperscriptTextInline : MarkdownInline, IInlineContainer + { + /// + /// Initializes a new instance of the class. + /// + public SuperscriptTextInline() + : base(MarkdownInlineType.Superscript) + { + } + + /// + /// Gets or sets the contents of the inline. + /// + public IList Inlines { get; set; } + + /// + /// Returns the chars that if found means we might have a match. + /// + internal static void AddTripChars(List tripCharHelpers) + { + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '^', Method = InlineParseMethod.Superscript }); + tripCharHelpers.Add(new InlineTripCharHelper() { FirstChar = '<', Method = InlineParseMethod.Superscript }); + } + + /// + /// Attempts to parse a superscript text span. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed superscript text span, or null if this is not a superscript text span. + internal static InlineParseResult Parse(string markdown, int start, int maxEnd) + { + // Check the first character. + bool isHTMLSequence = false; + if (start == maxEnd || (markdown[start] != '^' && markdown[start] != '<')) + { + return null; + } + + if (markdown[start] != '^') + { + if (maxEnd - start < 5) + { + return null; + } + else if (markdown.Substring(start, 5) != "") + { + return null; + } + else + { + isHTMLSequence = true; + } + } + + if (isHTMLSequence) + { + int innerStart = start + 5; + int innerEnd, end; + innerEnd = Common.IndexOf(markdown, "", innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + if (innerEnd == innerStart) + { + return null; + } + + if (ParseHelpers.IsMarkdownWhiteSpace(markdown[innerStart]) || ParseHelpers.IsMarkdownWhiteSpace(markdown[innerEnd - 1])) + { + return null; + } + + // We found something! + end = innerEnd + 6; + var result = new SuperscriptTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, end); + } + else + { + // The content might be enclosed in parentheses. + int innerStart = start + 1; + int innerEnd, end; + if (innerStart < maxEnd && markdown[innerStart] == '(') + { + // Find the end parenthesis. + innerStart++; + innerEnd = Common.IndexOf(markdown, ')', innerStart, maxEnd); + if (innerEnd == -1) + { + return null; + } + + end = innerEnd + 1; + } + else + { + // Search for the next whitespace character. + innerEnd = Common.FindNextWhiteSpace(markdown, innerStart, maxEnd, ifNotFoundReturnLength: true); + if (innerEnd == innerStart) + { + // No match if the character after the caret is a space. + return null; + } + + end = innerEnd; + } + + // We found something! + var result = new SuperscriptTextInline(); + result.Inlines = Common.ParseInlineChildren(markdown, innerStart, innerEnd); + return new InlineParseResult(result, start, end); + } + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Inlines == null) + { + return base.ToString(); + } + + return "^(" + string.Join(string.Empty, Inlines) + ")"; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/TextRunInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/TextRunInline.cs new file mode 100644 index 0000000..adf1899 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Inlines/TextRunInline.cs @@ -0,0 +1,461 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// Represents a span containing plain text. + /// + public class TextRunInline : MarkdownInline, IInlineLeaf + { + /// + /// Initializes a new instance of the class. + /// + public TextRunInline() + : base(MarkdownInlineType.TextRun) + { + } + + /// + /// Gets or sets the text for this run. + /// + public string Text { get; set; } + + // A list of supported HTML entity names, along with their corresponding code points. + private static readonly Dictionary _entities = new Dictionary + { + { "quot", 0x0022 }, // " + { "amp", 0x0026 }, // & + { "apos", 0x0027 }, // ' + { "lt", 0x003C }, // < + { "gt", 0x003E }, // > + { "nbsp", 0x00A0 }, // + { "#160", 0x00A0 }, // ? + { "iexcl", 0x00A1 }, // ¡ + { "cent", 0x00A2 }, // ¢ + { "pound", 0x00A3 }, // £ + { "curren", 0x00A4 }, // ¤ + { "yen", 0x00A5 }, // ¥ + { "brvbar", 0x00A6 }, // ¦ + { "sect", 0x00A7 }, // § + { "uml", 0x00A8 }, // ¨ + { "copy", 0x00A9 }, // © + { "ordf", 0x00AA }, // ª + { "laquo", 0x00AB }, // « + { "not", 0x00AC }, // ¬ + { "shy", 0x00AD }, // ? + { "reg", 0x00AE }, // ® + { "macr", 0x00AF }, // ¯ + { "deg", 0x00B0 }, // ° + { "plusmn", 0x00B1 }, // ± + { "sup2", 0x00B2 }, // ² + { "sup3", 0x00B3 }, // ³ + { "acute", 0x00B4 }, // ´ + { "micro", 0x00B5 }, // µ + { "para", 0x00B6 }, // ¶ + { "middot", 0x00B7 }, // · + { "cedil", 0x00B8 }, // ¸ + { "sup1", 0x00B9 }, // ¹ + { "ordm", 0x00BA }, // º + { "raquo", 0x00BB }, // » + { "frac14", 0x00BC }, // ¼ + { "frac12", 0x00BD }, // ½ + { "frac34", 0x00BE }, // ¾ + { "iquest", 0x00BF }, // ¿ + { "Agrave", 0x00C0 }, // À + { "Aacute", 0x00C1 }, // Á + { "Acirc", 0x00C2 }, //  + { "Atilde", 0x00C3 }, // à + { "Auml", 0x00C4 }, // Ä + { "Aring", 0x00C5 }, // Å + { "AElig", 0x00C6 }, // Æ + { "Ccedil", 0x00C7 }, // Ç + { "Egrave", 0x00C8 }, // È + { "Eacute", 0x00C9 }, // É + { "Ecirc", 0x00CA }, // Ê + { "Euml", 0x00CB }, // Ë + { "Igrave", 0x00CC }, // Ì + { "Iacute", 0x00CD }, // Í + { "Icirc", 0x00CE }, // Î + { "Iuml", 0x00CF }, // Ï + { "ETH", 0x00D0 }, // Ð + { "Ntilde", 0x00D1 }, // Ñ + { "Ograve", 0x00D2 }, // Ò + { "Oacute", 0x00D3 }, // Ó + { "Ocirc", 0x00D4 }, // Ô + { "Otilde", 0x00D5 }, // Õ + { "Ouml", 0x00D6 }, // Ö + { "times", 0x00D7 }, // × + { "Oslash", 0x00D8 }, // Ø + { "Ugrave", 0x00D9 }, // Ù + { "Uacute", 0x00DA }, // Ú + { "Ucirc", 0x00DB }, // Û + { "Uuml", 0x00DC }, // Ü + { "Yacute", 0x00DD }, // Ý + { "THORN", 0x00DE }, // Þ + { "szlig", 0x00DF }, // ß + { "agrave", 0x00E0 }, // à + { "aacute", 0x00E1 }, // á + { "acirc", 0x00E2 }, // â + { "atilde", 0x00E3 }, // ã + { "auml", 0x00E4 }, // ä + { "aring", 0x00E5 }, // å + { "aelig", 0x00E6 }, // æ + { "ccedil", 0x00E7 }, // ç + { "egrave", 0x00E8 }, // è + { "eacute", 0x00E9 }, // é + { "ecirc", 0x00EA }, // ê + { "euml", 0x00EB }, // ë + { "igrave", 0x00EC }, // ì + { "iacute", 0x00ED }, // í + { "icirc", 0x00EE }, // î + { "iuml", 0x00EF }, // ï + { "eth", 0x00F0 }, // ð + { "ntilde", 0x00F1 }, // ñ + { "ograve", 0x00F2 }, // ò + { "oacute", 0x00F3 }, // ó + { "ocirc", 0x00F4 }, // ô + { "otilde", 0x00F5 }, // õ + { "ouml", 0x00F6 }, // ö + { "divide", 0x00F7 }, // ÷ + { "oslash", 0x00F8 }, // ø + { "ugrave", 0x00F9 }, // ù + { "uacute", 0x00FA }, // ú + { "ucirc", 0x00FB }, // û + { "uuml", 0x00FC }, // ü + { "yacute", 0x00FD }, // ý + { "thorn", 0x00FE }, // þ + { "yuml", 0x00FF }, // ÿ + { "OElig", 0x0152 }, // Œ + { "oelig", 0x0153 }, // œ + { "Scaron", 0x0160 }, // Š + { "scaron", 0x0161 }, // š + { "Yuml", 0x0178 }, // Ÿ + { "fnof", 0x0192 }, // ƒ + { "circ", 0x02C6 }, // ˆ + { "tilde", 0x02DC }, // ˜ + { "Alpha", 0x0391 }, // Α + { "Beta", 0x0392 }, // Β + { "Gamma", 0x0393 }, // Γ + { "Delta", 0x0394 }, // Δ + { "Epsilon", 0x0395 }, // Ε + { "Zeta", 0x0396 }, // Ζ + { "Eta", 0x0397 }, // Η + { "Theta", 0x0398 }, // Θ + { "Iota", 0x0399 }, // Ι + { "Kappa", 0x039A }, // Κ + { "Lambda", 0x039B }, // Λ + { "Mu", 0x039C }, // Μ + { "Nu", 0x039D }, // Ν + { "Xi", 0x039E }, // Ξ + { "Omicron", 0x039F }, // Ο + { "Pi", 0x03A0 }, // Π + { "Rho", 0x03A1 }, // Ρ + { "Sigma", 0x03A3 }, // Σ + { "Tau", 0x03A4 }, // Τ + { "Upsilon", 0x03A5 }, // Υ + { "Phi", 0x03A6 }, // Φ + { "Chi", 0x03A7 }, // Χ + { "Psi", 0x03A8 }, // Ψ + { "Omega", 0x03A9 }, // Ω + { "alpha", 0x03B1 }, // α + { "beta", 0x03B2 }, // β + { "gamma", 0x03B3 }, // γ + { "delta", 0x03B4 }, // δ + { "epsilon", 0x03B5 }, // ε + { "zeta", 0x03B6 }, // ζ + { "eta", 0x03B7 }, // η + { "theta", 0x03B8 }, // θ + { "iota", 0x03B9 }, // ι + { "kappa", 0x03BA }, // κ + { "lambda", 0x03BB }, // λ + { "mu", 0x03BC }, // μ + { "nu", 0x03BD }, // ν + { "xi", 0x03BE }, // ξ + { "omicron", 0x03BF }, // ο + { "pi", 0x03C0 }, // π + { "rho", 0x03C1 }, // ρ + { "sigmaf", 0x03C2 }, // ς + { "sigma", 0x03C3 }, // σ + { "tau", 0x03C4 }, // τ + { "upsilon", 0x03C5 }, // υ + { "phi", 0x03C6 }, // φ + { "chi", 0x03C7 }, // χ + { "psi", 0x03C8 }, // ψ + { "omega", 0x03C9 }, // ω + { "thetasym", 0x03D1 }, // ϑ + { "upsih", 0x03D2 }, // ϒ + { "piv", 0x03D6 }, // ϖ + { "ensp", 0x2002 }, //  ? + { "emsp", 0x2003 }, //  ? + { "thinsp", 0x2009 }, //  ? + { "zwnj", 0x200C }, // ? + { "zwj", 0x200D }, // ? + { "lrm", 0x200E }, // ? + { "rlm", 0x200F }, // ? + { "ndash", 0x2013 }, // – + { "mdash", 0x2014 }, // — + { "lsquo", 0x2018 }, // ‘ + { "rsquo", 0x2019 }, // ’ + { "sbquo", 0x201A }, // ‚ + { "ldquo", 0x201C }, // “ + { "rdquo", 0x201D }, // ” + { "bdquo", 0x201E }, // „ + { "dagger", 0x2020 }, // † + { "Dagger", 0x2021 }, // ‡ + { "bull", 0x2022 }, // • + { "hellip", 0x2026 }, // … + { "permil", 0x2030 }, // ‰ + { "prime", 0x2032 }, // ′ + { "Prime", 0x2033 }, // ″ + { "lsaquo", 0x2039 }, // ‹ + { "rsaquo", 0x203A }, // › + { "oline", 0x203E }, // ‾ + { "frasl", 0x2044 }, // ⁄ + { "euro", 0x20AC }, // € + { "image", 0x2111 }, // ℑ + { "weierp", 0x2118 }, // ℘ + { "real", 0x211C }, // ℜ + { "trade", 0x2122 }, // ™ + { "alefsym", 0x2135 }, // ℵ + { "larr", 0x2190 }, // ← + { "uarr", 0x2191 }, // ↑ + { "rarr", 0x2192 }, // → + { "darr", 0x2193 }, // ↓ + { "harr", 0x2194 }, // ↔ + { "crarr", 0x21B5 }, // ↵ + { "lArr", 0x21D0 }, // ⇐ + { "uArr", 0x21D1 }, // ⇑ + { "rArr", 0x21D2 }, // ⇒ + { "dArr", 0x21D3 }, // ⇓ + { "hArr", 0x21D4 }, // ⇔ + { "forall", 0x2200 }, // ∀ + { "part", 0x2202 }, // ∂ + { "exist", 0x2203 }, // ∃ + { "empty", 0x2205 }, // ∅ + { "nabla", 0x2207 }, // ∇ + { "isin", 0x2208 }, // ∈ + { "notin", 0x2209 }, // ∉ + { "ni", 0x220B }, // ∋ + { "prod", 0x220F }, // ∏ + { "sum", 0x2211 }, // ∑ + { "minus", 0x2212 }, // − + { "lowast", 0x2217 }, // ∗ + { "radic", 0x221A }, // √ + { "prop", 0x221D }, // ∝ + { "infin", 0x221E }, // ∞ + { "ang", 0x2220 }, // ∠ + { "and", 0x2227 }, // ∧ + { "or", 0x2228 }, // ∨ + { "cap", 0x2229 }, // ∩ + { "cup", 0x222A }, // ∪ + { "int", 0x222B }, // ∫ + { "there4", 0x2234 }, // ∴ + { "sim", 0x223C }, // ∼ + { "cong", 0x2245 }, // ≅ + { "asymp", 0x2248 }, // ≈ + { "ne", 0x2260 }, // ≠ + { "equiv", 0x2261 }, // ≡ + { "le", 0x2264 }, // ≤ + { "ge", 0x2265 }, // ≥ + { "sub", 0x2282 }, // ⊂ + { "sup", 0x2283 }, // ⊃ + { "nsub", 0x2284 }, // ⊄ + { "sube", 0x2286 }, // ⊆ + { "supe", 0x2287 }, // ⊇ + { "oplus", 0x2295 }, // ⊕ + { "otimes", 0x2297 }, // ⊗ + { "perp", 0x22A5 }, // ⊥ + { "sdot", 0x22C5 }, // ⋅ + { "lceil", 0x2308 }, // ⌈ + { "rceil", 0x2309 }, // ⌉ + { "lfloor", 0x230A }, // ⌊ + { "rfloor", 0x230B }, // ⌋ + { "lang", 0x2329 }, // 〈 + { "rang", 0x232A }, // 〉 + { "loz", 0x25CA }, // ◊ + { "spades", 0x2660 }, // ♠ + { "clubs", 0x2663 }, // ♣ + { "hearts", 0x2665 }, // ♥ + { "diams", 0x2666 }, // ♦ + }; + + // A list of characters that can be escaped. + private static readonly char[] _escapeCharacters = new char[] { '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '#', '+', '-', '.', '!', '|', '~', '^', '&', ':', '<', '>', '/' }; + + /// + /// Parses unformatted text. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed text span. + internal static TextRunInline Parse(string markdown, int start, int end) + { + // Handle escape sequences and entities. + // Note: this code is designed to be as fast as possible in the case where there are no + // escape sequences and no entities (expected to be the common case). + StringBuilder result = null; + int textPos = start; + int searchPos = start; + while (searchPos < end) + { + // Look for the next backslash. + int sequenceStartIndex = markdown.IndexOfAny(new char[] { '\\', '&' }, searchPos, end - searchPos); + if (sequenceStartIndex == -1) + { + break; + } + + searchPos = sequenceStartIndex + 1; + + char decodedChar; + if (markdown[sequenceStartIndex] == '\\') + { + // This is an escape sequence, with one more character expected. + if (sequenceStartIndex >= end - 1) + { + break; + } + + // Check if the character after the backslash can be escaped. + decodedChar = markdown[sequenceStartIndex + 1]; + if (Array.IndexOf(_escapeCharacters, decodedChar) < 0) + { + // This character cannot be escaped. + continue; + } + + // This here's an escape sequence! + if (result == null) + { + result = new StringBuilder(end - start); + } + + result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); + result.Append(decodedChar); + searchPos = textPos = sequenceStartIndex + 2; + } + else if (markdown[sequenceStartIndex] == '&') + { + // This is an entity e.g. " ". + + // Look for the semicolon. + int semicolonIndex = markdown.IndexOf(';', sequenceStartIndex + 1, end - (sequenceStartIndex + 1)); + + // Unterminated entity. + if (semicolonIndex == -1) + { + continue; + } + + // Okay, we have an entity, but is it one we recognise? + string entityName = markdown.Substring(sequenceStartIndex + 1, semicolonIndex - (sequenceStartIndex + 1)); + + // Unrecognised entity. + if (_entities.ContainsKey(entityName) == false) + { + continue; + } + + // This here's an escape sequence! + if (result == null) + { + result = new StringBuilder(end - start); + } + + result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); + result.Append((char)_entities[entityName]); + searchPos = textPos = semicolonIndex + 1; + } + } + + if (result != null) + { + result.Append(markdown.Substring(textPos, end - textPos)); + return new TextRunInline { Text = result.ToString() }; + } + + return new TextRunInline { Text = markdown.Substring(start, end - start) }; + } + + /// + /// Parses unformatted text. + /// + /// The markdown text. + /// The location to start parsing. + /// The location to stop parsing. + /// A parsed text span. + internal static string ResolveEscapeSequences(string markdown, int start, int end) + { + // Handle escape sequences only. + // Note: this code is designed to be as fast as possible in the case where there are no + // escape sequences (expected to be the common case). + StringBuilder result = null; + int textPos = start; + int searchPos = start; + while (searchPos < end) + { + // Look for the next backslash. + int sequenceStartIndex = markdown.IndexOf('\\', searchPos, end - searchPos); + if (sequenceStartIndex == -1) + { + break; + } + + searchPos = sequenceStartIndex + 1; + + // This is an escape sequence, with one more character expected. + if (sequenceStartIndex >= end - 1) + { + break; + } + + // Check if the character after the backslash can be escaped. + char decodedChar = markdown[sequenceStartIndex + 1]; + if (Array.IndexOf(_escapeCharacters, decodedChar) < 0) + { + // This character cannot be escaped. + continue; + } + + // This here's an escape sequence! + if (result == null) + { + result = new StringBuilder(end - start); + } + + result.Append(markdown.Substring(textPos, sequenceStartIndex - textPos)); + result.Append(decodedChar); + searchPos = textPos = sequenceStartIndex + 2; + } + + if (result != null) + { + result.Append(markdown.Substring(textPos, end - textPos)); + return result.ToString(); + } + + return markdown.Substring(start, end - start); + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Text == null) + { + return base.ToString(); + } + + return Text; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownBlock.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownBlock.cs new file mode 100644 index 0000000..eb316dd --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownBlock.cs @@ -0,0 +1,49 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Blocks +{ + /// + /// A Block Element is an element that is a container for other structures. + /// + public abstract class MarkdownBlock : MarkdownElement + { + /// + /// Gets or sets tells us what type this element is. + /// + public MarkdownBlockType Type { get; set; } + + /// + /// Initializes a new instance of the class. + /// + internal MarkdownBlock(MarkdownBlockType type) + { + Type = type; + } + + /// + /// Determines whether the specified object is equal to the current object. + /// + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. + public override bool Equals(object obj) + { + if (!base.Equals(obj) || !(obj is MarkdownBlock)) + { + return false; + } + + return Type == ((MarkdownBlock)obj).Type; + } + + /// + /// Serves as the default hash function. + /// + /// A hash code for the current object. + public override int GetHashCode() + { + return base.GetHashCode() ^ Type.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownDocument.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownDocument.cs new file mode 100644 index 0000000..c43cff1 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownDocument.cs @@ -0,0 +1,418 @@ +// 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. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Toolkit.Parsers.Markdown.Blocks; +using Microsoft.Toolkit.Parsers.Markdown.Helpers; + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// Represents a Markdown Document. + /// Initialize an instance and call to parse the Raw Markdown Text. + /// + public class MarkdownDocument : MarkdownBlock + { + /// + /// Gets a list of URL schemes. + /// + public static List KnownSchemes { get; private set; } = new List() + { + "http", + "https", + "ftp", + "steam", + "irc", + "news", + "mumble", + "ssh", + "ms-windows-store", + "sip" + }; + + private Dictionary _references; + + /// + /// Initializes a new instance of the class. + /// + public MarkdownDocument() + : base(MarkdownBlockType.Root) + { + } + + /// + /// Gets or sets the list of block elements. + /// + public IList Blocks { get; set; } + + /// + /// Parses markdown document text. + /// + /// The markdown text. + public void Parse(string markdownText) + { + Blocks = Parse(markdownText, 0, markdownText.Length, quoteDepth: 0, actualEnd: out _); + + // Remove any references from the list of blocks, and add them to a dictionary. + for (int i = Blocks.Count - 1; i >= 0; i--) + { + if (Blocks[i].Type == MarkdownBlockType.LinkReference) + { + var reference = (LinkReferenceBlock)Blocks[i]; + if (_references == null) + { + _references = new Dictionary(StringComparer.OrdinalIgnoreCase); + } + + if (!_references.ContainsKey(reference.Id)) + { + _references.Add(reference.Id, reference); + } + + Blocks.RemoveAt(i); + } + } + } + + /// + /// Parses a markdown document. + /// + /// The markdown text. + /// The position to start parsing. + /// The position to stop parsing. + /// The current nesting level for block quoting. + /// Set to the position at which parsing ended. This can be + /// different from when the parser is being called recursively. + /// + /// A list of parsed blocks. + internal static List Parse(string markdown, int start, int end, int quoteDepth, out int actualEnd) + { + // We need to parse out the list of blocks. + // Some blocks need to start on a new paragraph (code, lists and tables) while other + // blocks can start on any line (headers, horizontal rules and quotes). + // Text that is outside of any other block becomes a paragraph. + var blocks = new List(); + int startOfLine = start; + bool lineStartsNewParagraph = true; + var paragraphText = new StringBuilder(); + + // These are needed to parse underline-style header blocks. + int previousRealtStartOfLine = start; + int previousStartOfLine = start; + int previousEndOfLine = start; + + // Go line by line. + while (startOfLine < end) + { + // Find the first non-whitespace character. + int nonSpacePos = startOfLine; + char nonSpaceChar = '\0'; + int realStartOfLine = startOfLine; // i.e. including quotes. + int expectedQuotesRemaining = quoteDepth; + while (true) + { + while (nonSpacePos < end) + { + char c = markdown[nonSpacePos]; + if (c == '\r' || c == '\n') + { + // The line is either entirely whitespace, or is empty. + break; + } + + if (c != ' ' && c != '\t') + { + // The line has content. + nonSpaceChar = c; + break; + } + + nonSpacePos++; + } + + // When parsing blocks in a blockquote context, we need to count the number of + // quote characters ('>'). If there are less than expected AND this is the + // start of a new paragraph, then stop parsing. + if (expectedQuotesRemaining == 0) + { + break; + } + + if (nonSpaceChar == '>') + { + // Expected block quote characters should be ignored. + expectedQuotesRemaining--; + nonSpacePos++; + nonSpaceChar = '\0'; + startOfLine = nonSpacePos; + + // Ignore the first space after the quote character, if there is one. + if (startOfLine < end && markdown[startOfLine] == ' ') + { + startOfLine++; + nonSpacePos++; + } + } + else + { + int lastIndentation = 0; + string lastline = null; + + // Determines how many Quote levels were in the last line. + if (realStartOfLine > 0) + { + lastline = markdown.Substring(previousRealtStartOfLine, previousEndOfLine - previousRealtStartOfLine); + lastIndentation = lastline.Count(c => c == '>'); + } + + var currentEndOfLine = Common.FindNextSingleNewLine(markdown, nonSpacePos, end, out _); + var currentline = markdown.Substring(realStartOfLine, currentEndOfLine - realStartOfLine); + var currentIndentation = currentline.Count(c => c == '>'); + var firstChar = markdown[realStartOfLine]; + + // This is a quote that doesn't start with a Quote marker, but carries on from the last line. + if (lastIndentation == 1) + { + if (nonSpaceChar != '\0' && firstChar != '>') + { + break; + } + } + + // Collapse down a level of quotes if the current indentation is greater than the last indentation. + // Only if the last indentation is greater than 1, and the current indentation is greater than 0 + if (lastIndentation > 1 && currentIndentation > 0 && currentIndentation < lastIndentation) + { + break; + } + + // This must be the end of the blockquote. End the current paragraph, if any. + actualEnd = realStartOfLine; + + if (paragraphText.Length > 0) + { + blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); + } + + return blocks; + } + } + + // Find the end of the current line. + int endOfLine = Common.FindNextSingleNewLine(markdown, nonSpacePos, end, out int startOfNextLine); + + if (nonSpaceChar == '\0') + { + // The line is empty or nothing but whitespace. + lineStartsNewParagraph = true; + + // End the current paragraph. + if (paragraphText.Length > 0) + { + blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); + paragraphText.Clear(); + } + } + else + { + // This is a header if the line starts with a hash character, + // or if the line starts with '-' or a '=' character and has no other characters. + // Or a quote if the line starts with a greater than character (optionally preceded by whitespace). + // Or a horizontal rule if the line contains nothing but 3 '*', '-' or '_' characters (with optional whitespace). + MarkdownBlock newBlockElement = null; + if (nonSpaceChar == '-' && nonSpacePos == startOfLine) + { + // Yaml Header + newBlockElement = YamlHeaderBlock.Parse(markdown, startOfLine, markdown.Length, out startOfLine); + if (newBlockElement != null) + { + realStartOfLine = startOfLine; + endOfLine = startOfLine + 3; + startOfNextLine = Common.FindNextSingleNewLine(markdown, startOfLine, end, out startOfNextLine); + + paragraphText.Clear(); + } + } + + if (newBlockElement == null && nonSpaceChar == '#' && nonSpacePos == startOfLine) + { + // Hash-prefixed header. + newBlockElement = HeaderBlock.ParseHashPrefixedHeader(markdown, startOfLine, endOfLine); + } + else if ((nonSpaceChar == '-' || nonSpaceChar == '=') && nonSpacePos == startOfLine && paragraphText.Length > 0) + { + // Underline style header. These are weird because you don't know you've + // got one until you've gone past it. + // Note: we intentionally deviate from reddit here in that we only + // recognize this type of header if the previous line is part of a + // paragraph. For example if you have this, the header at the bottom is + // ignored: + // a|b + // -|- + // 1|2 + // === + newBlockElement = HeaderBlock.ParseUnderlineStyleHeader(markdown, previousStartOfLine, previousEndOfLine, startOfLine, endOfLine); + + if (newBlockElement != null) + { + // We're going to have to remove the header text from the pending + // paragraph by prematurely ending the current paragraph. + // We already made sure that there is a paragraph in progress. + paragraphText.Length = paragraphText.Length - (previousEndOfLine - previousStartOfLine); + } + } + + // These characters overlap with the underline-style header - this check should go after that one. + if (newBlockElement == null && (nonSpaceChar == '*' || nonSpaceChar == '-' || nonSpaceChar == '_')) + { + newBlockElement = HorizontalRuleBlock.Parse(markdown, startOfLine, endOfLine); + } + + if (newBlockElement == null && lineStartsNewParagraph) + { + // Some block elements must start on a new paragraph (tables, lists and code). + int endOfBlock = startOfNextLine; + if (nonSpaceChar == '*' || nonSpaceChar == '+' || nonSpaceChar == '-' || (nonSpaceChar >= '0' && nonSpaceChar <= '9')) + { + newBlockElement = ListBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out endOfBlock); + } + + if (newBlockElement == null && (nonSpacePos > startOfLine || nonSpaceChar == '`')) + { + newBlockElement = CodeBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out endOfBlock); + } + + if (newBlockElement == null) + { + newBlockElement = TableBlock.Parse(markdown, realStartOfLine, endOfLine, end, quoteDepth, out endOfBlock); + } + + if (newBlockElement != null) + { + startOfNextLine = endOfBlock; + } + } + + // This check needs to go after the code block check. + if (newBlockElement == null && nonSpaceChar == '>') + { + newBlockElement = QuoteBlock.Parse(markdown, realStartOfLine, end, quoteDepth, out startOfNextLine); + } + + // This check needs to go after the code block check. + if (newBlockElement == null && nonSpaceChar == '[') + { + newBlockElement = LinkReferenceBlock.Parse(markdown, startOfLine, endOfLine); + } + + // Block elements start new paragraphs. + lineStartsNewParagraph = newBlockElement != null; + + if (newBlockElement == null) + { + // The line contains paragraph text. + if (paragraphText.Length > 0) + { + // If the previous two characters were both spaces, then append a line break. + if (paragraphText.Length > 2 && paragraphText[paragraphText.Length - 1] == ' ' && paragraphText[paragraphText.Length - 2] == ' ') + { + // Replace the two spaces with a line break. + paragraphText[paragraphText.Length - 2] = '\r'; + paragraphText[paragraphText.Length - 1] = '\n'; + } + else + { + paragraphText.Append(" "); + } + } + + // Add the last paragraph if we are at the end of the input text. + if (startOfNextLine >= end) + { + if (paragraphText.Length == 0) + { + // Optimize for single line paragraphs. + blocks.Add(ParagraphBlock.Parse(markdown.Substring(startOfLine, endOfLine - startOfLine))); + } + else + { + // Slow path. + paragraphText.Append(markdown.Substring(startOfLine, endOfLine - startOfLine)); + blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); + } + } + else + { + paragraphText.Append(markdown.Substring(startOfLine, endOfLine - startOfLine)); + } + } + else + { + // The line contained a block. End the current paragraph, if any. + if (paragraphText.Length > 0) + { + blocks.Add(ParagraphBlock.Parse(paragraphText.ToString())); + paragraphText.Clear(); + } + + blocks.Add(newBlockElement); + } + } + + // Repeat. + previousRealtStartOfLine = realStartOfLine; + previousStartOfLine = startOfLine; + previousEndOfLine = endOfLine; + startOfLine = startOfNextLine; + } + + actualEnd = startOfLine; + return blocks; + } + + /// + /// Looks up a reference using the ID. + /// A reference is a line that looks like this: + /// [foo]: http://example.com/ + /// + /// The ID of the reference (case insensitive). + /// The reference details, or null if the reference wasn't found. + public LinkReferenceBlock LookUpReference(string id) + { + if (id == null) + { + throw new ArgumentNullException("id"); + } + + if (_references == null) + { + return null; + } + + if (_references.TryGetValue(id, out LinkReferenceBlock result)) + { + return result; + } + + return null; + } + + /// + /// Converts the object into it's textual representation. + /// + /// The textual representation of this object. + public override string ToString() + { + if (Blocks == null) + { + return base.ToString(); + } + + return string.Join("\r\n", Blocks); + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownElement.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownElement.cs new file mode 100644 index 0000000..d0e1099 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownElement.cs @@ -0,0 +1,13 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown +{ + /// + /// This is a class used as the base class of all markdown elements. + /// + public abstract class MarkdownElement + { + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownInline.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownInline.cs new file mode 100644 index 0000000..c1739bd --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/MarkdownInline.cs @@ -0,0 +1,25 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Inlines +{ + /// + /// An internal class that is the base class for all inline elements. + /// + public abstract class MarkdownInline : MarkdownElement + { + /// + /// Gets or sets this element is. + /// + public MarkdownInlineType Type { get; set; } + + /// + /// Initializes a new instance of the class. + /// + internal MarkdownInline(MarkdownInlineType type) + { + Type = type; + } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/IRenderContext.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/IRenderContext.cs new file mode 100644 index 0000000..bb1a60f --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/IRenderContext.cs @@ -0,0 +1,28 @@ +// 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. + +namespace Microsoft.Toolkit.Parsers.Markdown.Render +{ + /// + /// Helper for holding persistent state of Renderer. + /// + public interface IRenderContext + { + /// + /// Gets or sets a value indicating whether to trim whitespace. + /// + bool TrimLeadingWhitespace { get; set; } + + /// + /// Gets or sets the parent Element for this Context. + /// + object Parent { get; set; } + + /// + /// Clones the Context. + /// + /// Clone + IRenderContext Clone(); + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Blocks.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Blocks.cs new file mode 100644 index 0000000..16a8a58 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Blocks.cs @@ -0,0 +1,54 @@ +// 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. + +using Microsoft.Toolkit.Parsers.Markdown.Blocks; + +namespace Microsoft.Toolkit.Parsers.Markdown.Render +{ + /// + /// Block Rendering Methods. + /// + public partial class MarkdownRendererBase + { + /// + /// Renders a paragraph element. + /// + protected abstract void RenderParagraph(ParagraphBlock element, IRenderContext context); + + /// + /// Renders a yaml header element. + /// + protected abstract void RenderYamlHeader(YamlHeaderBlock element, IRenderContext context); + + /// + /// Renders a header element. + /// + protected abstract void RenderHeader(HeaderBlock element, IRenderContext context); + + /// + /// Renders a list element. + /// + protected abstract void RenderListElement(ListBlock element, IRenderContext context); + + /// + /// Renders a horizontal rule element. + /// + protected abstract void RenderHorizontalRule(IRenderContext context); + + /// + /// Renders a quote element. + /// + protected abstract void RenderQuote(QuoteBlock element, IRenderContext context); + + /// + /// Renders a code element. + /// + protected abstract void RenderCode(CodeBlock element, IRenderContext context); + + /// + /// Renders a table element. + /// + protected abstract void RenderTable(TableBlock element, IRenderContext context); + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Inlines.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Inlines.cs new file mode 100644 index 0000000..f57d188 --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.Inlines.cs @@ -0,0 +1,91 @@ +// 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. + +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Render +{ + /// + /// Inline Rendering Methods. + /// + public partial class MarkdownRendererBase + { + /// + /// Renders emoji element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderEmoji(EmojiInline element, IRenderContext context); + + /// + /// Renders a text run element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderTextRun(TextRunInline element, IRenderContext context); + + /// + /// Renders a bold run element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderBoldRun(BoldTextInline element, IRenderContext context); + + /// + /// Renders a link element + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderMarkdownLink(MarkdownLinkInline element, IRenderContext context); + + /// + /// Renders an image element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderImage(ImageInline element, IRenderContext context); + + /// + /// Renders a raw link element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderHyperlink(HyperlinkInline element, IRenderContext context); + + /// + /// Renders a text run element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderItalicRun(ItalicTextInline element, IRenderContext context); + + /// + /// Renders a strikethrough element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderStrikethroughRun(StrikethroughTextInline element, IRenderContext context); + + /// + /// Renders a superscript element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderSuperscriptRun(SuperscriptTextInline element, IRenderContext context); + + /// + /// Renders a subscript element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderSubscriptRun(SubscriptTextInline element, IRenderContext context); + + /// + /// Renders a code element + /// + /// The parsed inline element to render. + /// Persistent state. + protected abstract void RenderCodeRun(CodeInline element, IRenderContext context); + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.cs b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.cs new file mode 100644 index 0000000..9472b2d --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Markdown/Render/MarkdownRendererBase.cs @@ -0,0 +1,251 @@ +// 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. + +using System.Collections.Generic; +using System.Text; +using Microsoft.Toolkit.Parsers.Markdown.Blocks; +using Microsoft.Toolkit.Parsers.Markdown.Inlines; + +namespace Microsoft.Toolkit.Parsers.Markdown.Render +{ + /// + /// A base renderer for Rendering Markdown into Controls. + /// + public abstract partial class MarkdownRendererBase + { + /// + /// Initializes a new instance of the class. + /// + /// Markdown Document to Render + public MarkdownRendererBase(MarkdownDocument document) + { + Document = document; + } + + /// + /// Renders all Content to the Provided Parent UI. + /// + /// UI Context + public virtual void Render(IRenderContext context) + { + RenderBlocks(Document.Blocks, context); + } + + /// + /// Renders a list of block elements. + /// + protected virtual void RenderBlocks(IEnumerable blockElements, IRenderContext context) + { + foreach (MarkdownBlock element in blockElements) + { + RenderBlock(element, context); + } + } + + /// + /// Called to render a block element. + /// + protected void RenderBlock(MarkdownBlock element, IRenderContext context) + { + { + switch (element.Type) + { + case MarkdownBlockType.Paragraph: + RenderParagraph((ParagraphBlock)element, context); + break; + + case MarkdownBlockType.Quote: + RenderQuote((QuoteBlock)element, context); + break; + + case MarkdownBlockType.Code: + RenderCode((CodeBlock)element, context); + break; + + case MarkdownBlockType.Header: + RenderHeader((HeaderBlock)element, context); + break; + + case MarkdownBlockType.List: + RenderListElement((ListBlock)element, context); + break; + + case MarkdownBlockType.HorizontalRule: + RenderHorizontalRule(context); + break; + + case MarkdownBlockType.Table: + RenderTable((TableBlock)element, context); + break; + + case MarkdownBlockType.YamlHeader: + RenderYamlHeader((YamlHeaderBlock)element, context); + break; + } + } + } + + /// + /// Renders all of the children for the given element. + /// + /// The parsed inline elements to render. + /// Persistent state. + protected void RenderInlineChildren(IList inlineElements, IRenderContext context) + { + foreach (MarkdownInline element in inlineElements) + { + switch (element.Type) + { + case MarkdownInlineType.Comment: + case MarkdownInlineType.LinkReference: + break; + + default: + RenderInline(element, context); + break; + } + } + } + + /// + /// Called to render an inline element. + /// + /// The parsed inline element to render. + /// Persistent state. + protected void RenderInline(MarkdownInline element, IRenderContext context) + { + switch (element.Type) + { + case MarkdownInlineType.TextRun: + RenderTextRun((TextRunInline)element, context); + break; + + case MarkdownInlineType.Italic: + RenderItalicRun((ItalicTextInline)element, context); + break; + + case MarkdownInlineType.Bold: + RenderBoldRun((BoldTextInline)element, context); + break; + + case MarkdownInlineType.MarkdownLink: + CheckRenderMarkdownLink((MarkdownLinkInline)element, context); + break; + + case MarkdownInlineType.RawHyperlink: + RenderHyperlink((HyperlinkInline)element, context); + break; + + case MarkdownInlineType.Strikethrough: + RenderStrikethroughRun((StrikethroughTextInline)element, context); + break; + + case MarkdownInlineType.Superscript: + RenderSuperscriptRun((SuperscriptTextInline)element, context); + break; + + case MarkdownInlineType.Subscript: + RenderSubscriptRun((SubscriptTextInline)element, context); + break; + + case MarkdownInlineType.Code: + RenderCodeRun((CodeInline)element, context); + break; + + case MarkdownInlineType.Image: + RenderImage((ImageInline)element, context); + break; + + case MarkdownInlineType.Emoji: + RenderEmoji((EmojiInline)element, context); + break; + } + } + + /// + /// Removes leading whitespace, but only if this is the first run in the block. + /// + /// The corrected string + protected string CollapseWhitespace(IRenderContext context, string text) + { + bool dontOutputWhitespace = context.TrimLeadingWhitespace; + StringBuilder result = null; + for (int i = 0; i < text.Length; i++) + { + char c = text[i]; + if (c == ' ' || c == '\t') + { + if (dontOutputWhitespace) + { + if (result == null) + { + result = new StringBuilder(text.Substring(0, i), text.Length); + } + } + else + { + result?.Append(c); + + dontOutputWhitespace = true; + } + } + else + { + result?.Append(c); + + dontOutputWhitespace = false; + } + } + + context.TrimLeadingWhitespace = false; + return result == null ? text : result.ToString(); + } + + /// + /// Verifies if the link is valid, before processing into a link, or plain text. + /// + /// The parsed inline element to render. + /// Persistent state. + protected void CheckRenderMarkdownLink(MarkdownLinkInline element, IRenderContext context) + { + // Avoid processing when link text is empty. + if (element.Inlines.Count == 0) + { + return; + } + + // Attempt to resolve references. + element.ResolveReference(Document); + if (element.Url == null) + { + // The element couldn't be resolved, just render it as text. + RenderInlineChildren(element.Inlines, context); + return; + } + + foreach (MarkdownInline inline in element.Inlines) + { + if (inline is ImageInline imageInline) + { + // this is an image, create Image. + if (!string.IsNullOrEmpty(imageInline.ReferenceId)) + { + imageInline.ResolveReference(Document); + } + + imageInline.Url = element.Url; + RenderImage(imageInline, context); + return; + } + } + + RenderMarkdownLink(element, context); + } + + /// + /// Gets the markdown document that will be rendered. + /// + protected MarkdownDocument Document { get; } + } +} \ No newline at end of file diff --git a/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Microsoft.Toolkit.Parsers.csproj b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Microsoft.Toolkit.Parsers.csproj new file mode 100644 index 0000000..49d99bd --- /dev/null +++ b/MarkdownUI.WPF/Microsoft.Toolkit.Parsers/Microsoft.Toolkit.Parsers.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + Windows Community Toolkit .NET Standard Parsers + + This .NET standard library contains various parsers + + Markdown: Allows you to parse a Markdown String into a Markdown Document, and then Render it with a Markdown Renderer. + + RSS: Allows you to parse an RSS content String into an RSS Schema. + + + UWP Toolkit Windows Parsers Parsing Markdown RSS + + + + + + + diff --git a/RestartHelper/Properties/AssemblyInfo.cs b/MarkdownUI.WPF/Properties/AssemblyInfo.cs similarity index 85% rename from RestartHelper/Properties/AssemblyInfo.cs rename to MarkdownUI.WPF/Properties/AssemblyInfo.cs index 02e97ff..3afcd10 100644 --- a/RestartHelper/Properties/AssemblyInfo.cs +++ b/MarkdownUI.WPF/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // 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("RestartHelper.exe")] +[assembly: AssemblyTitle("MarkdownUI.WPF")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RestartHelper.exe")] -[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyProduct("MarkdownUI.WPF")] +[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("44b19bf5-de61-447d-b881-a74dbfe30a0c")] +[assembly: Guid("0ed1b140-9fa4-44f0-a5be-3bddc12270ab")] // Version information for an assembly consists of the following four values: // diff --git a/MarkdownUI.WPF/StringExtensions.cs b/MarkdownUI.WPF/StringExtensions.cs new file mode 100644 index 0000000..f21ec7b --- /dev/null +++ b/MarkdownUI.WPF/StringExtensions.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace MarkdownUI.WPF +{ + /// + /// Helpers for working with strings and string representations. + /// + public static class StringExtensions + { + public static Dictionary GetArgs(string markdown,int urlStart, int pos) + { + Dictionary args = new Dictionary(); + + var imageDimensionsPos = markdown.IndexOf(" ", urlStart, pos - urlStart, StringComparison.Ordinal); + + + if (imageDimensionsPos > 0) + { + string remainingText = markdown.Substring(imageDimensionsPos + 1, pos - imageDimensionsPos - 1); + + var parts = remainingText.Split(','); + foreach (var part in parts) + { + var seperator = part.IndexOf('='); + string name = part.Substring(0, seperator); + string value = part.Substring(seperator + 1); + + args.Add(name, value); + } + } + + return args; + } + + /// + /// Regular expression for matching a phone number. + /// + internal const string PhoneNumberRegex = @"^[+]?(\d{1,3})?[\s.-]?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$"; + + /// + /// Regular expression for matching a string that contains only letters. + /// + internal const string CharactersRegex = "^[A-Za-z]+$"; + + /// + /// Regular expression for matching an email address. + /// + /// General Email Regex (RFC 5322 Official Standard) from emailregex.com. + internal const string EmailRegex = "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"; + + /// + /// Regular expression of HTML tags to remove. + /// + private const string RemoveHtmlTagsRegex = @"(?>(?:[^>'""]+|'[^']*'|""[^""]*"")*)>"; + + /// + /// Regular expression for removing comments from HTML. + /// + private static readonly Regex RemoveHtmlCommentsRegex = new Regex("", RegexOptions.Singleline); + + /// + /// Regular expression for removing scripts from HTML. + /// + private static readonly Regex RemoveHtmlScriptsRegex = new Regex(@"(?s)|)", RegexOptions.Singleline | RegexOptions.IgnoreCase); + + /// + /// Regular expression for removing styles from HTML. + /// + private static readonly Regex RemoveHtmlStylesRegex = new Regex(@"(?s)|)", RegexOptions.Singleline | RegexOptions.IgnoreCase); + + /// + /// Determines whether a string is a valid email address. + /// + /// The string to test. + /// true for a valid email address; otherwise, false. + public static bool IsEmail(this string str) => Regex.IsMatch(str, EmailRegex); + + /// + /// Determines whether a string is a valid decimal number. + /// + /// The string to test. + /// true for a valid decimal number; otherwise, false. + public static bool IsDecimal(this string str) + => decimal.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out _); + + /// + /// Determines whether a string is a valid integer. + /// + /// The string to test. + /// true for a valid integer; otherwise, false. + public static bool IsNumeric(this string str) => int.TryParse(str, out _); + + /// + /// Determines whether a string is a valid phone number. + /// + /// The string to test. + /// true for a valid phone number; otherwise, false. + public static bool IsPhoneNumber(this string str) => Regex.IsMatch(str, PhoneNumberRegex); + + /// + /// Determines whether a string contains only letters. + /// + /// The string to test. + /// true if the string contains only letters; otherwise, false. + public static bool IsCharacterString(this string str) => Regex.IsMatch(str, CharactersRegex); + + /// + /// Returns a string representation of an object. + /// + /// The object to convert. + /// String representation of the object. + [Obsolete("Use value?.ToString() instead. This will be removed in the next release of the toolkit.")] + public static string ToSafeString(this object value) => value?.ToString(); + + /// + /// Returns a string with HTML comments, scripts, styles, and tags removed. + /// + /// HTML string. + /// Decoded HTML string. + public static string DecodeHtml(this string htmlText) + { + if (htmlText == null) + { + return null; + } + + var ret = htmlText.FixHtml(); + + // Remove html tags + ret = new Regex(RemoveHtmlTagsRegex).Replace(ret, string.Empty); + + return WebUtility.HtmlDecode(ret); + } + + /// + /// Returns a string with HTML comments, scripts, and styles removed. + /// + /// HTML string to fix. + /// Fixed HTML string. + public static string FixHtml(this string html) + { + // Remove comments + var withoutComments = RemoveHtmlCommentsRegex.Replace(html, string.Empty); + + // Remove scripts + var withoutScripts = RemoveHtmlScriptsRegex.Replace(withoutComments, string.Empty); + + // Remove styles + var withoutStyles = RemoveHtmlStylesRegex.Replace(withoutScripts, string.Empty); + + return withoutStyles; + } + + /// + /// Truncates a string to the specified length. + /// + /// The string to be truncated. + /// The maximum length. + /// Truncated string. + public static string Truncate(this string value, int length) => Truncate(value, length, false); + + /// + /// Provide better linking for resourced strings. + /// + /// The format of the string being linked. + /// The object which will receive the linked String. + /// Truncated string. + public static string AsFormat(this string format, params object[] args) => string.Format(format, args); + + /// + /// Truncates a string to the specified length. + /// + /// The string to be truncated. + /// The maximum length. + /// true to add ellipsis to the truncated text; otherwise, false. + /// Truncated string. + public static string Truncate(this string value, int length, bool ellipsis) + { + if (!string.IsNullOrEmpty(value)) + { + value = value.Trim(); + if (value.Length > length) + { + if (ellipsis) + { + return value.Substring(0, length) + "..."; + } + + return value.Substring(0, length); + } + } + + return value ?? string.Empty; + } + } + +} diff --git a/MarkdownUI.WPF/packages.config b/MarkdownUI.WPF/packages.config new file mode 100644 index 0000000..71405ca --- /dev/null +++ b/MarkdownUI.WPF/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/BackgroundUploadHelper/App.config b/MarkdrownUI.Tester/App.config similarity index 100% rename from BackgroundUploadHelper/App.config rename to MarkdrownUI.Tester/App.config diff --git a/MarkdrownUI.Tester/App.xaml b/MarkdrownUI.Tester/App.xaml new file mode 100644 index 0000000..ec374de --- /dev/null +++ b/MarkdrownUI.Tester/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/DeviceExcludeTool/App.xaml.cs b/MarkdrownUI.Tester/App.xaml.cs similarity index 91% rename from DeviceExcludeTool/App.xaml.cs rename to MarkdrownUI.Tester/App.xaml.cs index e75595c..a2e08b1 100644 --- a/DeviceExcludeTool/App.xaml.cs +++ b/MarkdrownUI.Tester/App.xaml.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using System.Windows; -namespace DeviceExcludeTool +namespace MarkdrownUI.Tester { /// /// Interaction logic for App.xaml diff --git a/MarkdrownUI.Tester/DemoVM.cs b/MarkdrownUI.Tester/DemoVM.cs new file mode 100644 index 0000000..67497d9 --- /dev/null +++ b/MarkdrownUI.Tester/DemoVM.cs @@ -0,0 +1,78 @@ +using MarkdownUI.WPF; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MarkdrownUI.Tester +{ + public class DemoVM : MarkDownViewModel + { + public DemoVM() + { + MadLedViewDevices = new List(); + MadLedViewDevices.Add(new MadLedViewDevice() + { + Name = "test 1", + LedCount = "8", + Serial = "1234" + }); + + MadLedViewDevices.Add(new MadLedViewDevice() + { + Name = "test 2", + LedCount = "16", + Serial = "5678" + }); + } + private string textBoxText = "example Text"; + public string TextBoxText + { + get => textBoxText; + set => Set(ref textBoxText, value); + } + + private string sliderValue = "17"; + public string SliderValue + { + get => sliderValue; + set => Set(ref sliderValue, value); + } + + public void TestClick() + { + + var ca = TextBoxText.ToCharArray(); + Array.Reverse(ca); + TextBoxText = new string(ca); + } + + + public List MadLedViewDevices { get; set; } + + public class MadLedViewDevice : MarkDownViewModel + { + private string serialNumber; + public string Serial + { + get => serialNumber; + set => Set(ref serialNumber, value); + } + + private string name; + public string Name + { + get => name; + set => Set(ref name, value); + } + + private string ledCount = "0"; + public string LedCount + { + get => ledCount; + set => Set(ref ledCount, value); + } + } + } +} diff --git a/MarkdrownUI.Tester/MainWindow.xaml b/MarkdrownUI.Tester/MainWindow.xaml new file mode 100644 index 0000000..8bbd5af --- /dev/null +++ b/MarkdrownUI.Tester/MainWindow.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/MarkdrownUI.Tester/MainWindow.xaml.cs b/MarkdrownUI.Tester/MainWindow.xaml.cs new file mode 100644 index 0000000..9dea604 --- /dev/null +++ b/MarkdrownUI.Tester/MainWindow.xaml.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using MarkdownUI.WPF; + +namespace MarkdrownUI.Tester +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + + public MainWindow() + { + InitializeComponent(); + + var vm = new DemoVM(); + + var vvm = vm.GetVirtualViewModel(); + + + Debug.WriteLine(vvm); + } + + public class VirtualViewModel + { + public string Name { get; set; } + public List Props { get; set; } = new List(); + public List Collections { get; set; } = new List(); + } + + private void textChanged(object sender, TextChangedEventArgs e) + { + var vm = new DemoVM(); + + MarkDownViewModel vvm = new MarkDownViewModel(); + var props = vm.GetType().GetProperties(); + foreach (var prop in props) + { + Console.WriteLine("{0}={1}", prop.Name, prop.GetValue(vm, null)); + if (prop.GetValue(vm, null) is string vl) + { + vvm.bindings.Add(prop.Name, vl); + } + } + + string markdown = TextEntry.Text; + + ResourceDictionary theme = new ResourceDictionary { Source = new Uri(@"\MarkdownDark.xaml", UriKind.Relative) }; + MarkdownUI.WPF.MarkdownUIHandler handler = new MarkdownUI.WPF.MarkdownUIHandler(markdown, vvm, theme); + try + { + handler.RenderToUI(this.MDHere); + } + catch (Exception ee) { } + + } + } +} diff --git a/MarkdrownUI.Tester/MarkdownDark.xaml b/MarkdrownUI.Tester/MarkdownDark.xaml new file mode 100644 index 0000000..a97984e --- /dev/null +++ b/MarkdrownUI.Tester/MarkdownDark.xaml @@ -0,0 +1,121 @@ + + + + + + Segoe UI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BackgroundUploadHelper/BackgroundUploadHelper.csproj b/MarkdrownUI.Tester/MarkdrownUI.Tester.csproj similarity index 58% rename from BackgroundUploadHelper/BackgroundUploadHelper.csproj rename to MarkdrownUI.Tester/MarkdrownUI.Tester.csproj index f7452e4..af13f50 100644 --- a/BackgroundUploadHelper/BackgroundUploadHelper.csproj +++ b/MarkdrownUI.Tester/MarkdrownUI.Tester.csproj @@ -1,22 +1,19 @@  - Debug AnyCPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C} + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3} WinExe - BackgroundUploadHelper - BackgroundUploadHelper + MarkdrownUI.Tester + MarkdrownUI.Tester v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 true true - - AnyCPU @@ -37,19 +34,7 @@ prompt 4 - - image.ico - - - ..\RGBSync+\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll - - - ..\RGBSync+\packages\MaterialDesignColors.1.2.6\lib\net45\MaterialDesignColors.dll - - - ..\RGBSync+\packages\MaterialDesignThemes.3.1.3\lib\net45\MaterialDesignThemes.Wpf.dll - @@ -78,10 +63,15 @@ App.xaml Code + MainWindow.xaml Code + + MSBuild:Compile + Designer + @@ -101,7 +91,6 @@ ResXFileCodeGenerator Resources.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs @@ -111,23 +100,10 @@ - - - - - - - + + {0ed1b140-9fa4-44f0-a5be-3bddc12270ab} + MarkdownUI.WPF + - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - \ No newline at end of file diff --git a/DeviceExcludeTool/Properties/AssemblyInfo.cs b/MarkdrownUI.Tester/Properties/AssemblyInfo.cs similarity index 93% rename from DeviceExcludeTool/Properties/AssemblyInfo.cs rename to MarkdrownUI.Tester/Properties/AssemblyInfo.cs index ff11ceb..ed31d68 100644 --- a/DeviceExcludeTool/Properties/AssemblyInfo.cs +++ b/MarkdrownUI.Tester/Properties/AssemblyInfo.cs @@ -7,12 +7,12 @@ // 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("DeviceExcludeTool")] +[assembly: AssemblyTitle("MarkdrownUI.Tester")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DeviceExcludeTool")] -[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyProduct("MarkdrownUI.Tester")] +[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/DeviceExcludeTool/Properties/Resources.Designer.cs b/MarkdrownUI.Tester/Properties/Resources.Designer.cs similarity index 94% rename from DeviceExcludeTool/Properties/Resources.Designer.cs rename to MarkdrownUI.Tester/Properties/Resources.Designer.cs index c8b184e..12a8d83 100644 --- a/DeviceExcludeTool/Properties/Resources.Designer.cs +++ b/MarkdrownUI.Tester/Properties/Resources.Designer.cs @@ -8,10 +8,9 @@ // //------------------------------------------------------------------------------ -namespace DeviceExcludeTool.Properties -{ - +namespace MarkdrownUI.Tester.Properties +{ /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -44,7 +43,7 @@ internal Resources() { if ((resourceMan == null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DeviceExcludeTool.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MarkdrownUI.Tester.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/SDK_Debug/Properties/Resources.resx b/MarkdrownUI.Tester/Properties/Resources.resx similarity index 100% rename from SDK_Debug/Properties/Resources.resx rename to MarkdrownUI.Tester/Properties/Resources.resx diff --git a/DeviceExcludeTool/Properties/Settings.Designer.cs b/MarkdrownUI.Tester/Properties/Settings.Designer.cs similarity index 96% rename from DeviceExcludeTool/Properties/Settings.Designer.cs rename to MarkdrownUI.Tester/Properties/Settings.Designer.cs index a5d9f00..0c8f883 100644 --- a/DeviceExcludeTool/Properties/Settings.Designer.cs +++ b/MarkdrownUI.Tester/Properties/Settings.Designer.cs @@ -8,10 +8,9 @@ // //------------------------------------------------------------------------------ -namespace DeviceExcludeTool.Properties -{ - +namespace MarkdrownUI.Tester.Properties +{ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase diff --git a/DeviceExcludeTool/Properties/Settings.settings b/MarkdrownUI.Tester/Properties/Settings.settings similarity index 100% rename from DeviceExcludeTool/Properties/Settings.settings rename to MarkdrownUI.Tester/Properties/Settings.settings diff --git a/Nan0SyncStudio.Branding/Class1.cs b/Nan0SyncStudio.Branding/Class1.cs new file mode 100644 index 0000000..fc19e70 --- /dev/null +++ b/Nan0SyncStudio.Branding/Class1.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using SyncStudio.Branding; + +namespace Nan0SyncStudio.Branding +{ + public class Nan0SyncBranding : IBranding + { + public UserControl GetDarkSplashLogo() + { + return new LogoDark(false); + } + + public UserControl GetLightSplashLogo() + { + return new LogoDark(true); + } + + public string GetAppName() + { + return "Nan0Sync Studio"; + } + + public BitmapImage GetIcon() + { + var derp = Assembly.GetAssembly(typeof(Nan0SyncBranding)).GetManifestResourceNames(); + + + using (Stream myStream = Assembly.GetAssembly(typeof(Nan0SyncBranding)).GetManifestResourceStream("Nan0SyncStudio.Branding.nano_icon_wMs_icon.ico")) + { + if (myStream != null) + { + var image= System.Drawing.Image.FromStream(myStream); + return Convert((Bitmap)image); + } + } + + return null; + } + public string GetAppAuthor() + { + return "Sync Studio Team"; + } + private BitmapImage Convert(Bitmap src) + { + MemoryStream ms = new MemoryStream(); + ((System.Drawing.Bitmap)src).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); + BitmapImage image = new BitmapImage(); + image.BeginInit(); + ms.Seek(0, SeekOrigin.Begin); + image.StreamSource = ms; + image.EndInit(); + return image; + } + } +} diff --git a/Nan0SyncStudio.Branding/LogoDark.xaml b/Nan0SyncStudio.Branding/LogoDark.xaml new file mode 100644 index 0000000..766ea9d --- /dev/null +++ b/Nan0SyncStudio.Branding/LogoDark.xaml @@ -0,0 +1,87 @@ + + + + + + diff --git a/Nan0SyncStudio.Branding/LogoDark.xaml.cs b/Nan0SyncStudio.Branding/LogoDark.xaml.cs new file mode 100644 index 0000000..de8faa6 --- /dev/null +++ b/Nan0SyncStudio.Branding/LogoDark.xaml.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Nan0SyncStudio.Branding +{ + /// + /// Interaction logic for LogoDark.xaml + /// + public partial class LogoDark : UserControl + { + public LogoDark(bool light) + { + InitializeComponent(); + + if (light) + { + this.LogoHere.Fill = new SolidColorBrush(Colors.Black); + } + + + } + private BitmapImage Convert(Bitmap src) + { + MemoryStream ms = new MemoryStream(); + ((System.Drawing.Bitmap)src).Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); + BitmapImage image = new BitmapImage(); + image.BeginInit(); + ms.Seek(0, SeekOrigin.Begin); + image.StreamSource = ms; + image.EndInit(); + return image; + } + } +} diff --git a/Nan0SyncStudio.Branding/Nan0SyncStudio.Branding.csproj b/Nan0SyncStudio.Branding/Nan0SyncStudio.Branding.csproj new file mode 100644 index 0000000..7e90a21 --- /dev/null +++ b/Nan0SyncStudio.Branding/Nan0SyncStudio.Branding.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {518EA12F-6E44-49B7-9D62-49C837087779} + Library + Properties + Nan0SyncStudio.Branding + Nan0SyncStudio.Branding + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + LogoDark.xaml + + + + + + {6C755854-B53F-4E8F-817B-5DE28CF7580F} + SyncStudio.Branding + + + + + Designer + MSBuild:Compile + + + + + + + \ No newline at end of file diff --git a/StartupHelper/Properties/AssemblyInfo.cs b/Nan0SyncStudio.Branding/Properties/AssemblyInfo.cs similarity index 77% rename from StartupHelper/Properties/AssemblyInfo.cs rename to Nan0SyncStudio.Branding/Properties/AssemblyInfo.cs index 5f29a41..e2a9cc8 100644 --- a/StartupHelper/Properties/AssemblyInfo.cs +++ b/Nan0SyncStudio.Branding/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // 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("StartupHelper")] -[assembly: AssemblyDescription("Starts JackNet RGB Sync on system startup.")] +[assembly: AssemblyTitle("Nan0SyncStudio.Branding")] +[assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("JackNet Systems")] -[assembly: AssemblyProduct("StartupHelper")] -[assembly: AssemblyCopyright("Copyright © 2020 Fanman03")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Nan0SyncStudio.Branding")] +[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ca1a6020-2caf-4697-8fff-ece71786344e")] +[assembly: Guid("518ea12f-6e44-49b7-9d62-49c837087779")] // Version information for an assembly consists of the following four values: // diff --git a/Nan0SyncStudio.Branding/nano_icon_wMs_icon.ico b/Nan0SyncStudio.Branding/nano_icon_wMs_icon.ico new file mode 100644 index 0000000..a7bd8fc Binary files /dev/null and b/Nan0SyncStudio.Branding/nano_icon_wMs_icon.ico differ diff --git a/RGBSync+/App.config b/RGBSync+/App.config index 8e15646..ecdcf8a 100644 --- a/RGBSync+/App.config +++ b/RGBSync+/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/RGBSync+/App.xaml b/RGBSync+/App.xaml index 96f2469..03ee868 100644 --- a/RGBSync+/App.xaml +++ b/RGBSync+/App.xaml @@ -1,51 +1,276 @@ - + xmlns:styles="clr-namespace:SyncStudio.WPF.Styles" + xmlns:RGBSyncStudio="clr-namespace:SyncStudio.WPF" xmlns:Converter="clr-namespace:SyncStudio.WPF.Converter" + xmlns:fluentWpf="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF" + xmlns:system="clr-namespace:System;assembly=mscorlib" + xmlns:presentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options" + x:Class="SyncStudio.WPF.App" + Exit="App_OnExit"> + + + + + pack://application:,,,/Fonts/#Rss Symbol + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + IconSource="Resources/ProgramIcon.ico" + ToolTipText ="RGB Sync Studio" + PopupActivation="LeftOrRightClick"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #FFDCDCDC + #FF2A2A2A + #B82A2A2A + #111111 + #B8111111 + #60111111 + #50000000 + #FFFFFFFF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #60111111 + #B8111111 + + + + + + + + #60111111 + #B8111111 + + + + + + + + + + + + + + + + 40 + + + + 14 + 14 + 22 + + + + + + + + + + + diff --git a/RGBSync+/App.xaml.cs b/RGBSync+/App.xaml.cs index 8be6048..37eb838 100644 --- a/RGBSync+/App.xaml.cs +++ b/RGBSync+/App.xaml.cs @@ -1,20 +1,25 @@ -using System; +using Hardcodet.Wpf.TaskbarNotification; +using SimpleLed; +using System; +using System.Collections.ObjectModel; +using System.Diagnostics; using System.IO; using System.Windows; using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Resources; -using Hardcodet.Wpf.TaskbarNotification; -using Newtonsoft.Json; -using RGBSyncPlus.Configuration; -using RGBSyncPlus.Configuration.Legacy; -using RGBSyncPlus.Helper; -using RGBSyncPlus.UI; - -namespace RGBSyncPlus +using System.Windows.Media; +using System.Windows.Threading; +using SyncStudio.WPF.Helper; +using SyncStudio.WPF.UI; + +namespace SyncStudio.WPF { public partial class App : Application { + + public const string SLSPROVIDER_DIRECTORY = "Providers"; + private const string ProfileS_DIRECTORY = "Profiles"; + private const string SLSCONFIGS_DIRECTORY = "SLSConfigs"; + #region Constants private const string PATH_SETTINGS = "Profile.json"; @@ -26,87 +31,198 @@ public partial class App : Application #region Properties & Fields private TaskbarIcon _taskbarIcon; + + + public AppBVM appBvm { get; set; } = new AppBVM(); #endregion #region Methods + private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) + { + ServiceManager.Instance.Logger.CrashWindow(e.Exception); + + e.Handled = true; + } protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); + if (!Debugger.IsAttached) + { + this.DispatcherUnhandledException += App_DispatcherUnhandledException; + } + + ServiceManager.Initialize(SLSCONFIGS_DIRECTORY, ProfileS_DIRECTORY); + ServiceManager.Instance.ApplicationManager.Initialize(); + +// ServiceManager.Instance.ProfileService.OnProfilesChanged += (object sender, EventArgs ev) => appBvm.RefreshProfiles(); try { ToolTipService.ShowDurationProperty.OverrideMetadata(typeof(DependencyObject), new FrameworkPropertyMetadata(int.MaxValue)); _taskbarIcon = (TaskbarIcon)FindResource("TaskbarIcon"); - _taskbarIcon.DoubleClickCommand = ApplicationManager.Instance.OpenConfigurationCommand; - - Settings settings = null; - try { settings = JsonConvert.DeserializeObject(File.ReadAllText(PATH_SETTINGS), new ColorSerializer()); } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - /* File doesn't exist or is corrupt - just create a new one. */ - } - - AppSettings appsettings = null; - try { appsettings = JsonConvert.DeserializeObject(File.ReadAllText(PATH_APPSETTINGS), new ColorSerializer()); } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - /* File doesn't exist or is corrupt - just create a new one. */ - } - - if (settings == null) - { - settings = new Settings { Version = Settings.CURRENT_VERSION }; - _taskbarIcon.ShowBalloonTip("JackNet RGB Sync is starting in the tray!", "Click on the icon to open the configuration.", BalloonIcon.Info); - } - - else if (settings.Version != Settings.CURRENT_VERSION) - ConfigurationUpdates.PerformOn(settings); - - if (appsettings == null) - { - appsettings = new AppSettings { Version = AppSettings.CURRENT_VERSION }; - } - - - ApplicationManager.Instance.Settings = settings; - ApplicationManager.Instance.AppSettings = appsettings; - ApplicationManager.Instance.Initialize(); - if (!appsettings.MinimizeToTray) //HACK Fanman03 05.12.2019: Workaround to create the window - { - ApplicationManager.Instance.OpenConfigurationCommand.Execute(null); - ApplicationManager.Instance.HideConfigurationCommand.Execute(null); - } + _taskbarIcon.DoubleClickCommand = new ActionCommand(() => ServiceManager.Instance.ApplicationManager.OpenConfiguration()); + + //ServiceManager.Instance.ApplicationManager.OpenConfigurationCommand.Execute(null); } catch (Exception ex) { File.WriteAllText("error.log", $"[{DateTime.Now:G}] Exception!\r\n\r\nMessage:\r\n{ex.GetFullMessage()}\r\n\r\nStackTrace:\r\n{ex.StackTrace}\r\n\r\n"); - GenericErrorDialog dialog = new GenericErrorDialog("An error occured while starting JackNet RGB Sync.\r\nMore information can be found in the error.log file in the application directory.", "Can't start JackNet RGB Sync.", $"[{DateTime.Now:G}] Exception!\r\n\r\nMessage:\r\n{ex.GetFullMessage()}\r\n\r\nStackTrace:\r\n{ex.StackTrace}\r\n\r\n"); - dialog.Show(); - try { ApplicationManager.Instance.ExitCommand.Execute(null); } + try { ServiceManager.Instance.ApplicationManager.Exit(); } catch { Environment.Exit(0); } } + + + } + #endregion + + private void App_OnExit(object sender, ExitEventArgs e) + { + // throw new NotImplementedException(); + } + + + private void ToggleProfilesPopup(object sender, RoutedEventArgs e) + { + if (appBvm.PopupVisibility == Visibility.Collapsed) + { + appBvm.PopupVisibility = Visibility.Visible; + appBvm.Arrow = ""; + appBvm.ProfilesBackground = SystemParameters.WindowGlassBrush; + } + else + { + appBvm.PopupVisibility = Visibility.Collapsed; + appBvm.Arrow = ""; + appBvm.ProfilesBackground = new SolidColorBrush(Color.FromRgb(64, 64, 64)); + } } - protected override void OnExit(ExitEventArgs e) + private void SwitchProfile(object sender, RoutedEventArgs e) { - base.OnExit(e); + Button btn = sender as Button; + ServiceManager.Instance.ProfilesService.GetProfile(Guid.NewGuid()); + //.Get.ProfileService.LoadProfileFromName(btn.Content.ToString()); + appBvm.Profiles = AppBVM.GetProfiles(); + } - File.WriteAllText(PATH_SETTINGS, JsonConvert.SerializeObject(ApplicationManager.Instance.Settings, new ColorSerializer())); - File.WriteAllText(PATH_APPSETTINGS, JsonConvert.SerializeObject(ApplicationManager.Instance.AppSettings, new ColorSerializer())); + private void TechSupportClick(object sender, RoutedEventArgs e) + { + System.Diagnostics.Process.Start("https://rgbsync.com/discord"); } - public static void SaveSettings() + private void RestartAppClick(object sender, RoutedEventArgs e) { - File.WriteAllText(PATH_SETTINGS, JsonConvert.SerializeObject(ApplicationManager.Instance.Settings, new ColorSerializer())); - File.WriteAllText(PATH_APPSETTINGS, JsonConvert.SerializeObject(ApplicationManager.Instance.AppSettings, new ColorSerializer())); + ServiceManager.Instance.ApplicationManager.RestartApp(); } - #endregion + private void ExitClicked(object sender, RoutedEventArgs e) + { + ServiceManager.Instance.ApplicationManager.Exit(); + } + + private void HideClicked(object sender, RoutedEventArgs e) + { + ServiceManager.Instance.ApplicationManager.HideConfiguration(); + } + } + + public class AppBVM : BaseViewModel + { + public void RefreshProfiles() + { + Profiles = GetProfiles(); + } + + public static ObservableCollection GetProfiles() + { + return null; + //todo wtf why here? + //if (ServiceManager.Instance?.ConfigService?.Settings?.ProfileNames != null) + //{ + // ObservableCollection prfs = new ObservableCollection(); + // foreach (string name in settings.ProfileNames) + // { + // ProfileObject prf = new ProfileObject(); + // prf.Name = name; + // prfs.Add(prf); + + // if (prf.Name == settings.CurrentProfile) + // { + // prf.IsSelected = true; + // } + // else + // { + // prf.IsSelected = false; + // } + // } + // return prfs; + //} + //else + //{ + // return new ObservableCollection(); + //} + + } + private Visibility popupVisibility = Visibility.Collapsed; + public Visibility PopupVisibility + { + get + { + return popupVisibility; + } + set + { + SetProperty(ref popupVisibility, value); + } + } + + private string arrow = ""; + + public string Arrow + { + get + { + return arrow; + } + set + { + SetProperty(ref arrow, value); + } + } + + private Brush profilesBackground = new SolidColorBrush(Color.FromRgb(64, 64, 64)); + public Brush ProfilesBackground + { + get + { + return profilesBackground; + } + set + { + SetProperty(ref profilesBackground, value); + } + } + + private ObservableCollection profiles = GetProfiles(); + public ObservableCollection Profiles + { + get + { + return profiles; + } + set + { + SetProperty(ref profiles, value); + } + } + public class ProfileObject + { + public string Name { get; set; } + public bool IsSelected { get; set; } + } } } diff --git a/RGBSync+/ApplicationManager.cs b/RGBSync+/ApplicationManager.cs index 2517539..dc9aaa9 100644 --- a/RGBSync+/ApplicationManager.cs +++ b/RGBSync+/ApplicationManager.cs @@ -1,376 +1,127 @@ using System; -using System.Collections.Generic; -using System.Collections.Specialized; +using System.Diagnostics; +using System.Globalization; using System.IO; -using System.Linq; using System.Reflection; -using System.Windows; using System.Threading; -using RGB.NET.Core; -using RGB.NET.Groups; -using RGBSyncPlus.Brushes; -using RGBSyncPlus.Configuration; -using RGBSyncPlus.Helper; -using RGBSyncPlus.Model; -using RGBSyncPlus.UI; -using DiscordRPC; -using DiscordRPC.Message; -using System.Globalization; -using Newtonsoft.Json; -using System.Net; -using NLog; -using System.Diagnostics; -using System.Security.Principal; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Threading; +using Autofac; +using SyncStudio.ClientService; +using SyncStudio.WPF.UI; + -namespace RGBSyncPlus +namespace SyncStudio.WPF { public class ApplicationManager { - #region Constants + private ClientService.Settings settings = new Settings(); public Version Version => Assembly.GetEntryAssembly().GetName().Version; + public MainWindowViewModel MainViewModel => MainWindow.DataContext as MainWindowViewModel; - private const string DEVICEPROVIDER_DIRECTORY = "DeviceProvider"; - - #endregion - - #region Properties & Fields - - public static ApplicationManager Instance { get; } = new ApplicationManager(); - - private ConfigurationWindow _configurationWindow; - - public Settings Settings { get; set; } - - public AppSettings AppSettings { get; set; } - public TimerUpdateTrigger UpdateTrigger { get; private set; } - - #endregion - - #region Commands - - private ActionCommand _openConfiguration; - public ActionCommand OpenConfigurationCommand => _openConfiguration ?? (_openConfiguration = new ActionCommand(OpenConfiguration)); - - private ActionCommand _hideConfiguration; - public ActionCommand HideConfigurationCommand => _hideConfiguration ?? (_hideConfiguration = new ActionCommand(HideConfiguration)); - - private ActionCommand _restartApp; - public ActionCommand RestartAppCommand => _restartApp ?? (_restartApp = new ActionCommand(RestartApp)); - - private ActionCommand _techSupport; - public ActionCommand TechSupportCommand => _techSupport ?? (_techSupport = new ActionCommand(TechSupport)); + public const string SLSPROVIDER_DIRECTORY = "Providers"; + private const string ProfileS_DIRECTORY = "Profiles"; + private const string SLSCONFIGS_DIRECTORY = "SLSConfigs"; - private ActionCommand _exitCommand; - public ActionCommand ExitCommand => _exitCommand ?? (_exitCommand = new ActionCommand(Exit)); + public MainWindow MainWindow; - #endregion - - #region Constructors - - private ApplicationManager() { } - - public DiscordRpcClient client; - - private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); + public void FireLanguageChangedEvent() + { + LanguageChangedEvent?.Invoke(this, new EventArgs()); + } - #endregion + public event EventHandler LanguageChangedEvent; - #region Methods + public void NavigateToTab(string tab) => MainWindow?.SetTab(tab); + public SplashLoader LoadingSplash; + public void Initialize() { + + LoadingSplash = new SplashLoader(); + LoadingSplash.Show(); - var config = new NLog.Config.LoggingConfiguration(); + LoadingSplash.LoadingText.Text = "Initializing"; - // Targets where to log to: File and Console - var logfile = new NLog.Targets.FileTarget("logfile") { FileName = "rgbsync.log" }; + Task.Delay(TimeSpan.FromSeconds(1)).Wait(); - // Rules for mapping loggers to targets - config.AddRule(LogLevel.Debug, LogLevel.Fatal, logfile); + LoadingSplash.Activate(); - // Apply config - LogManager.Configuration = config; + ServiceManager.Instance.Logger.Debug("============ "+ ServiceManager.Instance.Branding.GetAppName()+" is Starting ============"); - Logger.Debug("============ JackNet RGB Sync is Starting ============"); - if (AppSettings.RunAsAdmin == true) - { - Logger.Debug("App should be run as administrator."); - Logger.Debug("Checking to see if app is running as administrator..."); - var identity = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(identity); - bool isRunningAsAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); - if (isRunningAsAdmin == false) - { - Logger.Debug("App is not running as administrator, restarting..."); - ExecuteAsAdmin("RGBSync+.exe"); - Exit(); - } - else - { - Logger.Debug("App is running as administrator, proceding with startup."); - } - } + //SyncStudio.Core.ServiceManager.LoadingMessage = (s => LoadingSplash.LoadingText.Text = s); + //SyncStudio.Core.ServiceManager.LoadingMax = f => LoadingSplash.ProgressBar.Maximum = f; + //SyncStudio.Core.ServiceManager.LoadingAmount = f => LoadingSplash.ProgressBar.Value = f; - CultureInfo ci = CultureInfo.InstalledUICulture; - if (AppSettings.Lang == null) - { - Logger.Debug("Language is not set, inferring language from system culture. Lang="+ ci.TwoLetterISOLanguageName); - AppSettings.Lang = ci.TwoLetterISOLanguageName; - } - System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(AppSettings.Lang); - client = new DiscordRpcClient("581567509959016456"); - client.Initialize(); + //SyncStudio.Core.ServiceManager.LedService.LoadSLSProviders(); - string tempSetup = Directory.GetCurrentDirectory() + "\\~TEMP_setup.exe"; - if (File.Exists(tempSetup)) - { - Logger.Debug("Found old installer, removing..."); - try - { - File.Delete(tempSetup); - Logger.Debug("Old installer successfully removed."); - } - catch(Exception ex) - { - Logger.Error("Error deleting file: "+ex.ToString()); - } - } - - int delay = AppSettings.StartDelay * 1000; + LoadingSplash.LoadingText.Text = "Mapping from config"; + //ServiceManager.Instance.ConfigService.SetUpMappedDevicesFromConfig(); - RGBSurface surface = RGBSurface.Instance; - LoadDeviceProviders(); - surface.AlignDevices(); + LoadingSplash.LoadingText.Text = "Loading Settings"; + //ServiceManager.Instance.ConfigService.LoadSettings(); + LoadingSplash.LoadingText.Text = "All done"; - foreach (IRGBDevice device in surface.Devices) - device.UpdateMode = DeviceUpdateMode.Sync | DeviceUpdateMode.SyncBack; + OpenConfiguration(); - UpdateTrigger = new TimerUpdateTrigger { UpdateFrequency = 1.0 / MathHelper.Clamp(AppSettings.UpdateRate, 1, 100) }; - surface.RegisterUpdateTrigger(UpdateTrigger); - UpdateTrigger.Start(); - - foreach (SyncGroup syncGroup in Settings.SyncGroups) - RegisterSyncGroup(syncGroup); - } - - private void LoadDeviceProviders() - { - string deviceProvierDir = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) ?? string.Empty, DEVICEPROVIDER_DIRECTORY); - if (!Directory.Exists(deviceProvierDir)) return; - - foreach (string file in Directory.GetFiles(deviceProvierDir, "*.dll")) + DispatcherTimer closeTimer = new DispatcherTimer(); + closeTimer.Interval = TimeSpan.FromSeconds(1); + closeTimer.Tick += (sender, args) => { - try - { - Logger.Debug("Loading provider " + file); - Assembly assembly = Assembly.LoadFrom(file); - foreach (Type loaderType in assembly.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface && t.IsClass - && typeof(IRGBDeviceProviderLoader).IsAssignableFrom(t))) - { - if (Activator.CreateInstance(loaderType) is IRGBDeviceProviderLoader deviceProviderLoader) - { - //TODO DarthAffe 03.06.2018: Support Initialization - if (deviceProviderLoader.RequiresInitialization) continue; - - var deviceTypes = AppSettings.DeviceTypes; + LoadingSplash.Close(); + closeTimer.Stop(); + }; + closeTimer.Start(); - try - { - RGBSurface.Instance.LoadDevices(deviceProviderLoader, deviceTypes); - Logger.Debug(file + " has been loaded"); - } - catch - { - RGBSurface.Instance.LoadDevices(deviceProviderLoader, RGBDeviceType.All); - Logger.Debug(file + " has been loaded with all types."); - } - - } - } - } - catch(Exception ex) - { - Logger.Error("Error loading " + file); - Logger.Error(ex); - } - } - } - - public void AddSyncGroup(SyncGroup syncGroup) - { - Settings.SyncGroups.Add(syncGroup); - RegisterSyncGroup(syncGroup); } - private void RegisterSyncGroup(SyncGroup syncGroup) + public void HideConfiguration() { - try + if (settings.EnableDiscordRPC == true) { - syncGroup.LedGroup = new ListLedGroup(syncGroup.Leds.GetLeds()) { Brush = new SyncBrush(syncGroup) }; - syncGroup.LedsChangedEventHandler = (sender, args) => UpdateLedGroup(syncGroup.LedGroup, args); - syncGroup.Leds.CollectionChanged += syncGroup.LedsChangedEventHandler; + ServiceManager.Instance.DiscordService.Stop(); } - catch(Exception ex) + if (settings.MinimizeToTray) { - Logger.Error("Error registering group: " + syncGroup.Name); - Logger.Error(ex); - } - - } - - public void RemoveSyncGroup(SyncGroup syncGroup) - { - Settings.SyncGroups.Remove(syncGroup); - syncGroup.Leds.CollectionChanged -= syncGroup.LedsChangedEventHandler; - syncGroup.LedGroup.Detach(); - syncGroup.LedGroup = null; - } - private void UpdateLedGroup(ListLedGroup group, NotifyCollectionChangedEventArgs args) - { - if (args.Action == NotifyCollectionChangedAction.Reset) - { - List leds = group.GetLeds().ToList(); - group.RemoveLeds(leds); + if (MainWindow.IsVisible) + MainWindow.Hide(); } else - { - if (args.NewItems != null) - group.AddLeds(args.NewItems.Cast().GetLeds()); - - if (args.OldItems != null) - group.RemoveLeds(args.OldItems.Cast().GetLeds()); - } - } - private void HideConfiguration() - { - if (AppSettings.EnableDiscordRPC == true) - { - if (client.IsDisposed == false) - { - client.Dispose(); - } - } - if (AppSettings.MinimizeToTray) - { - if (_configurationWindow.IsVisible) - _configurationWindow.Hide(); - } - else - _configurationWindow.WindowState = WindowState.Minimized; + MainWindow.WindowState = WindowState.Minimized; } public void OpenConfiguration() { - if (AppSettings.EnableDiscordRPC == true) + Debug.WriteLine("Opening Main Window"); + if (MainWindow == null) MainWindow = new MainWindow(); + if (!MainWindow.IsVisible) { - Logger.Info("Discord RPC enabled."); - if (client.IsDisposed == true) - { - Logger.Info("Discord RPC client disposed, initializing new one."); - client = new DiscordRpcClient("581567509959016456"); - client.Initialize(); - } - Logger.Info("Setting Discord presensce."); - client.SetPresence(new RichPresence() - { - State = "Profile: " + Settings.Name, - Details = "Syncing lighting effects", - Assets = new Assets() - { - LargeImageKey = "large_image", - LargeImageText = "JackNet RGB Sync", - SmallImageKey = "small_image", - SmallImageText = "by Fanman03" - } - }); + MainWindow.Show(); } - if (_configurationWindow == null) _configurationWindow = new ConfigurationWindow(); - if (!_configurationWindow.IsVisible) - _configurationWindow.Show(); - - if (_configurationWindow.WindowState == WindowState.Minimized) - _configurationWindow.WindowState = WindowState.Normal; - - try - { - using (WebClient w = new WebClient()) - { - Logger.Info("Checking for update..."); - var json = w.DownloadString(ApplicationManager.Instance.AppSettings.versionURL); - ProgVersion versionFromApi = JsonConvert.DeserializeObject(json); - int versionMajor = Version.Major; - int versionMinor = Version.Minor; - int versionBuild = Version.Build; - - if (versionFromApi.major > versionMajor) - { - GetUpdateWindow getUpdateWindow = new GetUpdateWindow(); - getUpdateWindow.Show(); - Logger.Info("Update available. (major)"); - } - else if (versionFromApi.minor > versionMinor) - { - GetUpdateWindow getUpdateWindow = new GetUpdateWindow(); - getUpdateWindow.Show(); - Logger.Info("Update available. (minor)"); - } - else if (versionFromApi.build > versionBuild) - { - GetUpdateWindow getUpdateWindow = new GetUpdateWindow(); - Logger.Info("Update available. (build)"); - getUpdateWindow.Show(); - } - else - { - Logger.Info("No update available."); - } - - } - } catch(Exception ex) + if (MainWindow.WindowState == WindowState.Minimized) { - Logger.Error("Unable to check for updates. Download failed with exception: " + ex); + MainWindow.WindowState = WindowState.Normal; } - } public void RestartApp() { - Logger.Debug("App is restarting."); + ServiceManager.Instance.Logger.Info("App is restarting."); System.Diagnostics.Process.Start(Application.ResourceAssembly.Location); - if (AppSettings.EnableDiscordRPC == true) - { - if (client.IsDisposed == false) - { - client.Dispose(); - } - } - Application.Current.Shutdown(); + ServiceManager.Shutdown(); } - public void ExecuteAsAdmin(string fileName) - { - Process proc = new Process(); - proc.StartInfo.FileName = fileName; - proc.StartInfo.UseShellExecute = true; - proc.StartInfo.Verb = "runas"; - proc.Start(); - } - - private void TechSupport() => System.Diagnostics.Process.Start("https://rgbsync.com/discord"); - public void Exit() { - Logger.Debug("============ App is Shutting Down ============"); - try { RGBSurface.Instance?.Dispose(); } catch { /* well, we're shuting down anyway ... */ } - try { client.Dispose(); } catch { /* well, we're shuting down anyway ... */ } - - Application.Current.Shutdown(); - } + ServiceManager.Instance.Logger.Info("App is Shutting Down"); - #endregion + ServiceManager.Shutdown(); + } } } diff --git a/RGBSync+/Attached/SliderValue.cs b/RGBSync+/Attached/SliderValue.cs index ab43c1d..8065606 100644 --- a/RGBSync+/Attached/SliderValue.cs +++ b/RGBSync+/Attached/SliderValue.cs @@ -5,7 +5,7 @@ using System.Windows.Input; using System.Windows.Media; -namespace RGBSyncPlus.Attached +namespace SyncStudio.WPF.Attached { public static class SliderValue { diff --git a/RGBSync+/Attached/SliderValueAdorner.cs b/RGBSync+/Attached/SliderValueAdorner.cs index bc44983..f2b5e6d 100644 --- a/RGBSync+/Attached/SliderValueAdorner.cs +++ b/RGBSync+/Attached/SliderValueAdorner.cs @@ -5,7 +5,7 @@ using System.Windows.Media; using Point = System.Windows.Point; -namespace RGBSyncPlus.Attached +namespace SyncStudio.WPF.Attached { public class SliderValueAdorner : System.Windows.Documents.Adorner { diff --git a/RGBSync+/BenchMark.cs b/RGBSync+/BenchMark.cs new file mode 100644 index 0000000..0821553 --- /dev/null +++ b/RGBSync+/BenchMark.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SyncStudio.WPF +{ + public static class BenchMarkProvider + { + public static Dictionary BenchMarks = new Dictionary(); + + public static int FramePointer = 0; + public static int Steps = 32; + + public static void Output() + { + System.Diagnostics.Debug.WriteLine( + "Key".PadLeft(50, ' ') + " " + + ("avg").PadRight(30) + " " + + ("avg ms").PadRight(15) + " " + + ("peak").PadRight(30) + " " + + ("peak ms").PadRight(15) + " " + + ("total").PadRight(30) + " " + + ("total ms").PadRight(15) + " " + + ("#")); + foreach (var benchMark in BenchMarks) + { + System.Diagnostics.Debug.WriteLine( + benchMark.Key.PadLeft(50,' ')+" "+ + (benchMark.Value.AverageTime.ToString()).PadRight(30) + " " + + (benchMark.Value.AverageTime.TotalMilliseconds.ToString()).PadRight(15) + " " + + (benchMark.Value.LongestTime.ToString()).PadRight(30) + " " + + (benchMark.Value.LongestTime.TotalMilliseconds.ToString()).PadRight(15) + " " + + (benchMark.Value.TotalTime.ToString()).PadRight(30) + " " + + (benchMark.Value.TotalTime.TotalMilliseconds.ToString()).PadRight(15) + " " + + (benchMark.Value.NumberOfTimesRun) + + ); + } + + System.Diagnostics.Debug.WriteLine("-----------------------------"); + } + } + + + + public class BenchMarkDetails + { + public TimeSpan FrameTime { get; set; } = TimeSpan.Zero; + public string Key { get; set; } + public int NumberOfTimesRun { get; set; } = 0; + public TimeSpan ShortestTime { get; set; } = TimeSpan.MaxValue; + public TimeSpan LongestTime { get; set; } = TimeSpan.Zero; + public TimeSpan TotalTime { get; set; } = TimeSpan.Zero; + public int[] History { get; set; } = new int[512]; + public double[] FrameHistory { get; set; } = new double[512]; + public TimeSpan[] FrameHistorySpan { get; set; } = new TimeSpan[512]; + public TimeSpan AverageTime => NumberOfTimesRun == 0 ? TimeSpan.Zero : TimeSpan.FromMilliseconds(TotalTime.TotalMilliseconds / NumberOfTimesRun); + public Color Color { get; set; } = Color.White; + } + + public class BenchMark : IDisposable + { + public string Key { get; set; } + public DateTime StartTime { get; set; } + //public BenchMark([CallerMemberName] string key = null) + //{ + // Key = key; + // StartTime = DateTime.Now; + //} + + public BenchMark(string txt = "", [CallerMemberName] string key = null) + { + Key = key; + if (!string.IsNullOrWhiteSpace(txt)) + { + Key = txt + ": " + key; + } + + StartTime = DateTime.Now; + } + + public void Dispose() + { + TimeSpan timeRun = (DateTime.Now - StartTime); + + if (BenchMarkProvider.BenchMarks.ContainsKey(Key)) + { + var cb = BenchMarkProvider.BenchMarks[Key]; + + cb.NumberOfTimesRun++; + + if (timeRun < cb.ShortestTime) cb.ShortestTime = timeRun; + if (timeRun > cb.LongestTime) cb.LongestTime = timeRun; + + cb.TotalTime = cb.TotalTime + timeRun; + } + else + { + try + { + BenchMarkProvider.BenchMarks.Add(Key, new BenchMarkDetails() + { + Key = this.Key, + NumberOfTimesRun = 1, + TotalTime = timeRun, + ShortestTime = timeRun, + LongestTime = timeRun, + History = new int[BenchMarkProvider.Steps], + FrameHistory = new double[BenchMarkProvider.Steps], + FrameHistorySpan = new TimeSpan[BenchMarkProvider.Steps], + }); + } + catch + { + } + } + + BenchMarkProvider.BenchMarks[Key].FrameTime = BenchMarkProvider.BenchMarks[Key].FrameTime + timeRun; + BenchMarkProvider.BenchMarks[Key].History[BenchMarkProvider.FramePointer % BenchMarkProvider.Steps] = (int)timeRun.TotalMilliseconds; + } + } +} diff --git a/RGBSync+/Brushes/SyncBrush.cs b/RGBSync+/Brushes/SyncBrush.cs deleted file mode 100644 index b3d7987..0000000 --- a/RGBSync+/Brushes/SyncBrush.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.ComponentModel; -using RGB.NET.Core; -using RGBSyncPlus.Helper; -using RGBSyncPlus.Model; - -namespace RGBSyncPlus.Brushes -{ - public class SyncBrush : AbstractBrush - { - #region Properties & Fields - - private readonly SyncGroup _syncGroup; - - private Led _syncLed; - - #endregion - - #region Constructors - - public SyncBrush(SyncGroup syncGroup) - { - this._syncGroup = syncGroup; - - syncGroup.PropertyChanged += SyncGroupOnPropertyChanged; - _syncLed = syncGroup.SyncLed?.GetLed(); - } - - #endregion - - #region Methods - - private void SyncGroupOnPropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(SyncGroup.SyncLed)) - _syncLed = _syncGroup.SyncLed?.GetLed(); - } - - protected override Color GetColorAtPoint(Rectangle rectangle, BrushRenderTarget renderTarget) - { - if(_syncLed == null) - _syncLed = _syncGroup.SyncLed?.GetLed(); - - if (renderTarget.Led == _syncLed) - return Color.Transparent; - - return _syncLed?.Color ?? Color.Transparent; - } - - #endregion - } -} diff --git a/RGBSync+/Configuration/AbstractConfiguration.cs b/RGBSync+/Configuration/AbstractConfiguration.cs deleted file mode 100644 index 69f897f..0000000 --- a/RGBSync+/Configuration/AbstractConfiguration.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using RGB.NET.Core; - -namespace RGBSyncPlus.Configuration -{ - public class AbstractConfiguration : AbstractBindable, IConfiguration, INotifyPropertyChanged - { - #region Methods - - protected override bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) - { - if ((typeof(T) == typeof(double)) || (typeof(T) == typeof(float))) - { - if (Math.Abs((double)(object)storage - (double)(object)value) < 0.000001) return false; - } - else - { - if (Equals(storage, value)) return false; - } - - storage = value; - // ReSharper disable once ExplicitCallerInfoArgument - OnPropertyChanged(propertyName); - return true; - } - - #endregion - } -} diff --git a/RGBSync+/Configuration/AppSettings.cs b/RGBSync+/Configuration/AppSettings.cs deleted file mode 100644 index 25507ae..0000000 --- a/RGBSync+/Configuration/AppSettings.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using RGB.NET.Core; -using RGBSyncPlus.Model; - -namespace RGBSyncPlus.Configuration -{ - public class AppSettings - { - #region Constants - - public const int CURRENT_VERSION = 1; - - #endregion - - #region Properties & Fields - public string Lang { get; set; } = "en"; - public int Version { get; set; } = 0; - public double UpdateRate { get; set; } = 30.0; - - public int StartDelay { get; set; } = 0; - - public string ApiKey { get; set; } = null; - - public bool MinimizeToTray { get; set; } = false; - - public bool EnableDiscordRPC { get; set; } = true; - public bool RunAsAdmin { get; set; } = false; - public RGBDeviceType DeviceTypes { get; set; } = RGBDeviceType.All; - - public bool EnableClient { get; set; } = false; - - public bool EnableServer { get; set; } = false; - - public string BackgroundImg { get; set; } = "default"; - - public string versionURL { get; set; } = "https://fanman03.com/inc/version.json"; - - public string updateURL { get; set; } = "http://fanman03.com/dlmgr/click.php?id=jnsync_latest"; - - public bool ShowHelperConsole { get; set; } = false; - - #endregion - } -} diff --git a/RGBSync+/Configuration/ColorSerializer.cs b/RGBSync+/Configuration/ColorSerializer.cs deleted file mode 100644 index 7f2bae3..0000000 --- a/RGBSync+/Configuration/ColorSerializer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using RGB.NET.Core; - -namespace RGBSyncPlus.Configuration -{ - public class ColorSerializer : JsonConverter - { - #region Methods - - public override bool CanConvert(Type objectType) => objectType == typeof(Color); - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - if (!(value is Color color)) return; - - writer.WriteStartObject(); - writer.WritePropertyName("A"); - writer.WriteValue(color.A); - writer.WritePropertyName("R"); - writer.WriteValue(color.R); - writer.WritePropertyName("G"); - writer.WriteValue(color.G); - writer.WritePropertyName("B"); - writer.WriteValue(color.B); - writer.WriteEndObject(); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - JObject jsonObject = JObject.Load(reader); - return new Color(jsonObject.Property("A").Value.ToObject(), - jsonObject.Property("R").Value.ToObject(), - jsonObject.Property("G").Value.ToObject(), - jsonObject.Property("B").Value.ToObject()); - } - - #endregion - } -} diff --git a/RGBSync+/Configuration/IConfiguration.cs b/RGBSync+/Configuration/IConfiguration.cs deleted file mode 100644 index 65361f7..0000000 --- a/RGBSync+/Configuration/IConfiguration.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.ComponentModel; - -namespace RGBSyncPlus.Configuration -{ - public interface IConfiguration : INotifyPropertyChanged - { } -} diff --git a/RGBSync+/Configuration/Legacy/ConfigurationUpdates.cs b/RGBSync+/Configuration/Legacy/ConfigurationUpdates.cs deleted file mode 100644 index 34d52b4..0000000 --- a/RGBSync+/Configuration/Legacy/ConfigurationUpdates.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace RGBSyncPlus.Configuration.Legacy -{ - public static class ConfigurationUpdates - { - #region Methods - - public static void PerformOn(Settings settings) - { } - - #endregion - } -} diff --git a/RGBSync+/Configuration/ProgVersion.cs b/RGBSync+/Configuration/ProgVersion.cs deleted file mode 100644 index 08fb262..0000000 --- a/RGBSync+/Configuration/ProgVersion.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace RGBSyncPlus.Configuration -{ - class ProgVersion - { - public int major { get; set; } = 1; - - public int minor { get; set; } = 7; - - public int build { get; set; } = 0; - } -} diff --git a/RGBSync+/Configuration/Settings.cs b/RGBSync+/Configuration/Settings.cs deleted file mode 100644 index 718e375..0000000 --- a/RGBSync+/Configuration/Settings.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using RGBSyncPlus.Model; - -namespace RGBSyncPlus.Configuration -{ - public class Settings - { - #region Constants - - public const int CURRENT_VERSION = 1; - - #endregion - - #region Properties & Fields - - public int Version { get; set; } = 1; - - public string Name { get; set; } = "Default"; - - public List SyncGroups { get; set; } = new List(); - - #endregion - } -} diff --git a/RGBSync+/Controls/BlurredDecorationWindow.cs b/RGBSync+/Controls/BlurredDecorationWindow.cs deleted file mode 100644 index b11769f..0000000 --- a/RGBSync+/Controls/BlurredDecorationWindow.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media; - -namespace RGBSyncPlus.Controls -{ - [TemplatePart(Name = "PART_Decoration", Type = typeof(FrameworkElement))] - [TemplatePart(Name = "PART_Content", Type = typeof(FrameworkElement))] - [TemplatePart(Name = "PART_CloseButton", Type = typeof(Button))] - [TemplatePart(Name = "PART_MinimizeButton", Type = typeof(Button))] - [TemplatePart(Name = "PART_IconButton", Type = typeof(Button))] - public class BlurredDecorationWindow : Window - { - #region DependencyProperties - // ReSharper disable InconsistentNaming - - public static readonly DependencyProperty BackgroundImageProperty = DependencyProperty.Register( - "BackgroundImage", typeof(ImageSource), typeof(BlurredDecorationWindow), new PropertyMetadata(default(ImageSource))); - - public ImageSource BackgroundImage - { - get => (ImageSource)GetValue(BackgroundImageProperty); - set => SetValue(BackgroundImageProperty, value); - } - - public static readonly DependencyProperty DecorationHeightProperty = DependencyProperty.Register( - "DecorationHeight", typeof(double), typeof(BlurredDecorationWindow), new PropertyMetadata(20.0)); - - public double DecorationHeight - { - get => (double)GetValue(DecorationHeightProperty); - set => SetValue(DecorationHeightProperty, value); - } - - public static readonly DependencyProperty IconToolTipProperty = DependencyProperty.Register( - "IconToolTip", typeof(string), typeof(BlurredDecorationWindow), new PropertyMetadata(default(string))); - - public string IconToolTip - { - get => (string)GetValue(IconToolTipProperty); - set => SetValue(IconToolTipProperty, value); - } - - public static readonly DependencyProperty IconCommandProperty = DependencyProperty.Register( - "IconCommand", typeof(ICommand), typeof(BlurredDecorationWindow), new PropertyMetadata(default(ICommand))); - - public ICommand IconCommand - { - get => (ICommand)GetValue(IconCommandProperty); - set => SetValue(IconCommandProperty, value); - } - - // ReSharper restore InconsistentNaming - #endregion - - #region Constructors - - static BlurredDecorationWindow() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(BlurredDecorationWindow), new FrameworkPropertyMetadata(typeof(BlurredDecorationWindow))); - } - - #endregion - - #region Methods - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (GetTemplateChild("PART_Decoration") is FrameworkElement decoration) - decoration.MouseLeftButtonDown += (sender, args) => DragMove(); - - if (GetTemplateChild("PART_CloseButton") is Button closeButton) - closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null); - - if (GetTemplateChild("PART_MinimizeButton") is Button minimizeButton) - minimizeButton.Click += (sender, args) => ApplicationManager.Instance.HideConfigurationCommand.Execute(null); - - if (GetTemplateChild("PART_IconButton") is Button iconButton) - iconButton.Click += (sender, args) => IconCommand?.Execute(null); - } - - #endregion - } -} diff --git a/RGBSync+/Controls/ColorSelector.cs b/RGBSync+/Controls/ColorSelector.cs deleted file mode 100644 index 64ac1c5..0000000 --- a/RGBSync+/Controls/ColorSelector.cs +++ /dev/null @@ -1,483 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Shapes; -using RGB.NET; -using RGB.NET.Core; -using Color = RGB.NET.Core.Color; -using Point = System.Windows.Point; -using Rectangle = System.Windows.Shapes.Rectangle; -using WpfColor = System.Windows.Media.Color; - -namespace RGBSyncPlus.Controls -{ - [TemplatePart(Name = "PART_Selector", Type = typeof(Panel))] - [TemplatePart(Name = "PART_SliderAlpha", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderRed", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderGreen", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderBlue", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderHue", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderSaturation", Type = typeof(Slider))] - [TemplatePart(Name = "PART_SliderValue", Type = typeof(Slider))] - [TemplatePart(Name = "PART_Preview", Type = typeof(Rectangle))] - public class ColorSelector : Control - { - #region Properties & Fields - - private bool _ignorePropertyChanged; - private bool _dragSelector; - - private byte _a; - private byte _r; - private byte _g; - private byte _b; - private double _hue; - private double _saturation; - private double _value; - - private Panel _selector; - private Rectangle _selectorColor; - private Grid _selectorGrip; - private Slider _sliderAlpha; - private Slider _sliderRed; - private Slider _sliderGreen; - private Slider _sliderBlue; - private Slider _sliderHue; - private Slider _sliderSaturation; - private Slider _sliderValue; - private Rectangle _preview; - - private SolidColorBrush _previewBrush; - private SolidColorBrush _selectorBrush; - private LinearGradientBrush _alphaBrush; - private LinearGradientBrush _redBrush; - private LinearGradientBrush _greenBrush; - private LinearGradientBrush _blueBrush; - private LinearGradientBrush _hueBrush; - private LinearGradientBrush _saturationBrush; - private LinearGradientBrush _valueBrush; - - #endregion - - #region DependencyProperties - - public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register( - "SelectedColor", typeof(Color), typeof(ColorSelector), new FrameworkPropertyMetadata(new Color(255, 0, 0), - FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, - SelectedColorChanged)); - - public Color SelectedColor - { - get => (Color)GetValue(SelectedColorProperty); - set => SetValue(SelectedColorProperty, value); - } - - #endregion - - #region Methods - - public override void OnApplyTemplate() - { - if ((_selector = GetTemplateChild("PART_Selector") as Panel) != null) - { - _selectorBrush = new SolidColorBrush(); - _selectorColor = new Rectangle - { - VerticalAlignment = VerticalAlignment.Stretch, - HorizontalAlignment = HorizontalAlignment.Stretch, - SnapsToDevicePixels = true, - StrokeThickness = 0, - Fill = _selectorBrush - }; - _selector.Children.Add(_selectorColor); - - Rectangle selectorWhite = new Rectangle - { - VerticalAlignment = VerticalAlignment.Stretch, - HorizontalAlignment = HorizontalAlignment.Stretch, - SnapsToDevicePixels = true, - StrokeThickness = 0, - Fill = new LinearGradientBrush(WpfColor.FromRgb(255, 255, 255), WpfColor.FromArgb(0, 255, 255, 255), new Point(0, 0.5), new Point(1, 0.5)) - }; - _selector.Children.Add(selectorWhite); - - Rectangle selectorBlack = new Rectangle - { - VerticalAlignment = VerticalAlignment.Stretch, - HorizontalAlignment = HorizontalAlignment.Stretch, - SnapsToDevicePixels = true, - StrokeThickness = 0, - Fill = new LinearGradientBrush(WpfColor.FromRgb(0, 0, 0), WpfColor.FromArgb(0, 0, 0, 0), new Point(0.5, 1), new Point(0.5, 0)) - }; - _selector.Children.Add(selectorBlack); - - _selectorGrip = new Grid - { - VerticalAlignment = VerticalAlignment.Bottom, - HorizontalAlignment = HorizontalAlignment.Left, - SnapsToDevicePixels = true - }; - _selectorGrip.Children.Add(new Ellipse - { - VerticalAlignment = VerticalAlignment.Center, - HorizontalAlignment = HorizontalAlignment.Center, - SnapsToDevicePixels = true, - Stroke = new SolidColorBrush(WpfColor.FromRgb(0, 0, 0)), - StrokeThickness = 2, - Fill = null, - Width = 12, - Height = 12 - }); - _selectorGrip.Children.Add(new Ellipse - { - VerticalAlignment = VerticalAlignment.Center, - HorizontalAlignment = HorizontalAlignment.Center, - SnapsToDevicePixels = true, - Stroke = new SolidColorBrush(WpfColor.FromRgb(255, 255, 255)), - StrokeThickness = 1, - Fill = null, - Width = 10, - Height = 10 - }); - _selector.Children.Add(_selectorGrip); - - _selector.SizeChanged += (sender, args) => UpdateSelector(); - _selector.MouseLeftButtonDown += (sender, args) => - { - _dragSelector = true; - UpdateSelectorValue(args.GetPosition(_selector)); - }; - _selector.MouseEnter += (sender, args) => - { - if (args.LeftButton == MouseButtonState.Pressed) - { - _dragSelector = true; - UpdateSelectorValue(args.GetPosition(_selector)); - } - }; - _selector.MouseLeftButtonUp += (sender, args) => _dragSelector = false; - _selector.MouseLeave += (sender, args) => _dragSelector = false; - _selector.MouseMove += (sender, args) => UpdateSelectorValue(args.GetPosition(_selector)); - _selector.ClipToBounds = true; - } - - if ((_sliderAlpha = GetTemplateChild("PART_SliderAlpha") as Slider) != null) - { - _alphaBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderAlpha.Background = _alphaBrush; - _sliderAlpha.ValueChanged += AChanged; - } - - if ((_sliderRed = GetTemplateChild("PART_SliderRed") as Slider) != null) - { - _redBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderRed.Background = _redBrush; - _sliderRed.ValueChanged += RChanged; - } - - if ((_sliderGreen = GetTemplateChild("PART_SliderGreen") as Slider) != null) - { - _greenBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderGreen.Background = _greenBrush; - _sliderGreen.ValueChanged += GChanged; - } - - if ((_sliderBlue = GetTemplateChild("PART_SliderBlue") as Slider) != null) - { - _blueBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderBlue.Background = _blueBrush; - _sliderBlue.ValueChanged += BChanged; - } - - if ((_sliderHue = GetTemplateChild("PART_SliderHue") as Slider) != null) - { - _hueBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1.0 / 6.0), - new GradientStop(new WpfColor(), 2.0 / 6.0), - new GradientStop(new WpfColor(), 3.0 / 6.0), - new GradientStop(new WpfColor(), 4.0 / 6.0), - new GradientStop(new WpfColor(), 5.0 / 6.0), - new GradientStop(new WpfColor(), 1) })); - _sliderHue.Background = _hueBrush; - _sliderHue.ValueChanged += HueChanged; - } - - if ((_sliderSaturation = GetTemplateChild("PART_SliderSaturation") as Slider) != null) - { - _saturationBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderSaturation.Background = _saturationBrush; - _sliderSaturation.ValueChanged += SaturationChanged; - } - - if ((_sliderValue = GetTemplateChild("PART_SliderValue") as Slider) != null) - { - _valueBrush = new LinearGradientBrush(new GradientStopCollection(new[] { new GradientStop(new WpfColor(), 0), - new GradientStop(new WpfColor(), 1) })); - _sliderValue.Background = _valueBrush; - _sliderValue.ValueChanged += ValueChanged; - } - - if ((_preview = GetTemplateChild("PART_Preview") as Rectangle) != null) - { - _previewBrush = new SolidColorBrush(); - _preview.Fill = _previewBrush; - } - - SetColor(SelectedColor); - } - - private static void SelectedColorChanged(DependencyObject dependencyObject, - DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) - { - if (!(dependencyObject is ColorSelector cs) || !(dependencyPropertyChangedEventArgs.NewValue is Color color)) return; - cs.SetColor(color); - } - - private void SetColor(Color color) - { - if (_ignorePropertyChanged) return; - - SetA(color); - SetRGB(color); - SetHSV(color); - - UpdateSelector(); - UpdateUIColors(); - } - - private void AChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _a = (byte)routedPropertyChangedEventArgs.NewValue.Clamp(0, byte.MaxValue); - Color color = new Color(_a, _r, _g, _b); - UpdateSelectedColor(color); - UpdateUIColors(); - UpdateSelector(); - } - - private void RChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _r = (byte)routedPropertyChangedEventArgs.NewValue.Clamp(0, byte.MaxValue); - RGBChanged(); - } - - private void GChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _g = (byte)routedPropertyChangedEventArgs.NewValue.Clamp(0, byte.MaxValue); - RGBChanged(); - } - - private void BChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _b = (byte)routedPropertyChangedEventArgs.NewValue.Clamp(0, byte.MaxValue); - RGBChanged(); - } - - private void RGBChanged() - { - Color color = new Color(_a, _r, _g, _b); - UpdateSelectedColor(color); - SetHSV(color); - UpdateUIColors(); - UpdateSelector(); - } - - private void HueChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _hue = routedPropertyChangedEventArgs.NewValue.Clamp(0, 360); - HSVChanged(); - } - - private void SaturationChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _saturation = routedPropertyChangedEventArgs.NewValue.Clamp(0, 1); - HSVChanged(); - } - - private void ValueChanged(object sender, RoutedPropertyChangedEventArgs routedPropertyChangedEventArgs) - { - if (_ignorePropertyChanged) return; - - _value = routedPropertyChangedEventArgs.NewValue.Clamp(0, 1); - HSVChanged(); - } - - private void HSVChanged() - { - Color color = HSVColor.Create(_a, _hue, _saturation, _value); - UpdateSelectedColor(color); - SetRGB(color); - UpdateUIColors(); - UpdateSelector(); - } - - private void SetA(Color color) - { - _ignorePropertyChanged = true; - - _a = color.GetA(); - if (_sliderAlpha != null) - _sliderAlpha.Value = _a; - - _ignorePropertyChanged = false; - } - - private void SetRGB(Color color) - { - _ignorePropertyChanged = true; - - _r = color.GetR(); - if (_sliderRed != null) - _sliderRed.Value = _r; - - _g = color.GetG(); - if (_sliderGreen != null) - _sliderGreen.Value = _g; - - _b = color.GetB(); - if (_sliderBlue != null) - _sliderBlue.Value = _b; - - _ignorePropertyChanged = false; - } - - private void SetHSV(Color color) - { - _ignorePropertyChanged = true; - - (_hue, _saturation, _value) = color.GetHSV(); - - if (_sliderHue != null) - _sliderHue.Value = _hue; - - if (_sliderSaturation != null) - _sliderSaturation.Value = _saturation; - - if (_sliderValue != null) - _sliderValue.Value = _value; - - _ignorePropertyChanged = false; - } - - private void UpdateSelectedColor(Color color) - { - _ignorePropertyChanged = true; - - SelectedColor = color; - - _ignorePropertyChanged = false; - } - - private void UpdateSelector() - { - if (_selector == null) return; - - double selectorX = (_selector.ActualWidth * _saturation) - (_selectorGrip.ActualWidth / 2); - double selectorY = (_selector.ActualHeight * _value) - (_selectorGrip.ActualHeight / 2); - if (!double.IsNaN(selectorX) && !double.IsNaN(selectorY)) - _selectorGrip.Margin = new Thickness(selectorX, 0, 0, selectorY); - } - - private void UpdateSelectorValue(Point mouseLocation) - { - if (!_dragSelector) return; - - double saturation = mouseLocation.X / _selector.ActualWidth; - double value = 1 - (mouseLocation.Y / _selector.ActualHeight); - if (!double.IsNaN(saturation) && !double.IsNaN(value)) - { - _saturation = saturation; - _value = value; - HSVChanged(); - } - } - - private void UpdateUIColors() - { - Color hueColor = HSVColor.Create(_hue, 1, 1); - - if (_previewBrush != null) - _previewBrush.Color = WpfColor.FromArgb(_a, _r, _g, _b); - - if (_selectorBrush != null) - _selectorBrush.Color = WpfColor.FromRgb(hueColor.GetR(), hueColor.GetG(), hueColor.GetB()); - - if (_alphaBrush != null) - { - _alphaBrush.GradientStops[0].Color = WpfColor.FromArgb(0, _r, _g, _b); - _alphaBrush.GradientStops[1].Color = WpfColor.FromArgb(255, _r, _g, _b); - } - - if (_redBrush != null) - { - _redBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, 0, _g, _b); - _redBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, 255, _g, _b); - } - - if (_greenBrush != null) - { - _greenBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, _r, 0, _b); - _greenBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, _r, 255, _b); - } - - if (_blueBrush != null) - { - _blueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, _r, _g, 0); - _blueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, _r, _g, 255); - } - - if (_hueBrush != null) - { - Color referenceColor1 = HSVColor.Create(0, _saturation, _value); - Color referenceColor2 = HSVColor.Create(60, _saturation, _value); - Color referenceColor3 = HSVColor.Create(120, _saturation, _value); - Color referenceColor4 = HSVColor.Create(180, _saturation, _value); - Color referenceColor5 = HSVColor.Create(240, _saturation, _value); - Color referenceColor6 = HSVColor.Create(300, _saturation, _value); - - _hueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, referenceColor1.GetR(), referenceColor1.GetG(), referenceColor1.GetB()); - _hueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor2.GetR(), referenceColor2.GetG(), referenceColor2.GetB()); - _hueBrush.GradientStops[2].Color = WpfColor.FromArgb(_a, referenceColor3.GetR(), referenceColor3.GetG(), referenceColor3.GetB()); - _hueBrush.GradientStops[3].Color = WpfColor.FromArgb(_a, referenceColor4.GetR(), referenceColor4.GetG(), referenceColor4.GetB()); - _hueBrush.GradientStops[4].Color = WpfColor.FromArgb(_a, referenceColor5.GetR(), referenceColor5.GetG(), referenceColor5.GetB()); - _hueBrush.GradientStops[5].Color = WpfColor.FromArgb(_a, referenceColor6.GetR(), referenceColor6.GetG(), referenceColor6.GetB()); - _hueBrush.GradientStops[6].Color = WpfColor.FromArgb(_a, referenceColor1.GetR(), referenceColor1.GetG(), referenceColor1.GetB()); - } - - if (_saturationBrush != null) - { - Color referenceColor = HSVColor.Create(_hue, 1, _value); - - _saturationBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, 255, 255, 255); - _saturationBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.GetR(), referenceColor.GetG(), referenceColor.GetB()); - } - - if (_valueBrush != null) - { - Color referenceColor = HSVColor.Create(_hue, _saturation, 1); - - _valueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, 0, 0, 0); - _valueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.GetR(), referenceColor.GetG(), referenceColor.GetB()); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/RGBSync+/Controls/GradientEditor.cs b/RGBSync+/Controls/GradientEditor.cs deleted file mode 100644 index a79bb13..0000000 --- a/RGBSync+/Controls/GradientEditor.cs +++ /dev/null @@ -1,424 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using RGB.NET.Brushes.Gradients; -using RGB.NET.Core; -using Color = System.Windows.Media.Color; -using Point = System.Windows.Point; -using Size = System.Windows.Size; -using Rectangle = System.Windows.Shapes.Rectangle; -using GradientStop = RGB.NET.Brushes.Gradients.GradientStop; - -namespace RGBSyncPlus.Controls -{ - [TemplatePart(Name = "PART_Gradient", Type = typeof(Canvas))] - [TemplatePart(Name = "PART_Stops", Type = typeof(Canvas))] - public class GradientEditor : Control - { - #region Properties & Fields - - private Canvas _gradientContainer; - private Canvas _stopContainer; - private readonly List _previewRectangles = new List(); - private readonly Dictionary _stops = new Dictionary(); - private ContentControl _draggingStop; - private AdornerLayer _adornerLayer; - private ColorPickerAdorner _adorner; - private Window _window; - - #endregion - - #region DepdencyProperties - - public static readonly DependencyProperty GradientProperty = DependencyProperty.Register( - "Gradient", typeof(LinearGradient), typeof(GradientEditor), new FrameworkPropertyMetadata(null, - FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, - OnGradientChanged)); - - public LinearGradient Gradient - { - get => (LinearGradient)GetValue(GradientProperty); - set => SetValue(GradientProperty, value); - } - - public static readonly DependencyProperty GradientStopStyleProperty = DependencyProperty.Register( - "GradientStopStyle", typeof(Style), typeof(GradientEditor), new PropertyMetadata(default(Style))); - - public Style GradientStopStyle - { - get => (Style)GetValue(GradientStopStyleProperty); - set => SetValue(GradientStopStyleProperty, value); - } - - public static readonly DependencyProperty SelectedStopProperty = DependencyProperty.Register( - "SelectedStop", typeof(GradientStop), typeof(GradientEditor), new PropertyMetadata(default(GradientStop), SelectedStopChanged)); - - public GradientStop SelectedStop - { - get => (GradientStop)GetValue(SelectedStopProperty); - set => SetValue(SelectedStopProperty, value); - } - - public static readonly DependencyProperty ColorSelectorTemplateProperty = DependencyProperty.Register( - "ColorSelectorTemplate", typeof(DataTemplate), typeof(GradientEditor), new PropertyMetadata(default(DataTemplate))); - - public DataTemplate ColorSelectorTemplate - { - get => (DataTemplate)GetValue(ColorSelectorTemplateProperty); - set => SetValue(ColorSelectorTemplateProperty, value); - } - - public static readonly DependencyProperty CanAddOrDeleteStopsProperty = DependencyProperty.Register( - "CanAddOrDeleteStops", typeof(bool), typeof(GradientEditor), new PropertyMetadata(true)); - - public bool CanAddOrDeleteStops - { - get => (bool)GetValue(CanAddOrDeleteStopsProperty); - set => SetValue(CanAddOrDeleteStopsProperty, value); - } - - #endregion - - #region AttachedProperties - - public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.RegisterAttached( - "IsSelected", typeof(bool), typeof(GradientEditor), new PropertyMetadata(default(bool))); - - public static void SetIsSelected(DependencyObject element, bool value) => element.SetValue(IsSelectedProperty, value); - public static bool GetIsSelected(DependencyObject element) => (bool)element.GetValue(IsSelectedProperty); - - #endregion - - #region Constructors - - public GradientEditor() - { - if (Gradient == null) - Gradient = new LinearGradient(); - } - - #endregion - - #region Methods - - public override void OnApplyTemplate() - { - if ((_gradientContainer = GetTemplateChild("PART_Gradient") as Canvas) != null) - { - _gradientContainer.SizeChanged += (sender, args) => UpdateGradientPreview(); - _gradientContainer.MouseDown += GradientContainerOnMouseDown; - } - - if ((_stopContainer = GetTemplateChild("PART_Stops") as Canvas) != null) - _stopContainer.SizeChanged += (sender, args) => UpdateGradientStops(); - - _adornerLayer = AdornerLayer.GetAdornerLayer(this); - _window = Window.GetWindow(this); - if (_window != null) - { - _window.PreviewMouseDown += WindowMouseDown; - _window.PreviewKeyDown += (sender, args) => - { - if (args.Key == Key.Escape) - SelectedStop = null; - }; - } - - UpdateGradientPreview(); - UpdateGradientStops(); - } - - private void UpdateGradientPreview() - { - if ((_gradientContainer == null) || (Gradient == null)) return; - - List gradientStops = Gradient.GradientStops.OrderBy(x => x.Offset).ToList(); - if (gradientStops.Count == 0) - UpdatePreviewRectangleCount(gradientStops.Count); - else if (gradientStops.Count == 1) - { - UpdatePreviewRectangleCount(gradientStops.Count); - GradientStop firstStop = gradientStops[0]; - UpdatePreviewRectangle(_previewRectangles[0], _gradientContainer.ActualWidth, _gradientContainer.ActualHeight, 0, 1, firstStop.Color, firstStop.Color); - } - else - { - UpdatePreviewRectangleCount(gradientStops.Count + 1); - - GradientStop firstStop = gradientStops[0]; - UpdatePreviewRectangle(_previewRectangles[0], _gradientContainer.ActualWidth, _gradientContainer.ActualHeight, 0, firstStop.Offset, firstStop.Color, firstStop.Color); - for (int i = 0; i < (gradientStops.Count - 1); i++) - { - GradientStop stop = gradientStops[i]; - GradientStop nextStop = gradientStops[i + 1]; - Rectangle rect = _previewRectangles[i + 1]; - UpdatePreviewRectangle(rect, _gradientContainer.ActualWidth, _gradientContainer.ActualHeight, stop.Offset, nextStop.Offset, stop.Color, nextStop.Color); - } - GradientStop lastStop = gradientStops[gradientStops.Count - 1]; - UpdatePreviewRectangle(_previewRectangles[_previewRectangles.Count - 1], _gradientContainer.ActualWidth, _gradientContainer.ActualHeight, lastStop.Offset, 1, lastStop.Color, lastStop.Color); - } - } - - private void UpdatePreviewRectangle(Rectangle rect, double referenceWidth, double referenceHeight, double from, double to, - RGB.NET.Core.Color startColor, RGB.NET.Core.Color endColor) - { - rect.Fill = new LinearGradientBrush(Color.FromArgb(startColor.GetA(), startColor.GetR(), startColor.GetG(), startColor.GetB()), - Color.FromArgb(endColor.GetA(), endColor.GetR(), endColor.GetG(), endColor.GetB()), - new Point(0, 0.5), new Point(1, 0.5)); - - //DarthAffe 09.02.2018: Forced rounding to prevent render issues on resize - Canvas.SetLeft(rect, Math.Floor(referenceWidth * from.Clamp(0, 1))); - rect.Width = Math.Ceiling(referenceWidth * (to.Clamp(0, 1) - from.Clamp(0, 1))); - - Canvas.SetTop(rect, 0); - rect.Height = referenceHeight; - } - - private void UpdatePreviewRectangleCount(int gradientCount) - { - int countDiff = gradientCount - _previewRectangles.Count; - if (countDiff > 0) - for (int i = 0; i < countDiff; i++) - { - Rectangle rect = new Rectangle { VerticalAlignment = VerticalAlignment.Stretch }; - _previewRectangles.Add(rect); - _gradientContainer.Children.Add(rect); - } - - if (countDiff < 0) - for (int i = 0; i < Math.Abs(countDiff); i++) - { - int index = _previewRectangles.Count - i - 1; - Rectangle rect = _previewRectangles[index]; - _previewRectangles.RemoveAt(index); - _gradientContainer.Children.Remove(rect); - } - } - - private void UpdateGradientStops() - { - if (Gradient == null) return; - - List gradientStops = Gradient.GradientStops.OrderBy(x => x.Offset).ToList(); - UpdateGradientStopsCount(gradientStops); - foreach (GradientStop stop in gradientStops) - UpdateGradientStop(_stops[stop], _stopContainer.ActualWidth, _stopContainer.ActualHeight, stop); - } - - private void UpdateGradientStop(ContentControl control, double referenceWidth, double referenceHeight, GradientStop stop) - { - control.Background = new SolidColorBrush(Color.FromArgb(stop.Color.GetA(), stop.Color.GetR(), stop.Color.GetG(), stop.Color.GetB())); - - Canvas.SetLeft(control, (referenceWidth * stop.Offset.Clamp(0, 1)) - (control.Width / 2.0)); - - Canvas.SetTop(control, 0); - control.Height = referenceHeight; - } - - private void UpdateGradientStopsCount(List gradientStops) - { - foreach (GradientStop stop in gradientStops) - { - if (!_stops.ContainsKey(stop)) - { - ContentControl control = new ContentControl - { - VerticalAlignment = VerticalAlignment.Stretch, - Style = GradientStopStyle, - Content = stop - }; - control.MouseDown += GradientStopOnMouseDown; - _stops.Add(stop, control); - _stopContainer.Children.Add(control); - } - } - - List stopsToRemove = new List(); - foreach (KeyValuePair stopPair in _stops) - if (!gradientStops.Contains(stopPair.Key)) - { - ContentControl control = stopPair.Value; - control.MouseDown -= GradientStopOnMouseDown; - stopsToRemove.Add(stopPair.Key); - _stopContainer.Children.Remove(control); - } - - foreach (GradientStop stop in stopsToRemove) - _stops.Remove(stop); - } - - private void AttachGradient(AbstractGradient gradient) => gradient.GradientChanged += GradientChanged; - private void DetachGradient(AbstractGradient gradient) => gradient.GradientChanged -= GradientChanged; - - private void GradientChanged(object o, EventArgs eventArgs) - { - UpdateGradientPreview(); - UpdateGradientStops(); - } - - private static void OnGradientChanged(DependencyObject dependencyObject, - DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) - { - if (!(dependencyObject is GradientEditor ge)) return; - - if (dependencyPropertyChangedEventArgs.OldValue is AbstractGradient oldGradient) - ge.DetachGradient(oldGradient); - - if (dependencyPropertyChangedEventArgs.NewValue is AbstractGradient newGradient) - ge.AttachGradient(newGradient); - } - - private void GradientContainerOnMouseDown(object o, MouseButtonEventArgs mouseButtonEventArgs) - { - if ((mouseButtonEventArgs.ChangedButton != MouseButton.Left) || (Gradient == null) || !CanAddOrDeleteStops) return; - - double offset = mouseButtonEventArgs.GetPosition(_gradientContainer).X / _gradientContainer.ActualWidth; - RGB.NET.Core.Color color = Gradient.GetColor(offset); - GradientStop newStop = new GradientStop(offset, color); - Gradient.GradientStops.Add(newStop); - SelectedStop = newStop; - } - - private void GradientStopOnMouseDown(object o, MouseButtonEventArgs mouseButtonEventArgs) - { - if (!((o as ContentControl)?.Content is GradientStop stop) || (Gradient == null)) return; - - if (mouseButtonEventArgs.ChangedButton == MouseButton.Right) - { - if (CanAddOrDeleteStops) - Gradient.GradientStops.Remove(stop); - } - else if (mouseButtonEventArgs.ChangedButton == MouseButton.Left) - { - SelectedStop = stop; - _draggingStop = (ContentControl)o; - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - if (_draggingStop?.Content is GradientStop stop) - { - double location = e.GetPosition(_gradientContainer).X; - stop.Offset = (location / _gradientContainer.ActualWidth).Clamp(0, 1); - } - } - - protected override void OnMouseLeave(MouseEventArgs e) - { - base.OnMouseLeave(e); - - _draggingStop = null; - } - - protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) - { - base.OnMouseLeftButtonUp(e); - - _draggingStop = null; - } - - private static void SelectedStopChanged(DependencyObject dependencyObject, - DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) - { - if (!(dependencyObject is GradientEditor gradientEditor)) return; - - if (gradientEditor._adorner != null) - gradientEditor._adornerLayer.Remove(gradientEditor._adorner); - - if (dependencyPropertyChangedEventArgs.OldValue is GradientStop oldStop) - { - if (gradientEditor._stops.TryGetValue(oldStop, out ContentControl oldcontrol)) - SetIsSelected(oldcontrol, false); - } - - if (dependencyPropertyChangedEventArgs.NewValue is GradientStop stop) - { - ContentControl stopContainer = gradientEditor._stops[stop]; - SetIsSelected(stopContainer, true); - - if (gradientEditor._adornerLayer != null) - { - ContentControl contentControl = new ContentControl - { - ContentTemplate = gradientEditor.ColorSelectorTemplate, - Content = stop - }; - - ColorPickerAdorner adorner = new ColorPickerAdorner(stopContainer, contentControl); - gradientEditor._adorner = adorner; - gradientEditor._adornerLayer.Add(adorner); - } - } - } - - private void WindowMouseDown(object o, MouseButtonEventArgs mouseButtonEventArgs) - { - if ((_adorner != null) && (VisualTreeHelper.HitTest(_adorner, mouseButtonEventArgs.GetPosition(_adorner)) == null)) - SelectedStop = null; - } - - #endregion - } - - public class ColorPickerAdorner : Adorner - { - #region Properties & Fields - - private readonly VisualCollection _visualChildren; - private readonly FrameworkElement _colorSelector; - protected override int VisualChildrenCount => 1; - protected override Visual GetVisualChild(int index) => _colorSelector; - - #endregion - - #region Constructors - - public ColorPickerAdorner(UIElement adornedElement, FrameworkElement colorSelector) - : base(adornedElement) - { - this._colorSelector = colorSelector; - - _visualChildren = new VisualCollection(this) { colorSelector }; - } - - #endregion - - #region Methods - - protected override Size ArrangeOverride(Size finalSize) - { - Window referenceWindow = Window.GetWindow(AdornedElement); - Point referenceLocation = AdornedElement.TranslatePoint(new Point(0, 0), referenceWindow); - - double referenceWidth = ((FrameworkElement)AdornedElement).ActualWidth / 2.0; - double referenceHeight = ((FrameworkElement)AdornedElement).Height; - double referenceX = referenceLocation.X + referenceWidth; - double halfWidth = finalSize.Width / 2.0; - double maxOffset = referenceWindow.Width - halfWidth; - - double offset = (referenceX < halfWidth ? referenceX - : (((referenceX + (referenceWidth * 2)) > maxOffset) - ? halfWidth - ((maxOffset - referenceX) - (referenceWidth * 2)) - : halfWidth)); - - _colorSelector.Arrange(new Rect(new Point(referenceWidth - offset, referenceHeight), finalSize)); - return _colorSelector.RenderSize; - } - - protected override Size MeasureOverride(Size constraint) - { - _colorSelector.Measure(constraint); - return _colorSelector.DesiredSize; - } - - #endregion - } -} \ No newline at end of file diff --git a/RGBSync+/Converter/BackgroundGradientConverter.cs b/RGBSync+/Converter/BackgroundGradientConverter.cs new file mode 100644 index 0000000..f5b238e --- /dev/null +++ b/RGBSync+/Converter/BackgroundGradientConverter.cs @@ -0,0 +1,45 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using System.Windows.Media; + +namespace SyncStudio.WPF.Converter +{ + public class BackgroundGradientConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + { + return null; + } + + SolidColorBrush item = (SolidColorBrush)value; + + GradientStop start = new GradientStop(); + start.Offset = 0; + start.Color = item.Color; + + GradientStop stop = new GradientStop(); + stop.Offset = 1; + stop.Color = Colors.Transparent; + + RadialGradientBrush result = new RadialGradientBrush(); + result.GradientOrigin = new Point(0.20, 0.5); + result.Center = new Point(0.25, 0.5); + result.RadiusX = 0.75; + result.RadiusY = 0.5; + result.GradientStops = new GradientStopCollection(); + result.GradientStops.Add(start); + result.GradientStops.Add(stop); + + return result; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/BoolToSolidColorBrush.cs b/RGBSync+/Converter/BoolToSolidColorBrush.cs new file mode 100644 index 0000000..505c982 --- /dev/null +++ b/RGBSync+/Converter/BoolToSolidColorBrush.cs @@ -0,0 +1,209 @@ +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Windows.Data; +using System.Windows.Media; + +namespace SyncStudio.WPF.Converter +{ + public class BoolToSolidColorBrush : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string options = parameter.ToString(); + + List optionsList = options.Split('|').ToList(); + + string selectedOption; + if ((value as bool?) == true) + { + selectedOption = optionsList.First(); + } + else + { + selectedOption = optionsList.Last(); + } + + return new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectedOption)); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class StringMatchToSolidColorBrush : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string options = parameter.ToString(); + + List optionsList = options.Split('|').ToList(); + + string selectedOption; + if ((value as string).ToLower() == optionsList[0].ToLower()) + { + selectedOption = optionsList[1]; + } + else + { + selectedOption = optionsList.Last(); + } + + return new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectedOption)); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class LEDColorToSolidColorBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is LEDColor)) + { + return null; + } + + LEDColor ledColor = (LEDColor)value; + + return new SolidColorBrush(new Color() + { + R = (byte)ledColor.Red, + G = (byte)ledColor.Green, + B = (byte)ledColor.Blue, + A = 255 + }); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class LEDColorToColorConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is LEDColor)) + { + return null; + } + + LEDColor ledColor = (LEDColor)value; + + return new Color + { + R = (byte)ledColor.Red, + G = (byte)ledColor.Green, + B = (byte)ledColor.Blue, + A = 255 + }; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public class ColorModelToColorConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is ColorModel)) + { + return null; + } + + ColorModel ledColor = (ColorModel)value; + + return new Color + { + R = (byte)ledColor.Red, + G = (byte)ledColor.Green, + B = (byte)ledColor.Blue, + A = 255 + }; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is Color)) + { + return null; + } + + Color ledColor = (Color)value; + + return new ColorModel(ledColor.R, ledColor.G, ledColor.B); + } + } + + public class ColorModelToSolidColorBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is ColorModel)) + { + return null; + } + + ColorModel ledColor = (ColorModel)value; + + return new SolidColorBrush(new Color + { + R = (byte)ledColor.Red, + G = (byte)ledColor.Green, + B = (byte)ledColor.Blue, + A = 255 + }); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is SolidColorBrush)) + { + return null; + } + + Color ledColor = ((SolidColorBrush)value).Color; + + return new ColorModel(ledColor.R, ledColor.G, ledColor.B); + } + } + + public class ColorModelToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is ColorModel)) + { + return null; + } + + ColorModel ledColor = (ColorModel)value; + + return $"#{ledColor.Red:X2}{ledColor.Green:X2}{ledColor.Blue:X2}"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is string)) + { + return null; + } + + string ledColors = (string)value; + Color ledColor = (Color)ColorConverter.ConvertFromString(ledColors); + return new ColorModel(ledColor.R, ledColor.G, ledColor.B); + } + } +} diff --git a/RGBSync+/Converter/BoolToVisibilityConverter.cs b/RGBSync+/Converter/BoolToVisibilityConverter.cs index 04f4f2b..f81442a 100644 --- a/RGBSync+/Converter/BoolToVisibilityConverter.cs +++ b/RGBSync+/Converter/BoolToVisibilityConverter.cs @@ -3,7 +3,7 @@ using System.Windows; using System.Windows.Data; -namespace RGBSyncPlus.Converter +namespace SyncStudio.WPF.Converter { [ValueConversion(typeof(bool), typeof(Visibility))] public class BoolToVisibilityConverter : IValueConverter @@ -12,10 +12,23 @@ public class BoolToVisibilityConverter : IValueConverter public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (value as bool?) == true ? Visibility.Visible - : (string.Equals(parameter?.ToString(), "true", StringComparison.OrdinalIgnoreCase) ? Visibility.Hidden : Visibility.Collapsed); + : (string.Equals(parameter?.ToString(), "true", StringComparison.OrdinalIgnoreCase) ? Visibility.Hidden : Visibility.Collapsed); public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value as Visibility? == Visibility.Visible; #endregion } + + public class InvertedBoolToVisibilityConverter : IValueConverter + { + #region Methods + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + => (value as bool?) != true ? Visibility.Visible + : (string.Equals(parameter?.ToString(), "false", StringComparison.OrdinalIgnoreCase) ? Visibility.Hidden : Visibility.Collapsed); + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value as Visibility? != Visibility.Visible; + + #endregion + } } diff --git a/RGBSync+/Converter/DeviceTypeToImageConverter.cs b/RGBSync+/Converter/DeviceTypeToImageConverter.cs new file mode 100644 index 0000000..c514a73 --- /dev/null +++ b/RGBSync+/Converter/DeviceTypeToImageConverter.cs @@ -0,0 +1,87 @@ + +using SimpleLed; +using System; +using System.Globalization; +using System.Windows.Data; +using System.Windows.Media.Imaging; + +namespace SyncStudio.WPF.Converter +{ + public class DeviceTypeToImageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value == null) + { + return default; + } + + if (value is string stringValue) + { + switch (stringValue) + { + case DeviceTypes.Keyboard: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Keyboard.png", + UriKind.Absolute)); + case DeviceTypes.Mouse: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Mouse.png", UriKind.Absolute)); + case DeviceTypes.Headset: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Headphones.png", + UriKind.Absolute)); + case DeviceTypes.MousePad: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Mousepad.png", + UriKind.Absolute)); + case DeviceTypes.Fan: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Fan.png", + UriKind.Absolute)); + case DeviceTypes.LedStrip: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/LedStrip.png", + UriKind.Absolute)); + case DeviceTypes.Memory: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/DRAM.png", UriKind.Absolute)); + case DeviceTypes.MotherBoard: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Motherboard.png", + UriKind.Absolute)); + case DeviceTypes.GPU: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/GPU.png", + UriKind.Absolute)); + case DeviceTypes.Cooler: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Pump.png", UriKind.Absolute)); + case DeviceTypes.Speaker: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Speaker.png", + UriKind.Absolute)); + case DeviceTypes.Effect: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Effect.png", UriKind.Absolute)); + case DeviceTypes.Other: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Invalid.png", + UriKind.Absolute)); + default: + return new BitmapImage(new Uri( + "pack://application:,,,/RGBSync+;component/Resources/DevImg/Default.png", + UriKind.Absolute)); + } + } + + return null; + + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/DeviceTypeToLetterConverter.cs b/RGBSync+/Converter/DeviceTypeToLetterConverter.cs new file mode 100644 index 0000000..81cfbac --- /dev/null +++ b/RGBSync+/Converter/DeviceTypeToLetterConverter.cs @@ -0,0 +1,64 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.Windows.Data; +using SimpleLed; + +namespace SyncStudio.WPF.Converter +{ + public class DeviceTypeToLetterConverter : IValueConverter + { + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value == null) + { + return default; + } + + if (value is string stringValue) + { + Debug.WriteLine("Received: "+stringValue); + + switch (stringValue) + { + case DeviceTypes.Keyboard: + return "H"; + case DeviceTypes.Mouse: + return "K"; + case DeviceTypes.Headset: + return "F"; + case DeviceTypes.MousePad: + return "L"; + case DeviceTypes.Fan: + return "D"; + case DeviceTypes.LedStrip: + return "I"; + case DeviceTypes.Memory: + return "B"; + case DeviceTypes.MotherBoard: + return "J"; + case DeviceTypes.GPU: + return "E"; + case DeviceTypes.Cooler: + return "M"; + case DeviceTypes.Speaker: + return "N"; + case DeviceTypes.Effect: + return "C"; + case DeviceTypes.Other: + return "G"; + default: + return "G"; + } + } + + return "Dunno"; + + } + } +} \ No newline at end of file diff --git a/RGBSync+/Converter/EqualsToBoolConverter.cs b/RGBSync+/Converter/EqualsToBoolConverter.cs index 32373c9..0dbeda4 100644 --- a/RGBSync+/Converter/EqualsToBoolConverter.cs +++ b/RGBSync+/Converter/EqualsToBoolConverter.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.Windows.Data; -namespace RGBSyncPlus.Converter +namespace SyncStudio.WPF.Converter { [ValueConversion(typeof(object), typeof(bool))] public class EqualsToBoolConverter : IValueConverter diff --git a/RGBSync+/Converter/IndeterminateBoolToOpacityConverter.cs b/RGBSync+/Converter/IndeterminateBoolToOpacityConverter.cs new file mode 100644 index 0000000..5eb3e88 --- /dev/null +++ b/RGBSync+/Converter/IndeterminateBoolToOpacityConverter.cs @@ -0,0 +1,16 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace SyncStudio.WPF.Converter +{ + public class IndeterminateBoolToOpacityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (value as bool?) == true ? 1d : (0.5d); + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/LocConverter.cs b/RGBSync+/Converter/LocConverter.cs new file mode 100644 index 0000000..c54d175 --- /dev/null +++ b/RGBSync+/Converter/LocConverter.cs @@ -0,0 +1,46 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using SyncStudio.WPF.Languages; + +namespace SyncStudio.WPF.Converter +{ + [ValueConversion(typeof(string), typeof(string))] + public class LocConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (!string.IsNullOrWhiteSpace((string)value)) + { + return LanguageManager.GetValue(parameter?.ToString(), value?.ToString()); + } + } + catch + { + } + + return LanguageManager.GetValue(parameter?.ToString()); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + [ValueConversion(typeof(string), typeof(string))] + public class ValueLocConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return LanguageManager.GetValue(value?.ToString().Replace(" ", "")); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/NullToVisibilityConverter.cs b/RGBSync+/Converter/NullToVisibilityConverter.cs index 6fc33f9..da8bc5b 100644 --- a/RGBSync+/Converter/NullToVisibilityConverter.cs +++ b/RGBSync+/Converter/NullToVisibilityConverter.cs @@ -3,7 +3,7 @@ using System.Windows; using System.Windows.Data; -namespace RGBSyncPlus.Converter +namespace SyncStudio.WPF.Converter { [ValueConversion(typeof(object), typeof(Visibility))] public class NullToVisibilityConverter : IValueConverter @@ -13,6 +13,84 @@ public class NullToVisibilityConverter : IValueConverter public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (value == null) == (string.Equals(parameter?.ToString(), "true", StringComparison.OrdinalIgnoreCase)) ? Visibility.Visible : Visibility.Hidden; + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); + + #endregion + } + + [ValueConversion(typeof(object), typeof(Visibility))] + public class NotNullToVisibilityConverter : IValueConverter + { + #region Methods + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + => (value != null) == (string.Equals(parameter?.ToString(), "true", StringComparison.OrdinalIgnoreCase)) ? Visibility.Visible : Visibility.Hidden; + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); + + #endregion + } + + + [ValueConversion(typeof(object), typeof(Visibility))] + public class NonEmptyStringToVisibilityConverter : IValueConverter + { + #region Methods + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + bool trig = value == null || string.IsNullOrWhiteSpace(value.ToString()); + + if (trig) + { + if (parameter != null && (parameter.ToString() == "hidden")) + { + return Visibility.Hidden; + } + else + { + return Visibility.Collapsed; + } + } + else + { + return Visibility.Visible; + } + } + + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); + + #endregion + } + + [ValueConversion(typeof(object), typeof(Visibility))] + public class EmptyStringToVisibilityConverter : IValueConverter + { + #region Methods + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + bool trig = value == null || string.IsNullOrWhiteSpace(value.ToString()); + + if (!trig) + { + if (parameter != null && (parameter.ToString() == "hidden")) + { + return Visibility.Hidden; + } + else + { + return Visibility.Collapsed; + } + } + else + { + return Visibility.Visible; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException(); #endregion diff --git a/RGBSync+/Converter/PercentageConverter.cs b/RGBSync+/Converter/PercentageConverter.cs new file mode 100644 index 0000000..1ce376c --- /dev/null +++ b/RGBSync+/Converter/PercentageConverter.cs @@ -0,0 +1,130 @@ +using SyncStudio.WPF.Helper; +using System; +using System.Globalization; +using System.Linq; +using System.Windows; +using System.Windows.Data; +using System.Windows.Markup; + +namespace SyncStudio.WPF.Converter +{ + public class PercentageConverter : MarkupExtension, IValueConverter + { + private static PercentageConverter _instance; + + #region IValueConverter Members + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + double res = (value.ToString()).GetDouble() * ((parameter.ToString()).GetDouble() / 100d); + + if (res < 1) res = 1; + + return res; + } + catch + { + return 0; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + #endregion + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return _instance ?? (_instance = new PercentageConverter()); + } + } + + + public class SubtractorConverter : MarkupExtension, IValueConverter + { + private static SubtractorConverter _instance; + + #region IValueConverter Members + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + return (value.ToString()).GetDouble() - (parameter.ToString()).GetDouble(); + } + catch + { + return 0; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + #endregion + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return _instance ?? (_instance = new SubtractorConverter()); + } + } + + + + public class MarginConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null || (value as double?) == null) + { + return new Thickness(0, 0, 0, 0); + } + double v = (double)value; + + + string param = (string)parameter; + if (param != null && param.StartsWith("-")) + { + param = param.Substring(1); + v = -v; + } + + string[] parts = param.Split('|'); + param = parts.First(); + + if (parts.Length > 1) + { + double amount = parts[1].GetDouble(); + + v = v * amount; + } + + switch (param.ToLower()) + { + case "left": return new Thickness(v, 0, 0, 0); + case "top": return new Thickness(0, v, 0, 0); + case "right": return new Thickness(0, 0, v, 0); + case "bottom": return new Thickness(0, 0, 0, v); + + case "topleft": return new Thickness(v, v, 0, 0); + case "topright": return new Thickness(0, v, v, 0); + case "bottomleft": return new Thickness(v, 0, 0, v); + case "bottomright": return new Thickness(0, 0, v, v); + + } + + return new Thickness(0, 0, 0, 0); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/ProfileSelectedToColorBrushConverter.cs b/RGBSync+/Converter/ProfileSelectedToColorBrushConverter.cs new file mode 100644 index 0000000..6a38c32 --- /dev/null +++ b/RGBSync+/Converter/ProfileSelectedToColorBrushConverter.cs @@ -0,0 +1,39 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using System.Windows.Media; + +namespace SyncStudio.WPF.Converter +{ + public class ProfileSelectedToColorBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(value is bool)) + { + return null; + } + + SolidColorBrush output = new SolidColorBrush(); + + bool isSelected = (bool)value; + + if (isSelected) + { + output = (SolidColorBrush)SystemParameters.WindowGlassBrush; + } + else + { + output.Color = Color.FromRgb(64, 64, 64); + } + + return output; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Converter/ScrollOffsetToOpacityMaskConverter.cs b/RGBSync+/Converter/ScrollOffsetToOpacityMaskConverter.cs index cc0252f..a30abe9 100644 --- a/RGBSync+/Converter/ScrollOffsetToOpacityMaskConverter.cs +++ b/RGBSync+/Converter/ScrollOffsetToOpacityMaskConverter.cs @@ -4,7 +4,7 @@ using System.Windows.Data; using System.Windows.Media; -namespace RGBSyncPlus.Converter +namespace SyncStudio.WPF.Converter { public class ScrollOffsetToOpacityMaskConverter : IMultiValueConverter { @@ -19,11 +19,11 @@ public class ScrollOffsetToOpacityMaskConverter : IMultiValueConverter public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { - double offset = double.Parse(values[0].ToString()); - double maxHeight = double.Parse(values[1].ToString()); - double height = double.Parse(values[2].ToString()); + double offset = double.Parse(values[0].ToString(), CultureInfo.InvariantCulture); + double maxHeight = double.Parse(values[1].ToString(), CultureInfo.InvariantCulture); + double height = double.Parse(values[2].ToString(), CultureInfo.InvariantCulture); - double transparencyHeight = double.Parse(parameter.ToString()); + double transparencyHeight = double.Parse(parameter.ToString(), CultureInfo.InvariantCulture); double transparencyFactor = (transparencyHeight - 6) / height; double transparencyFadeFactor = (transparencyHeight + 4) / height; diff --git a/RGBSync+/Converter/ScrollOffsetToVisibilityConverter.cs b/RGBSync+/Converter/ScrollOffsetToVisibilityConverter.cs index 0eb286f..7b2317c 100644 --- a/RGBSync+/Converter/ScrollOffsetToVisibilityConverter.cs +++ b/RGBSync+/Converter/ScrollOffsetToVisibilityConverter.cs @@ -3,7 +3,7 @@ using System.Windows; using System.Windows.Data; -namespace RGBSyncPlus.Converter +namespace SyncStudio.WPF.Converter { // Based on: http://stackoverflow.com/a/28679767 public class ScrollOffsetToVisibilityConverter : IMultiValueConverter diff --git a/RGBSync+/Converter/StringMatchToVisibilityConverter.cs b/RGBSync+/Converter/StringMatchToVisibilityConverter.cs new file mode 100644 index 0000000..2332ade --- /dev/null +++ b/RGBSync+/Converter/StringMatchToVisibilityConverter.cs @@ -0,0 +1,51 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace SyncStudio.WPF.Converter +{ + [ValueConversion(typeof(string), typeof(Visibility))] + public class StringMatchToVisibilityConverter : IValueConverter + { + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + + if (value?.ToString() == parameter?.ToString()) + { + return Visibility.Visible; + } + else + { + return Visibility.Collapsed; + } + } + + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value as Visibility? == Visibility.Visible; + + } + + [ValueConversion(typeof(string), typeof(Visibility))] + public class InvertedStringMatchToVisibilityConverter : IValueConverter + { + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + + if (value?.ToString() != parameter?.ToString()) + { + return Visibility.Visible; + } + else + { + return Visibility.Collapsed; + } + } + + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value as Visibility? == Visibility.Visible; + + } +} \ No newline at end of file diff --git a/RGBSync+/DriverService.cs b/RGBSync+/DriverService.cs new file mode 100644 index 0000000..7a2120c --- /dev/null +++ b/RGBSync+/DriverService.cs @@ -0,0 +1,24 @@ +using SyncStudio.WPF.Model; +using SimpleLed; +using System.Collections.ObjectModel; +using SyncStudio.Domain; +using SyncStudio.WPF.UI; + +namespace SyncStudio.WPF +{ + public class DriverService : BaseViewModel + { + + private ObservableCollection slsDevices; + public ObservableCollection SLSDevices + { + get => slsDevices; + set + { + SetProperty(ref slsDevices, value); + this.OnPropertyChanged("SLSDevicesFiltered"); + } + } + + } +} diff --git a/RGBSync+/Fonts/RssSymbol-Regular.ttf b/RGBSync+/Fonts/RssSymbol-Regular.ttf new file mode 100644 index 0000000..06fb28f Binary files /dev/null and b/RGBSync+/Fonts/RssSymbol-Regular.ttf differ diff --git a/RGBSync+/Helper/ActionCommand.cs b/RGBSync+/Helper/ActionCommand.cs index 537357b..aaa70d9 100644 --- a/RGBSync+/Helper/ActionCommand.cs +++ b/RGBSync+/Helper/ActionCommand.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Input; -namespace RGBSyncPlus.Helper +namespace SyncStudio.WPF.Helper { public class ActionCommand : ICommand { diff --git a/RGBSync+/Helper/BrowserHelper.cs b/RGBSync+/Helper/BrowserHelper.cs new file mode 100644 index 0000000..defa89d --- /dev/null +++ b/RGBSync+/Helper/BrowserHelper.cs @@ -0,0 +1,49 @@ +using Microsoft.Win32; +using System.Diagnostics; + +namespace SyncStudio.WPF.Helper +{ + public static class BrowserHelper + { + + private static string GetBrowserPath() + { + string browserName = "iexplore.exe"; + using (RegistryKey userChoiceKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice")) + { + if (userChoiceKey != null) + { + object progIdValue = userChoiceKey.GetValue("Progid"); + if (progIdValue != null) + { + if (progIdValue.ToString().ToLower().Contains("chrome")) + browserName = "chrome.exe"; + else if (progIdValue.ToString().ToLower().Contains("firefox")) + browserName = "firefox.exe"; + else if (progIdValue.ToString().ToLower().Contains("safari")) + browserName = "safari.exe"; + else if (progIdValue.ToString().ToLower().Contains("opera")) + browserName = "opera.exe"; + else if (progIdValue.ToString().ToLower().Contains("edge")) + browserName = "msedge.exe"; + } + } + } + + return browserName; + } + + public static void NavigateToUrlInDefaultBrowser(this string input) + { + string browserPath = GetBrowserPath(); + if (browserPath == string.Empty) + browserPath = "iexplore"; + Process process = new Process(); + process.StartInfo = new ProcessStartInfo(browserPath); + process.StartInfo.Arguments = "\"" + input + "\""; + process.Start(); + + + } + } +} diff --git a/RGBSync+/Helper/ExceptionExtension.cs b/RGBSync+/Helper/ExceptionExtension.cs index e2d566f..51fcedb 100644 --- a/RGBSync+/Helper/ExceptionExtension.cs +++ b/RGBSync+/Helper/ExceptionExtension.cs @@ -1,6 +1,8 @@ using System; +using System.Windows; +using System.Windows.Threading; -namespace RGBSyncPlus.Helper +namespace SyncStudio.WPF.Helper { public static class ExceptionExtension { @@ -18,6 +20,15 @@ public static string GetFullMessage(this Exception ex, string message = "") return message; } + private static readonly Action EmptyDelegate = delegate () { }; + + + public static void Refresh(this UIElement uiElement) + + { + uiElement?.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); + } + #endregion } } diff --git a/RGBSync+/Helper/ImageHelpers.cs b/RGBSync+/Helper/ImageHelpers.cs new file mode 100644 index 0000000..8d1cb7a --- /dev/null +++ b/RGBSync+/Helper/ImageHelpers.cs @@ -0,0 +1,40 @@ +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Windows.Media.Imaging; + +namespace SyncStudio.WPF.Helper +{ + public static class ImageHelpers + { + public static BitmapImage ToBitmapImage(this Bitmap bitmap) + { + if (bitmap == null) + { + return null; + } + + try + { + using (MemoryStream memory = new MemoryStream()) + { + bitmap.Save(memory, ImageFormat.Png); + memory.Position = 0; + + BitmapImage bitmapImage = new BitmapImage(); + bitmapImage.BeginInit(); + bitmapImage.StreamSource = memory; + bitmapImage.CacheOption = BitmapCacheOption.OnLoad; + bitmapImage.EndInit(); + bitmapImage.Freeze(); + + return bitmapImage; + } + } + catch + { + return null; + } + } + } +} diff --git a/RGBSync+/Helper/MathHelper.cs b/RGBSync+/Helper/MathHelper.cs index 6ef4415..29e60cb 100644 --- a/RGBSync+/Helper/MathHelper.cs +++ b/RGBSync+/Helper/MathHelper.cs @@ -1,11 +1,27 @@ using System; +using System.Globalization; -namespace RGBSyncPlus.Helper +namespace SyncStudio.WPF.Helper { public static class MathHelper { #region Methods + public static double GetDouble(this string value, double defaultValue = 0) + { + double result; + //Try parsing in the current culture + if (!double.TryParse(value, System.Globalization.NumberStyles.Any, CultureInfo.CurrentCulture, out result) && + //Then try in US english + !double.TryParse(value, System.Globalization.NumberStyles.Any, CultureInfo.GetCultureInfo("en-US"), out result) && + //Then in neutral language + !double.TryParse(value, System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out result)) + { + result = defaultValue; + } + + return result; + } public static double Clamp(double value, double min, double max) => Math.Max(min, Math.Min(max, value)); public static float Clamp(float value, float min, float max) => (float)Clamp((double)value, min, max); public static int Clamp(int value, int min, int max) => Math.Max(min, Math.Min(max, value)); diff --git a/RGBSync+/Helper/RGBNetExtension.cs b/RGBSync+/Helper/RGBNetExtension.cs deleted file mode 100644 index bd710f5..0000000 --- a/RGBSync+/Helper/RGBNetExtension.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using RGB.NET.Core; -using RGBSyncPlus.Model; - -namespace RGBSyncPlus.Helper -{ - public static class RGBNetExtension - { - public static string GetDeviceName(this IRGBDevice device) => $"{device.DeviceInfo.DeviceName} ({device.DeviceInfo.DeviceType})"; - - public static IEnumerable GetLeds(this IEnumerable syncLeds) - => syncLeds.Select(GetLed).Where(led => led != null); - - public static Led GetLed(this SyncLed syncLed) - { - if (syncLed == null) return null; - return RGBSurface.Instance.Leds.FirstOrDefault(l => (l.Id == syncLed.LedId) && (l.Device.GetDeviceName() == syncLed.Device)); - } - } -} diff --git a/RGBSync+/Helper/ReflectionHelpers.cs b/RGBSync+/Helper/ReflectionHelpers.cs new file mode 100644 index 0000000..b79b036 --- /dev/null +++ b/RGBSync+/Helper/ReflectionHelpers.cs @@ -0,0 +1,114 @@ +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Windows.Controls; + +namespace SyncStudio.WPF.Helper +{ + public static class TypeLoaderExtensions + { + public static IEnumerable GetLoadableTypes(this Assembly assembly) + { + if (assembly == null) throw new ArgumentNullException("assembly"); + try + { + return assembly.GetTypes(); + } + catch (ReflectionTypeLoadException e) + { + return e.Types.Where(t => t != null); + } + } + + public static IEnumerable GetTypesWithInterface(this Assembly asm) + { + Type it = typeof(ISimpleLed); + return asm.GetLoadableTypes().Where(it.IsAssignableFrom).ToList(); + } + + + + public static void LoadChildAssemblies(Assembly assembly, string basePath) + { + + AssemblyName[] names = assembly.GetReferencedAssemblies(); + + foreach (AssemblyName assemblyName in names) + { + try + { + if (File.Exists(basePath + "\\" + assemblyName.Name + ".dll")) + { + Assembly temp = Assembly.Load(File.ReadAllBytes(basePath + "\\" + assemblyName.Name + ".dll")); + LoadChildAssemblies(temp, basePath); + } + else + { + Assembly.Load(assemblyName); + } + + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + } + } + + private static Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEventArgs args, string basePath) + { + string assemblyName = new AssemblyName(args.Name).Name; + + string dllName = assemblyName + ".dll"; + string dllFullPath = Path.Combine(basePath, dllName); + + if (File.Exists(dllFullPath)) + { + return Assembly.Load(File.ReadAllBytes(dllFullPath)); + } + + return null; + } + + public static ISimpleLed LoadDll(string basePath, string dllFileName) + { + ISimpleLed result = null; + + ResolveEventHandler delly = (sender, args) => CurrentDomainOnAssemblyResolve(sender, args, basePath); + + AppDomain.CurrentDomain.AssemblyResolve += delly; + + Assembly assembly = Assembly.Load(File.ReadAllBytes(basePath + "\\" + dllFileName)); + //Assembly assembly = Assembly.LoadFrom(file); + Type[] typeroo = assembly.GetTypes(); + List pat2 = typeroo.Where(t => !t.IsAbstract && !t.IsInterface && t.IsClass).ToList(); + + List pat3 = pat2.Where(t => typeof(ISimpleLed).IsAssignableFrom(t)).ToList(); + + foreach (Type loaderType in pat3) + { + if (Activator.CreateInstance(loaderType) is ISimpleLed slsDriver) + { + if (slsDriver is ISimpleLedWithConfig slsWithConfig) + { + var temp = slsWithConfig.GetCustomConfig(null); + + } + + + LoadChildAssemblies(assembly, basePath); + + result = slsDriver; + } + } + + AppDomain.CurrentDomain.AssemblyResolve -= delly; + + return result; + } + } +} diff --git a/RGBSync+/Helper/TryReallyHard.cs b/RGBSync+/Helper/TryReallyHard.cs new file mode 100644 index 0000000..d11a848 --- /dev/null +++ b/RGBSync+/Helper/TryReallyHard.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SyncStudio.WPF.Helper +{ + public static class TryReallyHard + { + public static void ToRun(Action thisCode, int tryTimes = 10, int andPauseBetweenRetries = 1000) + { + bool success = false; + int attempts = 0; + while (!success && attempts < tryTimes) + { + try + { + thisCode(); + } + catch + { + attempts++; + Thread.Sleep(andPauseBetweenRetries); + } + } + } + + public static T ToRun(Func thisCode, int tryTimes = 10, int andPauseBetweenRetries = 1000) + { + int attempts = 0; + while (true) + { + try + { + return thisCode(); + } + catch + { + attempts++; + if (attempts < tryTimes) + { + Thread.Sleep(andPauseBetweenRetries); + } + else + { + throw; + } + } + } + } + } +} diff --git a/RGBSync+/Helper/UIHelpers.cs b/RGBSync+/Helper/UIHelpers.cs new file mode 100644 index 0000000..b5060a1 --- /dev/null +++ b/RGBSync+/Helper/UIHelpers.cs @@ -0,0 +1,24 @@ +using System.Windows; +using System.Windows.Media; + +namespace SyncStudio.WPF.Helper +{ + public static class UIHelpers + { + public static T FindParent(this DependencyObject child) where T : DependencyObject + { + //get parent item + DependencyObject parentObject = VisualTreeHelper.GetParent(child); + + //we've reached the end of the tree + if (parentObject == null) return null; + + //check if the parent matches the type we're looking for + T parent = parentObject as T; + if (parent != null) + return parent; + else + return FindParent(parentObject); + } + } +} diff --git a/RGBSync+/INewsSource.cs b/RGBSync+/INewsSource.cs new file mode 100644 index 0000000..b597eb7 --- /dev/null +++ b/RGBSync+/INewsSource.cs @@ -0,0 +1,161 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using Tweetinvi; +using Tweetinvi.Models; +using TweetSharp; + +namespace SyncStudio.WPF +{ + public interface INewsSource + { + List GetLatestStories(); + Task> GetLatestStoriesAsync(); + } + + public class NewsStory + { + public string Ident { get; set; } + public string Title { get; set; } + public string Author { get; set; } + public string Body { get; set; } + public List Images { get; set; } + public List Videos { get; set; } + public string Url { get; set; } + public DateTime Date { get; set; } + } + + public class TwitterStories : INewsSource + { + private TwitterClient userClient; + public TwitterStories() + { + userClient = new TwitterClient("LdKYMVl67TYnXCfY7JP9uMWpv", "RNjdMgKTKmnga700z61CNFvtzLItzGF09Yg2VljLwo5BWI0F35", "19777997-tNpHpDmL40JS4QJ5miFAdh4FPhU8W6IBqOq7SBWef", "eMSkBMBfELXTKiCvYi96l4Fz0BT3Ac5nsY0qWmx4U6jVs"); + + + } + public List GetLatestStories() + { + Debug.WriteLine("Getting Twitter"); + + var temp = userClient.Timelines.GetUserTimelineAsync("rgbsync").Result; + + Debug.WriteLine("Got Twitter"); + + return temp.Select(Convert).ToList(); + } + + public async Task> GetLatestStoriesAsync() + { + Debug.WriteLine("Getting Twitter"); + + var temp = await userClient.Timelines.GetUserTimelineAsync("rgbsync"); + + Debug.WriteLine("Got Twitter"); + + return temp.Select(Convert).ToList(); + } + + private NewsStory Convert(ITweet x) + { + return new NewsStory + { + Author = "RGBSync Twitter", + Body = x.Text, + Date = x.CreatedAt.ToLocalTime().Date, + Ident = x.TweetDTO.Id.ToString(), + Images = x.Media.Select(xx => xx.MediaURL).ToList(), + Url = x.Url, + Title = x.Text.Split('.', '!', ',','?').First() + }; + } + + } + + public class RGBSyncStories : INewsSource + { + public List GetLatestStories() + { + try + { + string address = "https://api.rgbsync.com/news/getPosts/?limit=5"; + WebClient client = new WebClient(); + string reply = client.DownloadString(address); + List stories = JsonConvert.DeserializeObject>(reply); + return stories.Select(x => new NewsStory + { + Author = x.author, + Body = x.content, + Date = DateTimeOffset.FromUnixTimeSeconds(x.date).DateTime, + Ident = x.guid, + Images = !string.IsNullOrWhiteSpace(x.image_url) ? new List { x.image_url } : null, + Title = x.title, + Url = x.url, + Videos = !string.IsNullOrWhiteSpace(x.video_url) ? new List { x.video_url } : null, + }).ToList(); + } + catch + { + return new List(); + } + } + + public async Task> GetLatestStoriesAsync() + { + return GetLatestStories(); + } + + + + public class RGBSyncNewsStory + { + public int date { get; set; } + public string guid { get; set; } + public string title { get; set; } + public string author { get; set; } + public string content { get; set; } + public string video_url { get; set; } + public string image_url { get; set; } + public string url { get; set; } + public int _id { get; set; } + } + + } + + public static class NewsManager + { + public static List NewsSources = new List(); + + static NewsManager() + { + NewsSources.Add(new TwitterStories()); + NewsSources.Add(new RGBSyncStories()); + } + + public static List GetStories() + { + List stories = new List(); + foreach (INewsSource newsSource in NewsSources) + { + stories.AddRange(newsSource.GetLatestStories()); + } + + return stories.OrderByDescending(x => x.Date).ToList(); + } + + public static async Task> GetStoriesAsync() + { + List stories = new List(); + foreach (INewsSource newsSource in NewsSources) + { + stories.AddRange(await newsSource.GetLatestStoriesAsync()); + } + + return stories.OrderByDescending(x => x.Date).ToList(); + } + } +} diff --git a/RGBSync+/InternalSolids.cs b/RGBSync+/InternalSolids.cs new file mode 100644 index 0000000..5dc6122 --- /dev/null +++ b/RGBSync+/InternalSolids.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using SimpleLed; + +namespace SyncStudio.WPF +{ + internal static class InternalSolids + { + + internal static ThemeWatcher themeWatcher = new ThemeWatcher(); + internal static ThemeWatcher.WindowsTheme WindowsTheme; + internal static Color Accent; + static InternalSolids() + { + WindowsTheme = ThemeWatcher.GetWindowsTheme(); + themeWatcher.WatchTheme(); + themeWatcher.OnThemeChanged += ThemeWatcher_OnThemeChanged; + } + + private static void ThemeWatcher_OnThemeChanged(object sender, ThemeWatcher.ThemeChangeEventArgs e) + { + WindowsTheme = e.CurrentTheme; + Accent = e.AccentColor; + } + } +} diff --git a/RGBSync+/JackNet RGB Sync.sln b/RGBSync+/JackNet RGB Sync.sln deleted file mode 100644 index 2bc6e56..0000000 --- a/RGBSync+/JackNet RGB Sync.sln +++ /dev/null @@ -1,91 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.156 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JackNetRGBSync", "JackNetRGBSync.csproj", "{C6BF4357-07D9-496B-9630-A26568D30723}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartupHelper", "..\StartupHelper\StartupHelper.csproj", "{CA1A6020-2CAF-4697-8FFF-ECE71786344E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestartHelper", "..\RestartHelper\RestartHelper.csproj", "{44B19BF5-DE61-447D-B881-A74DBFE30A0C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDK_Debug", "..\SDK_Debug\SDK_Debug.csproj", "{62E2E082-16D9-4372-ADC2-1BD0EF5936B1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceExcludeTool", "..\DeviceExcludeTool\DeviceExcludeTool.csproj", "{34947C89-2B73-42D6-822D-6CC07BD98B88}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BackgroundUploadHelper", "..\BackgroundUploadHelper\BackgroundUploadHelper.csproj", "{BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginManager", "..\..\PluginManager\PluginManager\PluginManager.csproj", "{953AA2D4-6FAF-4667-83B0-46D73A64A3B5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|x64.ActiveCfg = Debug|x64 - {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|x64.Build.0 = Debug|x64 - {C6BF4357-07D9-496B-9630-A26568D30723}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C6BF4357-07D9-496B-9630-A26568D30723}.Release|Any CPU.Build.0 = Release|Any CPU - {C6BF4357-07D9-496B-9630-A26568D30723}.Release|x64.ActiveCfg = Release|x64 - {C6BF4357-07D9-496B-9630-A26568D30723}.Release|x64.Build.0 = Release|x64 - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Debug|x64.ActiveCfg = Debug|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Debug|x64.Build.0 = Debug|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Release|Any CPU.Build.0 = Release|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Release|x64.ActiveCfg = Release|Any CPU - {CA1A6020-2CAF-4697-8FFF-ECE71786344E}.Release|x64.Build.0 = Release|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Debug|x64.ActiveCfg = Debug|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Debug|x64.Build.0 = Debug|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Release|Any CPU.Build.0 = Release|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Release|x64.ActiveCfg = Release|Any CPU - {44B19BF5-DE61-447D-B881-A74DBFE30A0C}.Release|x64.Build.0 = Release|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Debug|x64.Build.0 = Debug|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Release|Any CPU.Build.0 = Release|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Release|x64.ActiveCfg = Release|Any CPU - {62E2E082-16D9-4372-ADC2-1BD0EF5936B1}.Release|x64.Build.0 = Release|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Debug|x64.ActiveCfg = Debug|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Debug|x64.Build.0 = Debug|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Release|Any CPU.Build.0 = Release|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Release|x64.ActiveCfg = Release|Any CPU - {34947C89-2B73-42D6-822D-6CC07BD98B88}.Release|x64.Build.0 = Release|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Debug|x64.ActiveCfg = Debug|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Debug|x64.Build.0 = Debug|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Release|Any CPU.Build.0 = Release|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Release|x64.ActiveCfg = Release|Any CPU - {BD9D6D04-1F12-4C2C-8973-FF9D9C1BE24C}.Release|x64.Build.0 = Release|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Debug|x64.Build.0 = Debug|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Release|Any CPU.Build.0 = Release|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Release|x64.ActiveCfg = Release|Any CPU - {953AA2D4-6FAF-4667-83B0-46D73A64A3B5}.Release|x64.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {3AD1163D-9F77-43AB-A3BA-38C1B9CCBA87} - EndGlobalSection -EndGlobal diff --git a/RGBSync+/Languages/DE-de.txt b/RGBSync+/Languages/DE-de.txt new file mode 100644 index 0000000..aa0cafe --- /dev/null +++ b/RGBSync+/Languages/DE-de.txt @@ -0,0 +1,142 @@ +DE-de +Deutsch +Deutsch +Crash.TitleText RGB Sync Studio ist abgestürzt. +Dialog.CopyCommand in die Zwischenablage kopieren +Dialog.No Nein +Dialog.NoPremiumTitle NoPremiumTitle +Dialog.NoUpdateText Du hast bereits die neueste Version installiert. +Dialog.NoUpdateTitle Keine neue Aktualisierung verfügbar. +Dialog.OKCommand OK +Dialog.UpdateText Es existiert eine Aktualisierung für RBG Sync Studio. Möchtest du Aktualisieren? +Dialog.UpdateTitle Aktualisierung Verfügbar +Dialog.Yes Ja +Settings.AdminLabel Als Administrator ausführen: +Settings.AdminText AdminText +Settings.DelayLabel Startverzögerung: +Settings.DelayToolTip DelayToolTip +Settings.DelayUnit Sekunden +Settings.DevicesLabel Produkte: +Settings.DiscordLabel Discord: +Settings.DiscordText DiscordText +Settings.DiscordToolTip DiscordToolTip +Settings.LanguageLabel Sprache: +Settings.MinimizationLabel Minimierung anschalten: +Settings.MinimizationText MinimizationText +Settings.PollingRateLabel Abfragerate: +Settings.PollingRateToolTip PollingRateTooltip +Settings.PollingRateUnit PollingRateUnit +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel Schema: +Settings.UpdateBtnText Nach Update suchen +Settings.UpdateLabel neue Versionen: +Settings.VersionLabel Version: +Settings.StartAsAdmin Als Administrator ausführen +Settings.StartAsAdminHelp Kann Kompatibilität erhöhen +Settings.ReleaseType Versions-typ +Settings.ReleaseTypeHelp Welche Version möchtest du? Release ist stabil, Beta hat nicht ganz so stabil und CI ist instabil +Settings.MinimizeToTray zu Symbolleiste minimieren +Settings.MinimizeToTrayHelp soll sie App zur Taskbar oder in die Symbolleiste minimiert werden? +Settings.MinimizeOnStart Minimiert starten +Settings.MinimizeOnStartHelp Soll die App als Fenster oder minimiert starten? +Store.ExperimentalBtnText Experimentell +Store.FilterLabel Suche +Store.Plugin.UpdateAvail Aktualisierung verfügbar +Store.Plugin.DisableBtnLabel Deaktivieren +Store.Plugin.InstallBtnLabel Installieren +Store.Plugin.InstalledBtnLabel Installiert +Store.Plugin.UninstallBtnLabel Deinstallieren +Store.Plugin.VersionsBtnLabel Versionen +Store.RefreshBtnText Plugin-Store Aktualisieren +Store.RestartAllBtnText Alle neustarten +Store.ShowStore Plugin-Store neustarten +Store.Experimental Experimentell anzeigen +Store.Updates Updates anschalten +Store.StoreButton Plugin-Store +Store.NotStoreButton Installiert +Store.ExperimentalButton Experimentell +Store.UpdatesButton Aktualisierungen +Store.Configure Konfigurieren +Store.Details Details +TrayMenu.ExitAppItem App schließen +TrayMenu.OpenUIItem App öffnen +TrayMenu.RestartAppItem App neustarten +TrayMenu.TechSupportItem Technischer Support +UI.AboutTabHeader Info +UI.AppName RGB Sync +UI.DeviceTabHeader Produkte +UI.ProfileTabHeader Profil +UI.SettingsTabHeader Einstellungen +UI.StoreTabHeader Treiber +About.OrigDev RGB Sync Ursprüngliche Entwicklung +About.20dev RGBSync Studio Entwicklumg +About.simpleleddev SimpleLED Projekt-Koordinator +About.Donations JackNet RGB Sync ist eine freie und Open-Source Software. Das Programm ist kostenlos, damit es für alle zugänglich ist. Spenden sind jedoch immer gerne gesehen, sie helfen uns bei der Entwicklung und dingen wie Web-Hosting. +Donate.Patreon MIT PATREON SPENDEN +Donate.PayPal MIT PAYPAL SPENDEN +About.Thanks Ein ganz besonderes Dankeschön an alle Unterstützer, Übersetzer und Spender die diese Software möglich machen. Eure Beiträge sind sehr Willkommen. +Devices.Info Info +Devices.SyncTo Synchronisieren zu +Devices.InfoDriver Treiber: +Devices.InfoName Name: +Devices.InfoAuthor Author: +Devices.InfoDriverVersion Treiber Version: +Devices.Multiple Mehrere Geräte +Devices.Selected ausgewählt +Devices.Config Konfiguration +Devices.Alignment Ausrichtung +Devices.NoConfig Dieses Produkt hat keine Konfiguration. +Devices.ZoomOut Heraus-zoomen +Devices.ZoomIn Herein-zoomen +Devices.Condensed Verkürzte Ansicht +Devices.IconView Symbol Ansicht +Devices.ShowSources Quellen anzeigen +Profile.TimeBasedTrigger Zeitabhängiger Trigger +Profile.TimeToTrigger Zeit wann der Trigger ausgelöst werden soll: +Profile.ProcessTrigger Auslöser für laufenden Prozess +Profile.ProcessName Name des zu überwachenden Prozesses: +Profile.ProcessInvert Bei Abwesenheit auslösen +Profile.TriggerDesc Auslöser für +Profile.SelectProfile Zu diesem Profil wechseln +Profile.EditProfile Profil editieren +Profile.Triggers Auslöser +Profile.RemoveProfile Profil entfernen +Profile.MomentaryTrigger momentaner Auslöser +Profile.Expand Erweitern +Profile.Collapse zuklappen +Generic.Off Aus +Generic.On An +Generic.Yes Ja +Generic.No Nein +Main.Devices Produkte +Main.Profiles Profile +Main.Store Treiber +Main.About Info +Main.CrashMe Absturz +Main.Settings Einstellungen +Settings.ApiServer API Server +Settings.ApiServerHelp Aktivieren Sie dies, um RGB Sync Studio REST API Server zu aktivieren +Settings.RefreshFreq Aktualisierungsfrequenz +Settings.RefreshFreqHelp Stellen sie ein wie oft pro Sekunde die LEDs aktualisiert werden +Settings.Language Sprache +Settings.Experimental Experimentelle Treiber +Settings.ExperimentalHelp Experimentelle Treiber im Store anzeigen +Fan Lüfter +LEDStrip LED Streifen +GPU GPU +MotherBoard MotherBoard +Keyboard Tastatur +Keypad Nummern-block +Mouse Maus +MousePad Mauspad +Headset Headset +HeadsetStand Headset Stand +PSU Netzteil +Cooler Kühler +Memory Arbeitsspeicher +Speaker Lautsprecher +Other Anderes +AIO All-in-One +WaterBlock Wasserblock +Effect Effekt + diff --git a/RGBSync+/Languages/ES-es.txt b/RGBSync+/Languages/ES-es.txt new file mode 100644 index 0000000..f05ea48 --- /dev/null +++ b/RGBSync+/Languages/ES-es.txt @@ -0,0 +1,166 @@ +ES-es +Español de España +Español de España +Crash.TitleText RGB Sync Studio ha dejado de funcionar. +Dialog.CopyCommand Copiar a Portapapeles +Dialog.No No +Dialog.NoPremiumTitle NoPremium +Dialog.NoUpdateText Estás usando la última versión de la app. +Dialog.NoUpdateTitle No hay actualizaciones disponibles +Dialog.OKCommand Vale +Dialog.UpdateText Hay una actualizacion nueva. Quieres actualizar? +Dialog.UpdateTitle Actualización Disponible +Dialog.Yes Sí +Settings.AppSettings Ajustes de Aplicación +Settings.LaunchBehaviour Ajustes de Inicio +Settings.AppStyling Apariencia +Settings.MinimizeBehaviour Ajustes Minimización +Settings.AdminLabel Ejecutar como administrador: +Settings.AdminText TextoDeAdmin +Settings.DelayLabel Inicio Atrasado: +Settings.DelayToolTip ConsejoInicioAtrasado +Settings.DelayUnit Segundos +Settings.DevicesLabel Dispositivos: +Settings.DiscordLabel Discord: +Settings.DiscordText TextoDeDiscord +Settings.DiscordToolTip ConsejoDeDiscord +Settings.LanguageLabel Idioma: +Settings.MinimizationLabel Habilitar Minimización: +Settings.MinimizationText TextoDeMinimización +Settings.PollingRateLabel Frecuencia de Actualización: +Settings.PollingRateToolTip ConsejoFrecuenciaDeActualización +Settings.PollingRateUnit UnidadFrecuenciaDeActualización +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel Tema: +Settings.UpdateBtnText Buscar Actualizaciones +Settings.UpdateLabel Actualizaciones: +Settings.VersionLabel Versión: +Settings.ApiServer Servidor API +Settings.ApiServerHelp Activar servidor RGB Sync Studio REST API +Settings.RefreshFreq Frequencia de Actualización +Settings.RefreshFreqHelp Ajusta la velocidad a la que se actualiza el RGB +Settings.Language Idioma +Settings.BackgroundPath Imagen de Fondo +Settings.BackgroundHelp Ruta de la Imagen +Settings.BackgroundOpacity Opacidad del Fondo +Settings.BackgroundOpacityHelp Ajusta la transparencia del Fondo +Settings.DimBackgroundOpacity Intensidad del Fondo +Settings.DimBackgroundOpacityHelp Ajusta el efecto Oscuro sobre el fondo +Settings.BackgroundBlur Difuminado del Fondo +Settings.BackgroundBlurHelp Ajustar la Cantidad del Difuminado sobre el Fondo +Settings.SyncableBG Fondo Sincronizable +Settings.SyncableBGHelp Activa el Fondo RGB Sincronizable +Settings.RainbowTab Marcadores de Pestaña Arcoíris +Settings.RainbowTabHelp Activa los marcadores arcoirís para las pestañas +Settings.StartAsAdmin Ejecutar como administrador +Settings.StartAsAdminHelp Puede ayudar con la compatibilidad +Settings.ReleaseType Tipo de cliente +Settings.ReleaseTypeHelp ¿Qué tipo de versión quieres? Release es estable, Beta no tanto y Cl es inestable +Settings.MinimizeToTray Minimización +Settings.MinimizeToTrayHelp ¿La app debe minimizar a la barra de tareas o al área de notificaciones? +Settings.MinimizeOnStart Minimizar al iniciar +Settings.MinimizeOnStartHelp ¿La app debe mostrarse al inciar, o minimizarse instantáneamente? +Settings.Experimental Drivers Experimentales +Settings.ExperimentalHelp Muestra los drivers experimentales en la tienda +Settings.SimpleLedAuth Autenticación de SimpleLed +Settings.SimpleLedAuthHelp Conectarse a los servidores de SimpleLed para desbloquear funcionalidades +Settings.SimpleLedLogin Iniciar Sesión +Settings.SimpleLedLogout Cerrar Sesión +Store.ExperimentalBtnText Experimental +Store.FilterLabel Buscar +Store.Plugin.DisableBtnLabel Deshabilitar +Store.Plugin.InstallBtnLabel Instalado +Store.Plugin.InstalledBtnLabel Instalado +Store.Plugin.UninstallBtnLabel Desinstalar +Store.Plugin.VersionsBtnLabel Versiones +Store.RefreshBtnText Actualizar Tienda +Store.RestartAllBtnText Reiniciar Todo +Store.NotStoreButton Instalado +Store.ShowStore Tienda +Store.StoreButton Tienda +Store.UpdatesButton Actualizaciones +Store.Updates Actualizaciones +TrayMenu.ExitAppItem Salir +TrayMenu.OpenUIItem Abrir +TrayMenu.RestartAppItem Reiniciar +TrayMenu.TechSupportItem Soporte Técnico +UI.AboutTabHeader Acerca de +UI.AppName RGB Sync +UI.DeviceTabHeader Dispositivos +UI.ProfileTabHeader Perfiles +UI.SettingsTabHeader Ajustes +UI.StoreTabHeader Dispositivos +About.OrigDev Desarrollo Original de RGB Sync +About.20dev Desarrollo de RGBSync Studio +About.simpleleddev Coordinador de Proyecto de SimpleLED +About.Donations JackNet RGB Sync es gratis y de código abierto. El programa es gratis para que todos puedan utilizarlo. Las donaciones son bienvenidas y ayudan como ejemplo, al hospedaje de los servidores. +Donate.Patreon DONAR VÍA PATREON +Donate.PayPal DONAR VÍA PAYPAL +About.Thanks Gracias a todos los Patrons, tradcutores y contribuidores a hacer este programa posible. Vuestras contribuciones son agradecidas. +Devices.Info Información +Devices.SyncTo Sincronizar a +Devices.Customize Personalizar +Devices.InfoDriver Controlador: +Devices.InfoName Nombre: +Devices.InfoAuthor Autor: +Devices.InfoDriverVersion Version de Controlador: +Devices.Multiple Varios Dispositivos +Devices.Selected Seleccionado(s) +Devices.Config Configuración +Devices.Alignment Alineamiento +Devices.NoConfig Este dispositivo no tiene configuración. +Devices.ZoomOut Alejar +Devices.ZoomIn Acercar +Devices.Condensed Compacto +Devices.ShowSources Mostrar efectos +Customize.Align Editar Alineamiento +Customize.AlignHint Usa estos controles para que tu dispositivo coincida con la imágenes +Customize.TitleOverride Cambiar Título +Customize.SubTitleOverride Cambiar SubTítulo +Customize.ChannelOverride Cambiar Nombre de Canal +Profile.Triggers Acciones +Profile.EditProfile Editar Perfil +Profile.SelectProfile Selccionar Perfil +Profile.RemoveProfile Eliminar Perfil +Profile.TimeBasedTrigger Acción Basada en Tiempo +Profile.TimeToTrigger Hora de la Acción: +Profile.ProcessTrigger Acción Basada en Proceso +Profile.ProcessName Nombre del proceso: +Profile.ProcessInvert Acción Basada en Ausencia +Profile.TriggerDesc Acciones por +Profile.MomentaryTrigger Acción Instantánea +Profile.Expand Expandir +Profile.Collapse Colapsar +ColorProfile.AddProfile Crear Perfil +ColorProfile.DeleteProfile Eliminar Perfil +Generic.Off Apagado +Generic.On Encendido +Generic.Yes Sí +Generic.No No +Main.Devices Dispositivos +Main.Profiles Perfiles de Sincronización +Main.palettes Perfiles de Color +Main.Store Tienda +Main.About Acerca de +Main.Crash Fallo! +Main.news Novedades +Main.crashme Crasheame +Main.Settings Ajustes +Fan Ventilador +LEDStrip Tira LED +GPU GPU +MotherBoard Placa Base +Keyboard Teclado +Keypad Teclado Numérico +Mouse Ratón +MousePad Alfombrilla +Headset Auriculares +HeadsetStand Soporte de Auriculares +PSU PSU +Cooler Disipador +Memory Memoria +Speaker Altavoz +Other Otro +AIO AIO +WaterBlock Bloque de Agua +Effect Efecto \ No newline at end of file diff --git a/RGBSync+/Languages/FR-fr.txt b/RGBSync+/Languages/FR-fr.txt new file mode 100644 index 0000000..d01429e --- /dev/null +++ b/RGBSync+/Languages/FR-fr.txt @@ -0,0 +1,141 @@ +FR-FR +Français +Français +Crash.TitleText RGB Sync Studio est tombé en panne. +Dialog.CopyCommand Copier dans le presse-papier +Dialog.No Non +Dialog.NoPremiumTitle Pas de titre premium +Dialog.NoUpdateText Vous utilisez actuellement la dernière version de l'application. +Dialog.NoUpdateTitle Pas de mise a jour disponible +Dialog.OKCommand D'accord +Dialog.UpdateText Une mise à jour de RGB Sync est disponible. Voulez-vous mettre à jour? +Dialog.UpdateTitle Mise à jour disponible +Dialog.Yes Oui +Settings.AdminLabel Exécuter en tant qu'administrateur: +Settings.AdminText Texte de l'administrateur +Settings.DelayLabel Délai de démarrage: +Settings.DelayToolTip Info-bulle sur les délais +Settings.DelayUnit Seconds +Settings.DevicesLabel Dispositifs: +Settings.DiscordLabel Discorde: +Settings.DiscordText Texte de Discorde +Settings.DiscordToolTip Info-bulle Discord +Settings.LanguageLabel Langue: +Settings.MinimizationLabel Activer la minimisation: +Settings.MinimizationText Texte de minimisation +Settings.PollingRateLabel Taux d'interrogation: +Settings.PollingRateToolTip Info-bulle relative au taux d'interrogation +Settings.PollingRateUnit Unité de taux d'interrogation +Settings.ThemeApplyBtnText Réglages. Thème Appliquer le texte btn +Settings.ThemeLabel Thème: +Settings.UpdateBtnText Vérifier les mises à jour +Settings.UpdateLabel Mises à jour: +Settings.VersionLabel Version: +Settings.StartAsAdmin Commencer en tant qu'administrateur +Settings.StartAsAdminHelp Peut augmenter la compatibilité +Settings.ReleaseType Type de version +Settings.ReleaseTypeHelp Quelle version voulez-vous? La version est stable, la version bêta moins, le CI est instable +Settings.MinimizeToTray Réduire dans le bac +Settings.MinimizeToTrayHelp L'application doit-elle être réduite à la barre d'outils ou à la barre d'état système? +Settings.MinimizeOnStart Réduire au démarrage +Settings.MinimizeOnStartHelp L'application doit-elle afficher sa fenêtre au démarrage ou la réduire instantanément? +Store.ExperimentalBtnTexte expérimental +Store.FilterLabel Chercher +Store.Plugin.UpdateAvail Mise à jour disponible +Store.Plugin.DisableBtnLabel Désactiver +Store.Plugin.InstallBtnLabel Installé +Store.Plugin.InstalledBtnLabel Installé +Store.Plugin.UninstallBtnLabel Désinstaller +Store.Plugin.VersionsBtnLabel Versions +Store.RefreshBtnText Actualiser le magasin +Store.RestartAllBtnText Tout redémarrer +Store.ShowStore Afficher le magasin +Store.Experimental Toggle Expérimental +Store.Updates Toggle Mises à jour +Store.StoreButton Magasin +Store.NotStoreButton Installé +Store.ExperimentalButton Expérimental +Store.UpdatesButton Mises à jour +Store.Configure Configurer +Store.Details Détails +TrayMenu.ExitAppItem Quitter l'application +TrayMenu.OpenUIItem Ouvrir application +TrayMenu.RestartAppItem Redémarrez l'application +TrayMenu.TechSupportItem Support technique +UI.AboutTabHeader About +UI.AppName RGB Sync +UI.DeviceTabHeader Dispositifs +UI.ProfileTabHeader Profil +UI.SettingsTabHeader Réglages +UI.StoreTabHeader Devices +About.OrigDev Développement original de RGB Sync +About.20dev Développement RGB Sync Studio +About.simpleleddev Coordinateur de projet SimpleLED +About.Donations JackNet RGB Sync est une œuvre de logiciel libre et open-source. Le programme est gratuit afin d'être accessible à tous. Cependant, les dons sont toujours appréciés et aident à payer des choses comme l'hébergement Web. +Donate.Patreon faire un don via Patreon +Donate.PayPal faire un don via Paypal +About.Thanks Un merci spécial à tous les mécènes, traducteurs et contributeurs qui ont contribué à rendre ce logiciel possible. Vos contributions sont grandement appréciées. +Devices.Info Info +Devices.SyncTo Synchroniser avec +Devices.InfoDriver Conducteur: +Devices.InfoName Nom: +Devices.InfoAuthor Auteur: +Devices.InfoDriverVersion Conducteur Version: +Devices.Multiple Plusieurs appareils +Devices.Selected choisi +Devices.Config Config +Devices.Alignment Alignement +Devices.NoConfig Cet appareil n'a pas de configuration. +Devices.ZoomOut Dézoomer +Devices.ZoomIn Agrandir +Devices.Condensed vue condensée +Devices.IconView vue des icônes +Devices.ShowSources Afficher les sources +Profile.TimeBasedTrigger Déclencheur basé sur le temps +Profile.TimeToTrigger Heure à laquelle déclencher: +Profile.ProcessTrigger Déclencheur de processus en cours +Profile.ProcessName Nom du processus à surveiller: +Profile.ProcessInvert Déclenchement en cas d'absence +Profile.TriggerDesc Déclencheurs pour +Profile.SelectProfile Passer à ce profil +Profile.EditProfile Editer le Profil +Profile.Triggers Déclencheurs +Profile.RemoveProfile Supprimer le profil +Profile.MomentaryTrigger Déclenchement momentané +Profile.Expand accroître +Profile.Collapse Effondrer +Generic.Off De +Generic.On Sur +Generic.Yes Oui +Generic.No Non +Main.Devices Dispositifs +Main.Profiles Profils +Main.Store Conducteurs +Main.About À propos +Main.CrashMe Fracas +Main.Settings Réglages +Settings.ApiServer API Serveur +Settings.ApiServerHelp Activez cette option pour activer le serveur API REST RGB Sync Studio +Settings.RefreshFreq Fréquence de rafraîchissement +Settings.RefreshFreqHelp Ajuster le nombre de minuteries par seconde RGB est mis à jour +Settings.Language Langue +Settings.Experimental Conducteur expérimentaux +Settings.ExperimentalHelp Afficher les conducteur expérimentaux dans le magasin +Fan Ventilateur +LEDStrip Bande LED +GPU GPU +MotherBoard Carte mère +Keyboard Clavier +Keypad Clavier +Mouse Souris +MousePad Tapis de souris +Headset Casque +HeadsetStand Support de casque +PSU PSU +Cooler Refroidisseur +Memory Mémoire +Speaker haut-parleurs +Other Autre +AIO AIO +WaterBlock Bloc d'eau +Effect Effet diff --git a/RGBSync+/Languages/LanguageModel.cs b/RGBSync+/Languages/LanguageModel.cs new file mode 100644 index 0000000..324ca45 --- /dev/null +++ b/RGBSync+/Languages/LanguageModel.cs @@ -0,0 +1,213 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using SyncStudio.ClientService; + +namespace SyncStudio.WPF.Languages +{ + public class LanguageModel + { + public string Code { get; set; } + public string EnglishName { get; set; } + public string NativeName { get; set; } + public string Emoji { get; set; } + public List Items { get; set; } + + public class LanguageItem + { + public string Key { get; set; } + public string Value { get; set; } + } + + public LanguageModel(string path) + { + string contents = File.ReadAllText(path); + List lines = contents.Split('\r').Select(x => x.Trim()).ToList(); + + this.Code = lines[0]; + this.EnglishName = lines[2]; + this.NativeName = lines[1]; + //this.Emoji = lines[3]; + + this.Items = new List(); + foreach (string s in lines.Skip(3)) + { + string[] parts = s.Replace(" ", "\t").Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries); + + if (parts.Length == 1 && parts[0].Contains(" ")) + { + parts = new string[2]; + + parts[0] = s.Substring(0, s.IndexOf(" ")).Trim(); + parts[1] = s.Substring(s.IndexOf(" ")).Trim(); + } + + if (parts.Length > 1) + { + this.Items.Add(new LanguageItem + { + Key = parts[0], + Value = parts[1] + }); + } + else + { + Debug.WriteLine(parts); + } + } + } + } + + public static class LanguageManager + { + private static ClientService.Settings settings = new Settings(); + public static List Languages { get; set; } = new List(); + static LanguageManager() + { + try + { + IEnumerable files = Directory.EnumerateFiles("Languages"); + + foreach (string file in files) + { + try + { + Languages.Add(new LanguageModel(file)); + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + } + } + } + catch + { + } + } + + public static string GetValue(string key, string lang) + { + try + { + LanguageModel l = Languages.FirstOrDefault(x => x.Code.ToUpper() == lang.ToUpper()); + if (l == null) + { + l = Languages.FirstOrDefault(x => x.Code.ToUpper().StartsWith(lang.ToUpper().Split('-').First())); + } + + //if (l == null) + //{ + // string fn = "C:\\Projects\\JackNet\\bin\\Languages\\" + lang + ".txt"; + + // if (File.Exists(fn)) + // { + + // l = new LanguageModel(fn); + // Languages.Add(l); + // dbg = dbg + "\r\nLoaded"; + // } + //} + + if (l == null) + { + return "[" + lang + ":" + key + "]"; + } + + //Debug.WriteLine("Looking for " + key + " in " + l?.Code); + string r = l.Items.FirstOrDefault(x => x.Key.ToLower() == key.ToLower())?.Value; + if (string.IsNullOrWhiteSpace(r)) + { + r = "[" + lang + ":" + key + "]"; + Debug.WriteLine("couldnt find " + r); + } + + return r; + } + catch + { + } + + return lang + ":::" + key; + } + + public static string GetValue(string key) + { + if (key == null) + { + return null; + } + + string dbg = ""; + try + { + string lang = string.Empty;// "EN-US"; + + if (ServiceManager.Instance.ApplicationManager != null) + { + if (settings?.Lang != null) + { + lang = settings.Lang; + } + } + + if (string.IsNullOrWhiteSpace(lang)) + { + lang = System.Globalization.CultureInfo.CurrentCulture.Name; + + if (settings != null) + { + + settings.Lang = lang; + } + } + + LanguageModel l = Languages.FirstOrDefault(x => x.Code.ToUpper() == lang.ToUpper()); + if (l == null) + { + l = Languages.FirstOrDefault(x => x.Code.ToUpper().StartsWith(lang.ToUpper().Split('-').First())); + } + + if (l == null) + { + dbg = dbg + " lang null, loading..."; + //Have to hardcode path for design time :( + string fn = "C:\\Projects\\JackNet\\bin\\Languages\\" + lang + ".txt"; + + //return fn; + + dbg = dbg + "\r\nloading " + fn; + + + if (File.Exists(fn)) + { + + l = new LanguageModel(fn); + Languages.Add(l); + dbg = dbg + "\r\nLoaded"; + } + } + + if (l == null) + { + return "[" + lang + ":" + key + "]"; + } + + //Debug.WriteLine("Looking for " + key + " in " + l?.Code); + string r = l.Items.FirstOrDefault(x => x.Key.ToLower() == key.ToLower())?.Value; + if (string.IsNullOrWhiteSpace(r)) + { + r = "[" + lang + ":" + key + "]"; + Debug.WriteLine("couldnt find " + r); + } + + return r; + } + catch (Exception e) + { + return e.Message; + } + } + } +} diff --git a/RGBSync+/Languages/NL-nl.txt b/RGBSync+/Languages/NL-nl.txt new file mode 100644 index 0000000..0f03fe9 --- /dev/null +++ b/RGBSync+/Languages/NL-nl.txt @@ -0,0 +1,174 @@ +NL-NL +Dutch +Nederlands +Crash.TitleText RGB Sync Studio is gecrashed. +Dialog.CopyCommand Kopieer naar klembord +Dialog.No Nee +Dialog.NoPremiumTitle GeenPremiumTitel +Dialog.NoUpdateText U gebruikt op dit moment de nieuwste versie van de app. +Dialog.NoUpdateTitle Geen update beschikbaar. +Dialog.OKCommand OK +Dialog.UpdateText Er is een update voor RGB Sync beschikbaar. Wilt u deze installeren? +Dialog.UpdateTitle Update Beschikbaar. +Dialog.Yes Ja +Settings.AdminLabel Openen met administratierechten: +Settings.AdminText AdminTekst +Settings.DelayLabel Opstart vertraging: +Settings.DelayToolTip opstartvertragingtip +Settings.DelayUnit Seconden +Settings.DevicesLabel Apparaten: +Settings.DiscordLabel Discord: +Settings.DiscordText DiscordTekst +Settings.DiscordToolTip DiscordtoolTip +Settings.LanguageLabel Taal: +Settings.MinimizationLabel Minimalisatie mogelijk maken: +Settings.MinimizationText Minimalisatietekst +Settings.PollingRateLabel Ververs frequentie: +Settings.PollingRateToolTip Verversfrequentietip +Settings.PollingRateUnit ververfrequentieeenheid +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel Thema: +Settings.UpdateBtnText Check voor Update +Settings.UpdateLabel Updates: +Settings.VersionLabel Versie: +Settings.StartAsAdmin Start Als Admin +Settings.StartAsAdminHelp Kan de compatibiliteit vergroten +Settings.ReleaseType Uitgave versie +Settings.ReleaseTypeHelp Welke uitgave versie zou U willen? Release is stabiel, Beta verminderd, CI is instabiel +Settings.MinimizeToTray Minimaliseer naar systeemvak +Settings.MinimizeToTrayHelp Minimaliseer naar start-balk of systeemvak? +Settings.MinimizeOnStart Minimaliseer na opstarten +Settings.MinimizeOnStartHelp Applicatievenster vertonen met windows start, of direct minimaliseren? +Settings.BackgroundPath Achtergrond +Settings.BackgroundHelp Pad naar achtergrond te grebruiken +Settings.BackgroundOpacity Achtergrond doorzichtigheid +Settings.BackgroundOpacityHelp Past de doorzichtigheid van de achtergrond aan +Settings.DimBackgroundOpacity Achtergrond Dimmer +Settings.DimBackgroundOpacityHelp Past de doorzichtigheid van de applicatie achtergrond aan +Settings.BackgroundBlur Achtergrond vervagen +Settings.BackgroundBlurHelp Hoeveelheid achtergrond vervagen +Settings.SyncableBG Synchroniseerbare achtergrond +Settings.SyncableBGHelp Activeer achtergrond kleuren controlerend apparaat. +Settings.RainbowTab Regenboog Tabblad indicatoren +Settings.RainbowTabHelp zouden alle tabblad indicatoren in linker paneel alle kleuren moeten zijn. +Settings.AppSettings App instellingen +Settings.LaunchBehaviour Opstart gedrag +Settings.MinimizeBehaviour Minimaliseer gedrag +Settings.AppStyling Applicatie Stijl +Settings.AccentColor Accent Kleur +Settings.AccentColorHelp Accent kleur overschijven. +Settings.SimpleLedAuth SimpleLED Authenticatie +Settings.SimpleLedAuthHelp Verbind met de SimpleLED authenticatie servers om de volledige functionaliteit beschikbaar te maken. +Settings.SimpleLedLogin Inloggen +Settings.SimpleLedLogout Uitloggenm +Store.ExperimentalBtnText Experimenteel +Store.FilterLabel Zoek +Store.Plugin.UpdateAvail Update Beschikbaar +Store.Plugin.DisableBtnLabel Uitschakellen +Store.Plugin.InstallBtnLabel Geinstalleerd +Store.Plugin.InstalledBtnLabel Geinstalleerd +Store.Plugin.UninstallBtnLabel De-installeren +Store.Plugin.VersionsBtnLabel Versies +Store.RefreshBtnText Ververs Winkel +Store.RestartAllBtnText Herstart Alle +Store.ShowStore Vertoon Winkel +Store.Experimental Experimenteel +Store.Updates Updates +Store.StoreButton Winkel +Store.NotStoreButton Geisntalleerd +Store.ExperimentalButton Experimenteel +Store.UpdatesButton Updates +Store.Configure Configureren +Store.Details Details +TrayMenu.ExitAppItem App sluiten +TrayMenu.OpenUIItem App openen +TrayMenu.RestartAppItem Herstart App +TrayMenu.TechSupportItem Tech Ondersteuning +ColorProfile.AddProfile Profiel toevoegen +ColorProfile.DeleteProfile Profiel verwijderen +UI.AboutTabHeader Over ons +UI.AppName RGB Sync +UI.DeviceTabHeader Apparaten +UI.ProfileTabHeader Profielen +UI.SettingsTabHeader Instellingen +UI.StoreTabHeader Apparaten +About.OrigDev RGB Sync Origineel Ontwikkelling +About.20dev RGBSync Studio Ontwikkelling +About.simpleleddev SimpleLED Project Coordinator +About.Donations RGB Sync Studio is een ontwikkeld als gratis en open-source software. Het programma is gratis zodat het beschikbaar kan zijn voor iedereen. Desondanks worden donaties zeer welkom om te betalen voor dingen zoals de web-hosting. +Donate.Patreon DONEER VIA PATREON +Donate.PayPal DONEER VIA PAYPAL +About.Thanks Speciale dank gaat uit naar alle Patreons, vertalers, en donateurs die deze software mede mogelijk hebben gemaakt. Jullie contributie is erg gewaardeerd. +Devices.Info Info +Devices.SyncTo Sync naar +Devices.InfoDriver Driver: +Devices.InfoName Naam: +Devices.InfoAuthor Auteur: +Devices.InfoDriverVersion Driver Versie: +Devices.Multiple Meerdere Apparaten +Devices.Selected geselecteerd +Devices.Config Config +Devices.Customize Aanpassen +Devices.Alignment Uitlijning +Devices.NoConfig Dit apparaat heeft geen configuratie. +Devices.ZoomOut Zoom Uit +Devices.ZoomIn Zoom In +Devices.Condensed Gecondenseerd +Devices.IconView Iconen +Devices.ShowSources Bronnen +Customize.Align Uitlijning aanpassen +Customize.AlignHint Gebruik de bediening hieronder om het apparaat en de plaatjes overeen te laten komen +Customize.TitleOverride Overschrijf Titel +Customize.SubTitleOverride Overschrijf SubTitel +Customize.ChannelOverride Overschrijf Kanaal tekst +Profile.TimeBasedTrigger Tijd basis activatie +Profile.TimeToTrigger Tijd tot activatie: +Profile.ProcessTrigger Actieve Applciatie activatie +Profile.ProcessName Naam van Applicatie: +Profile.ProcessInvert Activatie op afwezigheid +Profile.TriggerDesc Activeert op +Profile.SelectProfile Schakel naar dit profiel +Profile.EditProfile Profiel aanpassen +Profile.Triggers Activatie +Profile.RemoveProfile Profiel verwijderen +Profile.MomentaryTrigger Tijdelijke activatie +Profile.Expand uitvouwen +Profile.Collapse invouwen +Generic.Off Uit +Generic.On Aan +Generic.Yes Ja +Generic.No Nee +Main.Devices Apparaten +Main.Profiles Profielen +Main.Palettes Paletten +Main.Store Drivers +Main.About Over Ons +Main.CrashMe Crash +Main.Settings Instellingen +Main.News Nieuws +Settings.ApiServer API Server +Settings.ApiServerHelp Schakel dit in om RGB Sync Studio REST API Server in te schakellen +Settings.RefreshFreq Ververs Frequency +Settings.RefreshFreqHelp Past het aantal keer per seconde dat de RGB wordt geupdate +Settings.Language Taal +Settings.Experimental Experimentele Drivers +Settings.ExperimentalHelp Vertoon experimentele drivers in de winkel +Fan Ventilator +LEDStrip LED Strip +GPU GPU +MotherBoard MoederBord +Keyboard Toetsenbordbord +Keypad Keypad +Mouse Muis +MousePad Muis Mat +Headset Headset +HeadsetStand Headset Standaard +PSU PSU +Cooler Koeler +Memory Geheugen +Speaker Speaker +Other Anders +AIO AIO +WaterBlock Water Blok +Effect Effect + diff --git a/RGBSync+/Languages/en-gb.txt b/RGBSync+/Languages/en-gb.txt new file mode 100644 index 0000000..7e68eb0 --- /dev/null +++ b/RGBSync+/Languages/en-gb.txt @@ -0,0 +1,142 @@ +EN-GB +English (Original) +English (Original) +Crash.TitleText RGB Sync Studio has crashed. +Dialog.CopyCommand Copy to Clipboard +Dialog.No No +Dialog.NoPremiumTitle NoPremiumTitle +Dialog.NoUpdateText You are currently using the latest version of the app. +Dialog.NoUpdateTitle No Update Available +Dialog.OKCommand OK +Dialog.UpdateText An update to RGB Sync is available. Would you like to update? +Dialog.UpdateTitle Update Available +Dialog.Yes Yes +Settings.AdminLabel Run as Admin: +Settings.AdminText AdminText +Settings.DelayLabel Startup Delay: +Settings.DelayToolTip DelayToolTip +Settings.DelayUnit Seconds +Settings.DevicesLabel Devices: +Settings.DiscordLabel Discord: +Settings.DiscordText DiscordText +Settings.DiscordToolTip DiscordToolTip +Settings.LanguageLabel Language: +Settings.MinimizationLabel Enable Minimization: +Settings.MinimizationText MinimizationText +Settings.PollingRateLabel Polling Rate: +Settings.PollingRateToolTip PollingRateTooltip +Settings.PollingRateUnit PollingRateUnit +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel Theme: +Settings.UpdateBtnText Check for Update +Settings.UpdateLabel Updates: +Settings.VersionLabel Version: +Settings.StartAsAdmin Start As Admin +Settings.StartAsAdminHelp Can increase compatability +Settings.ReleaseType Release Type +Settings.ReleaseTypeHelp Which release do you want? Release is stable, Beta less so, CI is unstable +Settings.MinimizeToTray Minimize To Tray +Settings.MinimizeToTrayHelp Should the app minimize to toolbar or the system tray? +Settings.MinimizeOnStart Minimize On Start +Settings.MinimizeOnStartHelp Should the app show its window on start, or instantly minimize? +Store.ExperimentalBtnText Experimental +Store.FilterLabel Search +Store.Plugin.UpdateAvail Update Available +Store.Plugin.DisableBtnLabel Disable +Store.Plugin.InstallBtnLabel Installed +Store.Plugin.InstalledBtnLabel Installed +Store.Plugin.UninstallBtnLabel Uninstall +Store.Plugin.VersionsBtnLabel Versions +Store.RefreshBtnText Refresh Store +Store.RestartAllBtnText Restart All +Store.ShowStore Show Store +Store.Experimental Toggle Experimental +Store.Updates Toggle Updates +Store.StoreButton Store +Store.NotStoreButton Installed +Store.ExperimentalButton Experimental +Store.UpdatesButton Updates +Store.Configure Configure +Store.Details Details +TrayMenu.ExitAppItem Exit App +TrayMenu.OpenUIItem Open App +TrayMenu.RestartAppItem Restart App +TrayMenu.TechSupportItem Tech Support +UI.AboutTabHeader About +UI.AppName RGB Sync +UI.DeviceTabHeader Devices +UI.ProfileTabHeader Profile +UI.SettingsTabHeader Settings +UI.StoreTabHeader Devices +About.OrigDev RGB Sync Original Development +About.20dev RGBSync Studio Development +About.simpleleddev SimpleLED Project Coordinator +About.Donations JackNet RGB Sync is a work of free and open-source software. The program is free so that it can be available to all. However, donations are still appreciated and help pay for things like web-hosting. +Donate.Patreon DONATE VIA PATREON +Donate.PayPal DONATE VIA PAYPAL +About.Thanks A special thank you to all patrons, translators, and contributors who helped make this software possible. Your contributions are greatly appreciated. +Devices.Info Info +Devices.SyncTo Sync To +Devices.InfoDriver Driver: +Devices.InfoName Name: +Devices.InfoAuthor Author: +Devices.InfoDriverVersion Driver Version: +Devices.Multiple Multiple devices +Devices.Selected selected +Devices.Config Config +Devices.Alignment Alignment +Devices.NoConfig This device has no configuration. +Devices.ZoomOut Zoom Out +Devices.ZoomIn Zoom In +Devices.Condensed Condensed View +Devices.IconView Icon View +Devices.ShowSources Show Sources +Profile.TimeBasedTrigger Time Based Trigger +Profile.TimeToTrigger Time at which to trigger: +Profile.ProcessTrigger Running Process Trigger +Profile.ProcessName Name of process to watch for: +Profile.ProcessInvert Trigger on absence +Profile.TriggerDesc Triggers for +Profile.SelectProfile Switch to this profile +Profile.EditProfile Edit Profile +Profile.Triggers Triggers +Profile.RemoveProfile Remove Profile +Profile.MomentaryTrigger Momentary Trigger +Profile.Expand Expande +Profile.Collapse Collapse +Generic.Off Off +Generic.On On +Generic.Yes Yes +Generic.No No +Main.Devices Devices +Main.Profiles Profiles +Main.Store Drivers +Main.About About +Main.CrashMe Crash +Main.Settings Settings +Settings.ApiServer API Server +Settings.ApiServerHelp Enable this to enable RGB Sync Studio REST API Server +Settings.RefreshFreq Refresh Frequency +Settings.RefreshFreqHelp Adjust the number of timers per second RGB is updated +Settings.Language Language +Settings.Experimental Experimental Drivers +Settings.ExperimentalHelp Show experimental drivers in the store +Fan Fan +LEDStrip LED Strip +GPU GPU +MotherBoard MotherBoard +Keyboard Keyboard +Keypad Keypad +Mouse Mouse +MousePad Mouse Pad +Headset Headset +HeadsetStand Headset Stand +PSU PSU +Cooler Cooler +Memory Memory +Speaker Speaker +Other Other +AIO AIO +WaterBlock Water Block +Effect Effect + diff --git a/RGBSync+/Languages/en-us.txt b/RGBSync+/Languages/en-us.txt new file mode 100644 index 0000000..4c6bc78 --- /dev/null +++ b/RGBSync+/Languages/en-us.txt @@ -0,0 +1,181 @@ +en-US +English (American) +English (American) +Crash.TitleText RGB Sync Studio has crashed. +Dialog.CopyCommand Copy to Clipboard +Dialog.No No +Dialog.NoPremiumTitle NoPremiumTitle +Dialog.NoUpdateText You are currently using the latest version of the app. +Dialog.NoUpdateTitle No Update Available +Dialog.OKCommand OK +Dialog.UpdateText An update to RGB Sync is available. Would you like to update? +Dialog.UpdateTitle Update Available +Dialog.Yes Yes +Settings.AdminLabel Run as Admin: +Settings.AdminText AdminText +Settings.DelayLabel Startup Delay: +Settings.DelayToolTip DelayToolTip +Settings.DelayUnit Seconds +Settings.DevicesLabel Devices: +Settings.Discord Enable Discord integration +Settings.DiscordHelp Should the app change your Discord status to show others that you are using it? +Settings.LanguageLabel Language: +Settings.MinimizationLabel Enable Minimization: +Settings.MinimizationText MinimizationText +Settings.PollingRateLabel Polling Rate: +Settings.PollingRateToolTip PollingRateTooltip +Settings.PollingRateUnit PollingRateUnit +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel Theme: +Settings.UpdateBtnText Check for Update +Settings.UpdateLabel Updates: +Settings.VersionLabel Version: +Settings.StartAsAdmin Start As Admin +Settings.StartAsAdminHelp Can increase compatability +Settings.ReleaseType Release Type +Settings.ReleaseTypeHelp Which release do you want? Release is stable, Beta less so, CI is unstable +Settings.MinimizeToTray Minimize To Tray +Settings.MinimizeToTrayHelp Should the app minimize to toolbar or the system tray? +Settings.MinimizeOnStart Minimize On Start +Settings.MinimizeOnStartHelp Should the app show its window on start, or instantly minimize? +Settings.BackgroundPath Background Image +Settings.BackgroundHelp Path to a background image to use +Settings.BackgroundOpacity Background Opacity +Settings.BackgroundOpacityHelp Adjusts the transparency of the background image +Settings.DimBackgroundOpacity Background Dimmer +Settings.DimBackgroundOpacityHelp Adjusts the Darkening effect on background +Settings.BackgroundBlur Background Blur +Settings.BackgroundBlurHelp Amount to blur the chosen background image +Settings.SyncableBG Syncable Background +Settings.SyncableBGHelp Enable a device controlling background colors. +Settings.RainbowTab Rainbow Tab Markers +Settings.RainbowTabHelp Should the tab markers in the left panel be all the colors. +Settings.AppSettings App Settings +Settings.LaunchBehaviour Launch Behaviour +Settings.MinimizeBehaviour Minimize Behaviour +Settings.AppStyling App Styling +Settings.AccentColor Accent Color +Settings.AccentColorHelp Override the app accent color. +Settings.SimpleLedAuth SimpleLED Authentication +Settings.SimpleLedAuthHelp Connect to the SimpleLED authentication servers to unlock functionality +Settings.SimpleLedLogin Log In +Settings.SimpleLedLogout Log Out +Store.ExperimentalBtnText Experimental +Store.FilterLabel Search +Store.Plugin.UpdateAvail Update Available +Store.Plugin.DisableBtnLabel Disable +Store.Plugin.InstallBtnLabel Installed +Store.Plugin.InstalledBtnLabel Installed +Store.Plugin.UninstallBtnLabel Uninstall +Store.Plugin.VersionsBtnLabel Versions +Store.RefreshBtnText Refresh Store +Store.RestartAllBtnText Restart All +Store.ShowStore Show Store +Store.Experimental Toggle Experimental +Store.Updates Toggle Updates +Store.StoreButton Store +Store.NotStoreButton Installed +Store.ExperimentalButton Experimental +Store.UpdatesButton Updates +Store.Configure Configure +Store.Details Details +TrayMenu.ExitAppItem Exit App +TrayMenu.OpenUIItem Open App +TrayMenu.RestartAppItem Restart App +TrayMenu.TechSupportItem Tech Support +ColorProfile.AddProfile Add Profile +ColorProfile.DeleteProfile Delete Profile +UI.AboutTabHeader About +UI.AppName RGB Sync +UI.DeviceTabHeader Devices +UI.ProfileTabHeader Sync Profiles +UI.Main.palettes Color Profiles +UI.SettingsTabHeader Settings +UI.StoreTabHeader Devices +About.OrigDev RGB Sync Original Development +About.20dev RGBSync Studio Development +About.simpleleddev SimpleLED Project Coordinator +About.Donations RGB Sync Studio is a work of free and open-source software. The program is free so that it can be available to all. However, donations are still appreciated and help pay for things like web-hosting. +Donate.Patreon DONATE VIA PATREON +Donate.PayPal DONATE VIA PAYPAL +About.Thanks A special thank you to all patrons, translators, and contributors who helped make this software possible. Your contributions are greatly appreciated. +Devices.Info Info +Devices.SyncTo Sync To +Devices.InfoDriver Driver: +Devices.InfoName Name: +Devices.InfoAuthor Author: +Devices.InfoDriverVersion Driver Version: +Devices.Multiple Multiple devices +Devices.Selected selected +Devices.Config Config +Devices.Customize Customize +Devices.Alignment Alignment +Devices.NoConfig This device has no configuration. +Devices.ZoomOut Zoom Out +Devices.ZoomIn Zoom In +Devices.Condensed Condensed View +Devices.IconView Icon View +Devices.ShowSources Show Sources +Customize.Align Edit Alignment +Customize.AlignHint Use the controls below to make your device match the images +Customize.TitleOverride Override Title +Customize.SubTitleOverride Override SubTitle +Customize.ChannelOverride Override Channel text +Customize.LEDCount LED Count +Customize.Template Template +Customize.Image Product Image +Customize.Mapper Mapper +Customize.GridWidth 2D Width +Customize.GridHeight 2D Height +Customize.RGBOrder RGB Order +Profile.TimeBasedTrigger Time Based Trigger +Profile.TimeToTrigger Time at which to trigger: +Profile.ProcessTrigger Running Process Trigger +Profile.ProcessName Name of process to watch for: +Profile.ProcessInvert Trigger on absence +Profile.TriggerDesc Triggers for +Profile.SelectProfile Switch to this profile +Profile.EditProfile Edit Profile +Profile.Triggers Triggers +Profile.RemoveProfile Remove Profile +Profile.MomentaryTrigger Momentary Trigger +Profile.Expand Expande +Profile.Collapse Collapse +Generic.Off Off +Generic.On On +Generic.Yes Yes +Generic.No No +Main.Devices Devices +Main.Profiles Profiles +Main.Palettes Palettes +Main.Store Drivers +Main.About About +Main.CrashMe Crash +Main.Settings Settings +Main.News News +Settings.ApiServer API Server +Settings.ApiServerHelp Enable this to enable RGB Sync Studio REST API Server +Settings.RefreshFreq Refresh Frequency +Settings.RefreshFreqHelp Adjust the number of timers per second RGB is updated +Settings.Language Language +Settings.Experimental Experimental Drivers +Settings.ExperimentalHelp Show experimental drivers in the store +Fan Fan +LEDStrip LED Strip +GPU GPU +MotherBoard MotherBoard +Keyboard Keyboard +Keypad Keypad +Mouse Mouse +MousePad Mouse Pad +Headset Headset +HeadsetStand Headset Stand +PSU PSU +Cooler Cooler +Memory Memory +Speaker Speaker +Other Other +AIO AIO +WaterBlock Water Block +Effect Effect + diff --git a/RGBSync+/Languages/ja-JP_Auto.txt b/RGBSync+/Languages/ja-JP_Auto.txt new file mode 100644 index 0000000..4e9f58e --- /dev/null +++ b/RGBSync+/Languages/ja-JP_Auto.txt @@ -0,0 +1,59 @@ +ja-JP +日本語 +Japanese +Crash.TitleText RGB同期Studioがクラッシュしました。 +Dialog.CopyCommand クリップボードにコピー +Dialog.No 番号 +Dialog.NoPremiumTitle NoPremiumTitle +Dialog.NoUpdateText 現在、アプリの最新バージョンを使用しています。 +Dialog.NoUpdateTitle 利用可能なアップデートがありません +Dialog.OKCommand OK +Dialog.UpdateText RGB同期の更新が可能です。アップデートをしますか? +Dialog.UpdateTitle 利用可能な更新 +Dialog.Yes はい +Settings.AdminLabel 管理者として実行します。 +Settings.AdminText AdminText +Settings.DelayLabel スタートアップ遅延: +Settings.DelayToolTip DelayToolTip +Settings.DelayUnit 秒 +Settings.DevicesLabel デバイス: +Settings.DiscordLabel 不和: +Settings.DiscordText DiscordText +Settings.DiscordToolTip DiscordToolTip +Settings.LanguageLabel 言語: +Settings.MinimizationLabel 最小化を有効にします: +Settings.MinimizationText MinimizationText +Settings.PollingRateLabel ポーリングレート: +Settings.PollingRateToolTip PollingRateTooltip +Settings.PollingRateUnit PollingRateUnit +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel テーマ: +Settings.UpdateBtnText 更新を確認 +Settings.UpdateLabel アップデート: +Settings.VersionLabel バージョン: +Store.ExperimentalBtnText 実験的 +Store.FilterLabel 探す +Store.Plugin.DisableBtnLabel 無効化 +Store.Plugin.InstallBtnLabel インストール済み +Store.Plugin.InstalledBtnLabel インストール済み +Store.Plugin.UninstallBtnLabel アンインストール +Store.Plugin.VersionsBtnLabel バージョン +Store.RefreshBtnText リフレッシュストア +Store.RestartAllBtnText 再起動してすべての +TrayMenu.ExitAppItem 出口のApp +TrayMenu.OpenUIItem オープンアプリの +TrayMenu.RestartAppItem 再起動のApp +TrayMenu.TechSupportItem 技術サポート +UI.AboutTabHeader 約 +UI.AppName RGB同期 +UI.DeviceTabHeader デバイス +UI.ProfileTabHeader プロフィール +UI.SettingsTabHeader 設定 +UI.StoreTabHeader デバイス +About.OrigDev RGB同期オリジナル開発 +About.20dev RGBSync Studioの開発 +About.simpleleddev SimpleLEDプロジェクトコーディネーター +About.Donations JackNet RGB同期は無料で、オープンソースソフトウェアの仕事です。それはすべてに利用できるようにすることができるようにプログラムは無料です。しかし、寄付金はまだWebホスティングのようなもののために感謝し、助けを支払うされています。 +Donate.Patreon VIA PATREONを寄付 +Donate.PayPal VIA PAYPALを寄付 +About.Thanks 特別には、このソフトウェアが可能にさせてくれたすべての常連客、翻訳者、寄稿者にお願いします。あなたの貢献は大歓迎されています。 diff --git a/RGBSync+/Languages/zh-CN_Auto.txt b/RGBSync+/Languages/zh-CN_Auto.txt new file mode 100644 index 0000000..6827480 --- /dev/null +++ b/RGBSync+/Languages/zh-CN_Auto.txt @@ -0,0 +1,129 @@ +ZH-CN +中文 +Chinese +Crash.TitleText RGB同步工作室已经坠毁。 +Dialog.CopyCommand 复制到剪贴板 +Dialog.No 没有 +Dialog.NoPremiumTitle NoPremiumTitle +Dialog.NoUpdateText 目前您正在使用最新版本的应用程序。 +Dialog.NoUpdateTitle 没有可用的更新 +Dialog.OKCommand 好 +Dialog.UpdateText 到RGB同步有可用的更新。你想更新吗? +Dialog.UpdateTitle 有可用更新 +Dialog.Yes 是 +Settings.AdminLabel 以管理员身份运行: +Settings.AdminText AdminText +Settings.DelayLabel 启动延迟: +Settings.DelayToolTip DelayToolTip +Settings.DelayUnit 秒 +Settings.DevicesLabel 设备: +Settings.DiscordLabel 不和谐: +Settings.DiscordText DiscordText +Settings.DiscordToolTip DiscordToolTip +Settings.LanguageLabel 语言: +Settings.MinimizationLabel 启用最小化: +Settings.MinimizationText MinimizationText +Settings.PollingRateLabel 投票率: +Settings.PollingRateToolTip PollingRateTooltip +Settings.PollingRateUnit PollingRateUnit +Settings.ThemeApplyBtnText Settings.ThemeApplyBtnText +Settings.ThemeLabel 主题: +Settings.UpdateBtnText 检查更新 +Settings.UpdateLabel 更新: +Settings.VersionLabel 版: +Settings.StartAsAdmin 开始作为管理员 +Settings.StartAsAdminHelp 可以增加兼容性 +Settings.ReleaseType 发行类型 +Settings.ReleaseTypeHelp 你想要哪个版本?版本是稳定的,Beta版少所以,CI是不稳定的 +Settings.MinimizeToTray 最小化到托盘 +Settings.MinimizeToTrayHelp 如果该应用最小化工具栏或系统托盘? +Settings.MinimizeOnStart 尽量减少启动 +Settings.MinimizeOnStartHelp 如果该应用显示出其在启动窗口,或瞬间最小化? +Store.ExperimentalBtnText 试验 +Store.FilterLabel 搜索 +Store.Plugin.DisableBtnLabel 禁用 +Store.Plugin.InstallBtnLabel 安装 +Store.Plugin.InstalledBtnLabel 安装 +Store.Plugin.UninstallBtnLabel 卸载 +Store.Plugin.VersionsBtnLabel 版本 +Store.RefreshBtnText 刷新商店 +Store.RestartAllBtnText 重新启动所有 +Store.ShowStore 展店 +Store.Experimental 切换实验 +Store.Updates 切换更新 +TrayMenu.ExitAppItem 退出应用程序 +TrayMenu.OpenUIItem 打开应用 +TrayMenu.RestartAppItem 重新启动应用程序 +TrayMenu.TechSupportItem 技术支持 +UI.AboutTabHeader 关于 +UI.AppName RGB同步 +UI.DeviceTabHeader 设备 +UI.ProfileTabHeader 简介 +UI.SettingsTabHeader 设置 +UI.StoreTabHeader 设备 +About.OrigDev RGB同步原始开发 +About.20dev RGBSync Studio开发 +About.simpleleddev 了simpleLED项目协调员 +About.Donations JackNet RGB同步是自由和开放源码软件的工作。该计划是免费的,所以它可以提供给所有。然而,捐赠仍然赞赏和喜欢的事情Web托管帮助支付。 +Donate.Patreon 捐款VIA PATREON +Donate.PayPal 捐款通过Paypal +About.Thanks 特别感谢所有的赞助人,翻译,和贡献者谁帮助使这个软件成为可能。您的贡献是极大的赞赏。 +Devices.Info 信息 +Devices.SyncTo 同步到 +Devices.InfoDriver 司机: +Devices.InfoName 名称: +Devices.InfoAuthor 作者: +Devices.InfoDriverVersion 驱动程序版本: +Devices.Multiple 多个设备 +Devices.Selected 选 +Devices.Config 配置 +Devices.Alignment 对准 +Devices.NoConfig 该装置具有任何配置。 +Devices.ZoomOut 缩小 +Devices.ZoomIn 放大 +Devices.Condensed 简要信息 +Devices.IconView 图标视图 +Devices.ShowSources 展会资源 +Profile.TimeBasedTrigger 基于时间的触发 +Profile.TimeToTrigger 时间要触发: +Profile.ProcessTrigger 正在运行的进程触发 +Profile.ProcessName 过程监视的名称: +Profile.ProcessInvert 触发缺席 +Profile.TriggerDesc 对于触发器 +Profile.SelectProfile 切换到这个配置文件 +Profile.EditProfile 编辑个人资料 +Profile.Triggers 触发器 +Profile.RemoveProfile 删除档案 +Generic.Off 离 +Generic.On 上 +Generic.Yes 是 +Generic.No 没有 +Main.Devices 设备 +Main.Profiles 简介 +Main.Store 驱动程序 +Main.About 关于 +Main.CrashMe 紧急 +Main.Settings 设置 +Settings.ApiServer API服务器 +Settings.ApiServerHelp 启用此支持RGB同步工作室REST API服务器 +Settings.RefreshFreq 刷新频率 +Settings.RefreshFreqHelp 调整定时器的数目每秒RGB被更新 +Settings.Language 语言 +Fan 风扇 +LEDStrip 灯带 +GPU GPU +MotherBoard 母板 +Keyboard 键盘 +Keypad 键盘 +Mouse 老鼠 +MousePad 鼠标垫 +Headset 耳机 +HeadsetStand 耳机支架 +PSU PSU +Cooler 散热器 +Memory 记忆 +Speaker 扬声器 +Other 其他 +AIO AIO +WaterBlock 水冷头 +Effect 影响 diff --git a/RGBSync+/Libs/SLSInterface.dll b/RGBSync+/Libs/SLSInterface.dll new file mode 100644 index 0000000..20fa184 Binary files /dev/null and b/RGBSync+/Libs/SLSInterface.dll differ diff --git a/RGBSync+/Model/SyncGroup.cs b/RGBSync+/Model/SyncGroup.cs deleted file mode 100644 index 827772d..0000000 --- a/RGBSync+/Model/SyncGroup.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using Newtonsoft.Json; -using RGB.NET.Core; -using RGB.NET.Groups; - -namespace RGBSyncPlus.Model -{ - public class SyncGroup : AbstractBindable - { - #region Properties & Fields - - public string DisplayName => string.IsNullOrWhiteSpace(Name) ? "(unnamed)" : Name; - - private string _name; - public string Name - { - get => _name; - set - { - if (SetProperty(ref _name, value)) - OnPropertyChanged(nameof(DisplayName)); - } - } - - private SyncLed _syncLed; - public SyncLed SyncLed - { - get => _syncLed; - set => SetProperty(ref _syncLed, value); - } - - private ObservableCollection _leds = new ObservableCollection(); - public ObservableCollection Leds - { - get => _leds; - set => SetProperty(ref _leds, value); - } - - [JsonIgnore] - public ListLedGroup LedGroup { get; set; } - - [JsonIgnore] - public NotifyCollectionChangedEventHandler LedsChangedEventHandler { get; set; } - - #endregion - } -} diff --git a/RGBSync+/Model/SyncLed.cs b/RGBSync+/Model/SyncLed.cs deleted file mode 100644 index fdd5dee..0000000 --- a/RGBSync+/Model/SyncLed.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Newtonsoft.Json; -using RGB.NET.Core; -using RGBSyncPlus.Helper; - -namespace RGBSyncPlus.Model -{ - public class SyncLed : AbstractBindable - { - #region Properties & Fields - - private string _device; - public string Device - { - get => _device; - set => SetProperty(ref _device, value); - } - - private LedId _ledId; - public LedId LedId - { - get => _ledId; - set => SetProperty(ref _ledId, value); - } - - private Led _led; - [JsonIgnore] - public Led Led - { - get => _led; - set => SetProperty(ref _led, value); - } - - #endregion - - #region Constructors - - public SyncLed() - { } - - public SyncLed(string device, LedId ledId) - { - this.Device = device; - this.LedId = ledId; - } - - public SyncLed(Led led) - { - this.Device = led.Device.GetDeviceName(); - this.LedId = led.Id; - this.Led = led; - } - - #endregion - - #region Methods - - protected bool Equals(SyncLed other) => string.Equals(_device, other._device) && (_ledId == other._ledId); - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != this.GetType()) return false; - return Equals((SyncLed)obj); - } - - public override int GetHashCode() - { - unchecked - { - return ((_device != null ? _device.GetHashCode() : 0) * 397) ^ (int)_ledId; - } - } - - public static bool operator ==(SyncLed left, SyncLed right) => Equals(left, right); - public static bool operator !=(SyncLed left, SyncLed right) => !Equals(left, right); - - #endregion - } -} diff --git a/RGBSync+/ProgramIcon.ico b/RGBSync+/ProgramIcon.ico new file mode 100644 index 0000000..b1388a7 Binary files /dev/null and b/RGBSync+/ProgramIcon.ico differ diff --git a/RGBSync+/Properties/AssemblyInfo.cs b/RGBSync+/Properties/AssemblyInfo.cs index a28480c..af02707 100644 --- a/RGBSync+/Properties/AssemblyInfo.cs +++ b/RGBSync+/Properties/AssemblyInfo.cs @@ -1,18 +1,16 @@ using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("JackNet RGB SYNC")] -[assembly: AssemblyDescription("The one-stop utlility for syncing your RGB perhipherals and components. Compatible with Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming, and Cooler Master Masterplus.")] +[assembly: AssemblyTitle("Sync Studio")] +[assembly: AssemblyDescription("The one-stop utility for syncing your RGB perhipherals and components. Compatible with Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming, and Cooler Master Masterplus.")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("JackNet Systems")] -[assembly: AssemblyProduct("JackNet RGB SYNC")] -[assembly: AssemblyCopyright("Copyright © 2020 JackNet Systems")] +[assembly: AssemblyCompany("Sync Studio Team")] +[assembly: AssemblyProduct("Sync Studio")] +[assembly: AssemblyCopyright("Copyright © 2020 Sync Studio Team")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.7.7.*")] -[assembly: AssemblyFileVersion("1.7.7.*")] \ No newline at end of file +[assembly: AssemblyVersion("2.0.0.*")] +[assembly: AssemblyFileVersion("2.0.0.*")] \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.Designer.cs b/RGBSync+/Properties/Resources.Designer.cs deleted file mode 100644 index b379442..0000000 --- a/RGBSync+/Properties/Resources.Designer.cs +++ /dev/null @@ -1,747 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace RGBSyncPlus.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RGBSyncPlus.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to . - /// - public static string _ { - get { - return ResourceManager.GetString(".", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to . - /// - public static string __ { - get { - return ResourceManager.GetString("..", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The one-stop utlility for syncing your RGB perhipherals and components. Compatible with Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming, EVGA Precision X1, and Cooler Master Masterplus.. - /// - public static string AboutDescription { - get { - return ResourceManager.GetString("AboutDescription", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to JackNet RGB Sync v1.7 by Fanman03. - /// - public static string AboutTitle { - get { - return ResourceManager.GetString("AboutTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Yes. - /// - public static string AffirmativeCommand { - get { - return ResourceManager.GetString("AffirmativeCommand", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Apply. - /// - public static string ApplyLabel { - get { - return ResourceManager.GetString("ApplyLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Available LEDs. - /// - public static string AvaliableLEDsLabel { - get { - return ResourceManager.GetString("AvaliableLEDsLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Check for Update. - /// - public static string CheckUpdateCommand { - get { - return ResourceManager.GetString("CheckUpdateCommand", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Client. - /// - public static string ClientHeading { - get { - return ResourceManager.GetString("ClientHeading", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Copy to Clipboard. - /// - public static string ClipboardCommand { - get { - return ResourceManager.GetString("ClipboardCommand", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Startup delay:. - /// - public static string DelayLabel { - get { - return ResourceManager.GetString("DelayLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Defines how long to wait, if at all, before the program starts.. - /// - public static string DelayTooltip { - get { - return ResourceManager.GetString("DelayTooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Seconds. - /// - public static string DelayUnit { - get { - return ResourceManager.GetString("DelayUnit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Devices:. - /// - public static string DevicesLabel { - get { - return ResourceManager.GetString("DevicesLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Discord RPC:. - /// - public static string DiscordLabel { - get { - return ResourceManager.GetString("DiscordLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enable Discord Rich Presence. - /// - public static string DiscordText { - get { - return ResourceManager.GetString("DiscordText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Displays that you are using JackNet RGB Sync as well as the name of the active profile on your Discord profile.. - /// - public static string DiscordTooltip { - get { - return ResourceManager.GetString("DiscordTooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enable Client. - /// - public static string EnableClientLabel { - get { - return ResourceManager.GetString("EnableClientLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enable Server. - /// - public static string EnableServerLabel { - get { - return ResourceManager.GetString("EnableServerLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to EVGA support written by emulamer. - /// - public static string EVGANotice { - get { - return ResourceManager.GetString("EVGANotice", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exclude Devices. - /// - public static string ExcludeBtn { - get { - return ResourceManager.GetString("ExcludeBtn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Exit. - /// - public static string ExitItem { - get { - return ResourceManager.GetString("ExitItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Export Groups. - /// - public static string ExportButton { - get { - return ResourceManager.GetString("ExportButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This feature requires Premium. Would you like to go to the webpage where you can purchase Premium?. - /// - public static string FeatureNotAvailable { - get { - return ResourceManager.GetString("FeatureNotAvailable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Name:. - /// - public static string GroupNameLabel { - get { - return ResourceManager.GetString("GroupNameLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Import Groups. - /// - public static string ImportButton { - get { - return ResourceManager.GetString("ImportButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Installed. - /// - public static string InstalledLabel { - get { - return ResourceManager.GetString("InstalledLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Join my Discord server. - /// - public static string JoinDiscordButton { - get { - return ResourceManager.GetString("JoinDiscordButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Language:. - /// - public static string LanguageLabel { - get { - return ResourceManager.GetString("LanguageLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to View Opensource Licenses. - /// - public static string LicenseButton { - get { - return ResourceManager.GetString("LicenseButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Manage Plugins. - /// - public static string ManagePluginsBtn { - get { - return ResourceManager.GetString("ManagePluginsBtn", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Control LED:. - /// - public static string MasterLEDLabel { - get { - return ResourceManager.GetString("MasterLEDLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Minimization:. - /// - public static string MinimizationLabel { - get { - return ResourceManager.GetString("MinimizationLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Enable Minimization. - /// - public static string MinimizationText { - get { - return ResourceManager.GetString("MinimizationText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MSI support written by Hex3l.. - /// - public static string MSINotice { - get { - return ResourceManager.GetString("MSINotice", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No. - /// - public static string NegativeCommand { - get { - return ResourceManager.GetString("NegativeCommand", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to New LED Group. - /// - public static string NewGroupButton { - get { - return ResourceManager.GetString("NewGroupButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No LED group selected .... - /// - public static string NoGroupSelected { - get { - return ResourceManager.GetString("NoGroupSelected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Not Installed. - /// - public static string NotInstalledLabel { - get { - return ResourceManager.GetString("NotInstalledLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No update found. You are currently using the latest version of the application.. - /// - public static string NoUpdateText { - get { - return ResourceManager.GetString("NoUpdateText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No Update Available. - /// - public static string NoUpdateTitle { - get { - return ResourceManager.GetString("NoUpdateTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OK. - /// - public static string OKCommand { - get { - return ResourceManager.GetString("OKCommand", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Open UI. - /// - public static string OpenUIItem { - get { - return ResourceManager.GetString("OpenUIItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to LED Groups. - /// - public static string Page1Header { - get { - return ResourceManager.GetString("Page1Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Settings. - /// - public static string Page2Header { - get { - return ResourceManager.GetString("Page2Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Network. - /// - public static string Page3Header { - get { - return ResourceManager.GetString("Page3Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to About. - /// - public static string Page4Header { - get { - return ResourceManager.GetString("Page4Header", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Pick File. - /// - public static string PickFileLabel { - get { - return ResourceManager.GetString("PickFileLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Polling Rate:. - /// - public static string PollingRateLabel { - get { - return ResourceManager.GetString("PollingRateLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Defines how fast the data is updated. Low value reduce CPU usage but might cause stuttering.. - /// - public static string PollingRateTooltip { - get { - return ResourceManager.GetString("PollingRateTooltip", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Updates per Second. - /// - public static string PollingRateUnit { - get { - return ResourceManager.GetString("PollingRateUnit", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Get Premium. - /// - public static string PremiumCTAButton { - get { - return ResourceManager.GetString("PremiumCTAButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Feature not Available. - /// - public static string PremiumFeatureTitle { - get { - return ResourceManager.GetString("PremiumFeatureTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Premium:. - /// - public static string PremiumLabel { - get { - return ResourceManager.GetString("PremiumLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Profile Name:. - /// - public static string ProfileNameLabel { - get { - return ResourceManager.GetString("ProfileNameLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Remove LED Group?. - /// - public static string RemoveHeader { - get { - return ResourceManager.GetString("RemoveHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Are you sure that you want to delete the group. - /// - public static string RemovePrompt { - get { - return ResourceManager.GetString("RemovePrompt", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Restart App. - /// - public static string RestartAppItem { - get { - return ResourceManager.GetString("RestartAppItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to JackNet RGB Sync is powered by RGB.NET by Darth Affe. - /// - public static string RGBNetNotice { - get { - return ResourceManager.GetString("RGBNetNotice", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run as Admin. - /// - public static string RunasAdmin { - get { - return ResourceManager.GetString("RunasAdmin", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Run as Admin:. - /// - public static string RunasAdminLabel { - get { - return ResourceManager.GetString("RunasAdminLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Server. - /// - public static string ServerHeading { - get { - return ResourceManager.GetString("ServerHeading", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Server IP:. - /// - public static string ServerIPLabel { - get { - return ResourceManager.GetString("ServerIPLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Server Port:. - /// - public static string ServerPortLabel { - get { - return ResourceManager.GetString("ServerPortLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start Client. - /// - public static string StartClientButton { - get { - return ResourceManager.GetString("StartClientButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start Server. - /// - public static string StartServerButton { - get { - return ResourceManager.GetString("StartServerButton", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Synchronized LEDs. - /// - public static string SyncedLEDsLabel { - get { - return ResourceManager.GetString("SyncedLEDsLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Having an issue or need help setting up this program?. - /// - public static string TechSupportCTA { - get { - return ResourceManager.GetString("TechSupportCTA", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Tech Support. - /// - public static string TechSupportItem { - get { - return ResourceManager.GetString("TechSupportItem", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Theme:. - /// - public static string ThemeLabel { - get { - return ResourceManager.GetString("ThemeLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to JackNet RGB Sync - Configuration. - /// - public static string Title { - get { - return ResourceManager.GetString("Title", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Translations provided by:. - /// - public static string TranslationsLabel { - get { - return ResourceManager.GetString("TranslationsLabel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An update to JackNet RGB Sync is available. Would you like to update?. - /// - public static string UpdateAvaiableText { - get { - return ResourceManager.GetString("UpdateAvaiableText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Update:. - /// - public static string UpdateText { - get { - return ResourceManager.GetString("UpdateText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Update Available!. - /// - public static string UpdateTitle { - get { - return ResourceManager.GetString("UpdateTitle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Version:. - /// - public static string VersionLabel { - get { - return ResourceManager.GetString("VersionLabel", resourceCulture); - } - } - } -} diff --git a/RGBSync+/Properties/Resources.de.resx b/RGBSync+/Properties/Resources.de.resx deleted file mode 100644 index 51f22fa..0000000 --- a/RGBSync+/Properties/Resources.de.resx +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - Ein Programm für das Steuern von verschiedenen RGB Komponenten. Es ist kompatibel mit Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming und Cooler Master MasterPlus. - - - JackNet RGB Sync v1.7 von Fanman03 - - - Ja - - - Anwenden - - - Verfügbare LEDs - - - Auf Updates prüfen - - - Client - - - Startup Verzögerung: - - - Sagt an wie lang das Programm warten soll, bevor es startet. - - - Sekunden - - - Geräte: - - - Discord RPC: - - - Discord Rich Presence aktivieren - - - Zeigt an, dass du JackNet RGB Sync benutzt mit deinem aktiv laufendem Profil. - - - Client aktivieren - - - Server aktivieren - - - EVGA wird Dank emulamer unterstützt. - - - Geräte ausblenden - - - Beenden - - - Gruppen exportieren - - - Dies ist ein Premium Feature. Möchten sie zu der Website, wo man Premium kaufen kann? - - - Name: - - - Gruppen importieren - - - Installiert - - - Joint meinen Discord Server - - - Sprache: - - - Opensource Lizenzen ansehen - - - Plugins verwalten - - - Haupt-LED: - - - Minimieren - - - Minimieren aktivieren - - - Nein - - - Neue LED Gruppe - - - Keine LED Gruppe ausgewählt ... - - - Nicht Installiert - - - Keine Aktualisierungen gefunden. Sie benutzten bereits die neuste Version der Software. - - - Keine Aktualisierungen verfügbar - - - Okay - - - Interface öffnen - - - LED Gruppen - - - Einstellungen - - - Netzwerk - - - Über - - - Datei Auswählen - - - Aktualisierungsrate: - - - Sagt an, wie schnell sich die Daten aktualisieren sollen. Niedrigere Werte können CPU Leistung verbessern, jedoch könnte es bei den Effekten etwas laggen. - - - Aktualisierungen pro Sekunde - - - Premium Bekommen - - - Funktion nicht verfügbar - - - Premium: - - - Profilname: - - - LED Gruppe entfernen? - - - Sind sie sicher, dass Sie die Gruppe entfernen wollen - - - App Neustarten - - - JackNetRGB Sync v1.7 wird mit Hilfe von RGB.NET von Darth Affe betrieben. - - - Als Admin starten - - - Als Admin starten: - - - Server - - - Server IP: - - - Server Port: - - - Client starten - - - Server starten - - - Synchronisierte LEDs - - - Schwierigkeiten mit dem Programm? - - - Tech Support - - - Thema: - - - JackNet RGB Sync - Konfiguration - - - Übersetzungen zur Verfügung gestellt von: - - - Eine Aktualisierung für JackNet RGB Sync ist verfügbar. Möchten sie diese herunterladen? - - - Aktualisierung - - - Aktualisierung verfügbar! - - - Version: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.es.resx b/RGBSync+/Properties/Resources.es.resx deleted file mode 100644 index adaec6f..0000000 --- a/RGBSync+/Properties/Resources.es.resx +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - La utilidad para sincronizar sus periféricos y componentes RGB. Compatible con Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming y Cooler Master Masterplus. - - - JackNet RGB Sync v1.7 hecho por Fanman03 - - - Si - - - Aplicar - - - LEDs Disponibles - - - Buscar Actualizaciones - - - Cliente - - - Inicio Automático: - - - Define cuanto tiempo esperar hasta iniciar el programa. - - - Segundos - - - Dispositivos: - - - Discord RPC: - - - Habilitar Discord Rich Presense - - - Muestra que estas usando JackNet RGB Sync y el perfil activo en tu perfil de Discord. - - - Habilitar Cliente - - - Habilitar Servidor - - - Soporte para EVGA escrito por emulamer - - - Excluir Dispositivos - - - Salir - - - Exportar Grupos - - - Esta función requiere Premium. Te gustaria ir a la pagina Web donde puedes comprar Premium? - - - Nombre: - - - Importar Grupos - - - Instalado - - - Únete a mi servidor de Discord - - - Idioma: - - - Ver Licencias de Código Abierto - - - Administrar Plugins - - - LED Principal: - - - Minimización: - - - Habilitar Minimización - - - Soporte para MSI escrito por Hex3l - - - No - - - Grupo de LED Nuevo - - - Grupo de LED No Seleccionado ... - - - No Instalado - - - No hay actualizaciones disponibles. Estas usando la ultima versión. - - - No hay Actualizaciones Disponibles - - - ¡Vale! - - - Mostrar Interfaz - - - Grupos de LED - - - Configuración - - - Red - - - Acerca de - - - Seleccionar Archivo - - - Frecuencia de Actualización: - - - Define como de rápido es actualizada la información. Valores mas bajos reducirán el uso de CPU pero pueden causar tirones. - - - Actualizaciones por Segundo - - - Hazte premium - - - Función no Disponible - - - Premium: - - - Nombre de Perfil: - - - ¿Eliminar Grupo de LED? - - - ¿Estás seguro de que quieres eliminar este grupo - - - Reiniciar App - - - JackNet RGB Sync funciona con RGB.NET hecho por Darth Affe - - - Ejecutar como Admin - - - Ejecutar como Admin: - - - Servidor - - - IP de Servidor: - - - Puerto de Servidor: - - - Iniciar Cliente - - - Iniciar Servidor - - - LEDs Sincronizados - - - ¿Tienes algún problema o necesitas ayuda? - - - Soporte Técnico - - - Tema: - - - JackNet RGB Sync - Configuración - - - Traducciones proporcionadas por: - - - Hay una nueva actualización disponible. ¿Te gustaría actualizar? - - - Actualización: - - - Actualización Disponible! - - - Versión: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.fr.resx b/RGBSync+/Properties/Resources.fr.resx deleted file mode 100644 index fa3386c..0000000 --- a/RGBSync+/Properties/Resources.fr.resx +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - L'utilitaire unique pour synchroniser vos périphériques et composants RGB. Compatible avec Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming et Cooler Master Masterplus. - - - JackNet RGB Sync v1.7 de Fanman03 - - - Oui - - - Appliquer - - - LEDs disponibles - - - Vérifier les mises à jour - - - Client - - - Délai de démarrage: - - - Définit le temps - - - Secondes - - - Périphériques: - - - Discord RPC: - - - Activer Discord Rich Presence - - - Affiche que vous utilisez JackNet RGB Sync ainsi que le nom du profil actif sur votre profil Discord. - - - Activer Client - - - Activer Serveur - - - Support EVGA écrit par emulamer - - - Quitter - - - Exporter Groupes - - - Cette fonctionnalité requiert Premium. Voulez-vous aller sur la page Web où vous pouvez acheter Premium? - - - Nom: - - - Importer Groupes - - - Installé - - - Joindre mon serveur Discord - - - Langue: - - - Voir les licenses Opensource - - - LED Principal: - - - Minimiser: - - - Activer minimisation - - - Non - - - Nouveau Groupe LED - - - Pas de groupe LED sélectionné ... - - - Pas Installé - - - Aucune mise à jour trouvée. Vous utilisez actuellement la dernière version de l'application. - - - Pas de mise à jour disponible - - - OK - - - Ouvrir UI - - - Groupes LED - - - Paramètres - - - Réseau - - - À propos - - - Choisir un fichier - - - Fréquence d'actualisation: - - - Définit la vitesse de mise à jour des données. Une valeur faible réduit l'utilisation du CPU mais peut provoquer des latences. - - - Actualisation par seconde - - - Fonctionnalité non disponible - - - Premium: - - - Premium - - - Nom de profil: - - - Supprimer le groupe LED? - - - Voulez-vous vraiment supprimer le groupe - - - Redémarrer l'application - - - JackNet RGB Sync propulsé par RGB.NET créé par Darth Affe - - - Serveur - - - IP du Serveur: - - - Port du serveur: - - - Démarrer le client - - - Démarrer le serveur - - - - - - Obtenez Premium - - - LEDs synchronisées - - - Avez-vous des problèmes ou besoin d'aide pour configurer ce programme? - - - Support Technique - - - Thème: - - - JackNet RGB Sync - Configuration - - - Traductions fournies par: - - - Une mise à jour de JackNet RGB Sync est disponible. Voulez-vous installer la mise à jour? - - - Mises à jour: - - - Mise à jour disponible! - - - Version: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.it.resx b/RGBSync+/Properties/Resources.it.resx deleted file mode 100644 index 9a01ce9..0000000 --- a/RGBSync+/Properties/Resources.it.resx +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - - - - Un unica utility per sincronizzare le tue periferiche e componenti RGB. Compatibile con Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming, e Cooler Master Masterplus. - - - JackNetRGB Sync v1.7 creato da Fanman03 - - - - - - Applicare - - - LEDs Disponibili - - - Verifica Aggiornamenti - - - Client - - - Ritardo avvio: - - - Specifica quanto aspettare, prima il caricamento del programma. - - - Secondi - - - Dispositivi: - - - Discord RPC: - - - Abilita Discord Rich Presence - - - Indica che stai utilizzando JackNet RGB Sync e il nome del profilo attivo sul tuo profilo Discord. - - - Abilita Client - - - Abilita Server - - - Supporto per EVGA scrito da emulamer - - - Esci - - - Esporta Gruppi - - - Questa funzionalità richiede il Premium. Desideri essere reindirizzato al sito per acquistare il Premium? - - - Nome: - - - Importa Gruppi - - - Installato - - - Entra sul mio server Discord - - - Language: - - - Visualizza Licenze Opensource - - - LED Principale: - - - Minimizza: - - - Abilita Minimizza - - - No - - - Nuovo Gruppo LED - - - Nessun Gruppo LED selezionato ... - - - Non Installato - - - No update found. You are currently using the latest version of the application. - - - No Update Available - - - OK - - - Apri Interfaccia - - - Gruppi LED - - - Impostazioni - - - Rete - - - Informazioni - - - Scegli File - - - Polling Rate: - - - Definisce la velocità di aggiornamento dei dati. Un valore più basso riduce l'uso della CPU, ma potrebbe causare stuttering. - - - Aggiornamenti per Secondo - - - Ottieni Premium - - - Funzione non Disponibile - - - Premium: - - - Nome del profilo: - - - Desideri eliminare questo Gruppo LED? - - - Sei sicuro di volere eliminare questo Gruppo LEDs - - - Riavvia - - - JackNet RGB Sync è stato creato utilizzando RGB.NET ed è stato creato da Darth Affe - - - Server - - - Server IP: - - - Porta Server: - - - Avvia Client - - - Avvia Server - - - Sincronizza LEDs - - - Hai riscontrato un problema o desideri essere aiutato per capire meglio questo programma? - - - Supporto Tecnico - - - Tema: - - - JackNet RGB Sync - Configurazione - - - Traduzione fornita da: - - - E' disponibile un nuovo aggiornamento per JackNet RGB Sync. Vuoi effettuare l'aggiornamento adesso? - - - Aggiornamento: - - - Aggiornamento Disponibile! - - - Versione: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.km.resx b/RGBSync+/Properties/Resources.km.resx deleted file mode 100644 index 9102149..0000000 --- a/RGBSync+/Properties/Resources.km.resx +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ឧបករណ៍ប្រើប្រាស់មួយកន្លែងសម្រាប់ធ្វើសមកាលកម្មគ្រឿងបន្លាស់និងគ្រឿងបន្លាស់ RGB របស់អ្នក។ ឆបគ្នាជាមួយ Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming និងម៉ាស្ទ័រម៉ាស្ទ័រត្រជាក់។ - - - JackNet RGB សមកាលកម្ម v1.7 ដោយហ្វានមេន ០៣ - - - ត្រូវហើយ - - - អំពូល LED ដែលមាន - - - អតិថិជន - - - ការពន្យាពេលចាប់ផ្តើម៖ - - - កំណត់ថាតើត្រូវរង់ចាំរយៈពេលប៉ុន្មានប្រសិនបើកម្មវិធីទាំងអស់ចាប់ផ្តើម។ - - - Seconds - - - Devices: - - - Discord RPC: - - - Enable Discord Rich Presense - - - Displays that you are using JackNet RGB Sync as well as the name of the active profile on your Discord profile. - - - Enable Client - - - Enable Server - - - EVGA support written by emulamer - - - Exit - - - Export Groups - - - This feature requires Premium. Would you like to go to the webpage where you can purchase Premium? - - - Name: - - - Import Groups - - - Join my Discord server - - - Language: - - - View Opensource Licenses - - - Master LED: - - - Minimization: - - - Enable Minimization - - - No - - - New LED Group - - - No LED group selected ... - - - Open UI - - - LED Groups - - - Settings - - - Network - - - About - - - Polling Rate: - - - Defines how fast the data is updated. Low value reduce CPU usage but might cause stuttering. - - - Updates per Second - - - Feature not Available - - - Premium: - - - Profile Name: - - - Remove LED Group? - - - Are you sure that you want to delete the group - - - Restart App - - - JackNet RGB Sync is powered by RGB.NET by Darth Affe - - - Server - - - Server IP: - - - Server Port: - - - Start Client - - - Start Server - - - Synchronized LEDs - - - Having an issue or need help setting up this program? - - - Tech Support - - - JackNet RGB Sync - Configuration - - - Translations provided by: - - - Version: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.nl.resx b/RGBSync+/Properties/Resources.nl.resx deleted file mode 100644 index 63ed060..0000000 --- a/RGBSync+/Properties/Resources.nl.resx +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Het one-stop hulpprogramma voor het synchroniseren van je RGB-randapparatuur en onderdelen. Werkt met CORSAIR iCue, ASUS Aura, Razer Synapse, Logitech Gaming en Cooler Master Masterplus. - - - JackNet RGBSync v1.7 door Fanman03 - - - Ja - - - Van toepassing zijn - - - Beschikbare LEDs - - - Cliënt - - - Opstartvertraging: - - - Defines how long to wait, if at all, before the program starts. - - - Seconden - - - Apparaten: - - - Discord RPC: - - - Zet Discord Rich Presense aan - - - Laat op je Discord profiel zien dat je JackNet RGB Sync gebruikt, en welk profiel geselecteerd is. - - - Cliënt activeren - - - Server activeren - - - EVGA ondersteuning mogelijk gemaakt door emulamer. - - - Beëindigen - - - Groepen exporteren - - - Deze functie vereist Premium. Wilt u naar de webpagina waar u Premium kan kopen? - - - Naam: - - - Groepen importeren - - - Geïnstalleerd - - - Join mijn Discord server: - - - Taal: - - - Bekijk Opensource licenties - - - Meester-LED: - - - Minimalisering - - - Zet minimalisering aan - - - Nee - - - Nieuwe LED-groep - - - Geen LED-groep geselecteerd ... - - - Niet Geïnstalleerd - - - UI openen - - - LED-groepen - - - Instellingen - - - Netwerk - - - Over - - - Kies Bestand - - - Ververssnelheid: - - - Definieert hoe snel de data wordt ge-update. Een lage waard vermindert CPU gebruik, maar kan voor stotteren zorgen. - - - Aantal verversen per seconde - - - Ontvang Premium - - - Functie niet beschikbaar - - - Premium: - - - Profielnaam: - - - LED-groep verwijderen? - - - Weet u zeker dat u de LED-groep wil verwijderen? - - - Programma herstarten - - - JackNet RGB Sync wordt mogelijk gemaakt door RGB.NET van Darth Affe. - - - Server - - - Server IP: - - - Server Poort: - - - Cliënt starten - - - Start Server - - - Gesynchroniseerde LEDs - - - Heeft u een probleem, of heeft u hulp nodig bij het gebruik van het programma? - - - Ondersteuning - - - Thema: - - - JackNet RGB Sync - Configuratie - - - Vertalingen verzorgd door: - - - Versie: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.pt.resx b/RGBSync+/Properties/Resources.pt.resx deleted file mode 100644 index 6d52f1a..0000000 --- a/RGBSync+/Properties/Resources.pt.resx +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - A utilidade para sincronizar os teus periféricos e componentes RGB. Compatível com Corsair iCUE, Asus Aura, Razer Synapse, Logitech Gaming, e CoolerMaster Masterplus. - - - JackNet RGB Sync v1.7 por Fanman03 - - - Sim - - - Aplique - - - LEDs Disponíveis - - - Verificar Atualizações - - - Cliente - - - Startup delay: - - - Defines how long to wait, if at all, before the program starts. - - - Seconds - - - Dispositivos: - - - Discord RPC: - - - Ativar Discord Rich Presence - - - Mostra que estás a usar JackNet RGB Sync assim como o nome do perfil ativo no teu perfil do Discord. - - - Ativar Cliente - - - Ativar Servidor - - - Suporte para EVGA escrito por emulamer - - - Sair - - - Exportar grupos - - - Esta função requer Premium. Gostarias de ir à página web onde podes comprar Premium? - - - Name - - - Importar grupos - - - Instalado - - - Junta-te ao meu servidor de Discord - - - Language: - - - Ver licenças opensource - - - LED Principal: - - - Minimização: - - - Ativar minimização - - - Não - - - Novo grupo de LED - - - Nenhum grupo de LED selecionado ... - - - Não Instalado - - - Nenhuma atualização encontrada, estás a usar a versão mais recente da aplicação. - - - Nenhuma Atualização Disponível - - - Abrir interface - - - Grupos de LED - - - Definições - - - Rede - - - Sobre - - - Escolher Arquivo - - - Taxa de atualização: - - - Define o quão rápida a informação é atualizada. Valores baixos reduzem a utilização do CPU mas podem causar atrasos. - - - Atualizações por segundo - - - Obter Premium - - - Função não disponível - - - Premium: - - - Nome do perfil: - - - Eliminar grupo de LED? - - - Tens a certeza de que queres eliminar o grupo - - - Reinicar aplicação - - - JackNet RGBSync funciona com RGB.NET por Darth Affe - - - Servidor - - - IP do servidor: - - - Porta do Servidor: - - - Iniciar Cliente - - - Iniciar Servidor - - - LEDs Sincronizados - - - Tens algum problema ou precisas de ajuda? - - - Suporte Técnico - - - Tema: - - - JackNet RGB Sync - Configuração - - - Traduções fornecidas por: - - - Uma Atualização para o JackNet RGB Sync está disponível. Pretendes atualizar? - - - Atualizar: - - - Atualização Disponível! - - - Versão: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.resx b/RGBSync+/Properties/Resources.resx deleted file mode 100644 index 49fdc16..0000000 --- a/RGBSync+/Properties/Resources.resx +++ /dev/null @@ -1,348 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - - - - The one-stop utlility for syncing your RGB perhipherals and components. Compatible with Corsair iCUE, Asus AURA, Razer Synapse, Logitech Gaming, EVGA Precision X1, and Cooler Master Masterplus. - - - JackNet RGB Sync v1.7 by Fanman03 - - - Yes - - - Apply - - - Available LEDs - - - Check for Update - - - Client - - - Copy to Clipboard - - - Startup delay: - - - Defines how long to wait, if at all, before the program starts. - - - Seconds - - - Devices: - - - Discord RPC: - - - Enable Discord Rich Presence - - - Displays that you are using JackNet RGB Sync as well as the name of the active profile on your Discord profile. - - - Enable Client - - - Enable Server - - - EVGA support written by emulamer - - - Exclude Devices - - - Exit - - - Export Groups - - - This feature requires Premium. Would you like to go to the webpage where you can purchase Premium? - - - Name: - - - Import Groups - - - Installed - - - Join my Discord server - - - Language: - - - View Opensource Licenses - - - Manage Plugins - - - Control LED: - - - Minimization: - - - Enable Minimization - - - MSI support written by Hex3l. - - - No - - - New LED Group - - - No LED group selected ... - - - Not Installed - - - No update found. You are currently using the latest version of the application. - - - No Update Available - - - OK - - - Open UI - - - LED Groups - - - Settings - - - Network - - - About - - - Pick File - - - Polling Rate: - - - Defines how fast the data is updated. Low value reduce CPU usage but might cause stuttering. - - - Updates per Second - - - Get Premium - - - Feature not Available - - - Premium: - - - Profile Name: - - - Remove LED Group? - - - Are you sure that you want to delete the group - - - Restart App - - - JackNet RGB Sync is powered by RGB.NET by Darth Affe - - - Run as Admin - - - Run as Admin: - - - Server - - - Server IP: - - - Server Port: - - - Start Client - - - Start Server - - - Synchronized LEDs - - - Having an issue or need help setting up this program? - - - Tech Support - - - Theme: - - - JackNet RGB Sync - Configuration - - - Translations provided by: - - - An update to JackNet RGB Sync is available. Would you like to update? - - - Update: - - - Update Available! - - - Version: - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.ru.resx b/RGBSync+/Properties/Resources.ru.resx deleted file mode 100644 index 68effbf..0000000 --- a/RGBSync+/Properties/Resources.ru.resx +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - Универсальная программа синхронизации вашей RGB подсветки периферии и компонентов. Совместимо с Corsair ICUE, Asus AURA, Razer Synapse, Logitech Gaming и Cooler Master Masterplus. - - - JackNetRGB Sync v1.7 от Fanman03 - - - да - - - Подать заявление - - - Доступные LED - - - Клиент - - - Отложенный старт: - - - Определяет время ожидания до запвска программы, если это вообще произойдет. - - - Секунды - - - Устройства: - - - Discord RPC: - - - Включить расширенный статус Discord - - - Displays that you are using JackNet RGB Sync as well as the name of the active profile on your Discord profile. - - - Включить клиент - - - Включить сервер - - - Автор письменной поддержки EVGA emulamer - - - Выход - - - Экспорт групп - - - Эта функция доступна в Премиум версии. Приобретение Премиум версии программы доступно по ссылке - - - Имя: - - - Импорт групп: - - - Установлены - - - Присоединяйтесь к серверу Discord - - - Язык: - - - Просмотр свободных лицензий на ПО - - - Основной LED: - - - Сокращение: - - - Включение сокращения - - - Нет - - - Новая группа LED - - - не выбрано ни одной LED группы ... - - - Не установлено - - - Хорошо - - - Открытый UI - - - Группы LED - - - Настройки - - - Сеть - - - О программе - - - Выбрать файл - - - Частота опроса: - - - Определяет, как быстро обновляются данные. Низкое значение снижает нагрузку на процессор, но может вызывать некорректную работу. - - - Обновления в секунду - - - Получи Премиум - - - Функция не доступна - - - премия - - - Название профиля: - - - Удалить группу LED? - - - Вы уверены, что хотите удалить группу - - - Перезагрузка приложения - - - JackNet RGB Sync питается от RGB.NET Darth Affe - - - Сервер - - - IP сервера: - - - Порт сервера: - - - Запуск - - - Запуск сервера - - - Синхронизация LED - - - Предложения или помощь в установке программы? - - - Техническая поддержка - - - тема: - - - JackNet RGB Sync - конфигурация - - - Авторы перевода: - - - Версия - - \ No newline at end of file diff --git a/RGBSync+/Properties/Resources.te.resx b/RGBSync+/Properties/Resources.te.resx deleted file mode 100644 index e38a3c0..0000000 --- a/RGBSync+/Properties/Resources.te.resx +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - AboutDescription - - - AboutTitle - - - AffirmativeCommand - - - ApplyLabel - - - AvaliableLEDsLabel - - - ClientHeading - - - DelayLabel - - - DelayTooltip - - - DelayUnit - - - DevicesLabel - - - DiscordLabel - - - DiscordText - - - DiscordTooltip - - - EnableClientLabel - - - EnableServerLabel - - - EVGANotice - - - ExitItem - - - ExportButton - - - FeatureNotAvailable - - - GroupNameLabel - - - ImportButton - - - InstalledLabel - - - JoinDiscordButton - - - LanguageLabel - - - LicenseButton - - - MasterLEDLabel - - - MinimizationLabel - - - MinimizationText - - - MSINotice - - - NegativeCommand - - - NewGroupButton - - - NoGroupSelected - - - NotInstalledLabel - - - OKCommand - - - OpenUIItem - - - Page1Header - - - Page2Header - - - Page3Header - - - Page4Header - - - PickFileLabel - - - PollingRateLabel - - - PollingRateTooltip - - - PollingRateUnit - - - PremiumCTAButton - - - PremiumFeatureTitle - - - PremiumLabel - - - ProfileNameLabel - - - RemoveHeader - - - RemovePrompt - - - RestartApp - - - RGBNetNotice - - - ServerHeading - - - ServerIPLabel - - - ServerPortLabel - - - StartClientButton - - - StartServerButton - - - SyncedLEDsLabel - - - TechSupportCTA - - - TechSupportItem - - - ThemeLabel - - - Title - - - TranslationsLabel - - - VersionLabel - - \ No newline at end of file diff --git a/RGBSync+/Properties/Settings.Designer.cs b/RGBSync+/Properties/Settings.Designer.cs index 5ca9da0..f092aab 100644 --- a/RGBSync+/Properties/Settings.Designer.cs +++ b/RGBSync+/Properties/Settings.Designer.cs @@ -8,11 +8,11 @@ // //------------------------------------------------------------------------------ -namespace RGBSyncPlus.Properties { +namespace SyncStudio.WPF.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/RGBSync+/RSSBackgroundDevice.cs b/RGBSync+/RSSBackgroundDevice.cs new file mode 100644 index 0000000..1cd10e2 --- /dev/null +++ b/RGBSync+/RSSBackgroundDevice.cs @@ -0,0 +1,425 @@ +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using Color = System.Drawing.Color; + +namespace SyncStudio.WPF +{ + public class GradientDriver : ISimpleLed + { + private readonly List devices = new List(); + public void Dispose() + { + + } + + public void Configure(DriverDetails driverDetails) + { + for (int i = 0; i < 4; i++) + { + ControlDevice dd = (new ControlDevice + { + Driver = this, + Name = "Gradient", + ControlChannel = new ControlChannel + { + Name = "Bank " + (i + 1), + Serial = "GRADIENT"+i + }, + DeviceType = DeviceTypes.Effect, + LEDs = new ControlDevice.LedUnit[16] + }); + + for (int p = 0; p < 16; p++) + { + dd.LEDs[p] = new ControlDevice.LedUnit + { + Color = new LEDColor(0, 0, 0), + Data = new ControlDevice.LEDData { LEDNumber = p }, + LEDName = "LED " + (p + 1) + }; + } + + Bitmap Bmp = new Bitmap(192, 128); + using (Graphics gfx = Graphics.FromImage(Bmp)) + using (SolidBrush brush = new SolidBrush(Color.FromArgb(0, 0, 0))) + { + gfx.FillRectangle(brush, 0, 0, 192, 128); + } + dd.Name = "Solid Color"; + devices.Add(dd); + + DeviceAdded?.Invoke(this, new Events.DeviceChangeEventArgs(dd)); + } + } + + private ColorProfile colorProfile; + + public void Push(ControlDevice controlDevice) + { + + } + + public void Pull(ControlDevice controlDevice) + { + + } + + public DriverProperties GetProperties() + { + return new DriverProperties + { + SupportsPush = false, + IsSource = true, + SupportsPull = true, + ProductId = Guid.Parse("11111111-1111-1111-1111-111111111112"), + Author = "Sync Studio Team", + Blurb = "Solid Colors provided by Color Profile", + CurrentVersion = new ReleaseNumber(1, 0, 0, 0), + IsPublicRelease = true, + SetColorProfileAction = SetColorProfile + }; + } + + public T GetConfig() where T : SLSConfigData + { + return null; + } + + public void PutConfig(T config) where T : SLSConfigData + { + + } + + public string Name() + { + return "Gradient"; + } + + public void InterestedUSBChange(int VID, int PID, bool connected) + { + + } + + public void SetColorProfile(ColorProfile value) + { + colorProfile = value; + for (int i = 0; i < 4; i++) + { + ControlDevice dd = devices[i]; + ColorBank cc = colorProfile.ColorBanks[i]; + ColorObject pc = cc.Colors[0]; + ColorObject dc = cc.Colors[1]; + Bitmap Bmp = new Bitmap(192, 128); + + Color cpc = System.Drawing.Color.FromArgb(255, (byte)pc.Color.Red, (byte)pc.Color.Green, (byte)pc.Color.Blue); + Color cdc = System.Drawing.Color.FromArgb(255, (byte)dc.Color.Red, (byte)dc.Color.Green, (byte)dc.Color.Blue); + + using (Graphics graphics = Graphics.FromImage(Bmp)) + { + using (System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point(0, 0), new Point(192, 128), cpc, cdc)) + { + graphics.FillRectangle(brush, 0f, 0f, 192f, 128f); + } + } + + + dd.LEDs = cc.Colors.Select(x => new ControlDevice.LedUnit + { + Color = new LEDColor(x.Color.Red, x.Color.Green, x.Color.Blue) + }).ToArray(); + + float steps = 1 / 16f; + + dd.Name = value.ColorBanks[i].BankName; + dd.ProductImage = Bmp; + } + } + + public event Events.DeviceChangeEventHandler DeviceAdded; + public event Events.DeviceChangeEventHandler DeviceRemoved; + } + + public class SolidColorDriver : ISimpleLed + { + private readonly List devices = new List(); + public void Dispose() + { + + } + + public void Configure(DriverDetails driverDetails) + { + for (int i = 0; i < 4; i++) + { + ControlDevice dd = (new ControlDevice + { + Driver = this, + Name = "Solid Color", + ControlChannel = new ControlChannel + { + Name = "Bank " + (i + 1), + Serial = "SOLIDCOLOR" + i + }, + DeviceType = DeviceTypes.Effect, + LEDs = new ControlDevice.LedUnit[1] + { + new ControlDevice.LedUnit + { + Color = new LEDColor(0, 0, 0), + Data = new ControlDevice.LEDData {LEDNumber = 0}, + LEDName = "LED 1" + } + }, + + }); + + Bitmap Bmp = new Bitmap(192, 128); + using (Graphics gfx = Graphics.FromImage(Bmp)) + using (SolidBrush brush = new SolidBrush(Color.FromArgb(0, 0, 0))) + { + gfx.FillRectangle(brush, 0, 0, 192, 128); + } + dd.Name = "Solid Color"; + devices.Add(dd); + + DeviceAdded?.Invoke(this, new Events.DeviceChangeEventArgs(dd)); + } + } + + private ColorProfile colorProfile; + + public void Push(ControlDevice controlDevice) + { + + } + + public void Pull(ControlDevice controlDevice) + { + + } + + public DriverProperties GetProperties() + { + return new DriverProperties + { + SupportsPush = false, + IsSource = true, + SupportsPull = true, + ProductId = Guid.Parse("11111111-1111-1111-1111-111111111112"), + Author = "Sync Studio Team", + Blurb = "Solid Colors provided by Color Profile", + CurrentVersion = new ReleaseNumber(1, 0, 0, 0), + IsPublicRelease = true, + SetColorProfileAction = SetColorProfile + }; + } + + public T GetConfig() where T : SLSConfigData + { + return null; + } + + public void PutConfig(T config) where T : SLSConfigData + { + + } + + public string Name() + { + return "Solid Color"; + } + + public void InterestedUSBChange(int VID, int PID, bool connected) + { + + } + + public void SetColorProfile(ColorProfile value) + { + colorProfile = value; + for (int i = 0; i < 4; i++) + { + ControlDevice dd = devices[i]; + ColorBank cc = colorProfile.ColorBanks[i]; + ColorObject pc = cc.Colors[0]; + Bitmap Bmp = new Bitmap(192, 128); + using (Graphics gfx = Graphics.FromImage(Bmp)) + using (SolidBrush brush = new SolidBrush(Color.FromArgb(pc.Color.Red, pc.Color.Green, pc.Color.Blue))) + { + gfx.FillRectangle(brush, 0, 0, 192, 128); + } + + dd.LEDs[0].Color.Red = pc.Color.Red; + dd.LEDs[0].Color.Green = pc.Color.Green; + dd.LEDs[0].Color.Blue = pc.Color.Blue; + dd.Name = value.ColorBanks[i].BankName; + dd.ProductImage = Bmp; + } + } + + public event Events.DeviceChangeEventHandler DeviceAdded; + public event Events.DeviceChangeEventHandler DeviceRemoved; + } + public class RSSBackgroundDevice : ISimpleLed + { + public static Assembly assembly = Assembly.GetExecutingAssembly(); + public static Stream imageStream = assembly.GetManifestResourceStream("SyncStudio.WPF.UI.hires.png"); + public RSSBackgroundDevice() + { + dvs = new ControlDevice + { + Name = "Background", + Driver = this, + ControlChannel = new ControlChannel + { + Name = "App BG", + Serial = "AppBG" + }, + DeviceType = DeviceTypes.Other, + ProductImage = new Bitmap(imageStream), + LEDs = new ControlDevice.LedUnit[8] + { + new ControlDevice.LedUnit {LEDName = "Top", Data = new ControlDevice.LEDData {LEDNumber = 0}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "TopRight", Data = new ControlDevice.LEDData {LEDNumber = 1}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "Right", Data = new ControlDevice.LEDData {LEDNumber = 2}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "BottomRight", Data = new ControlDevice.LEDData {LEDNumber = 3}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "Bottom", Data = new ControlDevice.LEDData {LEDNumber = 4}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "BottomLeft", Data = new ControlDevice.LEDData {LEDNumber = 5}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "Left", Data = new ControlDevice.LEDData {LEDNumber = 6}, Color = new LEDColor(0, 0, 0)}, + new ControlDevice.LedUnit {LEDName = "TopLeft", Data = new ControlDevice.LEDData {LEDNumber = 7}, Color = new LEDColor(0, 0, 0)} + } + }; + } + + public event EventHandler ColourChange; + public LEDColor[] Leds = new LEDColor[8] + { + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0), + new LEDColor(0,0,0) + }; + + private readonly ControlDevice dvs; + private bool enabled; + public void Enable() + { + if (!enabled) + { + enabled = true; + DeviceAdded?.Invoke(this, new Events.DeviceChangeEventArgs(dvs)); + } + } + + public void Disable() + { + if (enabled) + { + enabled = false; + Leds[0] = new LEDColor(0, 0, 0); + Leds[1] = new LEDColor(0, 0, 0); + Leds[2] = new LEDColor(0, 0, 0); + Leds[3] = new LEDColor(0, 0, 0); + Leds[4] = new LEDColor(0, 0, 0); + Leds[5] = new LEDColor(0, 0, 0); + Leds[6] = new LEDColor(0, 0, 0); + Leds[7] = new LEDColor(0, 0, 0); + + DeviceRemoved?.Invoke(this, new Events.DeviceChangeEventArgs(dvs)); + } + } + public void Dispose() + { + + } + + public void Configure(DriverDetails driverDetails) + { + + } + + public void Push(ControlDevice controlDevice) + { + bool anyChanges = false; + for (int i = 0; i < 8; i++) + { + if (Leds[i].Red != controlDevice.LEDs[i].Color.Red || + Leds[i].Green != controlDevice.LEDs[i].Color.Green || + Leds[i].Blue != controlDevice.LEDs[i].Color.Blue) + { + anyChanges = true; + } + } + + if (anyChanges) + { + for (int i = 0; i < 8; i++) + { + Leds[i].Red = controlDevice.LEDs[i].Color.Red; + Leds[i].Green = controlDevice.LEDs[i].Color.Green; + Leds[i].Blue = controlDevice.LEDs[i].Color.Blue; + } + + ColourChange?.Invoke(this, new EventArgs()); + } + } + + public void Pull(ControlDevice controlDevice) + { + + } + + public DriverProperties GetProperties() + { + return new DriverProperties + { + SupportsPush = true, + IsSource = false, + SupportsPull = false, + ProductId = Guid.Parse("11111111-1111-1111-1111-111111111111"), + Author = "Sync Studio Team", + Blurb = "Control the background of your RSS window.", + CurrentVersion = new ReleaseNumber(1, 0, 0, 0), + IsPublicRelease = true + }; + } + + public T GetConfig() where T : SLSConfigData + { + return null; + } + + public void PutConfig(T config) where T : SLSConfigData + { + + } + + public string Name() + { + return "App Background"; + } + + public void InterestedUSBChange(int VID, int PID, bool connected) + { + + } + + + public void SetColorProfile(ColorProfile value) + { + + } + + public event Events.DeviceChangeEventHandler DeviceAdded; + public event Events.DeviceChangeEventHandler DeviceRemoved; + } +} diff --git a/RGBSync+/Resources/BannerBG.png b/RGBSync+/Resources/BannerBG.png new file mode 100644 index 0000000..f68e36d Binary files /dev/null and b/RGBSync+/Resources/BannerBG.png differ diff --git a/RGBSync+/Resources/DarkTheme.xaml b/RGBSync+/Resources/DarkTheme.xaml index 69c4439..ba9cb4b 100644 --- a/RGBSync+/Resources/DarkTheme.xaml +++ b/RGBSync+/Resources/DarkTheme.xaml @@ -1,31 +1,14 @@  - - - - - - - - - - - - - - - + xmlns:ui="clr-namespace:SyncStudio.WPF.UI" + xmlns:styles="clr-namespace:SyncStudio.WPF.Styles" + xmlns:converter="clr-namespace:SyncStudio.WPF.Converter"> - diff --git a/RGBSync+/Resources/DefaultBanner.png b/RGBSync+/Resources/DefaultBanner.png new file mode 100644 index 0000000..9ddba9c Binary files /dev/null and b/RGBSync+/Resources/DefaultBanner.png differ diff --git a/RGBSync+/Resources/ProgramIcon.ico b/RGBSync+/Resources/ProgramIcon.ico new file mode 100644 index 0000000..b1388a7 Binary files /dev/null and b/RGBSync+/Resources/ProgramIcon.ico differ diff --git a/RGBSync+/Resources/RGBSync+.xaml b/RGBSync+/Resources/RGBSync+.xaml index c5d0fad..630682e 100644 --- a/RGBSync+/Resources/RGBSync+.xaml +++ b/RGBSync+/Resources/RGBSync+.xaml @@ -1,40 +1,42 @@  + xmlns:ui="clr-namespace:SyncStudio.WPF.UI" + xmlns:styles="clr-namespace:SyncStudio.WPF.Styles" + + xmlns:converter="clr-namespace:SyncStudio.WPF.Converter"> - + + + - diff --git a/RGBSync+/Resources/argebee.ico b/RGBSync+/Resources/argebee.ico deleted file mode 100644 index 47618aa..0000000 Binary files a/RGBSync+/Resources/argebee.ico and /dev/null differ diff --git a/RGBSync+/Resources/background.png b/RGBSync+/Resources/background.png deleted file mode 100644 index 5a13f52..0000000 Binary files a/RGBSync+/Resources/background.png and /dev/null differ diff --git a/RGBSync+/Resources/base.png b/RGBSync+/Resources/base.png deleted file mode 100644 index c1d728a..0000000 Binary files a/RGBSync+/Resources/base.png and /dev/null differ diff --git a/RGBSync+/Resources/hires.ico b/RGBSync+/Resources/hires.ico new file mode 100644 index 0000000..3946440 Binary files /dev/null and b/RGBSync+/Resources/hires.ico differ diff --git a/RGBSync+/Resources/icon.ico b/RGBSync+/Resources/icon.ico deleted file mode 100644 index 47618aa..0000000 Binary files a/RGBSync+/Resources/icon.ico and /dev/null differ diff --git a/RGBSync+/Resources/icon.png b/RGBSync+/Resources/icon.png deleted file mode 100644 index 58f806b..0000000 Binary files a/RGBSync+/Resources/icon.png and /dev/null differ diff --git a/RGBSync+/Resources/navigation.ttf b/RGBSync+/Resources/navigation.ttf index 1a7f3b0..ddb2792 100644 Binary files a/RGBSync+/Resources/navigation.ttf and b/RGBSync+/Resources/navigation.ttf differ diff --git a/RGBSync+/Resources/tl_icon.ico b/RGBSync+/Resources/tl_icon.ico deleted file mode 100644 index 1800009..0000000 Binary files a/RGBSync+/Resources/tl_icon.ico and /dev/null differ diff --git a/RGBSync+/ServiceManager.cs b/RGBSync+/ServiceManager.cs new file mode 100644 index 0000000..38c38df --- /dev/null +++ b/RGBSync+/ServiceManager.cs @@ -0,0 +1,84 @@ +using SimpleLed; +using System.Windows; +using System.Windows.Media; +using Autofac; +using Autofac.Core; +using Nan0SyncStudio.Branding; +using RGBSyncStudio.Branding; +using SyncStudio.Branding; + +using SyncStudio.WPF.Services; + +namespace SyncStudio.WPF +{ + public class ServiceManager + { + public Color GetAccent() + { + return InternalSolids.themeWatcher.CurrentAccent; + } + + public ThemeWatcher.WindowsTheme GetTheme() + { + return InternalSolids.WindowsTheme; + } + + public static ServiceManager Instance; + + public ApplicationManager ApplicationManager; + // public SLSManager SLSManager; + + public ClientService.Profiles ProfilesService; + + public ApiServerService ApiServerService; + public SimpleLogger Logger; + // public ConfigService ConfigService; + + public DiscordService DiscordService; + public SLSAuthService SLSAuthService; + public ModalService ModalService; + public ProfileTriggerManager ProfileTriggerManager; + public StoreService StoreService; + public IBranding Branding; + + public static IContainer Container { get; set; } + public static void Initialize(string slsConfigsDirectory, string ProfileDir) + { + + var builder = new ContainerBuilder(); + builder.RegisterType().InstancePerLifetimeScope(); + builder.RegisterType().InstancePerLifetimeScope(); + builder.RegisterType().InstancePerLifetimeScope(); + Container = builder.Build(); + ClientService.Devices devices; + using (var scope = Container.BeginLifetimeScope()) + { + devices = scope.Resolve(); + } + + Instance = new ServiceManager(); + Instance.ApplicationManager = new ApplicationManager(); + + Instance.ApiServerService = new ApiServerService(); + Instance.Logger = new SimpleLogger(); + // Instance.ConfigService = new ConfigService(ProfileDir, slsConfigsDirectory, devices); + + Instance.DiscordService = new DiscordService(); + Instance.SLSAuthService = new SLSAuthService(); + Instance.ModalService = new ModalService(); + Instance.ProfileTriggerManager = new ProfileTriggerManager(); + Instance.StoreService = new StoreService(); + + Instance.Branding = new RGBSyncStudioBranding(); + + } + + public static void Shutdown() + { + + + Instance.DiscordService.Stop(); + Application.Current.Shutdown(); + } + } +} diff --git a/RGBSync+/Services/ApiServerService.cs b/RGBSync+/Services/ApiServerService.cs new file mode 100644 index 0000000..3e99cc1 --- /dev/null +++ b/RGBSync+/Services/ApiServerService.cs @@ -0,0 +1,38 @@ +using Swashbuckle.Application; +using System.Diagnostics; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.Http.SelfHost; + +namespace SyncStudio.WPF.Services +{ + public class ApiServerService + { + public HttpSelfHostServer server; + public void Start() + { + server?.CloseAsync().Wait(); + //setup API + //todo make this be able to be toggled: + Debug.WriteLine("Setting up API"); + HttpSelfHostConfiguration apiconfig = new HttpSelfHostConfiguration("http://localhost:59022"); + + + apiconfig.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional }); + + server = new HttpSelfHostServer(apiconfig); + apiconfig.EnableSwagger(c => c.SingleApiVersion("v1", "RGBSync API")).EnableSwaggerUi(); + //server.OpenAsync(); + + Task.Run(() => server.OpenAsync()); + Debug.WriteLine("API Running"); + } + + public void Stop() + { + server?.CloseAsync().Wait(); + } + + + } +} diff --git a/RGBSync+/Services/ConfigService.cs b/RGBSync+/Services/ConfigService.cs new file mode 100644 index 0000000..582b475 --- /dev/null +++ b/RGBSync+/Services/ConfigService.cs @@ -0,0 +1,360 @@ +using Newtonsoft.Json; +using SyncStudio.WPF.Model; +using SharedCode; +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Threading; +using SyncStudio.Core.Services.Device; +using SyncStudio.Domain; +using SyncStudio.WPF.Helper; + +namespace SyncStudio.WPF.Services +{ + public class ConfigService + { + IInterfaceDevices _devices; + public string ProfileS_DIRECTORY; + public string SLSCONFIGS_DIRECTORY; + + public ConfigService(string Profiles_dir, string configs_dir, IInterfaceDevices devices) + { + _devices = devices; + + ProfileS_DIRECTORY = Profiles_dir; + SLSCONFIGS_DIRECTORY = configs_dir; + + if (!Directory.Exists(SLSCONFIGS_DIRECTORY)) + { + Directory.CreateDirectory(SLSCONFIGS_DIRECTORY); + } + + configTimer = new Timer(ConfigUpdate, null, 0, 5000); + } + + public Timer configTimer; + public List MappedDevices = new List(); + public bool isHotLoading; + + + private List deviceMappingProxy; + + public List DeviceMappingProxy + { + get => deviceMappingProxy; + set { deviceMappingProxy = value; } + } + + //TODO does this actually run? I cant see that we ever set up the proxy + //public void SetUpMappedDevicesFromConfig() + //{ + // List alreadyBeingSyncedTo = new List(); + // MappedDevices = new List(); + // if (ServiceManager.Instance.ConfigService.DeviceMappingProxy != null) + // { + // foreach (DeviceMapping deviceMapping in ServiceManager.Instance.ConfigService.DeviceMappingProxy) + // { + // InterfaceControlDevice src = _devices.GetDevices().FirstOrDefault(x => + // x.Name == deviceMapping.SourceDevice.DeviceName && + // x.InterfaceDriverProperties.Name == deviceMapping.SourceDevice.DriverName); + // if (src != null) + // { + // DeviceMap dm = new DeviceMap + // { + // Source = src, + // Dest = new List() + // }; + + // foreach (DeviceProxy deviceMappingDestinationDevice in deviceMapping.DestinationDevices) + // { + // InterfaceControlDevice tmp = _devices.GetDevices().FirstOrDefault(x => + // x.Name == deviceMappingDestinationDevice.DeviceName && + // x.InterfaceDriverProperties.Name == deviceMappingDestinationDevice.DriverName); + + // if (alreadyBeingSyncedTo.Contains(tmp) == false) + // { + // if (tmp != null) + // { + // dm.Dest.Add(tmp); + + // alreadyBeingSyncedTo.Add(tmp); + // } + // } + // } + + // MappedDevices.Add(dm); + // } + // } + // } + //} + + private void ConfigUpdate(object state) + { + //todo + //ServiceManager.Instance.ConfigService.CheckSettingStale(); + //foreach (ISimpleLed slsManagerDriver in ServiceManager.Instance.SLSManager.Drivers.ToList().Where(x => x is ISimpleLedWithConfig).ToList()) + //{ + // ISimpleLedWithConfig cfgable = slsManagerDriver as ISimpleLedWithConfig; + // if (cfgable.GetIsDirty()) + // { + // ServiceManager.Instance.SLSManager.SaveConfig(cfgable); + // } + //} + } + + public Settings Settings = null; + + public LauncherPrefs LauncherPrefs { get; set; } = new LauncherPrefs(); + + public void LoadSettings() + { + if (File.Exists("Settings.json")) + { + string json = File.ReadAllText("Settings.json"); + //try + { + Settings = JsonConvert.DeserializeObject(json); + if (Settings == null) + { + Settings = new Settings(); + } + + ServiceManager.Instance.Logger.Info("Settings loaded"); + HotLoadSettings(); + } + //catch + //{ + // Logger.Error("error loading settings"); + //} + } + else + { + Settings = new Settings(); + SaveSettings(); + HotLoadSettings(); + } + } + + public DateTime TimeSettingsLastSave = DateTime.MinValue; + + private bool actuallySaveRunning = false; + private bool actualySaveContention = false; + + private async Task ActuallySave() + { + if (Settings != null) + { + if (actuallySaveRunning) + { + actualySaveContention = true; + return; + } + + actuallySaveRunning = true; + + DateTime start = DateTime.Now; + + while ((DateTime.Now - start).TotalMilliseconds < 1000) + { + await Task.Delay(10); + if (actualySaveContention) + { + start = DateTime.Now; + actualySaveContention = false; + } + } + + try + { + Debug.WriteLine( + "********************************************************************************************* SAVING SETTINGS!"); + string json = JsonConvert.SerializeObject(Settings); + File.WriteAllText("Settings.json", json); + TimeSettingsLastSave = DateTime.Now; + Settings.AreSettingsStale = false; + } + catch + { + } + + actuallySaveRunning = false; + } + } + + public void SaveSettings() + { + ActuallySave(); + } + + + public bool SettingsRequiresSave() + { + if (ServiceManager.Instance.ConfigService.Settings != null) + { + if (Settings.AreSettingsStale) return true; + if (Settings.DeviceSettings != null) + { + if (ServiceManager.Instance.ConfigService.Settings.DeviceSettings.Any(x => x.AreDeviceSettingsStale) + ) return true; + } + } + + return false; + } + + public void HotLoadSettings() + { + // if (isHotLoading) return; + + // isHotLoading = true; + + // CultureInfo ci = CultureInfo.InstalledUICulture; + // if (ServiceManager.Instance.ConfigService.Settings.Lang == null) + // { + // ServiceManager.Instance.Logger.Debug("Language is not set, inferring language from system culture. Lang=" + ci.TwoLetterISOLanguageName); + // ServiceManager.Instance.ConfigService.Settings.Lang = ci.TwoLetterISOLanguageName; + // } + + // Thread.CurrentThread.CurrentUICulture = new CultureInfo(ServiceManager.Instance.ConfigService.Settings.Lang); + + // if (ServiceManager.Instance.ConfigService.Settings.EnableDiscordRPC) + // { + // ServiceManager.Instance.DiscordService.ConnectDiscord(); + // } + + // //todo + // //SyncStudio.Core.ServiceManager.LedService.LoadOverrides(); + + // ServiceManager.Instance.ProfileService.profilePathMapping.Clear(); + // if (!Directory.Exists(ProfileS_DIRECTORY)) + // { + // Directory.CreateDirectory(ProfileS_DIRECTORY); + // ServiceManager.Instance.ProfileService.GenerateNewProfile("Default"); + // isHotLoading = false; + // return; + // } + + // string[] profiles = Directory.GetFiles(ProfileS_DIRECTORY, "*.json"); + + // if (profiles == null || profiles.Length == 0) + // { + // ServiceManager.Instance.ProfileService.GenerateNewProfile("Default"); + // } + + // Settings.ProfileNames = new ObservableCollection(); + + // foreach (string profile in profiles) + // { + // string profileName = ServiceManager.Instance.ProfileService.GetProfileFromPath(profile)?.Name; + // if (!string.IsNullOrWhiteSpace(profileName)) + // { + // try + // { + + // ServiceManager.Instance.ProfileService.profilePathMapping.Add(profileName, profile); + + // if (Settings.ProfileNames == null) + // { + // Settings.ProfileNames = new ObservableCollection(); + // } + // Settings.ProfileNames.Add(profileName); + // ServiceManager.Instance.ProfileService.OnProfilesChangedInvoke(this, new EventArgs()); + // } + // catch + // { + // } + // } + // } + + // if (Settings.ProfileNames == null) + // { + // Settings.ProfileNames = new ObservableCollection(); + // } + + // //todo + // if (false && Settings.ProfileNames.Contains(Settings.CurrentProfile)) + // { + + // ServiceManager.Instance.ProfileService.LoadProfileFromName(Settings.CurrentProfile); + // } + // else + // { + // Settings.CurrentProfile = "Default"; + // ServiceManager.Instance.ProfileService.LoadProfileFromName(Settings.CurrentProfile); + // } + + + // double tmr2 = 1000.0 / MathHelper.Clamp(Settings.UpdateRate, 1, 100); + // //todo + // //SyncStudio.Core.ServiceManager.LedService.SetUpdateRate(tmr2); + + // ServiceManager.Instance.ApiServerService.Stop(); + + // if (Settings.ApiEnabled) + // { + // ServiceManager.Instance.ApiServerService.Start(); + // } + + // if (Settings.DeviceSettings != null) + // { + // foreach (DeviceSettings SettingsDeviceSetting in Settings.DeviceSettings) + // { + // InterfaceControlDevice cd = _devices.GetControlDeviceFromName(SettingsDeviceSetting.ProviderName, SettingsDeviceSetting.Name); + + // if (cd != null) + // { + // cd.LedShift = SettingsDeviceSetting.LEDShift; + // cd.Reverse = SettingsDeviceSetting.Reverse; + + // } + // } + // } + + // if (!string.IsNullOrWhiteSpace(Settings.SimpleLedAuthToken)) + // { + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.AccessToken = Settings.SimpleLedAuthToken; + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.UserName = Settings.SimpleLedUserName; + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.UserId = Settings.SimpleLedUserId; + // try + // { + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.Authenticate(() => + // { + // Debug.WriteLine("Authenticated"); + // ServiceManager.Instance.SLSAuthService.SimpleLedAuthenticated = true; + // }); + // } + // catch + // { + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.AccessToken = ""; + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.UserName = ""; + // ServiceManager.Instance.SLSAuthService.SimpleLedAuth.UserId = Guid.Empty; + // ServiceManager.Instance.SLSAuthService.SimpleLedAuthenticated = false; + + // Settings.SimpleLedAuthToken = ""; + // Settings.SimpleLedUserId = Guid.Empty; + // Settings.SimpleLedUserName = ""; + // } + // } + + // if (File.Exists("launcherPrefs.json")) + // { + // LauncherPrefs = JsonConvert.DeserializeObject(File.ReadAllText("launcherPrefs.json")); + // } + // else + // { + // LauncherPrefs = new LauncherPrefs(); + // } + + // isHotLoading = false; + //} + + } + } +} diff --git a/RGBSync+/Services/DiscordService.cs b/RGBSync+/Services/DiscordService.cs new file mode 100644 index 0000000..2653010 --- /dev/null +++ b/RGBSync+/Services/DiscordService.cs @@ -0,0 +1,53 @@ +using DiscordRPC; +using SyncStudio.ClientService; + +namespace SyncStudio.WPF.Services +{ + public class DiscordService + { + private ClientService.Settings settings = new Settings(); + public DiscordRpcClient client; + public void ConnectDiscord() + { + client = new DiscordRpcClient("768250991149580310"); + client.Initialize(); + + ServiceManager.Instance.Logger.Info("Discord RPC enabled."); + if (client.IsDisposed == true) + { + ServiceManager.Instance.Logger.Info("Discord RPC client disposed, initializing new one."); + client = new DiscordRpcClient("768250991149580310"); + client.Initialize(); + } + + ServiceManager.Instance.Logger.Info("Setting Discord presence."); + client.SetPresence(new RichPresence() + { + State = "Profile: " +"profile",//todo SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile().Name, + Details = "Syncing lighting effects", + Assets = new Assets() + { + LargeImageKey = "logo", + LargeImageText = ServiceManager.Instance.Branding.GetAppName() + } + }); + } + + public void Stop() + { + if(settings.EnableDiscordRPC == true) + { + try + { + client.Dispose(); + + } + catch + { + } + } + + client = null; + } + } +} diff --git a/RGBSync+/Services/LedService.cs b/RGBSync+/Services/LedService.cs new file mode 100644 index 0000000..0885630 --- /dev/null +++ b/RGBSync+/Services/LedService.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; +using SyncStudio.WPF.Model; +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using System.Windows.Threading; +using SyncStudio.Domain; +using SyncStudio.WPF.Helper; + +namespace SyncStudio.WPF.Services +{ + + +} diff --git a/RGBSync+/Services/ModalService.cs b/RGBSync+/Services/ModalService.cs new file mode 100644 index 0000000..69d269b --- /dev/null +++ b/RGBSync+/Services/ModalService.cs @@ -0,0 +1,30 @@ +using SyncStudio.WPF.UI; +using SyncStudio.WPF.UI.Tabs; + +namespace SyncStudio.WPF.Services +{ + public class ModalService + { + public void ShowModal(ModalModel modalModel) + { + MainWindowViewModel vm = ((MainWindowViewModel)ServiceManager.Instance.ApplicationManager.MainWindow.DataContext); + + vm.ModalText = modalModel.ModalText; + vm.ModalShowPercentage = false; + vm.ShowModalCloseButton = true; + vm.ShowModal = true; + } + + public void ShowSimpleModal(string text) + { + MainWindowViewModel vm = ((MainWindowViewModel)ServiceManager.Instance.ApplicationManager.MainWindow.DataContext); + + vm.ModalText = text; + vm.ModalShowPercentage = false; + vm.ShowModalCloseButton = true; + vm.ShowModal = true; + } + + + } +} diff --git a/RGBSync+/Services/ProfileService.cs b/RGBSync+/Services/ProfileService.cs new file mode 100644 index 0000000..6acca74 --- /dev/null +++ b/RGBSync+/Services/ProfileService.cs @@ -0,0 +1,116 @@ +using Newtonsoft.Json; +using SyncStudio.WPF.Model; +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Threading; +using SyncStudio.Domain; +using SyncStudio.WPF.Helper; + +namespace SyncStudio.WPF.Services +{ + public class ProfileService + { + public event EventHandler OnProfilesChanged; + public void OnProfilesChangedInvoke(object sender, EventArgs e) + { + OnProfilesChanged?.Invoke(sender, e); + } + public readonly Dictionary profilePathMapping = new Dictionary(); + private readonly SimpleLogger Logger = ServiceManager.Instance.Logger; + + public ProfileService(string profilesDir) + { + + } + + private Profile cp => new Profile + { + Name = "Default", + Id = Guid.NewGuid() + }; + + //todo + private Profile CurrentProfile => cp;// SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile(); + + public bool ProfilesRequiresSave() + { + if (CurrentProfile == null) return false; + return (CurrentProfile.IsProfileStale); + } + + public void SaveCurrentProfile() + { + SyncStudio.Core.ServiceManager.Profiles.SaveProfile(CurrentProfile); + } + + public void GenerateNewProfile(string name, bool hotLoad = true) + { + var newProfile = SyncStudio.Core.ServiceManager.Profiles.GenerateNewProfile(name); + //todo updateConfig + + } + + public void LoadProfileFromName(string profileName) + { + //todo + return; + + var profile = Core.ServiceManager.Profiles.GetProfile(profileName); + Core.ServiceManager.Profiles.SetCurrentProfile(profile); + } + + public Profile GetProfileFromName(string profileName) + { + return Core.ServiceManager.Profiles.GetProfile(profileName); + } + + public Profile GetProfileFromPath(string path) + { + return TryReallyHard.ToRun(thisCode: () => + { + string json = File.ReadAllText(path); + return JsonConvert.DeserializeObject(json); + }); + } + + public void DeleteProfile(string dcName) + { + Core.ServiceManager.Profiles.RemoveProfile(dcName); + + string path = profilePathMapping[dcName]; + ServiceManager.Instance.ConfigService.TimeSettingsLastSave = DateTime.Now; + File.Delete(path); + ServiceManager.Instance.ConfigService.HotLoadSettings(); + } + + public void RenameProfile(string currentProfileOriginalName, string currentProfileName) + { + var profile = Core.ServiceManager.Profiles.GetProfile(currentProfileName); + profile.Name = currentProfileName; + Core.ServiceManager.Profiles.SaveProfile(profile); + } + + + public void SaveProfile(Profile profile) + { + string json = JsonConvert.SerializeObject(profile); + string path = profilePathMapping[profile.Name]; + ServiceManager.Instance.ConfigService.TimeSettingsLastSave = DateTime.Now; + File.WriteAllText(path, json); + CurrentProfile.IsProfileStale = false; + } + + public void SaveProfile(Profile profile, string path) + { + string json = JsonConvert.SerializeObject(profile); + ServiceManager.Instance.ConfigService.TimeSettingsLastSave = DateTime.Now; + File.WriteAllText(path, json); + CurrentProfile.IsProfileStale = false; + } + + } +} diff --git a/RGBSync+/Services/ProfileTriggerManager.cs b/RGBSync+/Services/ProfileTriggerManager.cs new file mode 100644 index 0000000..bdd5312 --- /dev/null +++ b/RGBSync+/Services/ProfileTriggerManager.cs @@ -0,0 +1,292 @@ +using Newtonsoft.Json; +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Windows.Threading; +using SyncStudio.WPF.UI; + +namespace SyncStudio.WPF +{ + public class ProfileTriggerManager : LanguageAwareBaseViewModel + { + private ObservableCollection profileTriggers = new ObservableCollection(); + + public ObservableCollection ProfileTriggers + { + get => profileTriggers; + set => SetProperty(ref profileTriggers, value); + } + + private readonly List blockedTriggers = new List(); + + public ProfileTriggerManager() + { + if (File.Exists("ProfileTriggers.json")) + { + try + { + string json = File.ReadAllText("ProfileTriggers.json"); + List temp = JsonConvert.DeserializeObject>(json); + ProfileTriggers = new ObservableCollection(temp); + IsDirty = false; + + } + catch + { + } + + if (ProfileTriggers == null) + { + ProfileTriggers = new ObservableCollection(); + } + } + + ProfileTriggers.CollectionChanged += ProfileTriggers_CollectionChanged; + + + + profileTriggerTimer = new DispatcherTimer(); + profileTriggerTimer.Interval = TimeSpan.FromSeconds(1); + profileTriggerTimer.Tick += (sender, args) => ServiceManager.Instance.ProfileTriggerManager.CheckTriggers(); + profileTriggerTimer.Start(); + } + + public DispatcherTimer profileTriggerTimer; + + + [JsonIgnore] public bool IsDirty = false; + + private void ProfileTriggers_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + IsDirty = true; + } + + private void CheckDirty() + { + if (IsDirty) + { + Debug.WriteLine("Writing profile Triggers"); + string json = JsonConvert.SerializeObject(ProfileTriggers.ToList()); + try + { + File.WriteAllText("ProfileTriggers.json", json); + } + catch + { + } + + IsDirty = false; + + } + } + + public void CheckTriggers() + { + CheckDirty(); + + Process[] processlist = Process.GetProcesses(); + if (ProfileTriggers != null) + { + foreach (ProfileTriggerEntry profileTriggerEntry in ProfileTriggers) + { + bool doit = false; + switch (profileTriggerEntry?.TriggerType) + { + case ProfileTriggerTypes.RunningProccess: + { + bool foundProcess = processlist.Any(x => + x.ProcessName.ToLower() == profileTriggerEntry?.ProcessName?.ToLower()); + + doit = foundProcess; + if (profileTriggerEntry.TriggerWhenNotFound) + { + doit = !doit; + } + + + + break; + } + + case ProfileTriggerTypes.TimeBased: + { + doit = (DateTime.Now.Minute == profileTriggerEntry.Minute && + DateTime.Now.Hour == profileTriggerEntry.Hour); + break; + } + } + + if (doit && blockedTriggers.All(x => x != profileTriggerEntry.Id)) + { + //ServiceManager.Instance.ProfileService.LoadProfileFromName(profileTriggerEntry.ProfileName); + blockedTriggers.Add(profileTriggerEntry.Id); + } + + if (!doit && blockedTriggers.Any(x => x == profileTriggerEntry.Id)) + { + blockedTriggers.Remove(profileTriggerEntry.Id); + } + } + } + } + public class ProfileTriggerEntry : BaseViewModel + { + private void Dirty() + { + ServiceManager.Instance.ProfileTriggerManager.IsDirty = true; + + } + + private bool expanded = false; + + [JsonIgnore] + public bool Expanded + { + get => expanded; + set + { + + SetProperty(ref expanded, value); + Dirty(); + } + } + private Guid id; + + public Guid Id + { + get => id; + set + { + + SetProperty(ref id, value); + Dirty(); + } + } + + private string name; + public string Name + { + get => name; + set + { + + SetProperty(ref name, value); + Dirty(); + } + } + + private string profileName; + public string ProfileName + { + get => profileName; + set + { + SetProperty(ref profileName, value); + + Dirty(); + } + } + + private Guid profileId; + + public Guid ProfileId + { + get => profileId; + set + { + SetProperty(ref profileId, value); + + Dirty(); + } + } + + private string triggerType; + + public string TriggerType + { + get => triggerType; + set + { + + SetProperty(ref triggerType, value); + + Dirty(); + } + } + + //RunningProccess + + private string processName; + + public string ProcessName + { + get => processName; + set + { + SetProperty(ref processName, value); + + Dirty(); + } + } + + private bool triggerWhenNotFound; + + public bool TriggerWhenNotFound + { + get => triggerWhenNotFound; + set + { + SetProperty(ref triggerWhenNotFound, value); + + Dirty(); + } + } + + //TimeBased + + private int hour = 0; + + public int Hour + { + get => hour; + set + { + SetProperty(ref hour, value); + + Dirty(); + } + } + + private int minute = 0; + + public int Minute + { + get => minute; + set + { + SetProperty(ref minute, value); + + Dirty(); + } + } + } + + public static class ProfileTriggerTypes + { + public const string RunningProccess = "Running Process"; + public const string TimeBased = "Time Based"; + public const string DiscordTrigger = "Discord Trigger"; + public const string APITrigger = "API Trigger"; + + } + + public void APIValueSet(string key, string value) + { + throw new NotImplementedException(); + } + } +} diff --git a/RGBSync+/Services/SLSAuthService.cs b/RGBSync+/Services/SLSAuthService.cs new file mode 100644 index 0000000..368c472 --- /dev/null +++ b/RGBSync+/Services/SLSAuthService.cs @@ -0,0 +1,25 @@ +using SimpleLed; +using System; +using System.Diagnostics; +using SyncStudio.ClientService; + +namespace SyncStudio.WPF.Services +{ + public class SLSAuthService + { + private ClientService.Settings settings = new Settings(); + public SimpleLed.LoginSystem SimpleLedAuth = new LoginSystem(); + public bool SimpleLedAuthenticated = false; + public void SimpleLedLogIn(Action onLoginAction) + { + Process.Start(SimpleLedAuth.Login(() => + { + settings.SimpleLedUserId = SimpleLedAuth.UserId.Value; + settings.SimpleLedUserName = SimpleLedAuth.UserName; + settings.SimpleLedAuthToken = SimpleLedAuth.AccessToken; + SimpleLedAuthenticated = true; + onLoginAction?.Invoke(); + })); + } + } +} diff --git a/RGBSync+/Services/StoreService.cs b/RGBSync+/Services/StoreService.cs new file mode 100644 index 0000000..7671a13 --- /dev/null +++ b/RGBSync+/Services/StoreService.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using MarkdownUI.WPF; +using SyncStudio.WPF.Model; +using SyncStudio.WPF.UI.Tabs; +using SharpCompress.Archives; +using SimpleLed; +using SyncStudio.WPF.UI; + +namespace SyncStudio.WPF.Services +{ + public class StoreService + { + private SimpleModal installingModal; + + + public void RemoveInstalledPlugin(ISimpleLed exist) + { + //todo remove? + //Guid id = exist.GetProperties().ProductId; + + //ServiceManager.Instance.SLSManager.Drivers.Remove(exist); + //Thread.Sleep(100); + //exist.Dispose(); + //Thread.Sleep(1000); + + + //string pluginPath = ApplicationManager.SLSPROVIDER_DIRECTORY + "\\" + id; + //if (Directory.Exists(pluginPath)) + //{ + // try + // { + // Directory.Delete(pluginPath, true); + // } + // catch + // { + // } + //} + } + + public async Task InstallPlugin(Guid pluginId, ReleaseNumber releaseNumber) + { + bool anyFail = false; + string pluginPath = ApplicationManager.SLSPROVIDER_DIRECTORY + "\\" + pluginId; + SimpleLedApiClient apiClient = new SimpleLedApiClient(); + byte[] drver = await apiClient.GetProduct(pluginId, releaseNumber); + + try + { + Directory.CreateDirectory(pluginPath); + } + catch + { + } + + using (Stream stream = new MemoryStream(drver)) + { + IArchive thingy = SharpCompress.Archives.ArchiveFactory.Open(stream); + + float mx = thingy.Entries.Count(); + int ct = 0; + List pluginPaths = new List(); + + foreach (IArchiveEntry archiveEntry in thingy.Entries) + { + bool suc = false; + int attemp = 0; + + while (attemp < 10 && !suc) + { + try + { + archiveEntry.WriteToDirectory(pluginPath); + suc = true; + } + catch + { + attemp++; + Thread.Sleep(100); + } + } + + if (!suc) + { + anyFail = true; + } + + ct++; + + installingModal?.UpdateModalPercentage(ServiceManager.Instance.ApplicationManager.MainViewModel, + (int)(ct / mx) * 100); + } + + try + { + File.Delete(pluginPath + "\\SimpleLed.dll"); + } + catch + { + } + + } + + return anyFail; + } + + public void ShowPlugInUI(Guid pluginID, Grid designationGrid) + { + //todo + //var herp = SyncStudio.Core.ServiceManager.SLSManager.Drivers.ToList(); + + //List berks = SyncStudio.Core.ServiceManager.Store.GetInstalledProviders().ToList(); + + //Dictionary lookup = herp.ToDictionary(simpleLed => simpleLed.GetProperties().ProductId); + + + //ISimpleLed existingPlugin = lookup[pluginID]; + //// berks.First(x => x.GetProperties().ProductId == pluginID); + + //ISimpleLedWithConfig testDrv = existingPlugin as ISimpleLedWithConfig; + + //if (existingPlugin is ISimpleLedWithConfig drv) + //{ + + + // MarkdownUIBundle cfgUI = drv.GetCustomConfig(null); + // designationGrid.Children.Clear(); + // StackPanel sp = new StackPanel(); + // designationGrid.Children.Add(sp); + + // ResourceDictionary theme = new ResourceDictionary { Source = new Uri(@"\UI\MarkdownDark.xaml", UriKind.Relative) }; + // if (Core.ServiceManager.SLSManager.GetTheme() == ThemeWatcher.WindowsTheme.Dark) + // { + // ((SolidColorBrush)theme["Primary"]).Color = Colors.Black; + // ((SolidColorBrush)theme["Secondary"]).Color = Colors.White; + // } + // else + // { + // ((SolidColorBrush)theme["Primary"]).Color = Colors.White; + // ((SolidColorBrush)theme["Secondary"]).Color = Colors.Black; + // } + // ((SolidColorBrush)theme["AccentColor"]).Color = Core.ServiceManager.SLSManager.GetAccent(); + + + // MarkdownUIHandler handler = new MarkdownUIHandler(cfgUI.Markdown, cfgUI.ViewModel, theme); + // handler.RenderToUI(sp); + + + + //todo + //designationGrid.Children.Add(cfgUI); + + //designationGrid.HorizontalAlignment = HorizontalAlignment.Stretch; + //designationGrid.VerticalAlignment = VerticalAlignment.Stretch; + + //cfgUI.HorizontalContentAlignment = HorizontalAlignment.Stretch; + //cfgUI.HorizontalAlignment = HorizontalAlignment.Stretch; + //cfgUI.VerticalAlignment = VerticalAlignment.Stretch; + //cfgUI.VerticalContentAlignment = VerticalAlignment.Stretch; + + //cfgUI.Foreground = new SolidColorBrush(Colors.Black); //Make theme aware + + } + + public async Task> GetDriversFromStore() + { + SimpleLedApiClient apiClient = new SimpleLedApiClient(); + List storePlugins = await apiClient.GetProducts(); + return storePlugins; + } + + } +} diff --git a/RGBSync+/SimpleLogger.cs b/RGBSync+/SimpleLogger.cs new file mode 100644 index 0000000..3c4d3c6 --- /dev/null +++ b/RGBSync+/SimpleLogger.cs @@ -0,0 +1,86 @@ +using QRCoder; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Runtime.CompilerServices; +using System.Windows.Media.Imaging; +using SyncStudio.WPF.UI; + +namespace SyncStudio.WPF +{ + public class SimpleLogger + { + public List Log = new List(); + + public void Debug(object log, [CallerMemberName] string cmn = "") + { + Log.Add(new LogEntry(log.ToString(), "Debug", null, cmn)); + } + + public void Info(object log, [CallerMemberName] string cmn = "") + { + Log.Add(new LogEntry(log.ToString(), "Info", null, cmn)); + } + + public void CrashWindow(Exception ex, [CallerMemberName] string callerMemberName = "") + { + CrashWindow crashWindow = new CrashWindow(); + crashWindow.errorName.Text = ex.GetType().ToString(); + crashWindow.message.Text = ex.Message; + + crashWindow.stackTrace.Text = ex.StackTrace; + crashWindow.Show(); + + Log.Add(new LogEntry(ex.GetType().ToString(), "Crash", ex)); + string guid = crashWindow.SendReport(ex); + string url = "https://api.rgbsync.com/crashlogs/viewReport/?guid=" + guid; + crashWindow.ErrorReportUrl = url; + + + QRCodeGenerator qrGenerator = new QRCodeGenerator(); + QRCodeData qrCodeData = qrGenerator.CreateQrCode(url, QRCodeGenerator.ECCLevel.Q); + QRCode qrCode = new QRCode(qrCodeData); + Bitmap qrCodeImage = qrCode.GetGraphic(20); + + crashWindow.qrcode.Source = BitmapToImageSource(qrCodeImage); + } + + private BitmapImage BitmapToImageSource(Bitmap bitmap) + { + using (MemoryStream memory = new MemoryStream()) + { + bitmap.Save(memory, System.Drawing.Imaging.ImageFormat.Bmp); + memory.Position = 0; + BitmapImage bitmapimage = new BitmapImage(); + bitmapimage.BeginInit(); + bitmapimage.StreamSource = memory; + bitmapimage.CacheOption = BitmapCacheOption.OnLoad; + bitmapimage.EndInit(); + + return bitmapimage; + } + } + + public class LogEntry + { + public string Log { get; set; } + public DateTime Time { get; set; } + public string Caller { get; set; } + public string LogType { get; set; } + public Exception Exception { get; set; } + public LogEntry(string log, string logType = "Info", Exception exception = null, [CallerMemberName] string callerMemberName = "") + { + Log = log; + Time = DateTime.Now; + Caller = callerMemberName; + LogType = logType; + + if (exception != null) + { + Exception = exception; + } + } + } + } +} diff --git a/RGBSync+/Styles/CachedResourceDictionary.cs b/RGBSync+/Styles/CachedResourceDictionary.cs index c35a946..65bc420 100644 --- a/RGBSync+/Styles/CachedResourceDictionary.cs +++ b/RGBSync+/Styles/CachedResourceDictionary.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Windows; -namespace RGBSyncPlus.Styles +namespace SyncStudio.WPF.Styles { public class CachedResourceDictionary : ResourceDictionary { @@ -40,8 +40,12 @@ private static void UpdateCache(Uri source) _cachedDictionaries.Add(uriPath); - ResourceDictionary newDictionary = new ResourceDictionary { Source = new Uri(uriPath, source.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative) }; - CopyDictionaryEntries(newDictionary, _innerDictionary); + try + { + ResourceDictionary newDictionary = new ResourceDictionary { Source = new Uri(uriPath, source.IsAbsoluteUri ? UriKind.Absolute : UriKind.Relative) }; + CopyDictionaryEntries(newDictionary, _innerDictionary); + } + catch { } } private static void CopyDictionaryEntries(IDictionary source, IDictionary target) diff --git a/RGBSync+/Styles/RainbowDefault/BlurredDecorationWindow.xaml b/RGBSync+/Styles/RainbowDefault/BlurredDecorationWindow.xaml deleted file mode 100644 index a32db2b..0000000 --- a/RGBSync+/Styles/RainbowDefault/BlurredDecorationWindow.xaml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/Button.xaml b/RGBSync+/Styles/RainbowDefault/Button.xaml deleted file mode 100644 index b40b659..0000000 --- a/RGBSync+/Styles/RainbowDefault/Button.xaml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/ColorSelector.xaml b/RGBSync+/Styles/RainbowDefault/ColorSelector.xaml deleted file mode 100644 index 1175f00..0000000 --- a/RGBSync+/Styles/RainbowDefault/ColorSelector.xaml +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/Form.xaml b/RGBSync+/Styles/RainbowDefault/Form.xaml deleted file mode 100644 index 061f734..0000000 --- a/RGBSync+/Styles/RainbowDefault/Form.xaml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/FrameworkElement.xaml b/RGBSync+/Styles/RainbowDefault/FrameworkElement.xaml deleted file mode 100644 index 107ef2e..0000000 --- a/RGBSync+/Styles/RainbowDefault/FrameworkElement.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/RGBSync+/Styles/RainbowDefault/GradientEditor.xaml b/RGBSync+/Styles/RainbowDefault/GradientEditor.xaml deleted file mode 100644 index 066b53c..0000000 --- a/RGBSync+/Styles/RainbowDefault/GradientEditor.xaml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/ImageButton.xaml b/RGBSync+/Styles/RainbowDefault/ImageButton.xaml deleted file mode 100644 index 479474d..0000000 --- a/RGBSync+/Styles/RainbowDefault/ImageButton.xaml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/ListBox.xaml b/RGBSync+/Styles/RainbowDefault/ListBox.xaml deleted file mode 100644 index f389dd1..0000000 --- a/RGBSync+/Styles/RainbowDefault/ListBox.xaml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/Navigation.xaml b/RGBSync+/Styles/RainbowDefault/Navigation.xaml deleted file mode 100644 index 116e43a..0000000 --- a/RGBSync+/Styles/RainbowDefault/Navigation.xaml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/TextBox.xaml b/RGBSync+/Styles/RainbowDefault/TextBox.xaml deleted file mode 100644 index dd71612..0000000 --- a/RGBSync+/Styles/RainbowDefault/TextBox.xaml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/Theme.xaml b/RGBSync+/Styles/RainbowDefault/Theme.xaml deleted file mode 100644 index fe19b2a..0000000 --- a/RGBSync+/Styles/RainbowDefault/Theme.xaml +++ /dev/null @@ -1,75 +0,0 @@ - - - #FFDCDCDC - #FF2A2A2A - #B82A2A2A - #111111 - #B8111111 - #60111111 - #50000000 - #FFFFFFFF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #60111111 - #B8111111 - - - - - - - - - - - - - - - 40 - - - - 14 - 14 - 22 - diff --git a/RGBSync+/Styles/RainbowDefault/ToolTip.xaml b/RGBSync+/Styles/RainbowDefault/ToolTip.xaml deleted file mode 100644 index 932042c..0000000 --- a/RGBSync+/Styles/RainbowDefault/ToolTip.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/RGBSync+/Styles/RainbowDefault/Scrollbar.xaml b/RGBSync+/Styles/Scrollbar.xaml similarity index 92% rename from RGBSync+/Styles/RainbowDefault/Scrollbar.xaml rename to RGBSync+/Styles/Scrollbar.xaml index 411c0ea..e8e6b1f 100644 --- a/RGBSync+/Styles/RainbowDefault/Scrollbar.xaml +++ b/RGBSync+/Styles/Scrollbar.xaml @@ -1,6 +1,6 @@  + xmlns:local="clr-namespace:SyncStudio.WPF.Styles"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RGBSync+/JackNetRGBSync.csproj b/RGBSync+/SyncStudio.WPF.csproj similarity index 55% rename from RGBSync+/JackNetRGBSync.csproj rename to RGBSync+/SyncStudio.WPF.csproj index 534bfd6..3f87097 100644 --- a/RGBSync+/JackNetRGBSync.csproj +++ b/RGBSync+/SyncStudio.WPF.csproj @@ -6,9 +6,9 @@ AnyCPU {C6BF4357-07D9-496B-9630-A26568D30723} WinExe - RGBSyncPlus - RGBSync+ - v4.5 + SyncStudio.WPF + SyncStudio.WPF + v4.7.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -27,6 +27,7 @@ 1.0.0.%2a false true + x86 @@ -48,10 +49,10 @@ 4 - RGBSyncPlus.App + SyncStudio.WPF.App - icon.ico + ProgramIcon.ico true @@ -75,13 +76,12 @@ - - ..\..\..\RGB Utilities\JackNet RGB SYNC Beta\RGBSync+\HidSharp.dll - + + @@ -105,161 +105,167 @@ - - - - - - - - + + + + + + + + + + + - + + - - - - - ConfigurationWindow.xaml - - - - - - + + + + + + + + + + + + + + + + App.xaml Code - - DeleteLayerDialog.xaml + + + + CrashWindow.xaml EnterKeyDialog.xaml - - GenericErrorDialog.xaml - - - GenericInfoDialog.xaml - - - GetUpdateWindow.xaml + + + + MainWindow.xaml + NoUpdateDialog.xaml - - PremiumMessageBox.xaml + + + SplashLoader.xaml + + + + + About.xaml + + + + Devices.xaml + + + + + + NewsView.xaml + + + + Palettes.xaml + + + + ProfilesTab.xaml + + + + SettingsUI.xaml + + + + Store.xaml + + Designer MSBuild:Compile - - Designer - MSBuild:Compile - - + MSBuild:Compile Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - - MSBuild:Compile + Designer - - MSBuild:Compile - Designer - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile @@ -268,44 +274,12 @@ Code - - True - True - Resources.resx - True Settings.settings True - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - - - PublicResXFileCodeGenerator - Resources.Designer.cs - Designer - + SettingsSingleFileGenerator Settings.Designer.cs @@ -319,12 +293,20 @@ + + 6.1.0 + 4.1.0 1.0.150 + + 6.2.4 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + 2.2.0 @@ -334,36 +316,38 @@ 2.1.0 - - 12.0.3 + + 0.4.0 - - 4.7.0 + + 5.2.7 - - 0.1.32 + + 12.0.3 - - 0.1.32 + + 1.4.1 - - 0.1.32 + + 0.26.0 - - 0.1.32 + + 5.6.0 4.5.0 + + 5.0.3 + + + 2.3.1 + 1.0.0 - - - - @@ -387,9 +371,6 @@ - - - @@ -427,25 +408,97 @@ - + - + - + - + - + - + - + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + {EB4729F4-0BF6-41D3-9548-F8C7846A2025} + SimpleLed + + + {7028e44e-407c-4460-a51e-00171036fb36} + ColorPickerWPF + + + {23a9ed3d-5354-4707-91e3-5a57104779bf} + FluentWPF + + + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB} + MarkdownUI.WPF + + + {518EA12F-6E44-49B7-9D62-49C837087779} + Nan0SyncStudio.Branding + + + {25C9A16E-F361-47B0-9566-17EC0BF34E36} + RGBSyncStudio.Branding + + + {6c755854-b53f-4e8f-817b-5de28cf7580f} + SyncStudio.Branding + + + {55d3373b-bc73-4065-883f-c5f6ee4dea06} + SyncStudio.ClientService + + + {790A3D76-28FA-4DFC-959E-81302CC5C9B4} + SyncStudio.Domain + + + + + + \ No newline at end of file diff --git a/RGBSync+/SyncStudio.sln b/RGBSync+/SyncStudio.sln new file mode 100644 index 0000000..9305d98 --- /dev/null +++ b/RGBSync+/SyncStudio.sln @@ -0,0 +1,208 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.156 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.WPF", "SyncStudio.WPF.csproj", "{C6BF4357-07D9-496B-9630-A26568D30723}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.Launcher", "..\Launcher\SyncStudio.Launcher.csproj", "{400FEC06-C6E7-4A09-80A6-B9A4E750D41A}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedCode", "..\SharedCode\SharedCode.shproj", "{285A3E6C-652A-4CA2-9B27-3A4DC4E1177B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentWPF", "..\FluentWPF\FluentWPF.csproj", "{23A9ED3D-5354-4707-91E3-5A57104779BF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPickerWPF", "..\ColorpickerWPF\ColorPickerWPF.csproj", "{7028E44E-407C-4460-A51E-00171036FB36}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Drivers", "Drivers", "{6F4DCDAA-0EEC-414D-ABC1-31CC3D30B0BD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.Core", "..\RGBSyncCore\SyncStudio.Core.csproj", "{69A31D81-1626-49E2-B7B3-C30CF6DF55A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.Domain", "..\SyncStudio.Domain\SyncStudio.Domain.csproj", "{790A3D76-28FA-4DFC-959E-81302CC5C9B4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{66E819DE-9A64-4EBE-A93F-773F6BB0030C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleLed", "..\..\..\Users\james\source\repos\Org\SimpleLed\Interface\SimpleLed\SimpleLed.csproj", "{EB4729F4-0BF6-41D3-9548-F8C7846A2025}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.Branding", "..\SyncStudio.Branding\SyncStudio.Branding.csproj", "{6C755854-B53F-4E8F-817B-5DE28CF7580F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Brandings", "Brandings", "{69D87DAB-7FE1-46F1-B824-94A4AB041573}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGBSyncStudio.Branding", "..\RGBSyncStudio.Branding\RGBSyncStudio.Branding.csproj", "{25C9A16E-F361-47B0-9566-17EC0BF34E36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nan0SyncStudio.Branding", "..\Nan0SyncStudio.Branding\Nan0SyncStudio.Branding.csproj", "{518EA12F-6E44-49B7-9D62-49C837087779}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Driver.HyperXAlloy.RGB", "..\..\..\Users\james\source\repos\Org\SimpleLed\Driver.HyperXAlloy.RGB\Driver.HyperXAlloy.RGB\Driver.HyperXAlloy.RGB.csproj", "{FF7C43DD-E460-4F07-8B2A-7DA9E356B736}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Driver.MadLed", "..\..\..\Users\james\source\repos\Org\SimpleLed\Driver.MadLedProtocol\Driver.MadLed.csproj", "{0BB33AB4-3959-4672-8C6E-23724E1B9E53}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownUI.WPF", "..\MarkdownUI.WPF\MarkdownUI.WPF.csproj", "{0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdrownUI.Tester", "..\MarkdrownUI.Tester\MarkdrownUI.Tester.csproj", "{2BD1843A-E114-4C55-AE56-53CDD0FC42D3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.Service", "..\SyncStudio.Service\SyncStudio.Service.csproj", "{8DD34248-90FD-41B6-84BB-658B1B880D36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyncStudio.ClientService", "..\SyncStudio.ClientService\SyncStudio.ClientService.csproj", "{55D3373B-BC73-4065-883F-C5F6EE4DEA06}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\SharedCode\SharedCode.projitems*{285a3e6c-652a-4ca2-9b27-3a4dc4e1177b}*SharedItemsImports = 13 + ..\SharedCode\SharedCode.projitems*{400fec06-c6e7-4a09-80a6-b9a4e750d41a}*SharedItemsImports = 4 + ..\SharedCode\SharedCode.projitems*{c6bf4357-07d9-496b-9630-a26568d30723}*SharedItemsImports = 4 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|x64.ActiveCfg = Debug|x64 + {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|x64.Build.0 = Debug|x64 + {C6BF4357-07D9-496B-9630-A26568D30723}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6BF4357-07D9-496B-9630-A26568D30723}.Release|Any CPU.Build.0 = Release|Any CPU + {C6BF4357-07D9-496B-9630-A26568D30723}.Release|x64.ActiveCfg = Release|x64 + {C6BF4357-07D9-496B-9630-A26568D30723}.Release|x64.Build.0 = Release|x64 + {C6BF4357-07D9-496B-9630-A26568D30723}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Debug|x64.ActiveCfg = Debug|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Debug|x64.Build.0 = Debug|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Release|Any CPU.Build.0 = Release|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Release|x64.ActiveCfg = Release|Any CPU + {400FEC06-C6E7-4A09-80A6-B9A4E750D41A}.Release|x64.Build.0 = Release|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Debug|x64.ActiveCfg = Debug|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Debug|x64.Build.0 = Debug|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Release|Any CPU.Build.0 = Release|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Release|x64.ActiveCfg = Release|Any CPU + {23A9ED3D-5354-4707-91E3-5A57104779BF}.Release|x64.Build.0 = Release|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Debug|x64.ActiveCfg = Debug|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Debug|x64.Build.0 = Debug|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Release|Any CPU.Build.0 = Release|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Release|x64.ActiveCfg = Release|Any CPU + {7028E44E-407C-4460-A51E-00171036FB36}.Release|x64.Build.0 = Release|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Debug|x64.ActiveCfg = Debug|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Debug|x64.Build.0 = Debug|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Release|Any CPU.Build.0 = Release|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Release|x64.ActiveCfg = Release|Any CPU + {69A31D81-1626-49E2-B7B3-C30CF6DF55A9}.Release|x64.Build.0 = Release|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Debug|x64.ActiveCfg = Debug|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Debug|x64.Build.0 = Debug|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Release|Any CPU.Build.0 = Release|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Release|x64.ActiveCfg = Release|Any CPU + {790A3D76-28FA-4DFC-959E-81302CC5C9B4}.Release|x64.Build.0 = Release|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Debug|x64.ActiveCfg = Debug|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Debug|x64.Build.0 = Debug|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Release|Any CPU.Build.0 = Release|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Release|x64.ActiveCfg = Release|Any CPU + {EB4729F4-0BF6-41D3-9548-F8C7846A2025}.Release|x64.Build.0 = Release|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Debug|x64.ActiveCfg = Debug|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Debug|x64.Build.0 = Debug|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Release|Any CPU.Build.0 = Release|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Release|x64.ActiveCfg = Release|Any CPU + {6C755854-B53F-4E8F-817B-5DE28CF7580F}.Release|x64.Build.0 = Release|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Debug|x64.ActiveCfg = Debug|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Debug|x64.Build.0 = Debug|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Release|Any CPU.Build.0 = Release|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Release|x64.ActiveCfg = Release|Any CPU + {25C9A16E-F361-47B0-9566-17EC0BF34E36}.Release|x64.Build.0 = Release|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Debug|Any CPU.Build.0 = Debug|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Debug|x64.ActiveCfg = Debug|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Debug|x64.Build.0 = Debug|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Release|Any CPU.ActiveCfg = Release|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Release|Any CPU.Build.0 = Release|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Release|x64.ActiveCfg = Release|Any CPU + {518EA12F-6E44-49B7-9D62-49C837087779}.Release|x64.Build.0 = Release|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Debug|x64.ActiveCfg = Debug|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Debug|x64.Build.0 = Debug|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Release|Any CPU.Build.0 = Release|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Release|x64.ActiveCfg = Release|Any CPU + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736}.Release|x64.Build.0 = Release|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Debug|x64.ActiveCfg = Debug|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Debug|x64.Build.0 = Debug|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Release|Any CPU.Build.0 = Release|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Release|x64.ActiveCfg = Release|Any CPU + {0BB33AB4-3959-4672-8C6E-23724E1B9E53}.Release|x64.Build.0 = Release|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Debug|x64.Build.0 = Debug|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Release|Any CPU.Build.0 = Release|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Release|x64.ActiveCfg = Release|Any CPU + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB}.Release|x64.Build.0 = Release|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Debug|x64.ActiveCfg = Debug|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Debug|x64.Build.0 = Debug|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Release|Any CPU.Build.0 = Release|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Release|x64.ActiveCfg = Release|Any CPU + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3}.Release|x64.Build.0 = Release|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Debug|x64.ActiveCfg = Debug|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Debug|x64.Build.0 = Debug|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Release|Any CPU.Build.0 = Release|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Release|x64.ActiveCfg = Release|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Release|x64.Build.0 = Release|Any CPU + {8DD34248-90FD-41B6-84BB-658B1B880D36}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Debug|x64.ActiveCfg = Debug|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Debug|x64.Build.0 = Debug|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Release|Any CPU.Build.0 = Release|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Release|x64.ActiveCfg = Release|Any CPU + {55D3373B-BC73-4065-883F-C5F6EE4DEA06}.Release|x64.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {23A9ED3D-5354-4707-91E3-5A57104779BF} = {66E819DE-9A64-4EBE-A93F-773F6BB0030C} + {7028E44E-407C-4460-A51E-00171036FB36} = {66E819DE-9A64-4EBE-A93F-773F6BB0030C} + {EB4729F4-0BF6-41D3-9548-F8C7846A2025} = {66E819DE-9A64-4EBE-A93F-773F6BB0030C} + {6C755854-B53F-4E8F-817B-5DE28CF7580F} = {69D87DAB-7FE1-46F1-B824-94A4AB041573} + {25C9A16E-F361-47B0-9566-17EC0BF34E36} = {69D87DAB-7FE1-46F1-B824-94A4AB041573} + {518EA12F-6E44-49B7-9D62-49C837087779} = {69D87DAB-7FE1-46F1-B824-94A4AB041573} + {FF7C43DD-E460-4F07-8B2A-7DA9E356B736} = {6F4DCDAA-0EEC-414D-ABC1-31CC3D30B0BD} + {0BB33AB4-3959-4672-8C6E-23724E1B9E53} = {6F4DCDAA-0EEC-414D-ABC1-31CC3D30B0BD} + {0ED1B140-9FA4-44F0-A5BE-3BDDC12270AB} = {66E819DE-9A64-4EBE-A93F-773F6BB0030C} + {2BD1843A-E114-4C55-AE56-53CDD0FC42D3} = {66E819DE-9A64-4EBE-A93F-773F6BB0030C} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3AD1163D-9F77-43AB-A3BA-38C1B9CCBA87} + EndGlobalSection +EndGlobal diff --git a/RGBSync+/SyncStudio.sln.DotSettings b/RGBSync+/SyncStudio.sln.DotSettings new file mode 100644 index 0000000..5518c4a --- /dev/null +++ b/RGBSync+/SyncStudio.sln.DotSettings @@ -0,0 +1,2 @@ + + UID \ No newline at end of file diff --git a/RGBSync+/ThemeWatcher.cs b/RGBSync+/ThemeWatcher.cs new file mode 100644 index 0000000..8020403 --- /dev/null +++ b/RGBSync+/ThemeWatcher.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Management; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; +using System.Windows.Threading; +using Microsoft.Win32; + +namespace SyncStudio.WPF +{ + public class ThemeWatcher + { + public class ThemeChangeEventArgs + { + public WindowsTheme CurrentTheme { get; set; } + public Color AccentColor { get; set; } + + } + + public delegate void ThemeChangedEventHandler(object sender, ThemeChangeEventArgs e); + public event ThemeChangedEventHandler OnThemeChanged; + + public WindowsTheme CurrentTheme = GetWindowsTheme(); + public Color CurrentAccent; + private const string RegistryKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; + + private const string RegistryValueName = "AppsUseLightTheme"; + + + public ThemeWatcher() + { + var acnt = (SolidColorBrush)SystemParameters.WindowGlassBrush; + acnt.Freeze(); + var clr = acnt.Color; + + CurrentAccent = clr; + } + public enum WindowsTheme + { + Light, + Dark + } + + public void WatchTheme() + { + var currentUser = WindowsIdentity.GetCurrent(); + string query = string.Format( + CultureInfo.InvariantCulture, + @"SELECT * FROM RegistryValueChangeEvent WHERE Hive = 'HKEY_USERS' AND KeyPath = '{0}\\{1}' AND ValueName = '{2}'", + currentUser.User.Value, + RegistryKeyPath.Replace(@"\", @"\\"), + RegistryValueName); + + try + { + var watcher = new ManagementEventWatcher(query); + watcher.EventArrived += (sender, args) => + { + WindowsTheme newWindowsTheme = GetWindowsTheme(); + if (newWindowsTheme != CurrentTheme) + { + var acnt = (SolidColorBrush)SystemParameters.WindowGlassBrush; + acnt.Freeze(); + OnThemeChanged?.Invoke(this, new ThemeChangeEventArgs + { + CurrentTheme = newWindowsTheme, + AccentColor = acnt.Color + }); + // React to new theme + CurrentTheme = newWindowsTheme; + } + }; + + // Start listening for events + watcher.Start(); + + DispatcherTimer accentWatcher = new DispatcherTimer + { + Interval = TimeSpan.FromSeconds(5), + }; + + accentWatcher.Tick += AccentWatcher_Tick; + + accentWatcher.Start(); + } + catch (Exception) + { + // This can fail on Windows 7 + } + + WindowsTheme initialTheme = GetWindowsTheme(); + } + + private void AccentWatcher_Tick(object sender, EventArgs e) + { + var acnt = (SolidColorBrush)SystemParameters.WindowGlassBrush; + acnt.Freeze(); + var clr = acnt.Color; + if (clr != CurrentAccent) + { + CurrentAccent = clr; + + OnThemeChanged?.Invoke(this, new ThemeChangeEventArgs + { + CurrentTheme = CurrentTheme, + AccentColor = CurrentAccent + }); + + + } + } + + public static WindowsTheme GetWindowsTheme() + { + using (RegistryKey key = Registry.CurrentUser.OpenSubKey(RegistryKeyPath)) + { + object registryValueObject = key?.GetValue(RegistryValueName); + if (registryValueObject == null) + { + return WindowsTheme.Light; + } + + int registryValue = (int)registryValueObject; + var theme = registryValue > 0 ? WindowsTheme.Light : WindowsTheme.Dark; + return theme; + } + } + + public static Color GetAccent() + { + var acnt = (SolidColorBrush)SystemParameters.WindowGlassBrush; + acnt.Freeze(); + var clr = acnt.Color; + + return clr; + } + } + +} diff --git a/RGBSync+/UI/BaseViewModel.cs b/RGBSync+/UI/BaseViewModel.cs new file mode 100644 index 0000000..1581e28 --- /dev/null +++ b/RGBSync+/UI/BaseViewModel.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media; +using Newtonsoft.Json; +using SimpleLed; + +namespace SyncStudio.WPF.UI +{ + /// + /// + /// Represents a basic bindable class which notifies when a property value changes. + /// + public abstract class BaseViewModel : IBindable + { + + protected BaseViewModel() + { + + InternalSolids.themeWatcher.OnThemeChanged += Watcher_OnThemeChanged; + + var test = (SolidColorBrush)SystemParameters.WindowGlassBrush; + AccentColor = test.Color; + AccentSolidColorBrush = new SolidColorBrush(AccentColor); + AccentSolidColorBrush.Freeze(); + + RaiseChanges(); + } + + private void Watcher_OnThemeChanged(object sender, ThemeWatcher.ThemeChangeEventArgs e) + { + CurrentTheme = e.CurrentTheme; + + PrimaryColor = CurrentTheme == ThemeWatcher.WindowsTheme.Dark ? Colors.White : Colors.Black; + PrimarySolidColorBrush = new SolidColorBrush(PrimaryColor); + + SecondaryColor = CurrentTheme == ThemeWatcher.WindowsTheme.Dark ? Colors.Black : Colors.White; + SecondarySolidColorBrush = new SolidColorBrush(SecondaryColor); + + AccentSolidColorBrush = new SolidColorBrush(e.AccentColor); + AccentSolidColorBrush.Freeze(); + + AccentColor = e.AccentColor; + + Debug.WriteLine("ThemeChange: ***********"); + Debug.WriteLine("Primary: " + PrimaryColor); + Debug.WriteLine("Secondary: " + SecondaryColor); + Debug.WriteLine("Accent: " + AccentColor); + + RaiseChanges(); + } + + + private SolidColorBrush primarySolidColorBrush = new SolidColorBrush(Colors.White); + + [JsonIgnore] + public SolidColorBrush PrimarySolidColorBrush + { + get => primarySolidColorBrush; + set + { + value.Freeze(); + SetProperty(ref primarySolidColorBrush, value); + } + } + + private SolidColorBrush secondarySolidColorBrush = new SolidColorBrush(Colors.Black); + [JsonIgnore] + public SolidColorBrush SecondarySolidColorBrush + { + get => secondarySolidColorBrush; + set + { + value.Freeze(); + SetProperty(ref secondarySolidColorBrush, value); + } + } + + private SolidColorBrush accentSolidColorBrush = new SolidColorBrush(Colors.CornflowerBlue); + [JsonIgnore] + public SolidColorBrush AccentSolidColorBrush + { + get => accentSolidColorBrush; + set + { + value.Freeze(); + SetProperty(ref accentSolidColorBrush, value); + } + } + + private Color primaryColor = Colors.White; + private Color secondaryColor = Colors.Black; + private Color accentColor = Colors.CornflowerBlue; + [JsonIgnore] + public Color PrimaryColor + { + get => primaryColor; + set { SetProperty(ref primaryColor, value); } + } + + [JsonIgnore] + public Color SecondaryColor + { + get => secondaryColor; + set => SetProperty(ref secondaryColor, value); + } + + [JsonIgnore] + public Color AccentColor + { + get => accentColor; + set => SetProperty(ref accentColor, value); + } + + [JsonIgnore] public Color PrimaryLow => new Color { A = 0x33, R = PrimaryColor.R, G = PrimaryColor.G, B = PrimaryColor.B }; + [JsonIgnore] public Color PrimaryMediumLow => new Color { A = 0x66, R = PrimaryColor.R, G = PrimaryColor.G, B = PrimaryColor.B }; + [JsonIgnore] public Color PrimaryMedium => new Color { A = 0x99, R = PrimaryColor.R, G = PrimaryColor.G, B = PrimaryColor.B }; + [JsonIgnore] public Color PrimaryMediumHigh => new Color { A = 0xCC, R = PrimaryColor.R, G = PrimaryColor.G, B = PrimaryColor.B }; + + + [JsonIgnore] public Color SecondaryLow => new Color { A = 0x33, R = SecondaryColor.R, G = SecondaryColor.G, B = SecondaryColor.B }; + [JsonIgnore] public Color SecondaryMediumLow => new Color { A = 0x66, R = SecondaryColor.R, G = SecondaryColor.G, B = SecondaryColor.B }; + [JsonIgnore] public Color SecondaryMedium => new Color { A = 0x99, R = SecondaryColor.R, G = SecondaryColor.G, B = SecondaryColor.B }; + [JsonIgnore] public Color SecondaryMediumHigh => new Color { A = 0xCC, R = SecondaryColor.R, G = SecondaryColor.G, B = SecondaryColor.B }; + + [JsonIgnore] public SolidColorBrush PrimaryLowSolidColorBrush => new SolidColorBrush(PrimaryLow); + [JsonIgnore] public SolidColorBrush PrimaryMediumLowSolidColorBrush => new SolidColorBrush(PrimaryMediumLow); + [JsonIgnore] public SolidColorBrush PrimaryMediumSolidColorBrush => new SolidColorBrush(PrimaryMedium); + [JsonIgnore] public SolidColorBrush PrimaryMediumHighSolidColorBrush => new SolidColorBrush(PrimaryMediumHigh); + + + [JsonIgnore] public SolidColorBrush SecondaryLowSolidColorBrush => new SolidColorBrush(SecondaryLow); + [JsonIgnore] public SolidColorBrush SecondaryMediumLowSolidColorBrush => new SolidColorBrush(SecondaryMediumLow); + [JsonIgnore] public SolidColorBrush SecondaryMediumSolidColorBrush => new SolidColorBrush(SecondaryMedium); + [JsonIgnore] public SolidColorBrush SecondaryMediumHighSolidColorBrush => new SolidColorBrush(SecondaryMediumHigh); + + + private void RaiseChanges() + { + this.OnPropertyChanged("PrimaryLow"); + this.OnPropertyChanged("PrimaryMediumLow"); + this.OnPropertyChanged("PrimaryMedium"); + this.OnPropertyChanged("PrimaryMediumHigh"); + + this.OnPropertyChanged("SecondaryLow"); + this.OnPropertyChanged("SecondaryMediumLow"); + this.OnPropertyChanged("SecondaryMedium"); + this.OnPropertyChanged("SecondaryMediumHigh"); + + this.OnPropertyChanged("PrimaryLowSolidColorBrush"); + this.OnPropertyChanged("PrimaryMediumLowSolidColorBrush"); + this.OnPropertyChanged("PrimaryMediumSolidColorBrush"); + this.OnPropertyChanged("PrimaryMediumHighSolidColorBrush"); + + this.OnPropertyChanged("SecondaryLowSolidColorBrush"); + this.OnPropertyChanged("SecondaryMediumLowSolidColorBrush"); + this.OnPropertyChanged("SecondaryMediumSolidColorBrush"); + this.OnPropertyChanged("SecondaryMediumHighSolidColorBrush"); + } + #region Events + + private ThemeWatcher.WindowsTheme currentTheme; + + [JsonIgnore] + public ThemeWatcher.WindowsTheme CurrentTheme + { + get => currentTheme; + set => SetProperty(ref currentTheme, value); + } + + /// + /// Occurs when a property value changes. + /// + public event PropertyChangedEventHandler PropertyChanged; + + #endregion + + #region Methods + + /// + /// Checks if the property already matches the desirec value or needs to be updated. + /// + /// Type of the property. + /// Reference to the backing-filed. + /// Value to apply. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected virtual bool RequiresUpdate(ref T storage, T value) + { + return !Equals(storage, value); + } + + /// + /// Checks if the property already matches the desired value and updates it if not. + /// + /// Type of the property. + /// Reference to the backing-filed. + /// Value to apply. + /// Name of the property used to notify listeners. This value is optional + /// and can be provided automatically when invoked from compilers that support . + /// true if the value was changed, false if the existing value matched the desired value. + protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) + { + if (!this.RequiresUpdate(ref storage, value)) return false; + + storage = value; + // ReSharper disable once ExplicitCallerInfoArgument + this.OnPropertyChanged(propertyName); + return true; + } + + /// + /// Triggers the -event when a a property value has changed. + /// + /// Name of the property used to notify listeners. This value is optional + /// and can be provided automatically when invoked from compilers that support . + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + #endregion + } + + /// + /// Represents a basic bindable class which notifies when a property value changes. + /// + public interface IBindable : INotifyPropertyChanged + { + } +} diff --git a/RGBSync+/UI/ConfigurationViewModel.cs b/RGBSync+/UI/ConfigurationViewModel.cs index 542aef5..a736db7 100644 --- a/RGBSync+/UI/ConfigurationViewModel.cs +++ b/RGBSync+/UI/ConfigurationViewModel.cs @@ -2,8 +2,11 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; +using System.Drawing; +using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Reflection; @@ -28,24 +31,273 @@ using System.Text; using System.Net; using System.Resources; +using System.Windows.Media.Imaging; +using SimpleLed; namespace RGBSyncPlus.UI { - public sealed class ConfigurationViewModel : AbstractBindable, IDropTarget + public sealed class ConfigurationViewModel : AbstractBindable { + private bool showManageProfiles; + + public bool ShowManageProfiles + { + get => showManageProfiles; + set => SetProperty(ref showManageProfiles, value); + } + + private int selectedProfileIndex = 0; + + public int SelectedProfileIndex + { + get => selectedProfileIndex; + set + { + selectedProfileIndex = value; + if (value > -1 && value < profileNames.Count) + { + string newProfileName = ProfileNames[value]; + if (ApplicationManager.Instance.CurrentProfile.Name != newProfileName) + { + ApplicationManager.Instance.LoadProfileFromName(newProfileName); + + } + } + } + } + private bool isDesign = DesignerProperties.GetIsInDesignMode(new DependencyObject()); + + + private ObservableCollection profileTriggerTypeNames = new ObservableCollection + { + ProfileTriggerManager.ProfileTriggerTypes.TimeBased, + ProfileTriggerManager.ProfileTriggerTypes.RunningProccess + }; + + public ObservableCollection ProfileTriggerTypeNames + { + get => profileTriggerTypeNames; + set => SetProperty(ref profileTriggerTypeNames, value); + } + + public class ProfileItemViewModel : BaseViewModel + { + private string name; + public string Name + { + get => name; + set => SetProperty(ref name, value); + } + + private ObservableCollection triggers; + + public ObservableCollection Triggers + { + get => triggers; + set => SetProperty(ref triggers, value); + } + } + + private ObservableCollection profileItems = new ObservableCollection(); + + public ObservableCollection ProfileItems + { + get => profileItems; + set => SetProperty(ref profileItems, value); + } + + private string selectedProfileItem; + public string SelectedProfileItem + { + get => selectedProfileItem; + set + { + SetProperty(ref selectedProfileItem, value); + } + } + private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); #region Properties & Fields - + private ObservableCollection profileNames; + + public ObservableCollection ProfileNames + { + get => profileNames; + set => SetProperty(ref profileNames, value); + } + + private ObservableCollection plugins; + public ObservableCollection Plugins + { + get => plugins; + set => SetProperty(ref plugins, value); + } + + private ObservableCollection slsDevices; + public ObservableCollection SLSDevices { get => slsDevices; set => SetProperty(ref slsDevices, value); } + private ObservableCollection deviceMappingViewModel; + public ObservableCollection DeviceMappingViewModel { get => deviceMappingViewModel; set => SetProperty(ref deviceMappingViewModel, value); } public Version Version => Assembly.GetEntryAssembly().GetName().Version; + private bool singleDeviceSelected; + + public bool SingledDeviceSelected + { + get => singleDeviceSelected; + set => SetProperty(ref singleDeviceSelected, value); + } + + private bool multipleDeviceSelected; + + public bool MultipleDeviceSelected + { + get => multipleDeviceSelected; + set => SetProperty(ref multipleDeviceSelected, value); + } + + + + private bool showModal; + + public bool ShowModal + { + get => showModal; + set => SetProperty(ref showModal, value); + } + + private string modalText = "Please Wait"; + + public string ModalText + { + get => modalText; + set => SetProperty(ref modalText, value); + } + + private bool showModalTextBox = false; + + public bool ShowModalTextBox + { + get => showModalTextBox; + set => SetProperty(ref showModalTextBox, value); + } + + private bool showModalCloseButton = false; + + public bool ShowModalCloseButton + { + get => showModalCloseButton; + set => SetProperty(ref showModalCloseButton, value); + } + + + private string syncToSearch = ""; + + public string SyncToSearch + { + get => syncToSearch; + set + { + SetProperty(ref syncToSearch, value); + FilterSourceDevices(); + } + } + + private string subViewMode = "Info"; + + public string SubViewMode + { + get => subViewMode; + set => SetProperty(ref subViewMode, value); + } + + private bool devicesCondenseView = false; + + public bool DevicesCondenseView + { + get => devicesCondenseView; + set => SetProperty(ref devicesCondenseView, value); + } + + private ObservableCollection sourceDevices; + + public ObservableCollection SourceDevices + { + get => sourceDevices; + set { SetProperty(ref sourceDevices, value); } + } + + public void FilterSourceDevices() + { + + var visibleDevices = SourceDevices.Where(sourceDevice => ((string.IsNullOrWhiteSpace(SyncToSearch) || + (sourceDevice.Name.ToLower() == + SyncToSearch.ToLower() || + sourceDevice.ProviderName.ToLower() == + SyncToSearch.ToLower() + ) + ) + )); + + Debug.WriteLine(visibleDevices.Count()); + foreach (var sourceDevice in SourceDevices) + { + sourceDevice.IsHidden = ! + (sourceDevice.Enabled || (string.IsNullOrWhiteSpace(SyncToSearch) || + (sourceDevice.Name.ToLower().Contains(SyncToSearch.ToLower()) || + sourceDevice.ProviderName.ToLower().Contains(SyncToSearch.ToLower())))); + } + + OnPropertyChanged(nameof(SourceDevices)); + } + + private ObservableCollection filteredSourceDevices; + + public ObservableCollection FilteredSourceDevices + { + get => filteredSourceDevices; + set => SetProperty(ref filteredSourceDevices, value); + } + + public void SetupSourceDevices(ControlDevice controlDevice) + { + if (controlDevice == null) return; + + var sources = ApplicationManager.Instance.SLSDevices.Where(x => x.Driver.GetProperties().IsSource || x.Driver.GetProperties().SupportsPull); + + ObservableCollection temp = ApplicationManager.Instance.CurrentProfile?.DeviceProfileSettings; + DeviceMappingModels.NGDeviceProfileSettings current = null; + + if (controlDevice != null) + { + temp?.FirstOrDefault(x => + x != null && x.Name == controlDevice.Name && x.ProviderName == controlDevice.Driver?.Name()); + } + + SourceDevices = new ObservableCollection(); + foreach (var source in sources) + { + var enabled = current != null && source.Driver.Name() == current.SourceProviderName && source.Name == current.SourceName && source.ConnectedTo == current.ConnectedTo; + SourceDevices.Add(new DeviceMappingModels.SourceModel + { + ProviderName = source.Driver.Name(), + ConnectedTo = source.ConnectedTo, + Device = source, + Name = source.Name, + Enabled = enabled, + Image = ToBitmapImage(source.ProductImage), + }); ; + } + + } + public static string PremiumStatus { get { - if(Directory.Exists("netplugin")) - { + if (Directory.Exists("netplugin")) + { //netplugin is installed return "Visible"; } @@ -72,205 +324,156 @@ public string NotPremiumStatus } } - public double UpdateRate + //public double UpdateRate + //{ + // get => 1.0 / ApplicationManager.Instance.UpdateTrigger.UpdateFrequency; + // set + // { + // double val = MathHelper.Clamp(value, 1, 100); + // ApplicationManager.Instance.AppSettings.UpdateRate = val; + // ApplicationManager.Instance.UpdateTrigger.UpdateFrequency = 1.0 / val; + // OnPropertyChanged(); + // } + //} + + private int thumbWidth = 64; + + public int ThumbWidth { - get => 1.0 / ApplicationManager.Instance.UpdateTrigger.UpdateFrequency; + get => thumbWidth; set { - double val = MathHelper.Clamp(value, 1, 100); - ApplicationManager.Instance.AppSettings.UpdateRate = val; - ApplicationManager.Instance.UpdateTrigger.UpdateFrequency = 1.0 / val; - OnPropertyChanged(); + SetProperty(ref thumbWidth, value); } } - public int StartupDelay - { - get => ApplicationManager.Instance.AppSettings.StartDelay; - set - { - ApplicationManager.Instance.AppSettings.StartDelay = value; - OnPropertyChanged(); - } - } + private int thumbHeight = 48; - public string SelectedLanguage + public int ThumbHeight { - get => ApplicationManager.Instance.AppSettings.Lang; + get => thumbHeight; set { - ApplicationManager.Instance.AppSettings.Lang = value; - OnPropertyChanged(); + SetProperty(ref thumbHeight, value); } } - public string Name + private int zoomLevel = 5; + + public int ZoomLevel { - get => ApplicationManager.Instance.Settings.Name; + get => zoomLevel; set { - ApplicationManager.Instance.Settings.Name = value; - OnPropertyChanged(); + SetProperty(ref zoomLevel, value); + if (ZoomLevel < 3) ZoomLevel = 3; + if (ZoomLevel > 9) ZoomLevel = 9; + ThumbWidth = new[] { 16, 32, 64, 128, 192, 256, 385, 512, 768, 1024, 2048, 4096 }[ZoomLevel]; + ThumbHeight = (int)(ThumbWidth / 1.3333333333333333f); + + ShowFullThumb = ZoomLevel > 3; } } - public bool IsMinimized + private bool showFullThumb; + + public bool ShowFullThumb { - get => ApplicationManager.Instance.AppSettings.MinimizeToTray; - set - { - ApplicationManager.Instance.AppSettings.MinimizeToTray = value; - OnPropertyChanged(); - } + get => showFullThumb; + set => SetProperty(ref showFullThumb, value); } - public bool EnableDiscordRPC + + public string SelectedLanguage { - get => ApplicationManager.Instance.AppSettings.EnableDiscordRPC; + get => ApplicationManager.Instance.NGSettings.Lang; set { - ApplicationManager.Instance.AppSettings.EnableDiscordRPC = value; + ApplicationManager.Instance.NGSettings.Lang = value; OnPropertyChanged(); } } + public ObservableCollection DeviceMaps { get; set; } = new ObservableCollection(); - public bool RunAsAdmin + public string Name { - get => ApplicationManager.Instance.AppSettings.RunAsAdmin; + get => ApplicationManager.Instance.Settings.Name; set { - ApplicationManager.Instance.AppSettings.RunAsAdmin = value; + ApplicationManager.Instance.Settings.Name = value; OnPropertyChanged(); } } - public bool EnableServer + public bool IsMinimized { - get => ApplicationManager.Instance.AppSettings.EnableServer; + get => ApplicationManager.Instance.NGSettings.MinimizeToTray; set { - ApplicationManager.Instance.AppSettings.EnableServer = value; + ApplicationManager.Instance.NGSettings.MinimizeToTray = value; OnPropertyChanged(); } } - public bool EnableClient + public bool EnableDiscordRPC { - get => ApplicationManager.Instance.AppSettings.EnableClient; + get => ApplicationManager.Instance.NGSettings.EnableDiscordRPC; set { - ApplicationManager.Instance.AppSettings.EnableClient = value; + ApplicationManager.Instance.NGSettings.EnableDiscordRPC = value; OnPropertyChanged(); } } - public string ClientButton + private void WriteConfig(JObject config) { - get - { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - return client["status"].ToString(); - } - set - { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - client["status"] = value; - File.WriteAllText("config.json", config.ToString()); - } + File.WriteAllText("config.json", config.ToString()); } - - public string ClientIP + private string ReadConfig() { - get + if (File.Exists("config.json")) { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - return client["host"].ToString(); + return File.ReadAllText("config.json", Encoding.UTF8); } - set + else { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - client["host"] = value; - File.WriteAllText("config.json", config.ToString()); + return "{\r\n \"client\": {\r\n \"host\": \"1.1.1.1\",\r\n \"port\": \"3784\",\r\n \"status\": \"Stop Client\"\r\n },\r\n \"server\": {\r\n \"port\": \"3784\"\r\n }\r\n}"; } } - public string ClientPort + + private double maxSubViewHeight; + public double MaxSubViewHeight { - get - { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - return client["port"].ToString(); - } - set - { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["client"]; - client["port"] = value; - File.WriteAllText("config.json", config.ToString()); - } + get => maxSubViewHeight; + set => SetProperty(ref maxSubViewHeight, value); } - public string ServerPort + private bool showPreRelease = false; + + public bool ShowPreRelease { - get - { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["server"]; - return client["port"].ToString(); - } + get => showPreRelease; set { - JObject config = JObject.Parse(File.ReadAllText("config.json", Encoding.UTF8)); - JObject client = (JObject)config["server"]; - client["port"] = value; - File.WriteAllText("config.json", config.ToString()); + SetProperty(ref showPreRelease, value); + FilterPlugins(); } } - private ObservableCollection _syncGroups; - public ObservableCollection SyncGroups - { - get => _syncGroups; - set => SetProperty(ref _syncGroups, value); - } + private string pluginSearch; - private SyncGroup _selectedSyncGroup; - public SyncGroup SelectedSyncGroup + public string PluginSearch { - get => _selectedSyncGroup; + get => pluginSearch; set { - if (SetProperty(ref _selectedSyncGroup, value)) - UpdateLedLists(); + SetProperty(ref pluginSearch, value); + FilterPlugins(); } } - private ListCollectionView _availableSyncLeds; - public ListCollectionView AvailableSyncLeds - { - get => _availableSyncLeds; - set => SetProperty(ref _availableSyncLeds, value); - } - - private ListCollectionView _availableLeds; - public ListCollectionView AvailableLeds - { - get => _availableLeds; - set => SetProperty(ref _availableLeds, value); - } - - private ListCollectionView _synchronizedLeds; - public ListCollectionView SynchronizedLeds - { - get => _synchronizedLeds; - set => SetProperty(ref _synchronizedLeds, value); - } #endregion @@ -283,13 +486,13 @@ public ListCollectionView SynchronizedLeds public ActionCommand ExportCommand => _exportCommand ?? (_exportCommand = new ActionCommand(Export)); private ActionCommand _exportCloudCommand; - public ActionCommand ExportCloudCommand => _exportCloudCommand ?? (_exportCloudCommand = new ActionCommand(ExportCloud)); + // public ActionCommand ExportCloudCommand => _exportCloudCommand ?? (_exportCloudCommand = new ActionCommand(ExportCloud)); private ActionCommand _importCommand; public ActionCommand ImportCommand => _importCommand ?? (_importCommand = new ActionCommand(Import)); private ActionCommand _importCloudCommand; - public ActionCommand ImportCloudCommand => _importCloudCommand ?? (_importCloudCommand = new ActionCommand(ImportCloud)); + // public ActionCommand ImportCloudCommand => _importCloudCommand ?? (_importCloudCommand = new ActionCommand(ImportCloud)); private ActionCommand _openSetCommand; public ActionCommand OpenSetCommand => _openSetCommand ?? (_openSetCommand = new ActionCommand(OpenSet)); @@ -300,8 +503,11 @@ public ListCollectionView SynchronizedLeds private ActionCommand _rpcCommand; public ActionCommand SetRPCCommand => _rpcCommand ?? (_rpcCommand = new ActionCommand(SetRPC)); + private ActionCommand _setDelayCommand; + //public ActionCommand SetDelayCommand => _setDelayCommand ?? (_setDelayCommand = new ActionCommand(SetDelay)); + private ActionCommand _adminCommand; - public ActionCommand SetAdminCommand => _adminCommand ?? (_adminCommand = new ActionCommand(SetAdmin)); + //public ActionCommand SetAdminCommand => _adminCommand ?? (_adminCommand = new ActionCommand(SetAdmin)); private ActionCommand _startClientCommand; public ActionCommand StartClientCommand => _startClientCommand ?? (_startClientCommand = new ActionCommand(StartClient)); @@ -310,25 +516,25 @@ public ListCollectionView SynchronizedLeds public ActionCommand StartServerCommand => _startServerCommand ?? (_startServerCommand = new ActionCommand(StartServer)); private ActionCommand _toggleServerCommand; - public ActionCommand ToggleServerCommand => _toggleServerCommand ?? (_toggleServerCommand = new ActionCommand(ToggleServer)); + // public ActionCommand ToggleServerCommand => _toggleServerCommand ?? (_toggleServerCommand = new ActionCommand(ToggleServer)); private ActionCommand _toggleClientCommand; - public ActionCommand ToggleClientCommand => _toggleClientCommand ?? (_toggleClientCommand = new ActionCommand(ToggleClient)); + //public ActionCommand ToggleClientCommand => _toggleClientCommand ?? (_toggleClientCommand = new ActionCommand(ToggleClient)); private ActionCommand _discord; public ActionCommand DiscordCommand => _discord ?? (_discord = new ActionCommand(Discord)); private ActionCommand _checkUpdate; - public ActionCommand CheckUpdateCommand => _checkUpdate ?? (_checkUpdate = new ActionCommand(checkUpdate)); + //public ActionCommand CheckUpdateCommand => _checkUpdate ?? (_checkUpdate = new ActionCommand(checkUpdate)); private ActionCommand _attribs; public ActionCommand AttribCommand => _attribs ?? (_attribs = new ActionCommand(Attribs)); private ActionCommand _addSyncGroupCommand; - public ActionCommand AddSyncGroupCommand => _addSyncGroupCommand ?? (_addSyncGroupCommand = new ActionCommand(AddSyncGroup)); + private ActionCommand _removeSyncGroupCommand; - public ActionCommand RemoveSyncGroupCommand => _removeSyncGroupCommand ?? (_removeSyncGroupCommand = new ActionCommand(RemoveSyncGroup)); + #endregion @@ -336,174 +542,477 @@ public ListCollectionView SynchronizedLeds public ConfigurationViewModel() { - SyncGroups = new ObservableCollection(ApplicationManager.Instance.Settings.SyncGroups); - AvailableSyncLeds = GetGroupedLedList(RGBSurface.Instance.Leds.Where(x => x.Device.DeviceInfo.SupportsSyncBack)); - OnPropertyChanged(nameof(AvailableSyncLeds)); - } + DeviceMappingViewModel = new ObservableCollection(); - #endregion - #region Methods - private ListCollectionView GetGroupedLedList(IEnumerable leds) => GetGroupedLedList(leds.Select(led => new SyncLed(led)).ToList()); + ProfileNames = ApplicationManager.Instance.NGSettings.ProfileNames; + SetUpProfileModels(); + this.ZoomLevel = 4; - private ListCollectionView GetGroupedLedList(IList syncLeds) + storeHandler = new StoreHandler(); + + LoadStoreAndPlugins(); + EnsureCorrectProfileIndex(); + + OnPropertyChanged(nameof(ProfileTriggerTypeNames)); + } + + public void SetUpProfileModels() { - ListCollectionView collectionView = new ListCollectionView(syncLeds); - collectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(SyncLed.Device))); - collectionView.SortDescriptions.Add(new SortDescription(nameof(SyncLed.Device), ListSortDirection.Ascending)); - collectionView.SortDescriptions.Add(new SortDescription(nameof(SyncLed.LedId), ListSortDirection.Ascending)); - collectionView.Refresh(); - return collectionView; + foreach (string profileName in ProfileNames) + { + ProfileItems.Add(new ProfileItemViewModel + { + Name = profileName, + Triggers = new ObservableCollection(ApplicationManager.Instance.ProfileTriggerManager.ProfileTriggers.Where(x=>x.ProfileName==profileName)) + }); + } } - private void UpdateLedLists() + public void LoadStoreAndPlugins() { - try + // using (new SimpleModal(this,"Refreshing store....")) { - SynchronizedLeds = GetGroupedLedList(SelectedSyncGroup.Leds); + + SetUpDeviceMapViewModel(); - OnPropertyChanged(nameof(SynchronizedLeds)); + List pp = storeHandler.DownloadStoreManifest(); - AvailableLeds = GetGroupedLedList(RGBSurface.Instance.Leds.Where(led => !SelectedSyncGroup.Leds.Any(sc => (sc.LedId == led.Id) && (sc.Device == led.Device.GetDeviceName())))); - OnPropertyChanged(nameof(AvailableLeds)); - } - catch(Exception ex) - { - Logger.Error("Error updating LedLists." + ex); - } - } + var ppu = pp.GroupBy(x => x.PluginId); - private void OpenHomepage() => Process.Start("https://www.rgbsync.com"); + Plugins = new ObservableCollection(); - private void OpenExcludeTool() => Process.Start("ExcludeHelper.exe"); + foreach (IGrouping pluginDetailses in ppu) + { + var insertThis = pluginDetailses.First(); - private void Discord() => Process.Start("https://discordapp.com/invite/pRyBKPr"); + var tmp = new PositionalAssignment.PluginDetailsViewModel(insertThis); + tmp.Versions = new ObservableCollection(pluginDetailses + .Select(x => new PositionalAssignment.PluginDetailsViewModel(x, true)).ToList()); - private void Attribs() => Process.Start("https://fanman03.com/rgbsync/?attribution"); + try + { + if (!Directory.Exists("icons")) + { + try + { + Directory.CreateDirectory("icons"); + } + catch + { + } + } + + if (File.Exists("icons\\" + tmp.PluginDetails.PluginId + ".png")) + { + using (Bitmap bm = new Bitmap("icons\\" + tmp.PluginDetails.PluginId + ".png")) + { + tmp.Image = ToBitmapImage(bm); + } + } + else + { + + string imageUrl = "https://github.com/SimpleLed/Store/raw/master/Icons/" + + tmp.PluginDetails.PluginId + ".png"; + Debug.WriteLine("Trying to fetch: " + imageUrl); + var webClient = new WebClient(); + using (Stream stream = webClient.OpenRead(imageUrl)) + { + // make a new bmp using the stream + using (Bitmap bitmap = new Bitmap(stream)) + { + //flush and close the stream + stream.Flush(); + stream.Close(); + // write the bmp out to disk + tmp.Image = ToBitmapImage(bitmap); + bitmap.Save("icons\\" + tmp.PluginDetails.PluginId + ".png"); + } + } + } + } + catch + { + } + + Plugins.Add(tmp); + + } + + FilterPlugins(); + + } + } - private void checkUpdate() + public void FilterPlugins() { - try + foreach (var pluginDetailsViewModel in Plugins) { - using (WebClient w = new WebClient()) + ReleaseNumber highestApplicable; + + ISimpleLed newestPublicModel; + ISimpleLed newestExperimentalModel; + + ISimpleLed installedVersion=null; + ReleaseNumber newestPublicFound = new ReleaseNumber(0, 0, 0, 0); + ReleaseNumber newestExperimentalFound = new ReleaseNumber(0, 0, 0, 0); + ReleaseNumber installed = new ReleaseNumber(0, 0, 0, 0); + + if (ApplicationManager.Instance.SLSManager.Drivers.Any(x => x.GetProperties().Id == pluginDetailsViewModel.PluginId)) { - Logger.Info("Checking for update..."); - var json = w.DownloadString(ApplicationManager.Instance.AppSettings.versionURL); - ProgVersion versionFromApi = JsonConvert.DeserializeObject(json); - int versionMajor = Version.Major; - int versionMinor = Version.Minor; - int versionBuild = Version.Build; - - if (versionFromApi.major > versionMajor) - { - PromptUpdate(); - Logger.Info("Update available. (major)"); - } - else if (versionFromApi.minor > versionMinor) + installedVersion = ApplicationManager.Instance.SLSManager.Drivers.First(x => x.GetProperties().Id == pluginDetailsViewModel.PluginId); + installed = installedVersion.GetProperties().CurrentVersion; + pluginDetailsViewModel.Installed = true; + } + else + { + pluginDetailsViewModel.Installed = false; + } + + foreach (var detailsViewModel in pluginDetailsViewModel.Versions) + { + if (detailsViewModel.PluginDetails.DriverProperties.CurrentVersion != null && + detailsViewModel.PluginDetails.DriverProperties.CurrentVersion > newestPublicFound && + detailsViewModel.PluginDetails.DriverProperties.IsPublicRelease) { - PromptUpdate(); - Logger.Info("Update available. (minor)"); + newestPublicFound = detailsViewModel.PluginDetails.DriverProperties.CurrentVersion; } - else if (versionFromApi.build > versionBuild) + + if (detailsViewModel.PluginDetails.DriverProperties.CurrentVersion != null && + detailsViewModel.PluginDetails.DriverProperties.CurrentVersion > newestExperimentalFound && + !detailsViewModel.PluginDetails.DriverProperties.IsPublicRelease) { - PromptUpdate(); - Logger.Info("Update available. (build)"); + newestExperimentalFound = detailsViewModel.PluginDetails.DriverProperties.CurrentVersion; } - else + } + + pluginDetailsViewModel.NewestPreReleaseVersion = newestExperimentalFound.ToString(); + pluginDetailsViewModel.NewestPublicVersion = newestPublicFound.ToString(); + + if (ShowPreRelease || (installedVersion!= null && !installedVersion.GetProperties().IsPublicRelease)) + { + highestApplicable = newestExperimentalFound; + if (highestApplicable < newestPublicFound) { - NoUpdate(); - Logger.Info("No update available."); + highestApplicable = newestPublicFound; } + } + else + { + highestApplicable = newestPublicFound; + } + + //p + + + //var publicReleases = pluginDetailsViewModel.Versions.Where(t => t.PluginDetails.Version != null && t.PluginDetails.DriverProperties.IsPublicRelease); + //if (publicReleases == null || publicReleases.Count()==0) + //{ + // pluginDetailsViewModel.Version = "0.0.0.0"; + //} + //else + //{ + // pluginDetailsViewModel.Version = publicReleases.Max(p => p.PluginDetails.Version).ToString(); + //} + + //var versionsWithVersions = pluginDetailsViewModel.Versions.Where(x => x.PluginDetails?.Version != null); + //pluginDetailsViewModel.PreReleaseVersion = versionsWithVersions.Max(p => p.PluginDetails.Version)?.ToString(); + //if (pluginDetailsViewModel.PreReleaseVersion == null) + //{ + // pluginDetailsViewModel.PreReleaseVersion = "0.0.0.0"; + //} + + //var existingInstalled = ApplicationManager.Instance.SLSManager.Drivers.FirstOrDefault(x => x.GetProperties().CurrentVersion?.ToString() == pluginDetailsViewModel.Version); + + //ReleaseNumber highestApplicable = new ReleaseNumber(pluginDetailsViewModel.Version); + //if (ShowPreRelease||(existingInstalled!=null&&!existingInstalled.GetProperties().IsPublicRelease)) + //{ + // highestApplicable = new ReleaseNumber(pluginDetailsViewModel.PreReleaseVersion); + //} + + //bool isoutdated = false; + //if (existingInstalled != null) + //{ + // isoutdated = existingInstalled.GetProperties().CurrentVersion < highestApplicable; + // pluginDetailsViewModel.InstalledButOutdated = isoutdated; + //} + + + PositionalAssignment.PluginDetailsViewModel newest = pluginDetailsViewModel.Versions.FirstOrDefault(x => x.Version == highestApplicable.ToString()); + + if (newest == null && highestApplicable.ToString() == "0.0.0.0000") + { + newest = pluginDetailsViewModel.Versions.FirstOrDefault(x => x.Version == null); } - } catch (Exception ex) - { - Logger.Error("Unable to check for updates. Download failed with exception: " + ex); + + if (newest == null) + { + pluginDetailsViewModel.Visible = false; + } + else + { + pluginDetailsViewModel.Visible = true; + pluginDetailsViewModel.Version = highestApplicable.ToString(); + pluginDetailsViewModel.Name = newest.Name; + pluginDetailsViewModel.Author = newest.Author; + + pluginDetailsViewModel.PreRelease = !newest.PluginDetails.DriverProperties.IsPublicRelease; + + pluginDetailsViewModel.InstalledButOutdated = pluginDetailsViewModel.Installed && highestApplicable > installedVersion.GetProperties().CurrentVersion; + + pluginDetailsViewModel.Visible = + (ShowPreRelease || !pluginDetailsViewModel.PreRelease) && + (string.IsNullOrWhiteSpace(PluginSearch) || + pluginDetailsViewModel.Name.ToLower().Contains(PluginSearch.ToLower()) + || + pluginDetailsViewModel.Author.ToLower().Contains(PluginSearch.ToLower()) + || + (pluginDetailsViewModel.Blurb != null && + pluginDetailsViewModel.Blurb.ToLower().Contains(PluginSearch.ToLower())) + ); + } + + } - } - public void PromptUpdate() - { - GetUpdateWindow getUpdateWindow = new GetUpdateWindow(); - getUpdateWindow.Show(); - } + private StoreHandler storeHandler; - public void NoUpdate() + private void SetUpDeviceMapViewModel() { - NoUpdateDialog noUpdate = new NoUpdateDialog(); - noUpdate.Show(); + SLSDevices = new ObservableCollection(); + foreach (ControlDevice device in ApplicationManager.Instance.SLSDevices) + { + var props = device.Driver.GetProperties(); + + SLSDevices.Add(new DeviceMappingModels.Device + { + ControlDevice = device, + Image = ToBitmapImage(device.ProductImage), + Name = device.Name, + ProviderName = device.Driver.Name(), + SupportsPull = props.SupportsPull, + SupportsPush = props.SupportsPush, + DriverProps = props, + ConnectedTo = device.ConnectedTo, + Title = string.IsNullOrWhiteSpace(device.TitleOverride) ? device.Driver.Name() : device.TitleOverride + }); + } + } - private void OpenSet() + public static BitmapImage ToBitmapImage(Bitmap bitmap) { - if(ApplicationManager.Instance.AppSettings.MinimizeToTray == true) - { - IsMinimized = true; - } - else if (ApplicationManager.Instance.AppSettings.MinimizeToTray == false) + if (bitmap == null) { - IsMinimized = false; + return null; } - } - private void SetRPC() - { - if (ApplicationManager.Instance.AppSettings.EnableDiscordRPC == true) + try { - EnableDiscordRPC = true; + using (var memory = new MemoryStream()) + { + bitmap.Save(memory, ImageFormat.Png); + memory.Position = 0; + + var bitmapImage = new BitmapImage(); + bitmapImage.BeginInit(); + bitmapImage.StreamSource = memory; + bitmapImage.CacheOption = BitmapCacheOption.OnLoad; + bitmapImage.EndInit(); + bitmapImage.Freeze(); + + return bitmapImage; + } } - else if (ApplicationManager.Instance.AppSettings.EnableDiscordRPC == false) + catch { - EnableDiscordRPC = false; + return null; } } - private void SetAdmin() + #endregion + + #region Methods + public ObservableCollection Devices { get; set; } = new ObservableCollection(); + private int devicesSelectedCount = 0; + public int DevicesSelectedCount { - if (ApplicationManager.Instance.AppSettings.RunAsAdmin == true) + get => devicesSelectedCount; + set { - RunAsAdmin = true; + int previousCount = devicesSelectedCount; + SetProperty(ref devicesSelectedCount, value); + if (previousCount == 0 && value > 0) + { + SubViewMode = "Info"; + } + + SingledDeviceSelected = value == 1; + MultipleDeviceSelected = value > 1; + + if (MultipleDeviceSelected && (SubViewMode == "Config" || SubViewMode == "Alignment")) + { + SubViewMode = "Info"; + } } - else if (ApplicationManager.Instance.AppSettings.RunAsAdmin == false) + } + + + + private ListCollectionView GetGroupedLedList(IEnumerable leds) + { + var thing = GetGroupedLedList(leds.Select(led => new SyncLed(led)).ToList()); + + return thing; + } + + public List GetSyncLeds() + { + List leds = new List(); + + leds.AddRange(RGBSurface.Instance.Leds.Where(x => x.Device.DeviceInfo.SupportsSyncBack).Select(p => new SyncLed(p))); + + foreach (var cd in ApplicationManager.Instance.SLSDevices.Where(v => v.Driver.GetProperties().IsSource)) { - RunAsAdmin = false; + leds.AddRange(cd.LEDs.OrderBy(x => x.Data.LEDNumber).Select(l => new SyncLed(cd, l))); } + + return leds; } - public void ToggleServer() + private ListCollectionView GetGroupedLedList(IList syncLeds) { - if(EnableServer == true) + ListCollectionView collectionView = new ListCollectionView(syncLeds); + collectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(SyncLed.Device))); + collectionView.SortDescriptions.Add(new SortDescription(nameof(SyncLed.Device), ListSortDirection.Ascending)); + collectionView.SortDescriptions.Add(new SortDescription(nameof(SyncLed.Index), ListSortDirection.Ascending)); + collectionView.Refresh(); + return collectionView; + } + + private void OpenHomepage() => Process.Start("https://www.rgbsync.com"); + private void OpenExcludeTool() => Process.Start("ExcludeHelper.exe"); + private void Discord() => Process.Start("https://www.rgbsync.com/discord"); + private void Attribs() => Process.Start("https://www.rgbsync.com?attribution"); + //private void checkUpdate() + //{ + // try + // { + // using (WebClient w = new WebClient()) + // { + // Logger.Info("Checking for update..."); + // var json = w.DownloadString(ApplicationManager.Instance.AppSettings.versionURL); + // ProgVersion versionFromApi = JsonConvert.DeserializeObject(json); + // int versionMajor = Version.Major; + // int versionMinor = Version.Minor; + // int versionBuild = Version.Build; + + // if (versionFromApi.major > versionMajor) + // { + // PromptUpdate(); + // Logger.Info("Update available. (major)"); + // } + // else if (versionFromApi.minor > versionMinor) + // { + // PromptUpdate(); + // Logger.Info("Update available. (minor)"); + // } + // else if (versionFromApi.build > versionBuild) + // { + // PromptUpdate(); + // Logger.Info("Update available. (build)"); + // } + // else + // { + // NoUpdate(); + // Logger.Info("No update available."); + // } + + // } + // } + // catch (Exception ex) + // { + // Logger.Error("Unable to check for updates. Download failed with exception: " + ex); + // } + + //} + + public void PromptUpdate() + { + //TODO fix update box. Until then, disable it because its annoying af. GetUpdateWindow getUpdateWindow = new GetUpdateWindow(); + //getUpdateWindow.Show(); + } + + public void NoUpdate() + { + NoUpdateDialog noUpdate = new NoUpdateDialog(); + noUpdate.Show(); + } + + private void OpenSet() + { + if (ApplicationManager.Instance.NGSettings.MinimizeToTray == true) { - EnableServer = true; - EnableClient = false; - } else + IsMinimized = true; + } + else if (ApplicationManager.Instance.NGSettings.MinimizeToTray == false) { - EnableServer = false; + IsMinimized = false; } - } - public void ToggleClient() + private void SetRPC() { - if (EnableClient == true) + if (ApplicationManager.Instance.NGSettings.EnableDiscordRPC == true) { - EnableClient = true; - EnableServer = false; + EnableDiscordRPC = true; } - else + else if (ApplicationManager.Instance.NGSettings.EnableDiscordRPC == false) { - EnableClient = false; + EnableDiscordRPC = false; } - } + + + //public void ToggleServer() + //{ + // if (EnableServer == true) + // { + // EnableServer = true; + // EnableClient = false; + // } + // else + // { + // EnableServer = false; + // } + + //} + + //public void ToggleClient() + //{ + // if (EnableClient == true) + // { + // EnableClient = true; + // EnableServer = false; + // } + // else + // { + // EnableClient = false; + // } + + //} + private void StartClient() { Process[] pname = Process.GetProcessesByName("netsync"); - if (pname.Length == 0) { + if (pname.Length == 0) + { if (!File.Exists("netplugin\\netsync.exe")) { Logger.Info("User does not have premium, cannot start client."); @@ -556,7 +1065,8 @@ private void StartServer() private void Export() { string settingsPath = "Profile.json"; - try { + try + { File.WriteAllText(settingsPath, JsonConvert.SerializeObject(ApplicationManager.Instance.Settings, new ColorSerializer())); string data = System.IO.File.ReadAllText(settingsPath); @@ -578,64 +1088,66 @@ private void Export() GenericErrorDialog infoDialog = new GenericErrorDialog("Access is denied", "Error", ex.GetFullMessage()); infoDialog.Show(); } - - } - private void ExportCloud() - { - if(ApplicationManager.Instance.AppSettings.ApiKey != null) - { - try - { - WebClient client = new WebClient(); - string profileData = Base64Encode(JsonConvert.SerializeObject(ApplicationManager.Instance.Settings, new ColorSerializer())); - string response = client.DownloadString("https://rgbsync.com/api/saveData.php?token=zQlszc7d1l9t8cv734nmte8ui4o3s8d15pcz&key=" + ApplicationManager.Instance.AppSettings.ApiKey + "&profile=" + profileData); - if(response == "success") - { - GenericInfoDialog infoDialog = new GenericInfoDialog("Profile has successfully been uploaded to the cloud.", "Success!"); - infoDialog.Show(); - } else - { - GenericErrorDialog errorDialog = new GenericErrorDialog("Error uploading profile.", "Error!", "Error uploading profile. Api response: "+ response); - errorDialog.Show(); - } - } - catch (Exception ex) - { - GenericErrorDialog errorDialog = new GenericErrorDialog("Error uploading profile.", "Error!", "Error uploading profile. " + ex); - errorDialog.Show(); - } - } else - { - EnterKeyDialog enterKeyDialog = new EnterKeyDialog(); - enterKeyDialog.Show(); - } } - private void ImportCloud() - { - if (ApplicationManager.Instance.AppSettings.ApiKey != null) - { - try - { - WebClient client = new WebClient(); - string response = client.DownloadString("https://rgbsync.com/api/fetchData.php?token=zQlszc7d1l9t8cv734nmte8ui4o3s8d15pcz&key=" + ApplicationManager.Instance.AppSettings.ApiKey); - ApplicationManager.Instance.Settings = JsonConvert.DeserializeObject(Base64Decode(response)); - App.SaveSettings(); - ApplicationManager.Instance.RestartApp(); - } - catch (Exception ex) - { - GenericErrorDialog errorDialog = new GenericErrorDialog("Error downloading profile.", "Error!", "Error downloading profile. " + ex); - errorDialog.Show(); - } - } - else - { - EnterKeyDialog enterKeyDialog = new EnterKeyDialog(); - enterKeyDialog.Show(); - } - } + //private void ExportCloud() + //{ + // if (ApplicationManager.Instance.AppSettings.ApiKey != null) + // { + // try + // { + // WebClient client = new WebClient(); + // string profileData = Base64Encode(JsonConvert.SerializeObject(ApplicationManager.Instance.Settings, new ColorSerializer())); + // string response = client.DownloadString("https://rgbsync.com/api/saveData.php?token=zQlszc7d1l9t8cv734nmte8ui4o3s8d15pcz&key=" + ApplicationManager.Instance.AppSettings.ApiKey + "&profile=" + profileData); + // if (response == "success") + // { + // GenericInfoDialog infoDialog = new GenericInfoDialog("Profile has successfully been uploaded to the cloud.", "Success!"); + // infoDialog.Show(); + // } + // else + // { + // GenericErrorDialog errorDialog = new GenericErrorDialog("Error uploading profile.", "Error!", "Error uploading profile. Api response: " + response); + // errorDialog.Show(); + // } + // } + // catch (Exception ex) + // { + // GenericErrorDialog errorDialog = new GenericErrorDialog("Error uploading profile.", "Error!", "Error uploading profile. " + ex); + // errorDialog.Show(); + // } + // } + // else + // { + // EnterKeyDialog enterKeyDialog = new EnterKeyDialog(); + // enterKeyDialog.Show(); + // } + //} + + //private void ImportCloud() + //{ + // if (ApplicationManager.Instance.AppSettings.ApiKey != null) + // { + // try + // { + // WebClient client = new WebClient(); + // string response = client.DownloadString("https://rgbsync.com/api/fetchData.php?token=zQlszc7d1l9t8cv734nmte8ui4o3s8d15pcz&key=" + ApplicationManager.Instance.AppSettings.ApiKey); + // ApplicationManager.Instance.Settings = JsonConvert.DeserializeObject(Base64Decode(response)); + // App.SaveSettings(); + // ApplicationManager.Instance.RestartApp(); + // } + // catch (Exception ex) + // { + // GenericErrorDialog errorDialog = new GenericErrorDialog("Error downloading profile.", "Error!", "Error downloading profile. " + ex); + // errorDialog.Show(); + // } + // } + // else + // { + // EnterKeyDialog enterKeyDialog = new EnterKeyDialog(); + // enterKeyDialog.Show(); + // } + //} private void Import() { @@ -666,78 +1178,47 @@ private void Import() } } - private void AddSyncGroup() + public static string Base64Encode(string plainText) { - SyncGroup syncGroup = new SyncGroup(); - SyncGroups.Add(syncGroup); - ApplicationManager.Instance.AddSyncGroup(syncGroup); + var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); + return System.Convert.ToBase64String(plainTextBytes); } - private void RemoveSyncGroup(SyncGroup syncGroup) + public static string Base64Decode(string base64EncodedData) { - if (syncGroup == null) return; - DeleteLayerDialog dld = new DeleteLayerDialog(syncGroup.DisplayName); - if ((bool)dld.ShowDialog()) - { - SyncGroups.Remove(syncGroup); - ApplicationManager.Instance.RemoveSyncGroup(syncGroup); - } - else - { - return; - } - - + var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); + return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); } - void IDropTarget.DragOver(IDropInfo dropInfo) + #endregion + + public void SubmitModalTextBox(string text) { - if ((dropInfo.Data is SyncLed || dropInfo.Data is IEnumerable) && (dropInfo.TargetCollection is ListCollectionView)) - { - dropInfo.DropTargetAdorner = DropTargetAdorners.Highlight; - dropInfo.Effects = DragDropEffects.Copy; - } + modalSubmitAction?.Invoke(text); } - void IDropTarget.Drop(IDropInfo dropInfo) + public void ShowCreateNewProfile() { - if (!(dropInfo.TargetCollection is ListCollectionView targetList)) return; - - //HACK DarthAffe 04.06.2018: Super ugly hack - I've no idea how to do this correctly ... - ListCollectionView sourceList = targetList == AvailableLeds ? SynchronizedLeds : AvailableLeds; - - if (dropInfo.Data is SyncLed syncLed) - { - targetList.AddNewItem(syncLed); - sourceList.Remove(syncLed); - - targetList.CommitNew(); - sourceList.CommitEdit(); - } - else if (dropInfo.Data is IEnumerable syncLeds) + ShowModal = true; + ModalText = "Enter name for new profile"; + ShowModalTextBox = true; + ShowModalCloseButton = true; + modalSubmitAction = (text) => { - foreach (SyncLed led in syncLeds) - { - targetList.AddNewItem(led); - sourceList.Remove(led); - } - targetList.CommitNew(); - sourceList.CommitEdit(); - } - } + ApplicationManager.Instance.GenerateNewProfile(text); + ProfileNames = ApplicationManager.Instance.NGSettings.ProfileNames; + ApplicationManager.Instance.LoadProfileFromName(text); + EnsureCorrectProfileIndex(); + }; - public static string Base64Encode(string plainText) - { - var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); - return System.Convert.ToBase64String(plainTextBytes); } - public static string Base64Decode(string base64EncodedData) + public void EnsureCorrectProfileIndex() { - var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); - return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); + SelectedProfileIndex = profileNames.IndexOf(ApplicationManager.Instance.CurrentProfile.Name); + SelectedProfileItem = ApplicationManager.Instance.CurrentProfile.Name; } - #endregion + private Action modalSubmitAction; } } diff --git a/RGBSync+/UI/ConfigurationWindow.xaml b/RGBSync+/UI/ConfigurationWindow.xaml index d8d40ad..218782d 100644 --- a/RGBSync+/UI/ConfigurationWindow.xaml +++ b/RGBSync+/UI/ConfigurationWindow.xaml @@ -1,4 +1,4 @@ - + Closed="ConfigurationWindow_OnClosed" ResizeMode="CanResizeWithGrip" SizeChanged="BlurredDecorationWindow_SizeChanged" + xmlns:fw="clr-namespace:SourceChord.FluentWPF;assembly=FluentWPF" + fw:AcrylicWindow.Enabled="True"> @@ -24,461 +26,903 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RGBSync+/UI/Tabs/About.xaml.cs b/RGBSync+/UI/Tabs/About.xaml.cs new file mode 100644 index 0000000..416e308 --- /dev/null +++ b/RGBSync+/UI/Tabs/About.xaml.cs @@ -0,0 +1,63 @@ +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using SimpleLed; + +namespace SyncStudio.WPF.UI.Tabs +{ + /// + /// Interaction logic for About.xaml + /// + public partial class About : UserControl + { + public About() + { + InitializeComponent(); + + UserControl splashLogo; + //todo + if (true)//todo || SyncStudio.Core.ServiceManager.SLSManager.GetTheme() == ThemeWatcher.WindowsTheme.Dark) + { + splashLogo = ServiceManager.Instance.Branding.GetDarkSplashLogo(); + } + else + { + splashLogo = ServiceManager.Instance.Branding.GetLightSplashLogo(); + } + + + this.LogoHere.Child = (splashLogo); + } + + private void DonatePatreon(object sender, RoutedEventArgs e) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://www.patreon.com/fanman03", + UseShellExecute = true + }; + Process.Start(psi); + } + + private void DonateCrypto(object sender, RoutedEventArgs e) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://rgbsync.com/?crypto", + UseShellExecute = true + }; + Process.Start(psi); + } + + + private void DonatePayPal(object sender, RoutedEventArgs e) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "https://paypal.me/ezmuze", + UseShellExecute = true + }; + Process.Start(psi); + } + } +} diff --git a/RGBSync+/UI/Tabs/AboutViewModel.cs b/RGBSync+/UI/Tabs/AboutViewModel.cs new file mode 100644 index 0000000..f1dfaec --- /dev/null +++ b/RGBSync+/UI/Tabs/AboutViewModel.cs @@ -0,0 +1,12 @@ +namespace SyncStudio.WPF.UI.Tabs +{ + public class AboutViewModel : LanguageAwareBaseViewModel + { + private string appName = "TODO";//ServiceManager.Instance.SLSManager.AppName; + public string AppName + { + get => appName; + set => SetProperty(ref appName, value); + } + } +} diff --git a/RGBSync+/UI/Tabs/Devices/Devices.xaml b/RGBSync+/UI/Tabs/Devices/Devices.xaml new file mode 100644 index 0000000..7ca495f --- /dev/null +++ b/RGBSync+/UI/Tabs/Devices/Devices.xaml @@ -0,0 +1,710 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RGBSync+/UI/Tabs/Palettes.xaml.cs b/RGBSync+/UI/Tabs/Palettes.xaml.cs new file mode 100644 index 0000000..1b83242 --- /dev/null +++ b/RGBSync+/UI/Tabs/Palettes.xaml.cs @@ -0,0 +1,141 @@ +using SyncStudio.WPF.Helper; +using SimpleLed; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Windows; +using System.Windows.Controls; + +namespace SyncStudio.WPF.UI.Tabs +{ + /// + /// Interaction logic for Palettes.xaml + /// + public partial class Palettes : UserControl + { + private PalettesViewModel vm => (PalettesViewModel)DataContext; + public Palettes() + { + InitializeComponent(); + } + + private void AddColor(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ColorBank bank = button.DataContext as ColorBank; + + if (bank.Colors.Count <= 20) + { + bank.Colors.Add(new ColorObject + { + ColorString = "#ff0000" + }); + + vm.SaveProfile(); + } + else + { + ServiceManager.Instance.ModalService.ShowSimpleModal("Color banks are limited to 20 colors"); + } + } + + private void debugclick(object sender, RoutedEventArgs e) + { + Button b = sender as Button; + ColorModel cm = b.DataContext as ColorModel; + Debug.WriteLine(cm); + cm = new ColorModel(80, 80, 80); + } + + private void DeleteColor(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ColorObject colorObject = button.DataContext as ColorObject; + + ListView parent = button.FindParent(); + + ColorBank parentContext = + parent.DataContext as ColorBank; + + if (parentContext.Colors.Count > 2) + { + parentContext.Colors.Remove(colorObject); + vm.SaveProfile(); + } + else + { + ServiceManager.Instance.ModalService.ShowSimpleModal("Color banks require at least 2 colors"); + } + } + + private void TextBox_TextChanged(object sender, TextChangedEventArgs e) + { + vm.SaveProfile(); + } + + private void AddProfile(object sender, RoutedEventArgs e) + { + string profileName = "New Profile"; + + if (vm.ColorProfiles.Any(x => x.ProfileName == profileName)) + { + int ct = 1; + + while (vm.ColorProfiles.Any(x => x.ProfileName == profileName + " " + ct)) + { + ct++; + } + + profileName = profileName + " " + ct; + + } + + ColorProfile cp = new ColorProfile + { + ProfileName = profileName, + ColorBanks = new ObservableCollection + { + new ColorBank + { + BankName = "Primary", + Colors = new ObservableCollection{ new ColorObject { ColorString = "#ff0000" } , new ColorObject { ColorString = "#000000" } } + }, + new ColorBank + { + BankName = "Secondary", + Colors = new ObservableCollection{ new ColorObject { ColorString = "#00ff00" } , new ColorObject { ColorString = "#000000" } } + },new ColorBank + { + BankName = "Tertiary", + Colors = new ObservableCollection{ new ColorObject { ColorString = "#0000ff" } , new ColorObject { ColorString = "#000000" } } + },new ColorBank + { + BankName = "Auxilary", + Colors = new ObservableCollection{ new ColorObject { ColorString = "#ff00ff" } , new ColorObject { ColorString = "#000000" } } + } + } + }; + + vm.ColorProfiles.Add(cp); + vm.CurrentProfile = cp; + } + + private void DeleteProfile(object sender, RoutedEventArgs e) + { + if (vm.ColorProfiles.Count > 1) + { + vm.ColorProfiles.Remove(vm.CurrentProfile); + File.Delete("ColorProfiles\\" + vm.CurrentProfile.Id + ".json"); + vm.CurrentProfile = vm.ColorProfiles.First(); + } + } + + private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + ComboBox thingy = sender as ComboBox; + ColorProfile cp = thingy.SelectedItem as ColorProfile; + vm.CurrentProfile = cp; + } + } +} diff --git a/RGBSync+/UI/Tabs/PalettesViewModel.cs b/RGBSync+/UI/Tabs/PalettesViewModel.cs new file mode 100644 index 0000000..2b24ba5 --- /dev/null +++ b/RGBSync+/UI/Tabs/PalettesViewModel.cs @@ -0,0 +1,120 @@ +using Newtonsoft.Json; +using SimpleLed; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Timers; +using System.Windows.Threading; + +namespace SyncStudio.WPF.UI.Tabs +{ + public class PalettesViewModel : LanguageAwareBaseViewModel + { + public void SaveProfile() + { + Unsaved = true; + ColorProfiles.First(x => x.Id == CurrentProfile.Id).ProfileName = CurrentProfile.ProfileName; + + if (saveTimer != null) + { + saveTimer.Stop(); + } + else + { + saveTimer = new Timer + { + AutoReset = false, + Interval = 50 + }; + + saveTimer.Elapsed += SaveTimer_Elapsed; + } + + saveTimer.Start(); + } + + private void SaveTimer_Elapsed(object sender, ElapsedEventArgs e) + { + ActuallySaveProfile(); + } + + private Timer saveTimer = null; + private void ActuallySaveProfile() + { + //todo move to api? + //string path = "ColorProfiles\\" + CurrentProfile.Id + ".json"; + + //if (!Directory.Exists("ColorProfiles")) + //{ + // Directory.CreateDirectory("ColorProfiles"); + //} + + //string json = JsonConvert.SerializeObject(CurrentProfile); + //File.WriteAllText(path, json); + + //ServiceManager.Instance.SLSManager.ColorProfile = CurrentProfile; + //SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile().ColorProfileId = CurrentProfile.Id; + //SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile().IsProfileStale = true; + + //Dispatcher.CurrentDispatcher.Invoke(() => Unsaved = false); + } + + private bool unsaved; + + public bool Unsaved + { + get => unsaved; + set => SetProperty(ref unsaved, value); + } + + public PalettesViewModel() + { + //todo + // CurrentProfile = SyncStudio.Core.ServiceManager.ColorPallets.GetActiveColorPallet(); + +// ColorProfiles = new ObservableCollection(SyncStudio.Core.ServiceManager.ColorPallets.GetAllColorPallets()); + + } + + private ColorProfile currentProfile; + + public ColorProfile CurrentProfile + { + get => currentProfile; + set + { + SetProperty(ref currentProfile, value); + SetUpWatchers(); + try + { + //todo + // ServiceManager.Instance.SLSManager.ColorProfile = value; + } + catch + { + } + } + } + + private ObservableCollection colorProfiles = new ObservableCollection(); + public ObservableCollection ColorProfiles + { + get => colorProfiles; + set => SetProperty(ref colorProfiles, value); + } + + public void SetUpWatchers() + { + foreach (ColorBank currentProfileColorBank in CurrentProfile.ColorBanks) + { + currentProfileColorBank.Colors.CollectionChanged += Colors_CollectionChanged; + + } + } + + private void Colors_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + { + SaveProfile(); + } + } +} diff --git a/RGBSync+/UI/Tabs/ProfileTabViewModel.cs b/RGBSync+/UI/Tabs/ProfileTabViewModel.cs new file mode 100644 index 0000000..b521d5a --- /dev/null +++ b/RGBSync+/UI/Tabs/ProfileTabViewModel.cs @@ -0,0 +1,358 @@ +using SimpleLed; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; +using Autofac; +using Autofac.Core; +using SyncStudio.ClientService; + +namespace SyncStudio.WPF.UI.Tabs +{ + public class ProfileTabViewModel : LanguageAwareBaseViewModel + { + private ClientService.Settings settings = new Settings(); + private ClientService.Profiles _profiles = ServiceManager.Container.Resolve(); + private string activeProfile; + + public string ActiveProfile + { + get => activeProfile; + set + { + SetProperty(ref activeProfile, value); + RefreshProfiles(false); + } + } + + private ProfileItemViewModel currentProfile; + + public ProfileItemViewModel CurrentProfile + { + get => currentProfile; + set => SetProperty(ref currentProfile, value); + } + + public class ProfileItemViewModel : BaseViewModel + { + private Guid profileId; + + public Guid ProfileId + { + get => profileId; + set => SetProperty(ref profileId, value); + } + + private bool isActiveProfile = false; + public bool IsActiveProfile + { + get => isActiveProfile; + set => SetProperty(ref isActiveProfile, value); + } + + private string name; + public string Name + { + get => name; + set => SetProperty(ref name, value); + } + + public ObservableCollection HoursList + { + get + { + ObservableCollection result = new ObservableCollection(); + for (int i = 0; i < 24; i++) + { + result.Add(i.ToString("00")); + } + + return result; + } + } + + public ObservableCollection MinutesList + { + get + { + ObservableCollection result = new ObservableCollection(); + for (int i = 0; i < 60; i++) + { + result.Add(i.ToString("00")); + } + + return result; + } + } + + private ObservableCollection triggers; + + public ObservableCollection Triggers + { + get => triggers; + set => SetProperty(ref triggers, value); + } + + public string OriginalName { get; set; } + } + private ObservableCollection profileTriggerTypeNames = new ObservableCollection + { + ProfileTriggerManager.ProfileTriggerTypes.TimeBased, + ProfileTriggerManager.ProfileTriggerTypes.RunningProccess + }; + + public ObservableCollection ProfileTriggerTypeNames + { + get => profileTriggerTypeNames; + set => SetProperty(ref profileTriggerTypeNames, value); + } + private ObservableCollection profileItems = new ObservableCollection(); + + public ObservableCollection ProfileItems + { + get => profileItems; + set => SetProperty(ref profileItems, value); + } + + private string selectedProfileItem; + public string SelectedProfileItem + { + get => selectedProfileItem; + set + { + SetProperty(ref selectedProfileItem, value); + } + } + + private bool showManageProfiles; + + public bool ShowManageProfiles + { + get => showManageProfiles; + set => SetProperty(ref showManageProfiles, value); + } + + private int selectedProfileIndex = 0; + + public int SelectedProfileIndex + { + get => selectedProfileIndex; + set + { + selectedProfileIndex = value; + if (value > -1 && value < profileNames.Count) + { + string newProfileName = ProfileNames[value]; + if (_profiles.GetCurrentProfileSync().Name != newProfileName) + { + //tood + Debug.WriteLine("todo"); + + //_profiles.LoadProfileFromName(newProfileName); + + } + } + } + } + + private ObservableCollection profileNames; + + public ObservableCollection ProfileNames + { + get => profileNames; + set => SetProperty(ref profileNames, value); + } + + private bool showEditProfile; + public bool ShowEditProfile + { + get => showEditProfile; + set => SetProperty(ref showEditProfile, value); + } + + private bool showTriggers; + public bool ShowTriggers + { + get => showTriggers; + set => SetProperty(ref showTriggers, value); + } + + public ProfileTabViewModel() + { + ProfileNames = new ObservableCollection(_profiles.GetAvailableProfilesSync().Select(x => x.Name).ToList()); + SetUpProfileModels(); + + EnsureCorrectProfileIndex(); + + OnPropertyChanged(nameof(ProfileTriggerTypeNames)); + + //todo + //ServiceManager.Instance.ConfigService.Settings.ProfileChange += delegate (object sender, EventArgs args) { CheckCurrentProfile(); }; + } + + public void SetUpProfileModels(bool setActive = true) + { + try + { + if (ProfileNames != null) + { + ObservableCollection triggers = ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers; + ProfileItems.Clear(); + foreach (string profileName in ProfileNames) + { + IEnumerable relevantTriggers = triggers.Where(x => x.ProfileName?.ToLower() == profileName.ToLower()); + + ProfileItems.Add(new ProfileItemViewModel + { + OriginalName = profileName, + Name = profileName, + Triggers = + new ObservableCollection(relevantTriggers), + IsActiveProfile = ActiveProfile == profileName, + + }); + } + + if (setActive) + { + //todo + //ActiveProfile = ServiceManager.Instance.ConfigService.Settings.CurrentProfile; + } + } + } + catch + { + } + } + + public void CheckCurrentProfile() + { + //todo + //if (ActiveProfile != ServiceManager.Instance.ConfigService.Settings.CurrentProfile) + //{ + // ActiveProfile = ServiceManager.Instance.ConfigService.Settings.CurrentProfile; + //} + + + //foreach (ProfileItemViewModel profileItemViewModel in ProfileItems) + //{ + // profileItemViewModel.IsActiveProfile = ActiveProfile == profileItemViewModel.Name; + //} + } + + public void EnsureCorrectProfileIndex() + { + //todo? + return; + //if (profileItems != null && SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile() != null) + //{ + // if (profileNames != null) + // { + // SelectedProfileIndex = profileNames.IndexOf(SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile().Name); + // SelectedProfileItem = SyncStudio.Core.ServiceManager.Profiles.GetCurrentProfile().Name; + // } + //} + } + + private readonly Action modalSubmitAction; + + public void CreateNewProfileUI() + { + ShowEditProfile = true; + CurrentProfile = new ProfileItemViewModel { }; + + CurrentProfile.Name = "Untitled"; + CurrentProfile.ProfileId = Guid.NewGuid(); + IsCreateButton = true; + + } + + public void CreateProfile() + { + //ServiceManager.Instance.ProfileService.GenerateNewProfile(CurrentProfile.Name); + RefreshProfiles(); + } + + public void DeleteProfile(ProfileItemViewModel dc) + { + // ServiceManager.Instance.ProfileService.DeleteProfile(dc.Name); + RefreshProfiles(); + } + + public void EditProfile(ProfileItemViewModel dc) + { + CurrentProfile = dc; + ShowEditProfile = true; + IsCreateButton = false; + } + + private bool isCreateButton; + + public bool IsCreateButton + { + get => isCreateButton; + set => SetProperty(ref isCreateButton, value); + } + + public void RefreshProfiles(bool setActive = true) + { + ProfileNames = new ObservableCollection(_profiles.GetAvailableProfilesSync().Select(x => x.Name).ToList()); + SetUpProfileModels(setActive); + ShowEditProfile = false; + OnPropertyChanged("ProfileNames"); + OnPropertyChanged("ProfileItems"); + } + + public void SaveProfile() + { + // ServiceManager.Instance.ProfileService.RenameProfile(CurrentProfile.OriginalName, CurrentProfile.Name); + RefreshProfiles(); + } + + public void SwitchToProfile(ProfileItemViewModel dc) + { + // ServiceManager.Instance.ProfileService.LoadProfileFromName(dc.Name); + RefreshProfiles(); + AppBVM appBVM = new AppBVM(); + appBVM.RefreshProfiles(); + appBVM.PopupVisibility = System.Windows.Visibility.Collapsed; + } + + + public void CreateNewTrigger() + { + ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers.Add(new ProfileTriggerManager.ProfileTriggerEntry + { + Name = "No name", + TriggerType = ProfileTriggerManager.ProfileTriggerTypes.RunningProccess, + ProfileName = CurrentProfile.OriginalName, + ProfileId = CurrentProfile.ProfileId + }); + + CurrentProfile.Triggers = new ObservableCollection( + ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers.Where(x => + x.ProfileName == CurrentProfile.OriginalName)); + + OnPropertyChanged("ProfileNames"); + OnPropertyChanged("ProfileItems"); + OnPropertyChanged("CurrentProfile"); + } + + public void DeleteTrigger(ProfileTriggerManager.ProfileTriggerEntry entry) + { + ProfileTriggerManager.ProfileTriggerEntry killMe = ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers.First(x => x.Id == entry.Id); + ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers.Remove(killMe); + + RefreshProfiles(); + + CurrentProfile.Triggers = new ObservableCollection( + ServiceManager.Instance.ProfileTriggerManager.ProfileTriggers.Where(x => + x.ProfileName == CurrentProfile.OriginalName)); + + OnPropertyChanged("ProfileNames"); + OnPropertyChanged("ProfileItems"); + OnPropertyChanged("CurrentProfile"); + } + } +} diff --git a/RGBSync+/UI/Tabs/ProfilesTab.xaml b/RGBSync+/UI/Tabs/ProfilesTab.xaml new file mode 100644 index 0000000..52ae1c5 --- /dev/null +++ b/RGBSync+/UI/Tabs/ProfilesTab.xaml @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RGBSync+/UI/Tabs/ProfilesTab.xaml.cs b/RGBSync+/UI/Tabs/ProfilesTab.xaml.cs new file mode 100644 index 0000000..850204d --- /dev/null +++ b/RGBSync+/UI/Tabs/ProfilesTab.xaml.cs @@ -0,0 +1,125 @@ +using System.Diagnostics; +using System.Text.RegularExpressions; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using SyncStudio.Domain; + +namespace SyncStudio.WPF.UI.Tabs +{ + /// + /// Interaction logic for ProfilesTab.xaml + /// + public partial class ProfilesTab : UserControl + { + private ProfileTabViewModel vm => (ProfileTabViewModel)DataContext; + public ProfilesTab() + { + InitializeComponent(); + } + + + private void DeleteProfile(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTabViewModel.ProfileItemViewModel dc = button.DataContext as ProfileTabViewModel.ProfileItemViewModel; + + vm.DeleteProfile(dc); + } + + private void ToggleShowTriggers(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTabViewModel.ProfileItemViewModel dc = button.DataContext as ProfileTabViewModel.ProfileItemViewModel; + vm.ShowTriggers = !vm.ShowTriggers; + vm.CurrentProfile = dc; + + //Profile tempProfile = ServiceManager.Instance.ProfileService.GetProfileFromName(dc.Name); + //vm.CurrentProfile.ProfileId = tempProfile.Id; + } + + private void AddNewProfile(object sender, RoutedEventArgs e) + { + vm.CreateNewProfileUI(); + } + + private void CreateProfile(object sender, RoutedEventArgs e) + { + vm.CreateProfile(); + } + + private void EditProfile(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTabViewModel.ProfileItemViewModel dc = button.DataContext as ProfileTabViewModel.ProfileItemViewModel; + vm.EditProfile(dc); + } + + private void ToggleShowProfile(object sender, RoutedEventArgs e) + { + vm.ShowEditProfile = !vm.ShowEditProfile; + } + + private void CloseShowProfile(object sender, RoutedEventArgs e) + { + vm.ShowEditProfile = false; + vm.SaveProfile(); + } + + + private void SetProfile(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTabViewModel.ProfileItemViewModel dc = button.DataContext as ProfileTabViewModel.ProfileItemViewModel; + vm.SwitchToProfile(dc); + } + + private void SetTrigger(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTriggerManager.ProfileTriggerEntry dc = button.DataContext as ProfileTriggerManager.ProfileTriggerEntry; + dc.TriggerType = (string)button.Tag; + Debug.WriteLine(dc); + } + + private void NumberValidationTextBox(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^0-9]+"); + e.Handled = regex.IsMatch(e.Text); + } + + private void CloseTriggerList(object sender, RoutedEventArgs e) + { + vm.ShowTriggers = false; + } + + private void ToggleTriggerWhenNotFound(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTriggerManager.ProfileTriggerEntry dc = button.DataContext as ProfileTriggerManager.ProfileTriggerEntry; + dc.TriggerWhenNotFound = !dc.TriggerWhenNotFound; + } + + private void AddNewTrigger(object sender, RoutedEventArgs e) + { + vm.CreateNewTrigger(); + } + + private void ToggleExpanded(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTriggerManager.ProfileTriggerEntry dc = button.DataContext as ProfileTriggerManager.ProfileTriggerEntry; + + dc.Expanded = !dc.Expanded; + } + + private void DeleteTrigger(object sender, RoutedEventArgs e) + { + Button button = sender as Button; + ProfileTriggerManager.ProfileTriggerEntry entry = + button.DataContext as ProfileTriggerManager.ProfileTriggerEntry; + + vm.DeleteTrigger(entry); + } + } +} diff --git a/RGBSync+/UI/Tabs/SettingsUI.xaml b/RGBSync+/UI/Tabs/SettingsUI.xaml new file mode 100644 index 0000000..213fcd2 --- /dev/null +++ b/RGBSync+/UI/Tabs/SettingsUI.xaml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +