1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 09:43:46 +00:00

Reworked XAML for profile and layer editor (some layer types tbd)

This commit is contained in:
SpoinkyNL 2017-03-01 17:15:41 +01:00
parent 809e38da7e
commit e729cfb960
26 changed files with 761 additions and 626 deletions

View File

@ -17,8 +17,7 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Accent and AppTheme setting --> <!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Teal.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Teal.xaml" />
<ResourceDictionary <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<ResourceDictionary Source="/Resources/Icons.xaml" /> <ResourceDictionary Source="/Resources/Icons.xaml" />
<ResourceDictionary Source="Styles/ColorBox.xaml" /> <ResourceDictionary Source="Styles/ColorBox.xaml" />
<ResourceDictionary Source="Styles/MarkdownStyles.xaml" /> <ResourceDictionary Source="Styles/MarkdownStyles.xaml" />

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Windows; using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
using Artemis.Utilities.Keyboard;
using NLog; using NLog;
using WpfExceptionViewer; using WpfExceptionViewer;
@ -26,6 +27,9 @@ namespace Artemis
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{ {
// Get rid of the keyboard hook in case of a crash, otherwise input freezes up system wide until Artemis is gone
KeyboardHook.Dispose();
if (DoHandle) if (DoHandle)
{ {
GetArtemisExceptionViewer(e.Exception).ShowDialog(); GetArtemisExceptionViewer(e.Exception).ShowDialog();

View File

@ -151,16 +151,16 @@
<HintPath>..\packages\Caliburn.Micro.3.0.3\lib\net45\Caliburn.Micro.Platform.Core.dll</HintPath> <HintPath>..\packages\Caliburn.Micro.3.0.3\lib\net45\Caliburn.Micro.Platform.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> <Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath> <HintPath>..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Corale.Colore, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Corale.Colore, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Colore.5.1.0\lib\net35\Corale.Colore.dll</HintPath> <HintPath>..\packages\Colore.5.1.0\lib\net35\Corale.Colore.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="CSCore, Version=1.1.5992.18249, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL"> <Reference Include="CSCore, Version=1.1.6245.30570, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL">
<HintPath>..\packages\CSCore.1.1.0\lib\net35-client\CSCore.dll</HintPath> <HintPath>..\packages\CSCore.1.2.0\lib\net35-client\CSCore.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="CUE.NET, Version=1.1.2.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CUE.NET, Version=1.1.2.1, Culture=neutral, processorArchitecture=MSIL">
@ -203,8 +203,8 @@
<HintPath>..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="MahApps.Metro, Version=1.4.1.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> <Reference Include="MahApps.Metro, Version=1.4.3.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.4.1\lib\net45\MahApps.Metro.dll</HintPath> <HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\MahApps.Metro.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL"> <Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
@ -248,7 +248,7 @@
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.4.3\lib\net45\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@ -290,7 +290,7 @@
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.4.1\lib\net45\System.Windows.Interactivity.dll</HintPath> <HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
@ -502,7 +502,7 @@
</Compile> </Compile>
<Compile Include="Profiles\Layers\Types\AmbientLight\AmbientLightPropertiesViewModel.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\AmbientLightPropertiesViewModel.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\AmbientLightType.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\AmbientLightType.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\Helper\CheckboxEnumFlagHelper.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\Helper\ToggleSwitchButtonEnumFlagHelper.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\Model\AmbienceCreatorType.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\Model\AmbienceCreatorType.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\Model\BlackBarDetectionMode.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\Model\BlackBarDetectionMode.cs" />
<Compile Include="Profiles\Layers\Types\AmbientLight\Model\Extensions\AvgColorExtension.cs" /> <Compile Include="Profiles\Layers\Types\AmbientLight\Model\Extensions\AvgColorExtension.cs" />

View File

@ -36,6 +36,14 @@ namespace Artemis
Initialize(); Initialize();
BindSpecialValues(); BindSpecialValues();
KeyboardHook.SetupKeyboardHook(); KeyboardHook.SetupKeyboardHook();
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
}
private void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
{
// Get rid of the keyboard hook in case of a crash, otherwise input freezes up system wide until Artemis is gone
KeyboardHook.Dispose();
} }
private void BindSpecialValues() private void BindSpecialValues()

View File

@ -14,7 +14,7 @@ namespace Artemis.DeviceProviders.Artemis
CantEnableText = "Waaaaah, this should not be happening!"; CantEnableText = "Waaaaah, this should not be happening!";
Height = 1; Height = 1;
Width = 1; Width = 1;
PreviewSettings = new PreviewSettings(984, 375, new Thickness(0, 0, 0, 0), Resources.none); PreviewSettings = new PreviewSettings(new Thickness(0, 0, 0, 0), Resources.none);
} }
public override void Disable() public override void Disable()

View File

@ -28,7 +28,7 @@ namespace Artemis.DeviceProviders.CoolerMaster
Height = 6; Height = 6;
Width = 22; Width = 22;
PreviewSettings = new PreviewSettings(670, 189, new Thickness(-2, -5, 0, 0), Resources.masterkeys_pro_l); PreviewSettings = new PreviewSettings(new Thickness(-2, -5, 0, 0), Resources.masterkeys_pro_l);
_generalSettings = SettingsProvider.Load<GeneralSettings>(); _generalSettings = SettingsProvider.Load<GeneralSettings>();
} }

View File

@ -28,7 +28,7 @@ namespace Artemis.DeviceProviders.CoolerMaster
Height = 6; Height = 6;
Width = 18; Width = 18;
PreviewSettings = new PreviewSettings(683, 242, new Thickness(0, 0, 0, 0), Resources.masterkeys_pro_s); PreviewSettings = new PreviewSettings(new Thickness(0, 0, 0, 0), Resources.masterkeys_pro_s);
_generalSettings = SettingsProvider.Load<GeneralSettings>(); _generalSettings = SettingsProvider.Load<GeneralSettings>();
} }

View File

@ -55,7 +55,7 @@ namespace Artemis.DeviceProviders.Corsair
Height = 7; Height = 7;
Width = 25; Width = 25;
Slug = "corsair-k95-rgb"; Slug = "corsair-k95-rgb";
PreviewSettings = new PreviewSettings(676, 190, new Thickness(0, -15, 0, 0), Resources.k95); PreviewSettings = new PreviewSettings(new Thickness(0, -15, 0, 0), Resources.k95);
break; break;
case "K70 RGB": case "K70 RGB":
case "K70 RGB RAPIDFIRE": case "K70 RGB RAPIDFIRE":
@ -63,7 +63,7 @@ namespace Artemis.DeviceProviders.Corsair
Height = 7; Height = 7;
Width = 21; Width = 21;
Slug = "corsair-k70-rgb"; Slug = "corsair-k70-rgb";
PreviewSettings = new PreviewSettings(676, 210, new Thickness(0, -25, 0, 0), Resources.k70); PreviewSettings = new PreviewSettings(new Thickness(0, -25, 0, 0), Resources.k70);
break; break;
case "K65 RGB": case "K65 RGB":
case "CGK65 RGB": case "CGK65 RGB":
@ -72,13 +72,13 @@ namespace Artemis.DeviceProviders.Corsair
Height = 7; Height = 7;
Width = 18; Width = 18;
Slug = "corsair-k65-rgb"; Slug = "corsair-k65-rgb";
PreviewSettings = new PreviewSettings(610, 240, new Thickness(0, -30, 0, 0), Resources.k65); PreviewSettings = new PreviewSettings(new Thickness(0, -30, 0, 0), Resources.k65);
break; break;
case "STRAFE RGB": case "STRAFE RGB":
Height = 7; Height = 7;
Width = 22; Width = 22;
Slug = "corsair-strafe-rgb"; Slug = "corsair-strafe-rgb";
PreviewSettings = new PreviewSettings(665, 215, new Thickness(0, -5, 0, 0), Resources.strafe); PreviewSettings = new PreviewSettings(new Thickness(0, -5, 0, 0), Resources.strafe);
break; break;
} }

View File

@ -115,15 +115,11 @@ namespace Artemis.DeviceProviders
public struct PreviewSettings public struct PreviewSettings
{ {
public int Width { get; set; }
public int Height { get; set; }
public Thickness Margin { get; set; } public Thickness Margin { get; set; }
public Bitmap Image { get; set; } public Bitmap Image { get; set; }
public PreviewSettings(int width, int height, Thickness margin, Bitmap image) public PreviewSettings(Thickness margin, Bitmap image)
{ {
Width = width;
Height = height;
Margin = margin; Margin = margin;
Image = image; Image = image;
} }

View File

@ -22,7 +22,7 @@ namespace Artemis.DeviceProviders.Logitech
"If needed, you can select a different keyboard in Artemis under settings."; "If needed, you can select a different keyboard in Artemis under settings.";
Height = 6; Height = 6;
Width = 21; Width = 21;
PreviewSettings = new PreviewSettings(675, 185, new Thickness(0, 35, 0, 0), Resources.g810); PreviewSettings = new PreviewSettings(new Thickness(0, 35, 0, 0), Resources.g810);
_generalSettings = SettingsProvider.Load<GeneralSettings>(); _generalSettings = SettingsProvider.Load<GeneralSettings>();
} }

View File

@ -24,7 +24,7 @@ namespace Artemis.DeviceProviders.Logitech
"If needed, you can select a different keyboard in Artemis under settings."; "If needed, you can select a different keyboard in Artemis under settings.";
Height = 7; Height = 7;
Width = 22; Width = 22;
PreviewSettings = new PreviewSettings(570, 175, new Thickness(-10, -105, 0, 0), Resources.g910); PreviewSettings = new PreviewSettings(new Thickness(10, -70, 10, 50), Resources.g910);
_generalSettings = SettingsProvider.Load<GeneralSettings>(); _generalSettings = SettingsProvider.Load<GeneralSettings>();
} }

View File

@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Razer
Height = Constants.MaxRows; Height = Constants.MaxRows;
Width = Constants.MaxColumns; Width = Constants.MaxColumns;
PreviewSettings = new PreviewSettings(665, 175, new Thickness(0, -15, 0, 0), Resources.blackwidow); PreviewSettings = new PreviewSettings(new Thickness(0, -15, 0, 0), Resources.blackwidow);
_generalSettings = SettingsProvider.Load<GeneralSettings>(); _generalSettings = SettingsProvider.Load<GeneralSettings>();
} }

View File

@ -1,10 +1,13 @@
using System.Linq; using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.DAL; using Artemis.DAL;
using Artemis.Managers; using Artemis.Managers;
using Artemis.Modules.Abstract; using Artemis.Modules.Abstract;
using Artemis.Settings; using Artemis.Settings;
using Artemis.Utilities; using Artemis.Utilities;
using Artemis.Utilities.Memory; using Artemis.Utilities.Memory;
using Newtonsoft.Json;
namespace Artemis.Modules.Games.RocketLeague namespace Artemis.Modules.Games.RocketLeague
{ {
@ -20,21 +23,21 @@ namespace Artemis.Modules.Games.RocketLeague
ProcessNames.Add("RocketLeague"); ProcessNames.Add("RocketLeague");
// Generate a new offset when the game is updated // Generate a new offset when the game is updated
//var offset = new GamePointersCollection var offset = new GamePointersCollection
//{ {
// Game = "RocketLeague", Game = "RocketLeague",
// GameVersion = "1.27", GameVersion = "1.30",
// GameAddresses = new List<GamePointer> GameAddresses = new List<GamePointer>
// { {
// new GamePointer new GamePointer
// { {
// Description = "Boost", Description = "Boost",
// BasePointer = new IntPtr(0x016D5084), BasePointer = new IntPtr(0x016E00B4),
// Offsets = new[] {0xC4, 0x214, 0x320, 0x73C, 0x224} Offsets = new[] {0xC4, 0x18, 0x388, 0x73C, 0x224}
// } }
// } }
//}; };
//var res = JsonConvert.SerializeObject(offset, Formatting.Indented); var res = JsonConvert.SerializeObject(offset, Formatting.Indented);
} }
public override string Name => "RocketLeague"; public override string Name => "RocketLeague";

View File

@ -250,9 +250,11 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="batchSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="batchSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="fullBatchSizeWriteLimit" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="overflowAction" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.AsyncTargetWrapperOverflowAction" /> <xs:element name="overflowAction" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.AsyncTargetWrapperOverflowAction" />
<xs:element name="queueLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="queueLimit" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="timeToSleepBetweenBatches" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="timeToSleepBetweenBatches" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -264,6 +266,11 @@
<xs:documentation>Number of log events that should be processed in a batch by the lazy writer thread.</xs:documentation> <xs:documentation>Number of log events that should be processed in a batch by the lazy writer thread.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="fullBatchSizeWriteLimit" type="xs:integer">
<xs:annotation>
<xs:documentation>Limit of full s to write before yielding into Performance is better when writing many small batches, than writing a single large batch</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="overflowAction" type="NLog.Targets.Wrappers.AsyncTargetWrapperOverflowAction"> <xs:attribute name="overflowAction" type="NLog.Targets.Wrappers.AsyncTargetWrapperOverflowAction">
<xs:annotation> <xs:annotation>
<xs:documentation>Action to be taken when the lazy writer thread request queue count exceeds the set limit.</xs:documentation> <xs:documentation>Action to be taken when the lazy writer thread request queue count exceeds the set limit.</xs:documentation>
@ -279,6 +286,11 @@
<xs:documentation>Time in milliseconds to sleep between batches.</xs:documentation> <xs:documentation>Time in milliseconds to sleep between batches.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -295,6 +307,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -306,6 +319,11 @@
<xs:documentation>Condition expression. Log events who meet this condition will cause a flush on the wrapped target.</xs:documentation> <xs:documentation>Condition expression. Log events who meet this condition will cause a flush on the wrapped target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -317,6 +335,7 @@
<xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="flushTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="flushTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="slidingTimeout" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="slidingTimeout" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -338,6 +357,11 @@
<xs:documentation>Indicates whether to use sliding timeout.</xs:documentation> <xs:documentation>Indicates whether to use sliding timeout.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -353,19 +377,20 @@
<xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="onConnectionOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetConnectionsOverflowAction" /> <xs:element name="onConnectionOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetConnectionsOverflowAction" />
<xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" />
<xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" />
<xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -407,6 +432,11 @@
<xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="maxConnections" type="xs:integer">
<xs:annotation>
<xs:documentation>Maximum current connections. 0 = no maximum.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="keepConnection" type="xs:boolean"> <xs:attribute name="keepConnection" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation>
@ -417,11 +447,6 @@
<xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="maxConnections" type="xs:integer">
<xs:annotation>
<xs:documentation>Maximum current connections. 0 = no maximum.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="address" type="SimpleLayoutAttribute"> <xs:attribute name="address" type="SimpleLayoutAttribute">
<xs:annotation> <xs:annotation>
<xs:documentation>Network address.</xs:documentation> <xs:documentation>Network address.</xs:documentation>
@ -432,14 +457,19 @@
<xs:documentation>Maximum queue size.</xs:documentation> <xs:documentation>Maximum queue size.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeMdc" type="xs:boolean">
<xs:annotation>
<xs:documentation>Indicates whether to include dictionary contents.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="includeSourceInfo" type="xs:boolean"> <xs:attribute name="includeSourceInfo" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:attribute name="includeNLogData" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>NDC item separator.</xs:documentation> <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeNdc" type="xs:boolean"> <xs:attribute name="includeNdc" type="xs:boolean">
@ -457,14 +487,14 @@
<xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeNLogData" type="xs:boolean"> <xs:attribute name="ndcItemSeparator" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> <xs:documentation>NDC item separator.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeMdc" type="xs:boolean"> <xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> <xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
</xs:extension> </xs:extension>
@ -514,6 +544,7 @@
<xs:element name="detectConsoleAvailable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="detectConsoleAvailable" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -555,6 +586,11 @@
<xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation> <xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -658,6 +694,7 @@
<xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="detectConsoleAvailable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="detectConsoleAvailable" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -694,6 +731,11 @@
<xs:documentation>The encoding for writing messages to the .</xs:documentation> <xs:documentation>The encoding for writing messages to the .</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -702,77 +744,83 @@
<xs:extension base="Target"> <xs:extension base="Target">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> <xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" />
<xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> <xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" />
<xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="commandType" minOccurs="0" maxOccurs="1" type="System.Data.CommandType" /> <xs:element name="commandType" minOccurs="0" maxOccurs="1" type="System.Data.CommandType" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="connectionString" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="connectionStringName" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the connection string (as specified in &lt;connectionStrings&gt; configuration section.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbDatabase" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbHost" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbPassword" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbProvider" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the database provider.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbUserName" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="keepConnection" type="xs:boolean">
<xs:annotation>
<xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="useTransactions" type="xs:boolean"> <xs:attribute name="useTransactions" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Obsolete - value will be ignored! The logging code always runs outside of transaction. Gets or sets a value indicating whether to use database transactions. Some data providers require this.</xs:documentation> <xs:documentation>Obsolete - value will be ignored! The logging code always runs outside of transaction. Gets or sets a value indicating whether to use database transactions. Some data providers require this.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="dbUserName" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbProvider" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the database provider.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbPassword" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="keepConnection" type="xs:boolean">
<xs:annotation>
<xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbDatabase" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="connectionStringName" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the connection string (as specified in &lt;connectionStrings&gt; configuration section.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="connectionString" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dbHost" type="SimpleLayoutAttribute">
<xs:annotation>
<xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="installConnectionString" type="SimpleLayoutAttribute"> <xs:attribute name="installConnectionString" type="SimpleLayoutAttribute">
<xs:annotation> <xs:annotation>
<xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation> <xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="commandText" type="SimpleLayoutAttribute"> <xs:attribute name="commandText" type="SimpleLayoutAttribute">
<xs:annotation> <xs:annotation>
<xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation> <xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation>
@ -864,6 +912,7 @@
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -885,6 +934,11 @@
<xs:documentation>Footer.</xs:documentation> <xs:documentation>Footer.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -894,6 +948,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -905,6 +960,11 @@
<xs:documentation>Layout used to format log messages.</xs:documentation> <xs:documentation>Layout used to format log messages.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -922,6 +982,7 @@
<xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.EventLogTargetOverflowAction" /> <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.EventLogTargetOverflowAction" />
<xs:element name="entryType" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="entryType" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="maxMessageLength" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="maxMessageLength" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -973,6 +1034,11 @@
<xs:documentation>Message length limit to write to the Event Log.</xs:documentation> <xs:documentation>Message length limit to write to the Event Log.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -989,6 +1055,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1000,6 +1067,11 @@
<xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation> <xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1022,6 +1094,7 @@
<xs:element name="forceManaged" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="forceManaged" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="archiveFileKind" minOccurs="0" maxOccurs="1" type="NLog.Targets.FilePathKind" /> <xs:element name="archiveFileKind" minOccurs="0" maxOccurs="1" type="NLog.Targets.FilePathKind" />
<xs:element name="cleanupFileName" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="cleanupFileName" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="discardAll" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="fileNameKind" minOccurs="0" maxOccurs="1" type="NLog.Targets.FilePathKind" /> <xs:element name="fileNameKind" minOccurs="0" maxOccurs="1" type="NLog.Targets.FilePathKind" />
<xs:element name="forceMutexConcurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="forceMutexConcurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="writeFooterOnArchivingOnly" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="writeFooterOnArchivingOnly" minOccurs="0" maxOccurs="1" type="xs:boolean" />
@ -1039,6 +1112,7 @@
<xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" />
@ -1119,6 +1193,11 @@
<xs:documentation>Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong.</xs:documentation> <xs:documentation>Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes. If set to false, nothing gets written when the filename is wrong.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="discardAll" type="xs:boolean">
<xs:annotation>
<xs:documentation>Whether or not this target should just discard all data that its asked to write. Mostly used for when testing NLog Stack except final write</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fileNameKind" type="NLog.Targets.FilePathKind"> <xs:attribute name="fileNameKind" type="NLog.Targets.FilePathKind">
<xs:annotation> <xs:annotation>
<xs:documentation>Is the an absolute or relative path?</xs:documentation> <xs:documentation>Is the an absolute or relative path?</xs:documentation>
@ -1204,6 +1283,11 @@
<xs:documentation>Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity.</xs:documentation> <xs:documentation>Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bufferSize" type="xs:integer"> <xs:attribute name="bufferSize" type="xs:integer">
<xs:annotation> <xs:annotation>
<xs:documentation>Log file buffer size in bytes.</xs:documentation> <xs:documentation>Log file buffer size in bytes.</xs:documentation>
@ -1278,6 +1362,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1289,6 +1374,11 @@
<xs:documentation>Condition expression. Log events who meet this condition will be forwarded to the wrapped target.</xs:documentation> <xs:documentation>Condition expression. Log events who meet this condition will be forwarded to the wrapped target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1304,6 +1394,7 @@
<xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1345,6 +1436,11 @@
<xs:documentation>Username to change context to.</xs:documentation> <xs:documentation>Username to change context to.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1378,6 +1474,7 @@
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="interval" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="interval" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="messageLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="messageLimit" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1394,6 +1491,11 @@
<xs:documentation>Maximum allowed number of messages written per .</xs:documentation> <xs:documentation>Maximum allowed number of messages written per .</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1409,6 +1511,7 @@
<xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" />
<xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1445,6 +1548,11 @@
<xs:documentation>Indicates whether to use binary message encoding.</xs:documentation> <xs:documentation>Indicates whether to use binary message encoding.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1487,9 +1595,10 @@
<xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="replaceNewlineWithBrTagInHtml" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="priority" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="timeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="timeout" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="priority" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="replaceNewlineWithBrTagInHtml" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" /> <xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" />
<xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" />
@ -1565,9 +1674,9 @@
<xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation> <xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="replaceNewlineWithBrTagInHtml" type="xs:boolean"> <xs:attribute name="timeout" type="xs:integer">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether NewLine characters in the body should be replaced with tags.</xs:documentation> <xs:documentation>Indicates the SMTP client timeout.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="priority" type="SimpleLayoutAttribute"> <xs:attribute name="priority" type="SimpleLayoutAttribute">
@ -1575,9 +1684,14 @@
<xs:documentation>Priority used for sending mails.</xs:documentation> <xs:documentation>Priority used for sending mails.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="timeout" type="xs:integer"> <xs:attribute name="replaceNewlineWithBrTagInHtml" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates the SMTP client timeout.</xs:documentation> <xs:documentation>Indicates whether NewLine characters in the body should be replaced with tags.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="smtpServer" type="SimpleLayoutAttribute"> <xs:attribute name="smtpServer" type="SimpleLayoutAttribute">
@ -1648,6 +1762,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1659,6 +1774,11 @@
<xs:documentation>Layout used to format log messages.</xs:documentation> <xs:documentation>Layout used to format log messages.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1671,6 +1791,7 @@
<xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="checkIfQueueExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="checkIfQueueExists" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" />
@ -1701,6 +1822,11 @@
<xs:documentation>Indicates whether to check if a queue exists before writing to it.</xs:documentation> <xs:documentation>Indicates whether to check if a queue exists before writing to it.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="createQueueIfNotExists" type="xs:boolean"> <xs:attribute name="createQueueIfNotExists" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation> <xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation>
@ -1732,6 +1858,7 @@
<xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1748,6 +1875,11 @@
<xs:documentation>Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g.</xs:documentation> <xs:documentation>Method name. The method must be public and static. Use the AssemblyQualifiedName , https://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx e.g.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1768,6 +1900,7 @@
<xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1834,6 +1967,11 @@
<xs:documentation>Maximum queue size.</xs:documentation> <xs:documentation>Maximum queue size.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1849,19 +1987,20 @@
<xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="onConnectionOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetConnectionsOverflowAction" /> <xs:element name="onConnectionOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetConnectionsOverflowAction" />
<xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" />
<xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="maxConnections" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" />
<xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1903,6 +2042,11 @@
<xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="maxConnections" type="xs:integer">
<xs:annotation>
<xs:documentation>Maximum current connections. 0 = no maximum.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="keepConnection" type="xs:boolean"> <xs:attribute name="keepConnection" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation>
@ -1913,11 +2057,6 @@
<xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="maxConnections" type="xs:integer">
<xs:annotation>
<xs:documentation>Maximum current connections. 0 = no maximum.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="address" type="SimpleLayoutAttribute"> <xs:attribute name="address" type="SimpleLayoutAttribute">
<xs:annotation> <xs:annotation>
<xs:documentation>Network address.</xs:documentation> <xs:documentation>Network address.</xs:documentation>
@ -1928,14 +2067,19 @@
<xs:documentation>Maximum queue size.</xs:documentation> <xs:documentation>Maximum queue size.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeMdc" type="xs:boolean">
<xs:annotation>
<xs:documentation>Indicates whether to include dictionary contents.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="includeSourceInfo" type="xs:boolean"> <xs:attribute name="includeSourceInfo" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:attribute name="includeNLogData" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>NDC item separator.</xs:documentation> <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeNdc" type="xs:boolean"> <xs:attribute name="includeNdc" type="xs:boolean">
@ -1953,14 +2097,14 @@
<xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeNLogData" type="xs:boolean"> <xs:attribute name="ndcItemSeparator" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> <xs:documentation>NDC item separator.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="includeMdc" type="xs:boolean"> <xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> <xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
</xs:extension> </xs:extension>
@ -1973,6 +2117,7 @@
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -1989,6 +2134,11 @@
<xs:documentation>Indicates whether to perform layout calculation.</xs:documentation> <xs:documentation>Indicates whether to perform layout calculation.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -1998,6 +2148,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -2009,6 +2160,11 @@
<xs:documentation>Layout used to format log messages.</xs:documentation> <xs:documentation>Layout used to format log messages.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2024,6 +2180,7 @@
<xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" /> <xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" />
<xs:element name="incrementValue" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="incrementValue" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -2065,6 +2222,11 @@
<xs:documentation>Performance counter instance name.</xs:documentation> <xs:documentation>Performance counter instance name.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2107,6 +2269,7 @@
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" /> <xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" />
<xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" /> <xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -2118,6 +2281,11 @@
<xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation> <xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2142,12 +2310,18 @@
<xs:extension base="CompoundTargetBase"> <xs:extension base="CompoundTargetBase">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2156,6 +2330,7 @@
<xs:extension base="WrapperTargetBase"> <xs:extension base="WrapperTargetBase">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
@ -2163,6 +2338,11 @@
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="repeatCount" type="xs:integer"> <xs:attribute name="repeatCount" type="xs:integer">
<xs:annotation> <xs:annotation>
<xs:documentation>Number of times to repeat each log message.</xs:documentation> <xs:documentation>Number of times to repeat each log message.</xs:documentation>
@ -2176,6 +2356,7 @@
<xs:extension base="WrapperTargetBase"> <xs:extension base="WrapperTargetBase">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" />
<xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" />
</xs:choice> </xs:choice>
@ -2184,6 +2365,11 @@
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="retryCount" type="xs:integer"> <xs:attribute name="retryCount" type="xs:integer">
<xs:annotation> <xs:annotation>
<xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation> <xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation>
@ -2202,12 +2388,18 @@
<xs:extension base="CompoundTargetBase"> <xs:extension base="CompoundTargetBase">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2216,12 +2408,18 @@
<xs:extension base="CompoundTargetBase"> <xs:extension base="CompoundTargetBase">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Name of the target.</xs:documentation> <xs:documentation>Name of the target.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2231,6 +2429,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string"> <xs:attribute name="name" type="xs:string">
<xs:annotation> <xs:annotation>
@ -2242,6 +2441,11 @@
<xs:documentation>Layout used to format log messages.</xs:documentation> <xs:documentation>Layout used to format log messages.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
@ -2252,6 +2456,7 @@
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="includeBOM" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeBOM" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="escapeDataNLogLegacy" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="escapeDataNLogLegacy" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="escapeDataRfc3986" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="escapeDataRfc3986" minOccurs="0" maxOccurs="1" type="xs:boolean" />
@ -2272,6 +2477,11 @@
<xs:documentation>Should we include the BOM (Byte-order-mark) for UTF? Influences the property. This will only work for UTF-8.</xs:documentation> <xs:documentation>Should we include the BOM (Byte-order-mark) for UTF? Influences the property. This will only work for UTF-8.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="optimizeBufferReuse" type="xs:boolean">
<xs:annotation>
<xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encoding" type="xs:string"> <xs:attribute name="encoding" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Encoding.</xs:documentation> <xs:documentation>Encoding.</xs:documentation>

View File

@ -1,15 +1,15 @@
<UserControl x:Class="Artemis.Profiles.Layers.Types.AmbientLight.AmbientLightPropertiesView" <UserControl x:Class="Artemis.Profiles.Layers.Types.AmbientLight.AmbientLightPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:Artemis.Utilities.Converters" xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:model="clr-namespace:Artemis.Profiles.Layers.Types.AmbientLight.Model" xmlns:model="clr-namespace:Artemis.Profiles.Layers.Types.AmbientLight.Model"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:helper="clr-namespace:Artemis.Profiles.Layers.Types.AmbientLight.Helper" xmlns:helper="clr-namespace:Artemis.Profiles.Layers.Types.AmbientLight.Helper"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="500"> d:DesignHeight="600" d:DesignWidth="500">
<UserControl.Resources> <UserControl.Resources>
<converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" /> <converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
@ -29,135 +29,101 @@
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- AmbienceCreatorType --> <!-- AmbienceCreatorType -->
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Ambilight-Mode:" <Label Grid.Row="0" Grid.Column="0" Content="Ambilight-Mode:" VerticalAlignment="Center" />
VerticalAlignment="Top" Height="18" /> <ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AmbienceCreatorTypeValues}}" SelectedItem="{Binding Path=LayerModel.Properties.AmbienceCreatorType}" VerticalAlignment="Center">
<ComboBox Grid.Row="0" Grid.Column="1"
ItemsSource="{Binding Source={StaticResource AmbienceCreatorTypeValues}}"
Margin="10,10,10,0" SelectedItem="{Binding Path=LayerModel.Properties.AmbienceCreatorType}"
VerticalAlignment="Top" Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <Label Content="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<!-- MirrorAmount & Downsampling--> <!-- MirrorAmount & Downsampling-->
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Mirrored Amount (%):" <Label Grid.Row="1" Grid.Column="0" Content="Mirrored Amount (%):" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Minimum="0" Maximum="100" Value="{Binding Path=LayerModel.Properties.MirroredAmount, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" Minimum="0" Maximum="100"
Value="{Binding Path=LayerModel.Properties.MirroredAmount, Mode=TwoWay}"
Margin="10,12,10,2" Height="24" />
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Downsampling:" <Label Grid.Row="1" Grid.Column="2" Content="Downsampling:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="1" Grid.Column="3" VerticalAlignment="Center" Minimum="1" Maximum="20" Value="{Binding Path=LayerModel.Properties.Downsampling, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="1" Grid.Column="3" VerticalAlignment="Top" Minimum="1" Maximum="20"
Value="{Binding Path=LayerModel.Properties.Downsampling, Mode=TwoWay}"
Margin="10,12,10,2" Height="24" />
<!-- SmoothMode --> <!-- SmoothMode -->
<TextBlock Grid.Row="2" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Smoothing:" <Label Grid.Row="2" Grid.Column="0" Content="Smoothing:" VerticalAlignment="Center" />
VerticalAlignment="Top" Height="18" /> <ComboBox Grid.Row="2" Grid.Column="1" ItemsSource="{Binding Source={StaticResource SmoothModeEnumValues}}" SelectedItem="{Binding Path=LayerModel.Properties.SmoothMode}" VerticalAlignment="Center" Margin="0,5">
<ComboBox Grid.Row="2" Grid.Column="1" ItemsSource="{Binding Source={StaticResource SmoothModeEnumValues}}"
Margin="10,10,10,0" SelectedItem="{Binding Path=LayerModel.Properties.SmoothMode}"
VerticalAlignment="Top" Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <Label Content="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<!-- FlipMode --> <!-- FlipMode -->
<TextBlock Grid.Row="3" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Flip Horizontal:" <Label Grid.Row="3" Grid.Column="0" Content="Flip Horizontal:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:ToggleSwitchButton Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="0,5"
<CheckBox Grid.Row="3" Grid.Column="1" VerticalAlignment="Top" Margin="10,12,10,2" Height="24" helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:FlipMode.Horizontal}"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:FlipMode.Horizontal}" helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.FlipMode}" />
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.FlipMode}" />
<TextBlock Grid.Row="3" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Flip Vertical:" <Label Grid.Row="3" Grid.Column="2" Content="Flip Vertical:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:ToggleSwitchButton Grid.Row="3" Grid.Column="3" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="0,5"
<CheckBox Grid.Row="3" Grid.Column="3" VerticalAlignment="Top" Margin="10,12,10,2" Height="24" helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:FlipMode.Vertical}"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:FlipMode.Vertical}" helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.FlipMode}" />
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.FlipMode}" />
<!-- Horizontal offsets --> <!-- Horizontal offsets -->
<TextBlock Grid.Row="4" Grid.Column="0" Margin="10,20,10,3" FontSize="13.333" Text="Offset" <Label Grid.Row="4" Grid.Column="0" Content="Offset" VerticalAlignment="Center" FontWeight="Black" />
Height="18" VerticalAlignment="Top" FontWeight="Black" />
<TextBlock Grid.Row="5" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Left:" <Label Grid.Row="5" Grid.Column="0" Content="Left:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" Minimum="0" Value="{Binding Path=LayerModel.Properties.OffsetLeft, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="5" Grid.Column="1" VerticalAlignment="Top" Minimum="0"
Value="{Binding Path=LayerModel.Properties.OffsetLeft, Mode=TwoWay}"
Margin="10,12,10,2" Height="24" />
<TextBlock Grid.Row="5" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Right:" <Label Grid.Row="5" Grid.Column="2" Content="Right:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="5" Grid.Column="3" VerticalAlignment="Center" Minimum="0" Value="{Binding Path=LayerModel.Properties.OffsetRight, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="5" Grid.Column="3" VerticalAlignment="Top" Minimum="0"
Value="{Binding Path=LayerModel.Properties.OffsetRight, Mode=TwoWay}"
Margin="10,12,10,2" Height="24" />
<!-- Vertical offsets --> <!-- Vertical offsets -->
<TextBlock Grid.Row="6" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Top:" <Label Grid.Row="6" Grid.Column="0" Content="Top:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" Minimum="0" Value="{Binding Path=LayerModel.Properties.OffsetTop, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="6" Grid.Column="1" VerticalAlignment="Top" Minimum="0"
Value="{Binding Path=LayerModel.Properties.OffsetTop, Mode=TwoWay}" Margin="10,12,10,2"
Height="24" />
<TextBlock Grid.Row="6" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Bottom:" <Label Grid.Row="6" Grid.Column="2" Content="Bottom:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:NumericUpDown Grid.Row="6" Grid.Column="3" VerticalAlignment="Center" Minimum="0" Value="{Binding Path=LayerModel.Properties.OffsetBottom, Mode=TwoWay}" Margin="0,5" />
<controls:NumericUpDown Grid.Row="6" Grid.Column="3" VerticalAlignment="Top" Minimum="0"
Value="{Binding Path=LayerModel.Properties.OffsetBottom, Mode=TwoWay}"
Margin="10,12,10,2" Height="24" />
<!-- Horizontal BlackBar-detection --> <!-- Horizontal BlackBar-detection -->
<TextBlock Grid.Row="7" Grid.Column="0" Margin="10,20,10,3" FontSize="13.333" Text="Black-Bar detection" <Label Grid.Row="7" Grid.Column="0" Content="Black-Bar detection" VerticalAlignment="Center" FontWeight="Black" />
Height="18" VerticalAlignment="Top" FontWeight="Black" />
<TextBlock Grid.Row="8" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Left:" <Label Grid.Row="8" Grid.Column="0" Content="Left:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:ToggleSwitchButton Grid.Row="8" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" Margin="0,5"
<CheckBox Grid.Row="8" Grid.Column="1" VerticalAlignment="Top" Margin="10,12,10,2" Height="24" helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Left}"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Left}" helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
<TextBlock Grid.Row="8" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Right:" <Label Grid.Row="8" Grid.Column="2" Content="Right:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:ToggleSwitchButton Grid.Row="8" Grid.Column="3" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="0,5"
<CheckBox Grid.Row="8" Grid.Column="3" VerticalAlignment="Top" Margin="10,12,10,2" Height="24" helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Right}"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Right}" helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
<!-- Vertical BlackBar-detection --> <!-- Vertical BlackBar-detection -->
<TextBlock Grid.Row="9" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Top:" <Label Grid.Row="9" Grid.Column="0" Content="Top:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <controls:ToggleSwitchButton Grid.Row="9" Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="0,5"
<CheckBox Grid.Row="9" Grid.Column="1" VerticalAlignment="Top" Margin="10,12,10,2" Height="24" helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Top}"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Top}" helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
<TextBlock Grid.Row="9" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Bottom:"
Height="18" VerticalAlignment="Top" />
<CheckBox Grid.Row="9" Grid.Column="3" VerticalAlignment="Top" Margin="10,12,10,2" Height="24"
helper:CheckboxEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Bottom}"
helper:CheckboxEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
<Label Grid.Row="9" Grid.Column="2" Content="Bottom:" VerticalAlignment="Center" />
<controls:ToggleSwitchButton Grid.Row="9" Grid.Column="3" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="0,5"
helper:ToggleSwitchButtonEnumFlagHelper.Value="{x:Static model:BlackBarDetectionMode.Bottom}"
helper:ToggleSwitchButtonEnumFlagHelper.Flags="{Binding Path=LayerModel.Properties.BlackBarDetectionMode}" />
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -1,18 +1,18 @@
using System; using System;
using System.Windows; using System.Windows;
using System.Windows.Controls;
using Artemis.Profiles.Layers.Types.AmbientLight.Model.Extensions; using Artemis.Profiles.Layers.Types.AmbientLight.Model.Extensions;
using MahApps.Metro.Controls;
namespace Artemis.Profiles.Layers.Types.AmbientLight.Helper namespace Artemis.Profiles.Layers.Types.AmbientLight.Helper
{ {
public class CheckboxEnumFlagHelper public class ToggleSwitchButtonEnumFlagHelper
{ {
#region DependencyProperties #region DependencyProperties
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
public static readonly DependencyProperty FlagsProperty = DependencyProperty.RegisterAttached( public static readonly DependencyProperty FlagsProperty = DependencyProperty.RegisterAttached(
"Flags", typeof(Enum), typeof(CheckboxEnumFlagHelper), "Flags", typeof(Enum), typeof(ToggleSwitchButtonEnumFlagHelper),
new FrameworkPropertyMetadata(default(Enum), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new FrameworkPropertyMetadata(default(Enum), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
FlagsChanged)); FlagsChanged));
@ -27,7 +27,7 @@ namespace Artemis.Profiles.Layers.Types.AmbientLight.Helper
} }
public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached( public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached(
"Value", typeof(Enum), typeof(CheckboxEnumFlagHelper), new PropertyMetadata(default(Enum), ValueChanged)); "Value", typeof(Enum), typeof(ToggleSwitchButtonEnumFlagHelper), new PropertyMetadata(default(Enum), ValueChanged));
public static void SetValue(DependencyObject element, Enum value) public static void SetValue(DependencyObject element, Enum value)
{ {
@ -48,48 +48,52 @@ namespace Artemis.Profiles.Layers.Types.AmbientLight.Helper
private static void FlagsChanged(DependencyObject dependencyObject, private static void FlagsChanged(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{ {
UpdateTarget(dependencyObject as CheckBox, dependencyPropertyChangedEventArgs.NewValue as Enum); UpdateTarget(dependencyObject as ToggleSwitchButton, dependencyPropertyChangedEventArgs.NewValue as Enum);
} }
private static void ValueChanged(DependencyObject dependencyObject, private static void ValueChanged(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{ {
var checkbox = dependencyObject as CheckBox; var toggleSwitchButton = dependencyObject as ToggleSwitchButton;
if (checkbox == null) return; if (toggleSwitchButton == null)
return;
checkbox.Checked -= UpdateSource; toggleSwitchButton.Checked -= UpdateSource;
checkbox.Unchecked -= UpdateSource; toggleSwitchButton.Unchecked -= UpdateSource;
if (dependencyPropertyChangedEventArgs.NewValue != null) if (dependencyPropertyChangedEventArgs.NewValue != null)
{ {
checkbox.Checked += UpdateSource; toggleSwitchButton.Checked += UpdateSource;
checkbox.Unchecked += UpdateSource; toggleSwitchButton.Unchecked += UpdateSource;
} }
UpdateTarget(checkbox, GetFlags(checkbox)); UpdateTarget(toggleSwitchButton, GetFlags(toggleSwitchButton));
} }
private static void UpdateTarget(CheckBox checkbox, Enum flags) private static void UpdateTarget(ToggleSwitchButton toggleSwitchButton, Enum flags)
{ {
if (checkbox == null) return; if (toggleSwitchButton == null)
return;
var value = GetValue(checkbox); var value = GetValue(toggleSwitchButton);
checkbox.IsChecked = value != null && (flags?.HasFlag(value) ?? false); toggleSwitchButton.IsChecked = value != null && (flags?.HasFlag(value) ?? false);
} }
private static void UpdateSource(object sender, RoutedEventArgs routedEventArgs) private static void UpdateSource(object sender, RoutedEventArgs routedEventArgs)
{ {
var checkbox = sender as CheckBox; var toggleSwitchButton = sender as ToggleSwitchButton;
if (checkbox == null) return; if (toggleSwitchButton == null)
return;
var flags = GetFlags(checkbox); var flags = GetFlags(toggleSwitchButton);
var value = GetValue(checkbox); var value = GetValue(toggleSwitchButton);
if (value == null) return; if (value == null)
return;
if (checkbox.IsChecked ?? false) if (toggleSwitchButton.IsChecked ?? false)
SetFlags(checkbox, flags == null ? value : flags.SetFlag(value, true, flags.GetType())); SetFlags(toggleSwitchButton, flags == null ? value : flags.SetFlag(value, true, flags.GetType()));
else else
SetFlags(checkbox, flags?.SetFlag(value, false, flags.GetType())); SetFlags(toggleSwitchButton, flags?.SetFlag(value, false, flags.GetType()));
} }
#endregion #endregion

View File

@ -1,26 +1,26 @@
<UserControl x:Class="Artemis.Profiles.Layers.Types.Audio.AudioPropertiesView" <UserControl x:Class="Artemis.Profiles.Layers.Types.Audio.AudioPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox" xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
xmlns:properties="clr-namespace:Artemis.Profiles.Layers.Types.Audio" xmlns:properties="clr-namespace:Artemis.Profiles.Layers.Types.Audio"
xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:converters="clr-namespace:Artemis.Utilities.Converters" xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="500"> d:DesignHeight="600" d:DesignWidth="500">
<UserControl.Resources> <UserControl.Resources>
<converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" /> <converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
<ObjectDataProvider MethodName="GetValues" <ObjectDataProvider MethodName="GetValues"
ObjectType="{x:Type system:Enum}" ObjectType="{x:Type system:Enum}"
x:Key="MmDeviceTypeEnumValues"> x:Key="MmDeviceTypeEnumValues">
<ObjectDataProvider.MethodParameters> <ObjectDataProvider.MethodParameters>
<x:Type TypeName="properties:MmDeviceType" /> <x:Type TypeName="properties:MmDeviceType" />
</ObjectDataProvider.MethodParameters> </ObjectDataProvider.MethodParameters>
</ObjectDataProvider> </ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" <ObjectDataProvider MethodName="GetValues"
ObjectType="{x:Type system:Enum}" ObjectType="{x:Type system:Enum}"
x:Key="DirectionEnumValues"> x:Key="DirectionEnumValues">
<ObjectDataProvider.MethodParameters> <ObjectDataProvider.MethodParameters>
<x:Type TypeName="properties:Direction" /> <x:Type TypeName="properties:Direction" />
</ObjectDataProvider.MethodParameters> </ObjectDataProvider.MethodParameters>
@ -28,25 +28,22 @@
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Animation --> <!-- Animation -->
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:" <Label Grid.Row="0" Grid.Column="0" Content="Animation:" VerticalAlignment="Center" />
VerticalAlignment="Center" <ComboBox Grid.Row="0" Grid.Column="1" x:Name="LayerAnimations" VerticalAlignment="Center" Margin="0,5">
Height="18" />
<ComboBox Grid.Row="0" Grid.Column="1" Margin="10,10,10,0" x:Name="LayerAnimations" VerticalAlignment="Top"
Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" /> <TextBlock Text="{Binding Path=Name, Mode=OneWay}" />
@ -55,53 +52,38 @@
</ComboBox> </ComboBox>
<!-- Animation Speed --> <!-- Animation Speed -->
<TextBlock Grid.Row="0" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:" <Label Grid.Row="0" Grid.Column="2" Content="Animation speed:" VerticalAlignment="Center" Margin="5,0,0,0" />
VerticalAlignment="Center" Height="18" /> <Slider Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" TickPlacement="None" TickFrequency="0.05"
<Slider Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Value="{Binding Path=LayerModel.Properties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3" SmallChange="0" IsSnapToTickEnabled="True" Margin="0,5" />
TickPlacement="None" TickFrequency="0.05"
Value="{Binding Path=LayerModel.Properties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
SmallChange="0" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
<!-- Device type --> <!-- Device type -->
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,13,10,10" FontSize="13.333" Text="Device type:" <Label Grid.Row="1" Grid.Column="0" Content="Device type:" VerticalAlignment="Center" />
Height="18" VerticalAlignment="Top" /> <ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource MmDeviceTypeEnumValues}}" SelectedItem="{Binding Path=DeviceType}" VerticalAlignment="Center" Margin="0,5">
<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource MmDeviceTypeEnumValues}}"
Margin="10,10,10,0" SelectedItem="{Binding Path=DeviceType}"
VerticalAlignment="Top" Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <Label Content="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<!-- Device --> <!-- Device -->
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Device:" <Label Grid.Row="1" Grid.Column="2" Content="Device:" VerticalAlignment="Center" Margin="5,0,0,0" />
VerticalAlignment="Top" Height="18" /> <ComboBox Grid.Row="1" Grid.Column="3" x:Name="Devices" VerticalAlignment="Center" Margin="0,5" />
<ComboBox Grid.Row="1" Grid.Column="3" x:Name="Devices" Margin="10,10,10,0" VerticalAlignment="Top" />
<!-- Colors --> <!-- Colors -->
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" x:Name="ShowBrush"> <Label Grid.Row="2" Grid.Column="0" Content="Color(s):" VerticalAlignment="Center" />
<TextBlock Margin="10,13,10,0" FontSize="13.333" Text="Color(s):" <Border Grid.Row="2" Grid.Column="1" BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit" Height="26" Margin="0,5">
VerticalAlignment="Top" Height="18" Width="130" /> <ncore:ColorBox Brush="{Binding Path=Brush, Mode=TwoWay}" ShowNone="False" VerticalAlignment="Stretch" />
<Border Margin="10" BorderBrush="{StaticResource ControlBorderBrush}" </Border>
BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit">
<ncore:ColorBox Brush="{Binding Path=Brush, Mode=TwoWay}" ShowNone="False" Height="24" Width="134"
VerticalAlignment="Top" />
</Border>
</StackPanel>
<!-- Bar direction --> <!-- Bar direction -->
<TextBlock Grid.Row="2" Grid.Column="2" Margin="10,13,10,10" FontSize="13.333" Text="Bar direction:" <Label Grid.Row="2" Grid.Column="2" Content="Bar direction:" VerticalAlignment="Center" Margin="5,0,0,0" />
VerticalAlignment="Top" Height="18" /> <ComboBox Grid.Row="2" Grid.Column="3" ItemsSource="{Binding Source={StaticResource DirectionEnumValues}}" SelectedItem="{Binding Path=LayerModel.Properties.Direction}" VerticalAlignment="Center" Margin="0,5">
<ComboBox Grid.Row="2" Grid.Column="3" ItemsSource="{Binding Source={StaticResource DirectionEnumValues}}"
Margin="10,10,10,0" SelectedItem="{Binding Path=LayerModel.Properties.Direction}"
VerticalAlignment="Top" Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -1,36 +1,33 @@
<UserControl x:Class="Artemis.Profiles.Layers.Types.Keyboard.KeyboardPropertiesView" <UserControl x:Class="Artemis.Profiles.Layers.Types.Keyboard.KeyboardPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox" xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="500"> d:DesignHeight="500" d:DesignWidth="500">
<Grid> <Grid>
<!-- Colors --> <!-- Colors -->
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
<ColumnDefinition /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Animation --> <!-- Animation -->
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:" <Label Grid.Row="0" Grid.Column="0" Content="Animation:" VerticalAlignment="Center" Margin="0,0,5,0" />
VerticalAlignment="Center" <ComboBox Grid.Row="0" Grid.Column="1" x:Name="LayerAnimations" VerticalAlignment="Center">
Height="18" />
<ComboBox Grid.Row="0" Grid.Column="1" Margin="10,10,10,0" x:Name="LayerAnimations" VerticalAlignment="Top"
Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" /> <TextBlock Text="{Binding Path=Name, Mode=OneWay}" />
@ -39,32 +36,19 @@
</ComboBox> </ComboBox>
<!-- Animation Speed --> <!-- Animation Speed -->
<TextBlock Grid.Row="0" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:" <Label Grid.Row="0" Grid.Column="2" Content="Animation speed:" VerticalAlignment="Center" Margin="5,0" />
VerticalAlignment="Center" Height="18" /> <Slider x:Name="RotationSpeed" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" TickPlacement="None" TickFrequency="0.05" Value="{Binding Path=LayerModel.Properties.AnimationSpeed, Mode=TwoWay}"
<Slider x:Name="RotationSpeed" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Minimum="0.05" Maximum="3" SmallChange="0" IsSnapToTickEnabled="True" />
TickPlacement="None" TickFrequency="0.05"
Value="{Binding Path=LayerModel.Properties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
SmallChange="0" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
<!-- ClippingType --> <!-- ClippingType -->
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10, 13, 10, 10" FontSize="13.333" Text="Clipping type:" <Label Grid.Row="1" Grid.Column="0" Content="Clipping type:" VerticalAlignment="Center" Margin="0,0,5,0" />
VerticalAlignment="Center" Height="23" /> <controls:ToggleSwitch Grid.Row="1" Grid.Column="1" IsChecked="{Binding Path=LayerModel.Properties.Contain, Mode=TwoWay}" OnLabel="Contain" OffLabel="Cut-off" VerticalAlignment="Center" Style="{StaticResource MahApps.Metro.Styles.ToggleSwitch.Win10}" Margin="0,10" />
<controls:ToggleSwitch IsChecked="{Binding Path=LayerModel.Properties.Contain, Mode=TwoWay}"
Grid.Row="1"
Grid.Column="1" OnLabel="Contain" OffLabel="Cut-off" Margin="10,1,5,1"
VerticalAlignment="Center"
Height="36" />
<!-- Colors --> <!-- Colors -->
<StackPanel Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Orientation="Horizontal" x:Name="ShowBrush"> <Label Grid.Row="1" Grid.Column="2" Content="Color(s):" VerticalAlignment="Center" Margin="5,0" />
<TextBlock Margin="10,13,10,0" FontSize="13.333" Text="Color(s):" <Border Grid.Row="1" Grid.Column="3" BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit" Height="26">
VerticalAlignment="Top" Height="18" Width="130" /> <ncore:ColorBox Brush="{Binding Path=Brush, Mode=TwoWay}" ShowNone="False" VerticalAlignment="Stretch" />
<Border Margin="10" BorderBrush="{StaticResource ControlBorderBrush}" </Border>
BorderThickness="1" SnapsToDevicePixels="True" ToolTip="Click to edit">
<ncore:ColorBox Brush="{Binding Path=Brush, Mode=TwoWay}" ShowNone="False" Height="24" Width="134"
VerticalAlignment="Top" />
</Border>
</StackPanel>
<!-- GIF settings --> <!-- GIF settings -->
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" x:Name="ShowGif"> <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" x:Name="ShowGif">
@ -78,28 +62,25 @@
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10,5,10,0" FontSize="13.333" Text="GIF file:" <Label Grid.Row="0" Grid.Column="0" Content="GIF file:" VerticalAlignment="Center" />
VerticalAlignment="Top" Height="18" /> <Grid Grid.Row="0" Grid.Column="1" ColumnSpan="3" VerticalAlignment="Top">
<Grid Grid.Row="0" Grid.Column="1" ColumnSpan="3" Margin="5,2,10,0" VerticalAlignment="Top"> <TextBox TextWrapping="Wrap" Text="{Binding Path=LayerModel.Properties.GifFile, Mode=TwoWay}" />
<TextBox Height="23" TextWrapping="Wrap" Margin="5,0,30,0" <Button x:Name="BrowseGif" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="25" />
Text="{Binding Path=LayerModel.Properties.GifFile, Mode=TwoWay}" />
<Button x:Name="BrowseGif" Content="..." RenderTransformOrigin="-0.039,-0.944"
HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="25" />
</Grid> </Grid>
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="10,2,10,10" FontSize="13.333" <TextBlock Margin="5" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Foreground="{DynamicResource HighlightBrush}" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap">
Foreground="{DynamicResource HighlightBrush}" <Run Text="Note: It is recommended to use very tiny gifs (25x7 per example, for size per keyboard see FAQ). " /><LineBreak /><Run Text="Any higher will degrade performance without any noticeable quality difference." />
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" ><Run Text="Note: It is recommended to use very tiny gifs (25x7 per example, for size per keyboard see FAQ). "/><LineBreak/><Run Text="Any higher will degrade performance without any noticeable quality difference."/></TextBlock> </TextBlock>
</Grid> </Grid>
<!-- Dynamic --> <!-- Dynamic -->
<Label Grid.Row="3" Grid.Column="0" FontSize="20" HorizontalAlignment="Left" <Label Grid.Row="3" Grid.Column="0" FontSize="20" Content="Dynamic" />
Content="Dynamic" Width="97" VerticalAlignment="Bottom" />
<!-- Dynamic property views --> <!-- Dynamic property views -->
<ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" x:Name="HeightProperties" /> <ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" x:Name="HeightProperties" />
<ContentControl Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" x:Name="WidthProperties" /> <ContentControl Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" x:Name="WidthProperties" />
<ContentControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" x:Name="OpacityProperties" /> <ContentControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" x:Name="OpacityProperties" />
<!-- Tweening -->
<ContentControl Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" x:Name="LayerTweenViewModel" /> <ContentControl Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" x:Name="LayerTweenViewModel" />
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -45,5 +45,18 @@ namespace Artemis.Utilities.Keyboard
public static event KeyCallbackHandler KeyUpCallback; public static event KeyCallbackHandler KeyUpCallback;
public static event MouseCallbackHandler MouseDownCallback; public static event MouseCallbackHandler MouseDownCallback;
public static event MouseCallbackHandler MouseUpCallback; public static event MouseCallbackHandler MouseUpCallback;
public static void Dispose()
{
if (_globalHook == null)
return;
_globalHook.KeyDown -= GlobalHookOnKeyDown;
_globalHook.KeyUp -= GlobalHookOnKeyUp;
_globalHook.MouseDown -= GlobalHookOnMouseDown;
_globalHook.MouseUp -= GlobalHookOnMouseUp;
_globalHook.Dispose();
_globalHook = null;
}
} }
} }

View File

@ -128,7 +128,8 @@ namespace Artemis.ViewModels
get { return _profileNames; } get { return _profileNames; }
set set
{ {
if (Equals(value, _profileNames)) return; if (Equals(value, _profileNames))
return;
_profileNames = value; _profileNames = value;
NotifyOfPropertyChange(() => ProfileNames); NotifyOfPropertyChange(() => ProfileNames);
} }
@ -139,7 +140,8 @@ namespace Artemis.ViewModels
get { return _layers; } get { return _layers; }
set set
{ {
if (Equals(value, _layers)) return; if (Equals(value, _layers))
return;
_layers = value; _layers = value;
NotifyOfPropertyChange(() => Layers); NotifyOfPropertyChange(() => Layers);
} }
@ -151,7 +153,8 @@ namespace Artemis.ViewModels
get { return _keyboardPreview; } get { return _keyboardPreview; }
set set
{ {
if (Equals(value, _keyboardPreview)) return; if (Equals(value, _keyboardPreview))
return;
_keyboardPreview = value; _keyboardPreview = value;
NotifyOfPropertyChange(() => KeyboardPreview); NotifyOfPropertyChange(() => KeyboardPreview);
} }
@ -162,7 +165,8 @@ namespace Artemis.ViewModels
get { return _showAll; } get { return _showAll; }
set set
{ {
if (value == _showAll) return; if (value == _showAll)
return;
_showAll = value; _showAll = value;
NotifyOfPropertyChange(); NotifyOfPropertyChange();
} }
@ -626,13 +630,8 @@ namespace Artemis.ViewModels
if (_draggingLayer != null) if (_draggingLayer != null)
return; return;
var keyboard = _deviceManager.ActiveKeyboard;
var pos = e.GetPosition((Image) e.OriginalSource); var pos = e.GetPosition((Image) e.OriginalSource);
var x = pos.X / ((double) keyboard.PreviewSettings.Width / keyboard.Width); var hoverLayer = GetLayers().Where(l => l.MustDraw()).FirstOrDefault(l => l.Properties.PropertiesRect(1).Contains(pos.X, pos.Y));
var y = pos.Y / ((double) keyboard.PreviewSettings.Height / keyboard.Height);
var hoverLayer = GetLayers().Where(l => l.MustDraw())
.FirstOrDefault(l => l.Properties.PropertiesRect(1).Contains(x, y));
if (hoverLayer != null) if (hoverLayer != null)
SelectedLayer = hoverLayer; SelectedLayer = hoverLayer;
@ -648,13 +647,9 @@ namespace Artemis.ViewModels
return; return;
var pos = e.GetPosition((Image) e.OriginalSource); var pos = e.GetPosition((Image) e.OriginalSource);
var keyboard = _deviceManager.ActiveKeyboard; var hoverLayer = GetLayers().Where(l => l.MustDraw()).FirstOrDefault(l => l.Properties.PropertiesRect(1).Contains(pos.X, pos.Y));
var x = pos.X / ((double) keyboard.PreviewSettings.Width / keyboard.Width);
var y = pos.Y / ((double) keyboard.PreviewSettings.Height / keyboard.Height);
var hoverLayer = GetLayers().Where(l => l.MustDraw())
.FirstOrDefault(l => l.Properties.PropertiesRect(1).Contains(x, y));
HandleDragging(e, x, y, hoverLayer); HandleDragging(e, pos.X, pos.Y, hoverLayer);
if (hoverLayer == null) if (hoverLayer == null)
{ {
@ -666,10 +661,9 @@ namespace Artemis.ViewModels
if (hoverLayer == SelectedLayer) if (hoverLayer == SelectedLayer)
{ {
var rect = hoverLayer.Properties.PropertiesRect(1); var rect = hoverLayer.Properties.PropertiesRect(1);
KeyboardPreviewCursor = KeyboardPreviewCursor = Math.Sqrt(Math.Pow(pos.X - rect.BottomRight.X, 2) + Math.Pow(pos.Y - rect.BottomRight.Y, 2)) < 0.6
Math.Sqrt(Math.Pow(x - rect.BottomRight.X, 2) + Math.Pow(y - rect.BottomRight.Y, 2)) < 0.6 ? Cursors.SizeNWSE
? Cursors.SizeNWSE : Cursors.SizeAll;
: Cursors.SizeAll;
} }
else else
{ {
@ -682,7 +676,8 @@ namespace Artemis.ViewModels
get { return _keyboardPreviewCursor; } get { return _keyboardPreviewCursor; }
set set
{ {
if (Equals(value, _keyboardPreviewCursor)) return; if (Equals(value, _keyboardPreviewCursor))
return;
_keyboardPreviewCursor = value; _keyboardPreviewCursor = value;
NotifyOfPropertyChange(() => KeyboardPreviewCursor); NotifyOfPropertyChange(() => KeyboardPreviewCursor);
} }

View File

@ -1,18 +1,17 @@
<controls:MetroWindow x:Class="Artemis.Views.LayerEditorView" <controls:MetroWindow x:Class="Artemis.Views.LayerEditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:utilities="clr-namespace:Artemis.Utilities" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d"
mc:Ignorable="d" Title="Artemis | Edit Layer" Height="600" Width="1100"
Title="Artemis | Edit Layer" Height="860" Width="630" xmlns:cal="http://www.caliburnproject.org"
xmlns:cal="http://www.caliburnproject.org" xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
xmlns:converters="clr-namespace:Artemis.Utilities.Converters" xmlns:models="clr-namespace:Artemis.Profiles.Layers.Models"
xmlns:models="clr-namespace:Artemis.Profiles.Layers.Models" GlowBrush="{DynamicResource AccentColorBrush}" Icon="../../Resources/bow.png"
GlowBrush="{DynamicResource AccentColorBrush}" Icon="../../Resources/bow.png" ResizeMode="CanResizeWithGrip">
ResizeMode="NoResize">
<controls:MetroWindow.Resources> <controls:MetroWindow.Resources>
<converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" /> <converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="ConditionTypeValues"> <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="ConditionTypeValues">
@ -24,111 +23,97 @@
<ScrollViewer VerticalScrollBarVisibility="Auto"> <ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Margin="10,0"> <Grid Margin="10,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="60" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Row="0"> <!-- First column -->
<!-- Header --> <StackPanel Grid.Column="0" Grid.Row="0">
<Grid.ColumnDefinitions> <!-- Basic -->
<ColumnDefinition Width="65" /> <Label FontSize="20" Content="Basics" />
<ColumnDefinition Width="Auto" /> <Grid>
<ColumnDefinition Width="65" /> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> <ColumnDefinition Width="*" />
<Grid.RowDefinitions> <ColumnDefinition Width="Auto" />
<RowDefinition /> <ColumnDefinition Width="Auto" />
<RowDefinition /> </Grid.ColumnDefinitions>
</Grid.RowDefinitions> <Grid.RowDefinitions>
<Label Grid.Row="0" Grid.ColumnSpan="4" FontSize="20" Content="Basics" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Layer name --> <!-- Layer name -->
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,12" FontSize="13.333" Text="Name:" <Label Grid.Row="0" Grid.Column="0" Content="Name:" VerticalAlignment="Center" HorizontalAlignment="Left" />
VerticalAlignment="Center" Height="18" /> <TextBox Grid.Row="0" Grid.Column="1" x:Name="Name" Margin="10" Text="{Binding Path=ProposedLayer.Name}" VerticalAlignment="Center" />
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Name" Margin="10" Width="200"
Text="{Binding Path=ProposedLayer.Name}" />
<!-- Layer type --> <!-- Layer type -->
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10,12" FontSize="13.333" Text="Type:" <Label Grid.Row="0" Grid.Column="2" Content="Type:" VerticalAlignment="Center" />
VerticalAlignment="Center" Height="18" /> <ComboBox Grid.Row="0" Grid.Column="3" Margin="10" x:Name="LayerTypes" VerticalAlignment="Center">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox Grid.Row="1" Grid.Column="3" Margin="10" Width="120" x:Name="LayerTypes"> <!-- Event toggle -->
<ComboBox.ItemTemplate> <Label Grid.Row="0" Grid.Column="4" Content="Is event: " VerticalAlignment="Center" />
<DataTemplate> <controls:ToggleSwitchButton Grid.Row="0" Grid.Column="5" VerticalAlignment="Center" IsChecked="{Binding Path=ProposedLayer.IsEvent, Mode=TwoWay}" cal:Message.Attach="[Event Click] = [Action ToggleIsEvent]"
<TextBlock Text="{Binding Path=Name, Mode=OneWay}" /> Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" HorizontalAlignment="Left" Margin="10" />
</DataTemplate> </Grid>
</ComboBox.ItemTemplate>
</ComboBox>
<!-- Event toggle --> <!-- Advanced -->
<Label Grid.Row="1" Grid.Column="4" Content="Is event: " Margin="0 3 0 0" HorizontalAlignment="Right" <Label FontSize="20" Content="Advanced" />
VerticalAlignment="Center" /> <!-- Properties -->
<ToggleButton Grid.Row="1" Grid.Column="5" Margin="0,4,6,0" Width="25" Height="25" <ContentControl x:Name="LayerPropertiesViewModel" />
IsChecked="{Binding Path=ProposedLayer.IsEvent}" </StackPanel>
Style="{DynamicResource MetroCircleToggleButtonStyle}" VerticalAlignment="Center"
cal:Message.Attach="[Event Click] = [Action ToggleIsEvent]" />
</Grid>
<!-- Condition editor --> <!-- Second column -->
<Grid Grid.Row="2" Grid.Column="0"> <StackPanel Grid.Column="1" Grid.Row="0">
<Grid.ColumnDefinitions> <Label FontSize="20" Content="Conditions" />
<ColumnDefinition Width="Auto" /> <!-- Conditions -->
<ColumnDefinition Width="*" /> <Grid>
</Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<Label FontSize="20" Content="Display if.." Grid.Column="0" /> <ColumnDefinition Width="Auto" />
<ComboBox SelectedItem="{Binding Path=ProposedLayer.Properties.ConditionType}" Grid.Column="1" <ColumnDefinition Width="*" />
ItemsSource="{Binding Source={StaticResource ConditionTypeValues}}" Margin="10,0" </Grid.ColumnDefinitions>
VerticalAlignment="Center" Height="22"> <Label FontSize="16" Content="Display if.." Grid.Column="0" />
<ComboBox.ItemTemplate> <ComboBox SelectedItem="{Binding Path=ProposedLayer.Properties.ConditionType}" Grid.Column="1" ItemsSource="{Binding Source={StaticResource ConditionTypeValues}}" Margin="10,0" VerticalAlignment="Center" Height="22">
<DataTemplate> <ComboBox.ItemTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <DataTemplate>
</DataTemplate> <TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
</ComboBox.ItemTemplate> </DataTemplate>
</ComboBox> </ComboBox.ItemTemplate>
</Grid> </ComboBox>
<Border Grid.Row="3" Grid.Column="0" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}" </Grid>
Margin="10,0" SnapsToDevicePixels="True"> <Border BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}" Margin="10,0" SnapsToDevicePixels="True">
<ListBox Height="138" x:Name="LayerConditionVms" ScrollViewer.VerticalScrollBarVisibility="Visible"> <ListBox Height="138" x:Name="LayerConditionVms" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListBox.Template> <ListBox.Template>
<ControlTemplate> <ControlTemplate>
<ScrollViewer> <ScrollViewer>
<ItemsPresenter /> <ItemsPresenter />
</ScrollViewer> </ScrollViewer>
</ControlTemplate> </ControlTemplate>
</ListBox.Template> </ListBox.Template>
</ListBox> </ListBox>
</Border> </Border>
<Button Grid.Row="4" x:Name="AddCondition" Content="Add condition" VerticalAlignment="Center" <Button x:Name="AddCondition" Content="Add condition" VerticalAlignment="Center" Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Right" Height="30" Margin="0,10,10,10" ScrollViewer.VerticalScrollBarVisibility="Auto" />
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Right" Height="30"
Margin="0,10,10,10" ScrollViewer.VerticalScrollBarVisibility="Auto" />
<!-- Advanced --> <!-- Event settings -->
<Label Grid.Row="4" Grid.Column="0" FontSize="20" HorizontalAlignment="Left" <ContentControl x:Name="EventPropertiesViewModel" />
Content="Advanced" Width="97" VerticalAlignment="Bottom" /> </StackPanel>
<!-- Advanced settings -->
<ContentControl Grid.Row="5" Grid.Column="0" x:Name="LayerPropertiesViewModel" />
<!-- Event settings --> <!-- Buttons -->
<ContentControl Grid.Row="6" Grid.Column="0" x:Name="EventPropertiesViewModel" /> <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal">
<Button x:Name="Apply" Content="Apply" VerticalAlignment="Bottom" Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20" Height="30" />
<StackPanel Grid.Row="7" Grid.Column="0" Orientation="Horizontal"> <Button x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom" Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20" Height="30" />
<Button x:Name="Apply" Content="Apply" VerticalAlignment="Bottom"
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left"
Margin="10,0,0,20"
Height="30" />
<Button x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom"
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left"
Margin="10,0,0,20"
Height="30" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>

View File

@ -34,8 +34,10 @@
</Border.Effect> </Border.Effect>
<Grid> <Grid>
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardImage}" MinHeight="10" MinWidth="10" Stretch="Uniform" /> <Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardImage}" MinHeight="10" MinWidth="10" Stretch="Uniform" />
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardPreview}" Opacity="0.8" Stretch="Uniform" Cursor="{Binding Path=KeyboardPreviewCursor}" IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}" <Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=KeyboardPreview}" Opacity="0.8" Stretch="Uniform" Cursor="{Binding Path=KeyboardPreviewCursor}"
cal:Message.Attach="[Event MouseMove] = [Action MouseMoveKeyboardPreview($eventArgs)]; [Event MouseDown] = [Action MouseDownKeyboardPreview($eventArgs)]; [Event MouseUp] = [Action MouseUpKeyboardPreview($eventArgs)]" /> IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}" Margin="{Binding Path=PreviewSettings.Margin}"
cal:Message.Attach="[Event MouseMove] = [Action MouseMoveKeyboardPreview($eventArgs)]; [Event MouseDown] = [Action MouseDownKeyboardPreview($eventArgs)];
[Event MouseUp] = [Action MouseUpKeyboardPreview($eventArgs)]" />
</Grid> </Grid>
</Border> </Border>
</Border> </Border>

View File

@ -1,12 +1,10 @@
<UserControl x:Class="Artemis.Views.Profiles.LayerConditionView" <UserControl x:Class="Artemis.Views.Profiles.LayerConditionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:utilities="clr-namespace:Artemis.Utilities" mc:Ignorable="d" d:DesignWidth="600">
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d" d:DesignWidth="613.296" Height="46">
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
@ -14,66 +12,58 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<Grid Margin="10"> <Grid Margin="1,5,5,5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Name="Col1" Width="2*" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Left --> <!-- Left -->
<ComboBox x:Name="DataModelProps" Grid.Column="0" Width="210" MaxDropDownHeight="400" <ComboBox Grid.Column="0" x:Name="DataModelProps" Width="{Binding ElementName=WidthLabel, Path=ActualWidth}" MaxDropDownHeight="400" VerticalAlignment="Top" Panel.ZIndex="2">
HorizontalAlignment="Center" VerticalAlignment="Top">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinWidth="522"> <Grid Width="512">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" /> <TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" />
<TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" <TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" HorizontalAlignment="Right" Margin="10,0,0,0" />
HorizontalAlignment="Right" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<Label Grid.Column="0" Name="WidthLabel" Panel.ZIndex="1"></Label>
<!-- Center --> <!-- Center -->
<TextBlock Grid.Column="1" Text="is" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,3,0,0" /> <TextBlock Grid.Column="1" Text="is" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0" />
<ComboBox x:Name="Operators" Grid.Column="2" Width="150" MaxDropDownHeight="125" HorizontalAlignment="Center" <ComboBox x:Name="Operators" Grid.Column="2" MaxDropDownHeight="125" VerticalAlignment="Top" DisplayMemberPath="Display" />
VerticalAlignment="Top" DisplayMemberPath="Display" />
<!-- Right --> <!-- Right -->
<Grid Grid.Column="3" HorizontalAlignment="Left" Margin="10,0,0,0" Width="148"> <Grid Grid.Column="3" Margin="10,0,0,0">
<Grid.ColumnDefinitions> <StackPanel Grid.Column="0" x:Name="KeybindIsVisible" VerticalAlignment="Top">
<ColumnDefinition Width="120" /> <controls:HotKeyBox HotKey="{Binding Path=HotKey}" VerticalAlignment="Center" Watermark="Enter keybind" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" x:Name="KeybindIsVisible" HorizontalAlignment="Left" VerticalAlignment="Top">
<controls:HotKeyBox HotKey="{Binding Path=HotKey}" VerticalAlignment="Center" HorizontalAlignment="Left" Width="110" Watermark="Enter keybind" />
</StackPanel> </StackPanel>
<StackPanel Grid.Column="0" x:Name="UserValueIsVisible" HorizontalAlignment="Left" VerticalAlignment="Top"> <StackPanel Grid.Column="0" x:Name="UserValueIsVisible" VerticalAlignment="Top">
<TextBox x:Name="UserValue" VerticalAlignment="Center" HorizontalAlignment="Left" Width="110" controls:TextBoxHelper.Watermark="Enter value" /> <TextBox x:Name="UserValue" VerticalAlignment="Center" controls:TextBoxHelper.Watermark="Enter value" />
</StackPanel> </StackPanel>
<StackPanel Grid.Column="0" x:Name="UserDropdownValueIsVisible" HorizontalAlignment="Left" VerticalAlignment="Top"> <StackPanel Grid.Column="0" x:Name="UserDropdownValueIsVisible" VerticalAlignment="Top">
<ComboBox x:Name="DropdownValues" Width="110" MaxDropDownHeight="125" HorizontalAlignment="Center" <ComboBox x:Name="DropdownValues" MaxDropDownHeight="125" VerticalAlignment="Top" />
VerticalAlignment="Top" />
</StackPanel> </StackPanel>
<Button Grid.Column="1" x:Name="Delete" Width="26" Height="26" Style="{DynamicResource SquareButtonStyle}"
VerticalAlignment="Top" HorizontalAlignment="Right">
<Button.Content>
<Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
</Grid> </Grid>
<!-- Delete button -->
<Button Grid.Column="4" x:Name="Delete" Width="22" Height="22" Style="{DynamicResource SquareButtonStyle}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10,0,0,0">
<Button.Content>
<Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12">
<Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
</Rectangle.OpacityMask>
</Rectangle>
</Button.Content>
</Button>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -1,16 +1,14 @@
<UserControl x:Class="Artemis.Views.Profiles.LayerDynamicPropertiesView" <UserControl x:Class="Artemis.Views.Profiles.LayerDynamicPropertiesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:utilities="clr-namespace:Artemis.Utilities" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:models="clr-namespace:Artemis.Profiles.Layers.Models"
xmlns:models="clr-namespace:Artemis.Profiles.Layers.Models" xmlns:converters="clr-namespace:Artemis.Utilities.Converters"
xmlns:converters="clr-namespace:Artemis.Utilities.Converters" mc:Ignorable="d"
mc:Ignorable="d" d:DesignWidth="500">
d:DesignHeight="40" d:DesignWidth="500">
<UserControl.Resources> <UserControl.Resources>
<converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" /> <converters:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="DynamicPropertyValues"> <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="DynamicPropertyValues">
@ -19,20 +17,19 @@
</ObjectDataProvider.MethodParameters> </ObjectDataProvider.MethodParameters>
</ObjectDataProvider> </ObjectDataProvider>
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid Margin="0,5">
<!-- Height --> <!-- Height -->
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" /> <ColumnDefinition Width="70" />
<ColumnDefinition Width="86*" /> <ColumnDefinition Width="86*" />
<ColumnDefinition Width="65*" /> <ColumnDefinition Width="65*" />
<ColumnDefinition Width="86*" /> <ColumnDefinition Width="86*" />
<ColumnDefinition Width="75*" /> <ColumnDefinition Width="75*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock x:Name="Name" Grid.Column="0" Margin="10" FontSize="13.333" VerticalAlignment="Center" Height="18" /> <Label x:Name="Name" Grid.Column="0" VerticalAlignment="Center" />
<!-- Target property --> <!-- Target property -->
<ComboBox x:Name="Targets" Grid.Column="1" Margin="10,0" MaxDropDownHeight="300" VerticalAlignment="Center" <ComboBox x:Name="Targets" Grid.Column="1" Margin="10,0,0,0" MaxDropDownHeight="300" VerticalAlignment="Center">
Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinWidth="482"> <Grid MinWidth="482">
@ -41,18 +38,14 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" /> <TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" />
<TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" <TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" HorizontalAlignment="Right" />
HorizontalAlignment="Right" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<!-- Dynamic type --> <!-- Dynamic type -->
<ComboBox SelectedItem="{Binding Path=LayerPropertyType}" Grid.Column="2" <ComboBox SelectedItem="{Binding Path=LayerPropertyType}" Grid.Column="2" ItemsSource="{Binding Source={StaticResource DynamicPropertyValues}}" Margin="10,0,0,0" VerticalAlignment="Center" IsEnabled="{Binding Path=ControlsEnabled}">
ItemsSource="{Binding Source={StaticResource DynamicPropertyValues}}"
Margin="10,0" VerticalAlignment="Center" Height="22"
IsEnabled="{Binding Path=ControlsEnabled}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
@ -62,8 +55,7 @@
<!-- PercentageOfProperty --> <!-- PercentageOfProperty -->
<StackPanel Grid.Column="3" x:Name="SourcesIsVisible" VerticalAlignment="Center"> <StackPanel Grid.Column="3" x:Name="SourcesIsVisible" VerticalAlignment="Center">
<ComboBox x:Name="Sources" Margin="10,0" MaxDropDownHeight="300" Height="22" <ComboBox x:Name="Sources" Margin="10,0,0,0" MaxDropDownHeight="300" IsEnabled="{Binding Path=ControlsEnabled}">
IsEnabled="{Binding Path=ControlsEnabled}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinWidth="522"> <Grid MinWidth="522">
@ -72,8 +64,7 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" /> <TextBlock Grid.Column="0" Text="{Binding Path=Display}" HorizontalAlignment="Left" />
<TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" <TextBlock Grid.Column="1" FontWeight="Bold" Text="{Binding Path=DisplayType}" HorizontalAlignment="Right" />
HorizontalAlignment="Right" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
@ -82,16 +73,11 @@
<!-- PercentageOf --> <!-- PercentageOf -->
<StackPanel Grid.Column="3" x:Name="UserSourceIsVisible" VerticalAlignment="Center"> <StackPanel Grid.Column="3" x:Name="UserSourceIsVisible" VerticalAlignment="Center">
<controls:NumericUpDown Margin="10,0" Height="22" <controls:NumericUpDown Margin="10,0,0,0" Value="{Binding Path=Proposed.PercentageSource, Mode=TwoWay}" IsEnabled="{Binding Path=ControlsEnabled}" />
Value="{Binding Path=Proposed.PercentageSource, Mode=TwoWay}"
IsEnabled="{Binding Path=ControlsEnabled}" />
</StackPanel> </StackPanel>
<!-- Extra option --> <!-- Extra option -->
<ComboBox SelectedItem="{Binding Path=Proposed.LayerPropertyOptions}" Grid.Column="4" <ComboBox SelectedItem="{Binding Path=Proposed.LayerPropertyOptions}" Grid.Column="4" ItemsSource="{Binding Path=LayerPropertyOptions}" Margin="10,0,0,0" VerticalAlignment="Center" IsEnabled="{Binding Path=ControlsEnabled}">
ItemsSource="{Binding Path=LayerPropertyOptions}"
Margin="10,0" VerticalAlignment="Center" Height="22"
IsEnabled="{Binding Path=ControlsEnabled}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" /> <TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />

View File

@ -1,47 +1,58 @@
<UserControl x:Class="Artemis.Views.Profiles.LayerTweenView" <UserControl x:Class="Artemis.Views.Profiles.LayerTweenView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Artemis.Views.Profiles" xmlns:local="clr-namespace:Artemis.Views.Profiles"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="900"> d:DesignHeight="300" d:DesignWidth="900">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="84" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
<ColumnDefinition Width="84" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
<RowDefinition /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" FontSize="20" HorizontalAlignment="Left" Content="Easing" <Label Grid.Row="0" Grid.Column="0" FontSize="20" HorizontalAlignment="Left" Content="Easing" />
VerticalAlignment="Bottom" />
<!-- Width --> <!-- Width -->
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10" FontSize="13.333" Text="Width:" VerticalAlignment="Center" Height="18" /> <Label Grid.Row="1" Grid.Column="0" Content="Width:" VerticalAlignment="Center" />
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal"> <Grid Grid.Row="1" Grid.Column="1">
<ComboBox Margin="10,10,10,0" VerticalAlignment="Top" Height="22" Width="86" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.WidthEase}" /> <Grid.ColumnDefinitions>
<controls:NumericUpDown Margin="0,10,10,0" Height="22" Width="105" Value="{Binding Path=LayerModel.Properties.WidthEaseTime}" /> <ColumnDefinition />
</StackPanel> <ColumnDefinition />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Margin="10,10,10,0" VerticalAlignment="Center" Height="22" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.WidthEase}" />
<controls:NumericUpDown Grid.Column="1" Margin="0,10,10,0" Height="22" Value="{Binding Path=LayerModel.Properties.WidthEaseTime}" VerticalAlignment="Center" />
</Grid>
<!-- Height --> <!-- Height -->
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10" FontSize="13.333" Text="Height:" VerticalAlignment="Center" Height="18" /> <Label Grid.Row="1" Grid.Column="2" Content="Height:" VerticalAlignment="Center" />
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Horizontal"> <Grid Grid.Row="1" Grid.Column="3">
<ComboBox Margin="10,10,10,0" VerticalAlignment="Top" Height="22" Width="86" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.HeightEase}" /> <Grid.ColumnDefinitions>
<controls:NumericUpDown Margin="0,10,10,0" Height="22" Width="105" Value="{Binding Path=LayerModel.Properties.HeightEaseTime}" /> <ColumnDefinition />
</StackPanel> <ColumnDefinition />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Margin="10,10,10,0" VerticalAlignment="Center" Height="22" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.HeightEase}" />
<controls:NumericUpDown Grid.Column="1" Margin="0,10,0,0" Height="22" Value="{Binding Path=LayerModel.Properties.HeightEaseTime}" VerticalAlignment="Center" />
</Grid>
<!-- Opacity --> <!-- Opacity -->
<TextBlock Grid.Row="2" Grid.Column="0" Margin="10" FontSize="13.333" Text="Opacity:" VerticalAlignment="Center" Height="18" /> <Label Grid.Row="2" Grid.Column="0" Content="Opacity:" VerticalAlignment="Center" />
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal"> <Grid Grid.Row="2" Grid.Column="1">
<ComboBox Margin="10,10,10,0" VerticalAlignment="Top" Height="22" Width="86" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.OpacityEase}" /> <Grid.ColumnDefinitions>
<controls:NumericUpDown Margin="0,10,10,0" Height="22" Width="105" Value="{Binding Path=LayerModel.Properties.OpacityEaseTime}" /> <ColumnDefinition />
</StackPanel> <ColumnDefinition />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Margin="10,10,10,0" VerticalAlignment="Center" Height="22" ItemsSource="{Binding EaseFunctions}" SelectedItem="{Binding Path=LayerModel.Properties.OpacityEase}" />
<controls:NumericUpDown Grid.Column="1" Margin="0,10,10,0" Height="22" Value="{Binding Path=LayerModel.Properties.OpacityEaseTime}" VerticalAlignment="Center" />
</Grid>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -3,16 +3,16 @@
<package id="Betwixt" version="1.4.1" targetFramework="net461" /> <package id="Betwixt" version="1.4.1" targetFramework="net461" />
<package id="Caliburn.Micro" version="3.0.3" targetFramework="net461" /> <package id="Caliburn.Micro" version="3.0.3" targetFramework="net461" />
<package id="Caliburn.Micro.Core" version="3.0.3" targetFramework="net461" /> <package id="Caliburn.Micro.Core" version="3.0.3" targetFramework="net461" />
<package id="Castle.Core" version="3.3.3" targetFramework="net452" /> <package id="Castle.Core" version="4.0.0" targetFramework="net461" />
<package id="Colore" version="5.1.0" targetFramework="net461" /> <package id="Colore" version="5.1.0" targetFramework="net461" />
<package id="CSCore" version="1.1.0" targetFramework="net461" /> <package id="CSCore" version="1.2.0" targetFramework="net461" />
<package id="CUE.NET" version="1.1.2.1" targetFramework="net461" /> <package id="CUE.NET" version="1.1.2.1" targetFramework="net461" />
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net461" /> <package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net461" />
<package id="DynamicExpresso.Core" version="1.3.3.5" targetFramework="net461" /> <package id="DynamicExpresso.Core" version="1.3.3.5" targetFramework="net461" />
<package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" /> <package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" />
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net452" /> <package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net452" />
<package id="log4net" version="2.0.7" targetFramework="net461" /> <package id="log4net" version="2.0.7" targetFramework="net461" />
<package id="MahApps.Metro" version="1.4.1" targetFramework="net461" /> <package id="MahApps.Metro" version="1.4.3" targetFramework="net461" />
<package id="MahApps.Metro.Resources" version="0.6.1.0" targetFramework="net452" /> <package id="MahApps.Metro.Resources" version="0.6.1.0" targetFramework="net452" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net461" /> <package id="Mono.Cecil" version="0.9.6.4" targetFramework="net461" />
<package id="MoonSharp" version="2.0.0.0" targetFramework="net461" /> <package id="MoonSharp" version="2.0.0.0" targetFramework="net461" />
@ -22,8 +22,8 @@
<package id="Ninject.Extensions.Conventions" version="3.2.0.0" targetFramework="net461" /> <package id="Ninject.Extensions.Conventions" version="3.2.0.0" targetFramework="net461" />
<package id="Ninject.Extensions.Logging" version="3.2.3.0" targetFramework="net452" /> <package id="Ninject.Extensions.Logging" version="3.2.3.0" targetFramework="net452" />
<package id="Ninject.Extensions.Logging.nlog4" version="3.2.3.0" targetFramework="net452" /> <package id="Ninject.Extensions.Logging.nlog4" version="3.2.3.0" targetFramework="net452" />
<package id="NLog" version="4.4.1" targetFramework="net461" /> <package id="NLog" version="4.4.3" targetFramework="net461" />
<package id="NLog.Schema" version="4.4.1" targetFramework="net461" /> <package id="NLog.Schema" version="4.4.3" targetFramework="net461" />
<package id="Process.NET" version="1.0.8" targetFramework="net461" /> <package id="Process.NET" version="1.0.8" targetFramework="net461" />
<package id="SharpDX" version="3.1.1" targetFramework="net461" /> <package id="SharpDX" version="3.1.1" targetFramework="net461" />
<package id="SharpDX.Direct3D9" version="3.1.1" targetFramework="net461" /> <package id="SharpDX.Direct3D9" version="3.1.1" targetFramework="net461" />