content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System; using CNTK; namespace SiaNet.Model.Initializers { /// <summary> /// He uniform variance scaling initializer. It draws samples from a uniform distribution within[-limit, limit] where /// limit is sqrt(6 / fan_in) where fan_in is the number of input units in the weight tensor. /// </summary> /// <seealso cref="InitializerBase" /> public class HeUniform : InitializerBase { private int? _filterRank; private int? _outputRank; private uint? _seed; /// <summary> /// Initializes a new instance of the <see cref="HeUniform" /> class. /// </summary> public HeUniform() : this(0.01) { } /// <summary> /// Initializes a new instance of the <see cref="HeUniform" /> class. /// </summary> /// <param name="scale">The scale value for the generator tensors.</param> public HeUniform(double scale) { Scale = scale; } /// <summary> /// Initializes a new instance of the <see cref="HeUniform" /> class. /// </summary> /// <param name="scale">The scale value for the generator tensors.</param> /// <param name="outputRank">The output rank value.</param> public HeUniform(double scale, int outputRank) : this(scale) { OutputRank = outputRank; } /// <summary> /// Initializes a new instance of the <see cref="HeUniform" /> class. /// </summary> /// <param name="scale">The scale value for the generator tensors.</param> /// <param name="outputRank">The output rank value.</param> /// <param name="filterRank">The filter rank value.</param> public HeUniform(double scale, int outputRank, int filterRank) : this(scale, outputRank) { FilterRank = filterRank; } /// <summary> /// Initializes a new instance of the <see cref="HeUniform" /> class. /// </summary> /// <param name="scale">The scale value for the generator tensors.</param> /// <param name="outputRank">The output rank value.</param> /// <param name="filterRank">The filter rank value.</param> /// <param name="seed">Used to seed the random generator.</param> public HeUniform(double scale, int outputRank, int filterRank, uint seed) : this(scale, outputRank, filterRank) { Seed = seed; } public int FilterRank { get { if (!_filterRank.HasValue) { throw new InvalidOperationException(); } return _filterRank.Value; } protected set => _filterRank = value; } public bool HasFilterRank { get => _filterRank.HasValue; } public bool HasOutputRank { get => _outputRank.HasValue; } public bool HasSeed { get => _seed.HasValue; } public int OutputRank { get { if (!_outputRank.HasValue) { throw new InvalidOperationException(); } return _outputRank.Value; } protected set => _outputRank = value; } public double Scale { get; protected set; } public uint Seed { get { if (!_seed.HasValue) { throw new InvalidOperationException(); } return _seed.Value; } protected set => _seed = value; } /// <inheritdoc /> internal override CNTKDictionary ToDictionary() { if (HasOutputRank) { if (HasFilterRank) { if (HasSeed) { return CNTKLib.HeUniformInitializer(Scale, OutputRank, FilterRank, Seed); } return CNTKLib.HeUniformInitializer(Scale, OutputRank, FilterRank); } return CNTKLib.HeUniformInitializer(Scale, OutputRank); } return CNTKLib.HeUniformInitializer(Scale); } } }
29.671141
125
0.510292
[ "MIT" ]
falahati/SiaNet
SiaNet/Model/Initializers/HeUniform.cs
4,423
C#
using IceCoffee.Wpf.MvvmFrame.Command; using IceCoffee.Wpf.MvvmFrame.NotifyPropertyChanged; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TianYiSdtdServerTools.Client.Models.ConsoleTempList; using TianYiSdtdServerTools.Client.Services.UI; using TianYiSdtdServerTools.Client.TelnetClient; using TianYiSdtdServerTools.Client.ViewModels.Primitives; namespace TianYiSdtdServerTools.Client.ViewModels.ControlPanel { public class PermissionManagementViewModel : ViewModelBase { private readonly IDialogService _dialogService; public List<Administrator> Administrators { get; [NPCA_Method]set; } public List<CommandLevel> CommandLevels { get; [NPCA_Method]set; } public string SteamID { get; set; } public int PermissionLevel1 { get; set; } = -1; public string Command { get; set; } public int PermissionLevel2 { get; set; } = -1; /// <summary> /// 管理员列表当前选中索引 /// </summary> public Administrator SelectedItem1 { get; set; } /// <summary> /// 命令权限列表当前选中索引 /// </summary> public CommandLevel SelectedItem2 { get; set; } private bool _isVisible; public bool IsVisible { get { return _isVisible; } set { _isVisible = value; if (_isVisible) { SdtdConsole.Instance.ReceivedTempListData -= OnReceivedTempListData; SdtdConsole.Instance.ReceivedTempListData += OnReceivedTempListData; PrivateRefreshList(); } else { SdtdConsole.Instance.ReceivedTempListData -= OnReceivedTempListData; } } } public RelayCommand AddAdministrator { get; private set; } public RelayCommand RemoveAdministrator { get; private set; } public RelayCommand RemoveAllAdministrator { get; private set; } public RelayCommand AddCommandLevel { get; private set; } public RelayCommand RemoveCommandLevel { get; private set; } public RelayCommand RefreshList { get; private set; } public RelayCommand ClearList { get; private set; } public PermissionManagementViewModel(IDispatcherService dispatcherService, IDialogService dialogService) : base(dispatcherService) { _dialogService = dialogService; AddAdministrator = new RelayCommand(()=> { SdtdConsole.Instance.AddAdministrator(SteamID, PermissionLevel1); PrivateRefreshList(); }); RemoveAdministrator = new RelayCommand(() => { SdtdConsole.Instance.RemoveAdministrator(SelectedItem1.SteamID); PrivateRefreshList(); }, CanRemoveAdministrator); RemoveAllAdministrator = new RelayCommand(() => { if(dialogService.ShowOKCancel("确定移除所有管理员吗?")) { foreach (var item in Administrators) { SdtdConsole.Instance.RemoveAdministrator(item.SteamID); } PrivateRefreshList(); } }, CanRemoveAdministrator); AddCommandLevel = new RelayCommand(() => { SdtdConsole.Instance.AddCommandPermissionLevel(Command, PermissionLevel2); PrivateRefreshList(); }); RemoveCommandLevel = new RelayCommand(() => { SdtdConsole.Instance.RemoveCommandPermissionLevel(SelectedItem2.Command); PrivateRefreshList(); }, CanRemoveCommandLevel); RefreshList = new RelayCommand(PrivateRefreshList); ClearList = new RelayCommand(() => { Administrators = null; CommandLevels = null; }); } private void PrivateRefreshList() { SdtdConsole.Instance.SendCmd("admin list" + Environment.NewLine + SdtdConsole.CmdPlaceholder); SdtdConsole.Instance.SendCmd("cp list" + Environment.NewLine + SdtdConsole.CmdPlaceholder); } private bool CanRemoveAdministrator() { return SelectedItem1 != null; } private bool CanRemoveCommandLevel() { return SelectedItem2 != null; } private void OnReceivedTempListData(object twoDimensionalList, TempListDataType tempListDataType) { if (tempListDataType == TempListDataType.AdminList && twoDimensionalList is List<Administrator>) { Administrators = (List<Administrator>)twoDimensionalList; } else if (tempListDataType == TempListDataType.PermissionList && twoDimensionalList is List<CommandLevel>) { CommandLevels = (List<CommandLevel>)twoDimensionalList; } } } }
33.096154
138
0.594034
[ "MIT" ]
1249993110/TianYiSdtdServerTools
Client/ViewModels/ControlPanel/PermissionManagementViewModel.cs
5,233
C#
using UnityEngine; using System.Collections; public class AN_InvitationInboxCloseResult : MonoBehaviour { private AdroidActivityResultCodes _resultCode; public AN_InvitationInboxCloseResult(string result) { _resultCode = (AdroidActivityResultCodes) System.Convert.ToInt32(result); } public AdroidActivityResultCodes ResultCode { get { return _resultCode; } } }
23.235294
76
0.76962
[ "Apache-2.0" ]
DougLazyAngus/lazyAngus
LazyAngus/Assets/Extensions/GooglePlayCommon/Models/Results/Invitations/AN_InvitationInboxCloseResult.cs
397
C#
namespace BlogEngine.Core.Web.Extensions { using System; using System.Collections.Generic; using System.Linq; using System.Xml.Serialization; using System.IO; using System.Runtime.Serialization.Formatters.Binary; /// <summary> /// Serializable object that holds extension, /// extension attributes and methods /// </summary> [Serializable] public class ManagedExtension { #region Constants and Fields /// <summary> /// The settings. /// </summary> private List<ExtensionSettings> settings; private List<Guid> blogs; #endregion #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref = "ManagedExtension" /> class. /// Default constructor required for serialization /// </summary> public ManagedExtension() { this.Version = string.Empty; this.ShowSettings = true; this.Name = string.Empty; this.Enabled = true; this.Description = string.Empty; this.Author = string.Empty; this.AdminPage = string.Empty; } /// <summary> /// Initializes a new instance of the <see cref="ManagedExtension"/> class. /// </summary> /// <param name="name">The extension name.</param> /// <param name="version">The version.</param> /// <param name="desc">The description.</param> /// <param name="author">The author.</param> public ManagedExtension(string name, string version, string desc, string author) { this.AdminPage = string.Empty; this.Name = name; this.Version = version; this.Description = desc; this.Author = author; this.settings = new List<ExtensionSettings>(); this.Enabled = true; this.ShowSettings = true; } #endregion #region Properties /// <summary> /// Gets or sets Custom admin page. If defined, link to default settings /// page will be replaced by the link to this page in the UI /// </summary> [XmlElement] public string AdminPage { get; set; } /// <summary> /// Gets or sets Extension Author. Will show up in the settings page, can be used as a /// link to author's home page /// </summary> [XmlElement] public string Author { get; set; } /// <summary> /// Gets or sets Extension Description /// </summary> [XmlElement] public string Description { get; set; } /// <summary> /// Gets or sets a value indicating whether extension is enabled. /// </summary> [XmlElement] public bool Enabled { get; set; } /// <summary> /// Gets or sets Extension Name /// </summary> [XmlAttribute] public string Name { get; set; } /// <summary> /// Gets or sets Extension Priority /// </summary> [XmlElement] public int Priority { get; set; } /// <summary> /// True if extenstion properties enabled in sub-blog /// </summary> [XmlElement] public bool SubBlogEnabled { get; set; } /// <summary> /// Gets or sets Settings for the extension /// </summary> [XmlElement(IsNullable = true)] public List<ExtensionSettings> Settings { get { if (!Blog.CurrentInstance.IsPrimary && SubBlogEnabled) { if (settings.All(xset => xset.BlogId != Blog.CurrentInstance.Id)) { var primId = Blog.Blogs.FirstOrDefault(b => b.IsPrimary).BlogId; List<ExtensionSettings> newSets = GenericHelper<List<ExtensionSettings>>.Copy( settings.Where(setItem => setItem.BlogId == primId || setItem.BlogId == null).ToList()); foreach (var setItem in newSets) { setItem.BlogId = Blog.CurrentInstance.Id; settings.Add(setItem); } } } return settings; } set { settings = value; } } /// <summary> /// Blog specific extension settings /// </summary> [XmlIgnore] public List<ExtensionSettings> BlogSettings { get { var primId = Blog.Blogs.FirstOrDefault(b => b.IsPrimary).BlogId; if (!Blog.CurrentInstance.IsPrimary && SubBlogEnabled) { if (settings.All(xset => xset.BlogId != Blog.CurrentInstance.Id)) { List<ExtensionSettings> newSets = GenericHelper<List<ExtensionSettings>>.Copy( settings.Where(setItem => setItem.BlogId == primId || setItem.BlogId == null).ToList()); foreach (var setItem in newSets) { setItem.BlogId = Blog.CurrentInstance.Id; settings.Add(setItem); } } } return settings.Where(s => s.BlogId == primId || s.BlogId == null).ToList(); } } /// <summary> /// List of blogs that opt to DISABLE extension /// </summary> [XmlElement] public List<Guid> Blogs { get { return blogs; } set { blogs = value; } } /// <summary> /// Gets or sets a value indicating whether to Show or hide settings in the admin/extensions list /// </summary> [XmlElement] public bool ShowSettings { get; set; } /// <summary> /// Gets or sets Extension Version /// </summary> [XmlElement] public string Version { get; set; } #endregion #region Public Methods /// <summary> /// Method to find out if extension has setting with this name /// </summary> /// <param name="settingName"> /// Setting Name /// </param> /// <returns> /// True if settings with this name already exists /// </returns> public bool ContainsSetting(string settingName) { return this.settings.Any(xset => xset.Name == settingName); } /// <summary> /// Initializes the settings. /// </summary> /// <param name="extensionSettings">The extension settings.</param> public void InitializeSettings(ExtensionSettings extensionSettings) { extensionSettings.Index = this.settings.Count; this.SaveSettings(extensionSettings); } /// <summary> /// Determine if settings has been initialized with default /// values (first time new extension loaded into the manager) /// </summary> /// <param name="xs"> /// The ExtensionSettings. /// </param> /// <returns> /// True if initialized /// </returns> public bool Initialized(ExtensionSettings xs) { return xs != null && this.settings.Where(setItem => setItem.Name == xs.Name).Any(setItem => setItem.Parameters.Count == xs.Parameters.Count); } /// <summary> /// Method to cache and serialize settings object /// </summary> /// <param name="extensionSettings">The extension settings.</param> public void SaveSettings(ExtensionSettings extensionSettings) { if (string.IsNullOrEmpty(extensionSettings.Name)) { extensionSettings.Name = this.Name; } if (!Blog.CurrentInstance.IsPrimary && SubBlogEnabled) { // update settings for sub-blog foreach (var setItem in this.settings.Where( setItem => setItem.Name == extensionSettings.Name && setItem.BlogId == extensionSettings.BlogId)) { this.settings.Remove(setItem); break; } } else { // update settings for primary blog var primId = Blog.Blogs.FirstOrDefault(b => b.IsPrimary).BlogId; extensionSettings.BlogId = primId; foreach (var setItem in this.settings.Where( setItem => setItem.Name == extensionSettings.Name && (setItem.BlogId == primId || setItem.BlogId == null))) { this.settings.Remove(setItem); break; } } settings.Add(extensionSettings); this.settings.Sort((s1, s2) => string.Compare(s1.Index.ToString(), s2.Index.ToString())); } /// <summary> /// Returns the physical path and filename of this extension. /// </summary> /// <param name="checkExistence"> /// If true, existence of the file is checked and if the file does not exist, /// an empty string is returned. /// </param> /// <returns></returns> //public string GetPathAndFilename(bool checkExistence) //{ // string filename = string.Empty; // var appRoot = HostingEnvironment.MapPath("~/"); // var codeAssemblies = Utils.CodeAssemblies(); // foreach (Assembly a in codeAssemblies) // { // var types = a.GetTypes(); // foreach (var type in types.Where(type => type.Name == Name)) // { // var assemblyName = type.Assembly.FullName.Split(".".ToCharArray())[0]; // assemblyName = assemblyName.Replace("App_SubCode_", "App_Code\\"); // var fileExt = assemblyName.Contains("VB_Code") ? ".vb" : ".cs"; // filename = appRoot + Path.Combine(Path.Combine(assemblyName, "Extensions"), Name + fileExt); // } // } // if (checkExistence && !string.IsNullOrWhiteSpace(filename)) // { // if (!File.Exists(filename)) // return string.Empty; // } // return filename; //} #endregion } /// <summary> /// Helper class /// </summary> /// <typeparam name="T">Object type</typeparam> public static class GenericHelper<T> { /// <summary> /// To copy collection by value /// </summary> /// <param name="objectToCopy">Object to copy from</param> /// <returns>New object, as oppose to object reference</returns> public static T Copy(object objectToCopy) { using (MemoryStream memoryStream = new MemoryStream()) { BinaryFormatter binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(memoryStream, objectToCopy); memoryStream.Seek(0, SeekOrigin.Begin); return (T)binaryFormatter.Deserialize(memoryStream); } } } }
34.504451
153
0.512384
[ "Unlicense" ]
Solotzy/Analysis-of-BlogEngine.NET
BlogEngine/BlogEngine.Core/Web/Extensions/ManagedExtension.cs
11,630
C#
using System; using System.Activities; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace EnvironmentFunctions { public sealed class EnvironmentVariables : CodeActivity { public enum Fold { UserName, ExitCode, TickCount, CommandLine, CurrentDirectory, MachineName, ProcessorCount, SystemPageSize, NewLine, Version, WorkingSet, OSVersion, StackTrace, Is64BitProcess, Is64BitOperatingSystem, HasShutdownStarted, SystemDirectory, UserInteractive, UserDomainName, CurrentManagedThreadId, } [Category("Input")] [DisplayName("SelectFolder")] public Fold fol { get; set; } [Category("Output")] [DisplayName("Result")] public OutArgument<String> Variables { get; set; } protected override void Execute(CodeActivityContext context) { int Fold = Convert.ToInt32(fol); WindowsFormsSection Foldval = new WindowsFormsSection(); String variables; if (Fold == 0) { variables = Environment.UserName; } else if (Fold == 1) { variables = (Environment.ExitCode).ToString(); } else if (Fold == 2) { variables = (Environment.TickCount).ToString(); } else if (Fold == 3) { variables = Environment.CommandLine; } else if (Fold == 4) { variables = Environment.CurrentDirectory; } else if (Fold == 5) { variables = Environment.MachineName; } else if (Fold == 6) { variables = (Environment.ProcessorCount).ToString(); } else if (Fold == 7) { variables = (Environment.SystemPageSize).ToString(); } else if (Fold == 8) { variables = Environment.NewLine; } else if (Fold == 9) { variables = (Environment.Version).ToString(); } else if (Fold == 10) { variables = (Environment.WorkingSet).ToString(); } else if (Fold == 11) { variables = (Environment.OSVersion).ToString(); } else if (Fold == 12) { variables = Environment.StackTrace; } else if (Fold == 13) { variables = (Environment.Is64BitProcess).ToString(); } else if (Fold == 14) { variables = (Environment.Is64BitOperatingSystem).ToString(); } else if (Fold == 15) { variables = (Environment.HasShutdownStarted).ToString(); } else if (Fold == 16) { variables = Environment.SystemDirectory; } else if (Fold == 17) { variables = (Environment.UserInteractive).ToString(); } else if (Fold == 18) { variables = Environment.UserDomainName; } else if (Fold == 19) { variables = (Environment.CurrentManagedThreadId).ToString(); } else { variables = Environment.UserName; } context.SetValue(Variables, variables); } } }
28.80292
76
0.460213
[ "Apache-2.0" ]
aibotstechrepo/AiBotsStudio
EnvironmentFunctions/EnvironmentVariables.cs
3,948
C#
// <copyright file="GestureTests.cs" company="Automate The Planet Ltd."> // Copyright 2018 Automate The Planet Ltd. // Licensed under the Apache License, Version 2.0 (the "License"); // You may not use this file except in compliance with the License. // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // <author>Anton Angelov</author> // <site>https://automatetheplanet.com/</site> using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium.Appium; using OpenQA.Selenium.Appium.Android; using OpenQA.Selenium.Appium.Enums; using System; using System.Drawing; using System.IO; using OpenQA.Selenium.Appium.Interfaces; using OpenQA.Selenium.Appium.MultiTouch; namespace GettingStartedAppiumAndroidMacCSharp { [TestClass] public class GestureTests { private static AndroidDriver<AndroidElement> _driver; [ClassInitialize] public static void ClassInitialize(TestContext context) { string testAppPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "ApiDemos-debug.apk"); var desiredCaps = new AppiumOptions(); desiredCaps.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Android_Accelerated_x86_Oreo"); desiredCaps.AddAdditionalCapability(AndroidMobileCapabilityType.AppPackage, "io.appium.android.apis"); desiredCaps.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android"); desiredCaps.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "7.1"); desiredCaps.AddAdditionalCapability(AndroidMobileCapabilityType.AppActivity, ".ApiDemos"); desiredCaps.AddAdditionalCapability(MobileCapabilityType.App, testAppPath); _driver = new AndroidDriver<AndroidElement>(new Uri("http://127.0.0.1:4723/wd/hub"), desiredCaps); _driver.CloseApp(); } [TestInitialize] public void TestInitialize() { if (_driver != null) { _driver.LaunchApp(); _driver.StartActivity("io.appium.android.apis", ".ApiDemos"); } } [TestCleanup] public void TestCleanup() { _driver?.CloseApp(); } [TestMethod] public void SwipeTest() { _driver.StartActivity("io.appium.android.apis", ".graphics.FingerPaint"); ITouchAction touchAction = new TouchAction(_driver); var element = _driver.FindElementById("android:id/content"); Point point = element.Coordinates.LocationInDom; Size size = element.Size; touchAction .Press(point.X + 5, point.Y + 5) .Wait(200).MoveTo(point.X + size.Width - 5, point.Y + size.Height - 5) .Release() .Perform(); } [TestMethod] public void MoveToTest() { ITouchAction touchAction = new TouchAction(_driver); var element = _driver.FindElementById("android:id/content"); Point point = element.Coordinates.LocationInDom; touchAction.MoveTo(point.X, point.Y).Perform(); } [TestMethod] public void TapTest() { ITouchAction touchAction = new TouchAction(_driver); var element = _driver.FindElementById("android:id/content"); Point point = element.Coordinates.LocationInDom; touchAction.Tap(point.X, point.Y, 2).Perform(); } } }
39.414141
120
0.657355
[ "Apache-2.0" ]
FrancielleWN/AutomateThePlanet-Learning-Series
Appium-Series/GettingStartedAppiumAndroidMacCSharp/GestureTests.cs
3,902
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraController : MonoBehaviour { private GameObject player; private Vector3 offset; void Start() { player = GameObject.FindGameObjectWithTag("Player"); if (player != null) { Debug.Log("Yes"); } offset = player.transform.position - transform.position; } void Update() { transform.position = player.transform.position + offset; } }
18.642857
64
0.626437
[ "MIT" ]
YuriyKnysh20/IsabellasAdventures1
Assets/Scripts/CameraController.cs
522
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.Commands.ServiceManagement.Test { public class Category { public const string Scenario = "AzureRTScenario"; public const string BVT = "BVT"; public const string Functional = "Functional"; public const string Preview = "Preview"; public const string Sequential = "Sequential"; public const string Network = "Network"; public const string Upload = "AzureRTUpload"; } public class LoadBalancerDistribution { public const string SourceIP = "sourceIP"; public const string SourceIPProtorol = "sourceIPProtocol"; public const string None = "none"; } }
42.142857
87
0.610169
[ "MIT" ]
kiranisaac/azure-powershell
src/ServiceManagement/Compute/Commands.ServiceManagement.Test/FunctionalTests/Constants.cs
1,443
C#
using ModernFlyouts.Core.Interop; using System; namespace ModernFlyouts.Core.Utilities { public static class NpsmService { private static readonly ulong WNF_NPSM_SERVICE_STARTED = 0xC951E23A3BC0875; private static readonly ulong WNF_SHEL_SESSION_LOGON_COMPLETE = 0xD83063EA3BE3835; private static readonly object _subscriptionLock = new object(); private static IntPtr _subId; private static event EventHandler _started; //This prevents from being GC'd private static readonly Wnf.WnfUserCallback wnfSubHandler = new Wnf.WnfUserCallback(WnfSubHandler); private static IntPtr WnfSubHandler(ulong stateName, uint changeStamp, IntPtr typeId, IntPtr callbackContext, IntPtr bufferPtr, uint bufferSize) { _started?.Invoke(null, EventArgs.Empty); return IntPtr.Zero; } /// <summary> /// Occurs when the NPSM service is started or restarted /// Of course this runs on a different thread. /// </summary> public static event EventHandler Started { add { lock (_subscriptionLock) { if (_started == null) { var wnfData = Wnf.QueryWnf(WNF_SHEL_SESSION_LOGON_COMPLETE); Wnf.SubscribeWnf(WNF_SHEL_SESSION_LOGON_COMPLETE, wnfData.Changestamp, wnfSubHandler, out _subId); } _started += value; } } remove { lock (_subscriptionLock) { _started -= value; if (_started == null) { Wnf.UnsubscribeWnf(_subId); _subId = IntPtr.Zero; } } } } } }
32.116667
152
0.545407
[ "MIT" ]
Alipoodle/ModernFlyouts
ModernFlyouts.Core/Utilities/NpsmService.cs
1,929
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Ahbc.Class.Seven")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Ahbc.Class.Seven")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d2646286-adcf-433f-98c5-4ffcac181510")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.837838
84
0.746429
[ "Apache-2.0" ]
JamilAbbas787/ahbc_dotnet_201810
Ahbc.Class.Seven/Ahbc.Class.Seven/Properties/AssemblyInfo.cs
1,403
C#
using System; using System.IO; using System.Linq; using UnityEditor; using UnityEngine; #if UNITY_EDITOR public static class PackageExporter { [MenuItem("Tools/Export Unitypackage")] public static void Export() { var root = "Scripts/ZString"; var version = GetVersion(root); var fileName = string.IsNullOrEmpty(version) ? "ZString.Unity.unitypackage" : $"ZString.Unity.{version}.unitypackage"; var exportPath = "./" + fileName; var path = Path.Combine(Application.dataPath, root); var assets = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories) .Where(x => Path.GetExtension(x) == ".cs" || Path.GetExtension(x) == ".meta" || Path.GetExtension(x) == ".asmdef") .Where(x => Path.GetFileNameWithoutExtension(x) != "_InternalVisibleTo") .Select(x => "Assets" + x.Replace(Application.dataPath, "").Replace(@"\", "/")) .ToArray(); var netStandardsAsset = Directory.EnumerateFiles(Path.Combine(Application.dataPath, "Plugins/"), "*", SearchOption.AllDirectories) .Select(x => "Assets" + x.Replace(Application.dataPath, "").Replace(@"\", "/")) .ToArray(); assets = assets.Concat(netStandardsAsset).ToArray(); UnityEngine.Debug.Log("Export below files" + Environment.NewLine + string.Join(Environment.NewLine, assets)); var dir = new FileInfo(exportPath).Directory; if (!dir.Exists) dir.Create(); AssetDatabase.ExportPackage( assets, exportPath, ExportPackageOptions.Default); UnityEngine.Debug.Log("Export complete: " + Path.GetFullPath(exportPath)); } static string GetVersion(string root) { var version = Environment.GetEnvironmentVariable("UNITY_PACKAGE_VERSION"); var versionJson = Path.Combine(Application.dataPath, root, "package.json"); if (File.Exists(versionJson)) { var v = JsonUtility.FromJson<Version>(File.ReadAllText(versionJson)); if (!string.IsNullOrEmpty(version)) { if (v.version != version) { var msg = $"package.json and env version are mismatched. UNITY_PACKAGE_VERSION:{version}, package.json:{v.version}"; if (Application.isBatchMode) { Console.WriteLine(msg); Application.Quit(1); } throw new Exception("package.json and env version are mismatched."); } } version = v.version; } return version; } public class Version { public string version; } } #endif
34.135802
138
0.590958
[ "MIT" ]
UWA-MakeItSimple/Terrain
Assets/Scripts/ZString/Editor/PackageExporter.cs
2,767
C#
// ------------------------------------------------------------------------------ // <auto-generated> // Generated by Xsd2Code. Version 3.4.0.18239 Microsoft Reciprocal License (Ms-RL) // <NameSpace>Mim.V6301</NameSpace><Collection>Array</Collection><codeType>CSharp</codeType><EnableDataBinding>False</EnableDataBinding><EnableLazyLoading>False</EnableLazyLoading><TrackingChangesEnable>False</TrackingChangesEnable><GenTrackingClasses>False</GenTrackingClasses><HidePrivateFieldInIDE>False</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><VirtualProp>False</VirtualProp><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenBaseClass>False</GenBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net35</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><OrderXMLAttrib>False</OrderXMLAttrib><EnableEncoding>False</EnableEncoding><AutomaticProperties>False</AutomaticProperties><GenerateShouldSerialize>False</GenerateShouldSerialize><DisableDebug>False</DisableDebug><PropNameSpecified>Default</PropNameSpecified><Encoder>UTF8</Encoder><CustomUsings></CustomUsings><ExcludeIncludedTypes>True</ExcludeIncludedTypes><EnableInitializeFields>False</EnableInitializeFields> // </auto-generated> // ------------------------------------------------------------------------------ namespace Mim.V6301 { using System; using System.Diagnostics; using System.Xml.Serialization; using System.Collections; using System.Xml.Schema; using System.ComponentModel; using System.IO; using System.Text; [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.18239")] [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:hl7-org:v3")] [System.Xml.Serialization.XmlRootAttribute(Namespace="urn:hl7-org:v3", IsNullable=false)] public partial class POCD_IN180006UK02 : POCD_IN180006UK02MCCI_MT010101UK12Message { private static System.Xml.Serialization.XmlSerializer serializer; private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(POCD_IN180006UK02)); } return serializer; } } #region Serialize/Deserialize /// <summary> /// Serializes current POCD_IN180006UK02 object into an XML document /// </summary> /// <returns>string XML value</returns> public virtual string Serialize() { System.IO.StreamReader streamReader = null; System.IO.MemoryStream memoryStream = null; try { memoryStream = new System.IO.MemoryStream(); Serializer.Serialize(memoryStream, this); memoryStream.Seek(0, System.IO.SeekOrigin.Begin); streamReader = new System.IO.StreamReader(memoryStream); return streamReader.ReadToEnd(); } finally { if ((streamReader != null)) { streamReader.Dispose(); } if ((memoryStream != null)) { memoryStream.Dispose(); } } } /// <summary> /// Deserializes workflow markup into an POCD_IN180006UK02 object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output POCD_IN180006UK02 object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out POCD_IN180006UK02 obj, out System.Exception exception) { exception = null; obj = default(POCD_IN180006UK02); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out POCD_IN180006UK02 obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static POCD_IN180006UK02 Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((POCD_IN180006UK02)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current POCD_IN180006UK02 object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> public virtual bool SaveToFile(string fileName, out System.Exception exception) { exception = null; try { SaveToFile(fileName); return true; } catch (System.Exception e) { exception = e; return false; } } public virtual void SaveToFile(string fileName) { System.IO.StreamWriter streamWriter = null; try { string xmlString = Serialize(); System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName); streamWriter = xmlFile.CreateText(); streamWriter.WriteLine(xmlString); streamWriter.Close(); } finally { if ((streamWriter != null)) { streamWriter.Dispose(); } } } /// <summary> /// Deserializes xml markup from file into an POCD_IN180006UK02 object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output POCD_IN180006UK02 object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out POCD_IN180006UK02 obj, out System.Exception exception) { exception = null; obj = default(POCD_IN180006UK02); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out POCD_IN180006UK02 obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static POCD_IN180006UK02 LoadFromFile(string fileName) { System.IO.FileStream file = null; System.IO.StreamReader sr = null; try { file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); sr = new System.IO.StreamReader(file); string xmlString = sr.ReadToEnd(); sr.Close(); file.Close(); return Deserialize(xmlString); } finally { if ((file != null)) { file.Dispose(); } if ((sr != null)) { sr.Dispose(); } } } #endregion #region Clone method /// <summary> /// Create a clone of this POCD_IN180006UK02 object /// </summary> public virtual POCD_IN180006UK02 Clone() { return ((POCD_IN180006UK02)(this.MemberwiseClone())); } #endregion } }
46.252632
1,358
0.590692
[ "MIT" ]
Kusnaditjung/MimDms
src/Mim.V6301/Generated/POCD_IN180006UK02.cs
8,788
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace SpartaGlobalAPI.Models { public partial class Course { public Course() { Students = new List<Student>(); } public int CourseId { get; set; } public string CourseName { get; set; } public string CourseType { get; set; } public virtual List<Student> Students { get; set; } } }
21.227273
59
0.610278
[ "MIT" ]
LeoRoma/APIWeek
homework/SpartaGlobalAPI/SpartaGlobalAPI/Models/Course.cs
469
C#
// ----------------------------------------------------------------------- // <copyright file="SessionTest.cs" company="PlayFab Inc"> // Copyright 2015 PlayFab Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // ----------------------------------------------------------------------- using System; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Consul.Test { [TestClass] public class SessionTest { [TestMethod] public void Session_CreateDestroy() { var client = new Client(); var sessionRequest = client.Session.Create(); var id = sessionRequest.Response; Assert.IsTrue(sessionRequest.RequestTime.TotalMilliseconds > 0); Assert.IsFalse(string.IsNullOrEmpty(sessionRequest.Response)); var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } [TestMethod] public void Session_CreateNoChecksDestroy() { var client = new Client(); var sessionRequest = client.Session.CreateNoChecks(); var id = sessionRequest.Response; Assert.IsTrue(sessionRequest.RequestTime.TotalMilliseconds > 0); Assert.IsFalse(string.IsNullOrEmpty(sessionRequest.Response)); var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } [TestMethod] public void Session_CreateRenewDestroy() { var client = new Client(); var sessionRequest = client.Session.Create(new SessionEntry() { TTL = TimeSpan.FromSeconds(10) }); var id = sessionRequest.Response; Assert.IsTrue(sessionRequest.RequestTime.TotalMilliseconds > 0); Assert.IsFalse(string.IsNullOrEmpty(sessionRequest.Response)); var renewRequest = client.Session.Renew(id); Assert.IsTrue(renewRequest.RequestTime.TotalMilliseconds > 0); Assert.IsNotNull(renewRequest.Response.ID); Assert.AreEqual(sessionRequest.Response, renewRequest.Response.ID); Assert.AreEqual(renewRequest.Response.TTL.TotalSeconds, TimeSpan.FromSeconds(10).TotalSeconds); var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } [TestMethod] public void Session_Create_RenewPeriodic_Destroy() { var client = new Client(); var sessionRequest = client.Session.Create(new SessionEntry() { TTL = TimeSpan.FromSeconds(10) }); var id = sessionRequest.Response; Assert.IsTrue(sessionRequest.RequestTime.TotalMilliseconds > 0); Assert.IsFalse(string.IsNullOrEmpty(sessionRequest.Response)); var tokenSource = new CancellationTokenSource(); var ct = tokenSource.Token; client.Session.RenewPeriodic(TimeSpan.FromSeconds(1), id, WriteOptions.Empty, ct); tokenSource.CancelAfter(3000); Task.Delay(3000, ct).Wait(ct); var infoRequest = client.Session.Info(id); Assert.IsTrue(infoRequest.LastIndex > 0); Assert.IsNotNull(infoRequest.KnownLeader); Assert.AreEqual(id, infoRequest.Response.ID); Assert.IsTrue(client.Session.Destroy(id).Response); } [TestMethod] public void Session_Info() { var client = new Client(); var sessionRequest = client.Session.Create(); var id = sessionRequest.Response; Assert.IsTrue(sessionRequest.RequestTime.TotalMilliseconds > 0); Assert.IsFalse(string.IsNullOrEmpty(sessionRequest.Response)); var infoRequest = client.Session.Info(id); Assert.IsTrue(infoRequest.LastIndex > 0); Assert.IsNotNull(infoRequest.KnownLeader); Assert.AreEqual(id, infoRequest.Response.ID); Assert.IsTrue(string.IsNullOrEmpty(infoRequest.Response.Name)); Assert.IsFalse(string.IsNullOrEmpty(infoRequest.Response.Node)); Assert.IsTrue(infoRequest.Response.CreateIndex > 0); Assert.AreEqual(infoRequest.Response.Behavior, SessionBehavior.Release); Assert.IsTrue(string.IsNullOrEmpty(infoRequest.Response.Name)); Assert.IsNotNull(infoRequest.KnownLeader); Assert.IsTrue(infoRequest.LastIndex > 0); Assert.IsNotNull(infoRequest.KnownLeader); var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } [TestMethod] public void Session_Node() { var client = new Client(); var sessionRequest = client.Session.Create(); var id = sessionRequest.Response; try { var infoRequest = client.Session.Info(id); var nodeRequest = client.Session.Node(infoRequest.Response.Node); Assert.AreEqual(nodeRequest.Response.Length, 1); Assert.AreNotEqual(nodeRequest.LastIndex, 0); Assert.IsTrue(nodeRequest.KnownLeader); } finally { var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } } [TestMethod] public void Session_List() { var client = new Client(); var sessionRequest = client.Session.Create(); var id = sessionRequest.Response; try { var listRequest = client.Session.List(); Assert.AreEqual(listRequest.Response.Length, 1); Assert.AreNotEqual(listRequest.LastIndex, 0); Assert.IsTrue(listRequest.KnownLeader); } finally { var destroyRequest = client.Session.Destroy(id); Assert.IsTrue(destroyRequest.Response); } } } }
36.075269
110
0.60611
[ "Apache-2.0" ]
rogeralsing/consuldotnet
Consul.Test/SessionTest.cs
6,712
C#
using Domain.Interfaces.Infrastructure.Providers; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.Linq; using System.Collections.Generic; using Infrastructure.Providers; using Domain.Interface.Infrastructure.Providers; namespace Presentation.Api { public static class IoC { public static void SetupIoC(this IServiceCollection serviceCollection, IConfiguration configuration) { serviceCollection.SetupIoCProviders(); foreach (var iFace in NumberIntoWordsInterfaces()) if (!serviceCollection.Any(s => s.ServiceType.Name == iFace.Name)) throw new System.Exception($"No implementations of {iFace.Name} have been configured."); } public static void SetupIoCProviders(this IServiceCollection serviceCollection) { serviceCollection.AddTransient<INumberIntoWordsProvider, NumberIntoWordsProvider>(); serviceCollection.AddTransient<IUserDataProvider, UserDataProvider>(); } private static IEnumerable<System.Type> NumberIntoWordsInterfaces() => System.AppDomain.CurrentDomain.GetAssemblies() .Where(a => a.FullName.StartsWith("Domain.Interfaces")).SelectMany(a => a.GetTypes()).Where(t => t.IsInterface); } }
42.677419
125
0.721844
[ "MIT" ]
RenatoMairesseJr/Niw
src/Presentation/Presentation.Api/IoC.cs
1,323
C#
// <auto-generated /> namespace GigHub.Migrations { using System.CodeDom.Compiler; using System.Data.Entity.Migrations; using System.Data.Entity.Migrations.Infrastructure; using System.Resources; [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] public sealed partial class OverrideConventionsForGigsAndGenres : IMigrationMetadata { private readonly ResourceManager Resources = new ResourceManager(typeof(OverrideConventionsForGigsAndGenres)); string IMigrationMetadata.Id { get { return "201612281322390_OverrideConventionsForGigsAndGenres"; } } string IMigrationMetadata.Source { get { return null; } } string IMigrationMetadata.Target { get { return Resources.GetString("Target"); } } } }
29.433333
118
0.648924
[ "MIT" ]
Dissolving-in-Eternity/GigHub
GigHub/Persistence/Migrations/201612281322390_OverrideConventionsForGigsAndGenres.Designer.cs
883
C#
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace UnityEngine.Experimental.Rendering.HDPipeline { [Serializable] public class AtmosphericScatteringSettings { [GenerateHLSL] public enum FogType { None, Linear, Exponential } [GenerateHLSL] public enum FogColorMode { ConstantColor, SkyColor, } private readonly static int m_TypeParam = Shader.PropertyToID("_AtmosphericScatteringType"); // Fog Color private readonly static int m_ColorModeParam = Shader.PropertyToID("_FogColorMode"); private readonly static int m_FogColorParam = Shader.PropertyToID("_FogColor"); private readonly static int m_MipFogParam = Shader.PropertyToID("_MipFogParameters"); // Linear Fog private readonly static int m_LinearFogParam = Shader.PropertyToID("_LinearFogParameters"); // Exp Fog private readonly static int m_ExpFogParam = Shader.PropertyToID("_ExpFogParameters"); public FogType type; // Fog Color public FogColorMode colorMode = FogColorMode.SkyColor; public Color fogColor = Color.grey; [Range(0.0f, 1.0f)] public float mipFogMaxMip = 1.0f; public float mipFogNear = 0.0f; public float mipFogFar = 1000.0f; // Linear Fog [Range(0.0f, 1.0f)] public float linearFogDensity = 1.0f; public float linearFogStart = 500.0f; public float linearFogEnd = 1000.0f; // Exponential fog //[Min(0.0f)] Not available until 2018.1 public float expFogDistance = 100.0f; [Range(0.0f, 1.0f)] public float expFogDensity = 1.0f; public bool NeedFogRendering() { return type != FogType.None; } public void PushShaderParameters(CommandBuffer cmd, RenderingDebugSettings renderingDebug) { if(renderingDebug.enableAtmosphericScattering) cmd.SetGlobalFloat(m_TypeParam, (float)type); else cmd.SetGlobalFloat(m_TypeParam, (float)FogType.None); // Fog Color cmd.SetGlobalFloat(m_ColorModeParam, (float)colorMode); cmd.SetGlobalColor(m_FogColorParam, fogColor); cmd.SetGlobalVector(m_MipFogParam, new Vector4(mipFogNear, mipFogFar, mipFogMaxMip, 0.0f)); // Linear Fog cmd.SetGlobalVector(m_LinearFogParam, new Vector4(linearFogStart, linearFogEnd, 1.0f / (linearFogEnd - linearFogStart), linearFogDensity)); // Exp fog cmd.SetGlobalVector(m_ExpFogParam, new Vector4(Mathf.Max(0.0f, expFogDistance), expFogDensity, 0.0f, 0.0f)); } } }
35.658537
151
0.622435
[ "MIT" ]
jk6699/kkkkkkkkk
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.cs
2,926
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Text; using System.Windows.Forms; using MaterialWinforms.Animations; using System.Drawing.Drawing2D; namespace MaterialWinforms.Controls { public class MaterialTabSelector : Control, IShadowedMaterialControl { [Browsable(false)] public int Depth { get; set; } [Browsable(false)] public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } } [Browsable(false)] public MouseState MouseState { get; set; } [Browsable(false)] public GraphicsPath ShadowBorder { get; set; } public Color BackColor { get { return SkinManager.ColorScheme.PrimaryColor; } } private int HoveredXButtonIndex = -1; public ContextMenuStrip RightClickMenu { get; set; } private Point RightClickLocation; private int _MaxTabWidth; public int MaxTabWidht { get { return _MaxTabWidth; } set { _MaxTabWidth = value; Invalidate(); } } private int _Elevation; public int Elevation { get { return _Elevation; } set { _Elevation = value; Margin = new Padding(0, 0, 0, value); } } public int TabPadding { get { return TAB_HEADER_PADDING; } set { TAB_HEADER_PADDING = value; } } public bool CenterTabs { get; set; } private MaterialTabControl baseTabControl; public MaterialTabControl BaseTabControl { get { return baseTabControl; } set { baseTabControl = value; if (baseTabControl == null) return; previousSelectedTabIndex = baseTabControl.SelectedIndex; baseTabControl.Deselected += (sender, args) => { previousSelectedTabIndex = baseTabControl.SelectedIndex; }; baseTabControl.SelectedIndexChanged += (sender, args) => { animationManager.SetProgress(0); animationManager.StartNewAnimation(AnimationDirection.In); }; baseTabControl.ControlAdded += delegate { UpdateTabRects(); Invalidate(); }; baseTabControl.ControlRemoved += delegate { UpdateTabRects(); Invalidate(); }; } } private int previousSelectedTabIndex; private Point animationSource; private readonly AnimationManager animationManager; private readonly AnimationManager HoverAnimationManager; private List<TabRectangle> tabRects; private int TAB_HEADER_PADDING = 24; private const int TAB_INDICATOR_HEIGHT = 2; private bool mouseDown = false; private int offset = 0; private int TabOffset = 0; private int oldXLocation = -1; private int TabLength = 0; private int HoveredTab = -1; struct TabRectangle { public Rectangle TabRect; public Rectangle XButtonRect; } public MaterialTabSelector() { SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer, true); Height = 35; _MaxTabWidth = -1; animationManager = new AnimationManager { AnimationType = AnimationType.EaseOut, Increment = 0.04 }; animationManager.OnAnimationProgress += sender => Invalidate(); HoverAnimationManager = new AnimationManager { AnimationType = AnimationType.EaseOut, Increment = 0.04 }; HoverAnimationManager.OnAnimationProgress += sender => Refresh(); ShadowBorder = new GraphicsPath(); Elevation = 10; ShadowBorder.AddLine(new Point(Location.X, Location.Y + Height), new Point(Location.X + Width, Location.Y + Height)); SetupRightClickMenu(); } private void SetupRightClickMenu() { RightClickMenu = new MaterialContextMenuStrip(); RightClickMenu.AutoSize = true; ToolStripMenuItem CloseAllTabs = new MaterialToolStripMenuItem(); ToolStripMenuItem TabPositionZurruecksetzten = new MaterialToolStripMenuItem(); ToolStripMenuItem CloseAllExeptCurrent = new MaterialToolStripMenuItem(); ToolStripMenuItem OpenInNewWindow = new MaterialToolStripMenuItem(); CloseAllTabs.Text = "Alle Tabs schließen"; CloseAllTabs.Click += CloseAllTabs_Click; RightClickMenu.Items.Add(CloseAllTabs); CloseAllExeptCurrent.Text = "Alle anderen Tabs Schließen"; CloseAllExeptCurrent.Click += CloseAllExeptCurrent_Click; RightClickMenu.Items.Add(CloseAllExeptCurrent); TabPositionZurruecksetzten.Text = "Tab Positionen zurrücksetzen"; TabPositionZurruecksetzten.Click += TabPositionZurruecksetzten_Click; RightClickMenu.Items.Add(TabPositionZurruecksetzten); OpenInNewWindow.Text = "Tab in neuem Fenster öffnen"; OpenInNewWindow.Click += OpenInNewWindow_Click; RightClickMenu.Items.Add(OpenInNewWindow); } void OpenInNewWindow_Click(object sender, EventArgs e) { for (int i = 0; i < tabRects.Count; i++) { if (tabRects[i].TabRect.Contains(RightClickLocation)) { var me = this; TabWindow t = new TabWindow((MaterialTabPage)baseTabControl.TabPages[i], ref me); t.Show(); return; } } } protected override void OnLayout(LayoutEventArgs levent) { base.OnLayout(levent); } void CloseAllExeptCurrent_Click(object sender, EventArgs e) { for (int i = baseTabControl.TabPages.Count - 1; i >= 0; i--) { if (i != baseTabControl.SelectedIndex) { if (((MaterialTabPage)BaseTabControl.TabPages[i]).Closable) baseTabControl.TabPages.RemoveAt(i); } } previousSelectedTabIndex = -1; TabOffset = 0; offset = 0; UpdateTabRects(); Invalidate(); } void TabPositionZurruecksetzten_Click(object sender, EventArgs e) { TabOffset = 0; offset = 0; UpdateTabRects(); Invalidate(); } void CloseAllTabs_Click(object sender, EventArgs e) { TabOffset = 0; offset = 0; for (int i = baseTabControl.TabPages.Count - 1; i >= 0; i--) { if (((MaterialTabPage)BaseTabControl.TabPages[i]).Closable) baseTabControl.TabPages.RemoveAt(i); } UpdateTabRects(); Invalidate(); } protected override void OnLocationChanged(System.EventArgs e) { base.OnLocationChanged(e); ShadowBorder = new GraphicsPath(); ShadowBorder.AddLine(new Point(Location.X, Location.Y + Height), new Point(Location.X + Width, Location.Y + Height)); } protected override void OnResize(System.EventArgs e) { base.OnResize(e); Height = 35; ShadowBorder = new GraphicsPath(); ShadowBorder.AddLine(new Point(Location.X, Location.Y + Height), new Point(Location.X + Width, Location.Y + Height)); UpdateTabRects(); Invalidate(); } protected override void OnPaint(PaintEventArgs e) { var g = e.Graphics; g.TextRenderingHint = TextRenderingHint.AntiAlias; g.Clear(SkinManager.ColorScheme.PrimaryColor); if (baseTabControl == null) return; if (!animationManager.IsAnimating() || tabRects == null || tabRects.Count != baseTabControl.TabCount) UpdateTabRects(); if (baseTabControl.TabPages.Count == 0) { baseTabControl.Visible = false; return; } else { baseTabControl.Visible = true; } double animationProgress = animationManager.GetProgress(); //Click feedback if (animationManager.IsAnimating()) { var rippleBrush = new SolidBrush(Color.FromArgb((int)(51 - (animationProgress * 50)), Color.White)); var rippleSize = (int)(animationProgress * tabRects[baseTabControl.SelectedIndex].TabRect.Width * 1.75); g.SetClip(tabRects[baseTabControl.SelectedIndex].TabRect); g.FillEllipse(rippleBrush, new Rectangle(animationSource.X - rippleSize / 2, animationSource.Y - rippleSize / 2, rippleSize, rippleSize)); g.ResetClip(); rippleBrush.Dispose(); } //Draw tab headers foreach (TabPage tabPage in baseTabControl.TabPages) { int currentTabIndex = baseTabControl.TabPages.IndexOf(tabPage); Brush textBrush = new SolidBrush(Color.FromArgb(CalculateTextAlpha(currentTabIndex, animationProgress), SkinManager.ColorScheme.TextColor)); var hoverBrush = new SolidBrush(Color.FromArgb((int)(SkinManager.GetFlatButtonHoverBackgroundColor().A * HoverAnimationManager.GetProgress()), SkinManager.GetFlatButtonHoverBackgroundColor())); Pen closePen = new Pen(textBrush, 2); if (currentTabIndex == HoveredXButtonIndex) { g.FillEllipse(hoverBrush, tabRects[currentTabIndex].XButtonRect); } else if (currentTabIndex == HoveredTab) { g.FillRectangle(hoverBrush, new Rectangle(tabRects[currentTabIndex].TabRect.X + offset, tabRects[currentTabIndex].TabRect.Y, tabRects[currentTabIndex].TabRect.Width, tabRects[currentTabIndex].TabRect.Height)); } g.DrawString( tabPage.Text.ToUpper(), SkinManager.ROBOTO_MEDIUM_10, textBrush, new Rectangle(tabRects[currentTabIndex].TabRect.X + offset, tabRects[currentTabIndex].TabRect.Y, tabRects[currentTabIndex].TabRect.Width - tabRects[currentTabIndex].XButtonRect.Width, tabRects[currentTabIndex].TabRect.Height), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }); if (((MaterialTabPage)BaseTabControl.TabPages[currentTabIndex]).Closable) { g.DrawLine( closePen, tabRects[currentTabIndex].XButtonRect.X + (int)(tabRects[currentTabIndex].XButtonRect.Width * 0.33) + offset, tabRects[currentTabIndex].XButtonRect.Y + (int)(tabRects[currentTabIndex].XButtonRect.Height * 0.33), tabRects[currentTabIndex].XButtonRect.X + (int)(tabRects[currentTabIndex].XButtonRect.Width * 0.66) + offset, tabRects[currentTabIndex].XButtonRect.Y + (int)(tabRects[currentTabIndex].XButtonRect.Height * 0.66) ); g.DrawLine( closePen, tabRects[currentTabIndex].XButtonRect.X + (int)(tabRects[currentTabIndex].XButtonRect.Width * 0.66) + offset, tabRects[currentTabIndex].XButtonRect.Y + (int)(tabRects[currentTabIndex].XButtonRect.Height * 0.33), tabRects[currentTabIndex].XButtonRect.X + (int)(tabRects[currentTabIndex].XButtonRect.Width * 0.33) + offset, tabRects[currentTabIndex].XButtonRect.Y + (int)(tabRects[currentTabIndex].XButtonRect.Height * 0.66)); textBrush.Dispose(); } } try { if (tabRects.Count >= baseTabControl.SelectedIndex) { //Animate tab indicator int previousSelectedTabIndexIfHasOne = previousSelectedTabIndex == -1 ? baseTabControl.SelectedIndex : previousSelectedTabIndex; if (previousSelectedTabIndex > BaseTabControl.TabCount - 1) //Last tab was active and got closed { previousSelectedTabIndex = BaseTabControl.TabCount - 1; } if (baseTabControl.SelectedIndex < 0) { return; } Rectangle previousActiveTabRect = tabRects[previousSelectedTabIndexIfHasOne].TabRect; Rectangle activeTabPageRect = tabRects[baseTabControl.SelectedIndex].TabRect; int y = activeTabPageRect.Bottom - 2; int x = previousActiveTabRect.X + (int)((activeTabPageRect.X - previousActiveTabRect.X) * animationProgress) + offset; int width = previousActiveTabRect.Width + (int)((activeTabPageRect.Width - previousActiveTabRect.Width) * animationProgress); g.FillRectangle(SkinManager.ColorScheme.AccentBrush, x, y, width, TAB_INDICATOR_HEIGHT); } } catch (Exception ex) { String str = ex.StackTrace; str = ex.Message; } } private int CalculateTextAlpha(int tabIndex, double animationProgress) { try { int primaryA = SkinManager.ACTION_BAR_TEXT().A; int secondaryA = SkinManager.ACTION_BAR_TEXT_SECONDARY().A; if (tabIndex == baseTabControl.SelectedIndex && !animationManager.IsAnimating()) { return primaryA; } if (tabIndex != previousSelectedTabIndex && tabIndex != baseTabControl.SelectedIndex) { return secondaryA; } if (tabIndex == previousSelectedTabIndex) { return primaryA - (int)((primaryA - secondaryA) * animationProgress); } return secondaryA + (int)((primaryA - secondaryA) * animationProgress); } catch (Exception ex) { throw ex; } } protected override void OnMouseMove(MouseEventArgs e) { bool HoveredTabSet = false; bool HoveredXButtonSet = false; try { base.OnMouseMove(e); if (baseTabControl != null && tabRects != null) { if (mouseDown && baseTabControl.TabPages.Count > 0) { bool move = false; if (oldXLocation > 0) { int off = offset; off -= oldXLocation - e.X; if (tabRects[0].TabRect.X + off < 0) { if (tabRects[tabRects.Count - 1].TabRect.Right + off > Width) { move = true; } } else { if (tabRects[tabRects.Count - 1].TabRect.Right + off < Width) { move = true; } } if (move) { offset -= oldXLocation - e.X; oldXLocation = e.X; Refresh(); } } else { oldXLocation = e.X; Refresh(); } return; } for (int i = 0; i < tabRects.Count; i++) { if (tabRects[i].TabRect.Contains(e.Location)) { if (HoveredTab != i) { HoveredTab = i; HoverAnimationManager.SetProgress(0); HoverAnimationManager.StartNewAnimation(AnimationDirection.In); } HoveredTabSet = true; if (((MaterialTabPage)BaseTabControl.TabPages[i]).Closable) { if (tabRects[i].XButtonRect.Contains(e.Location)) { if (HoveredXButtonIndex != i) { HoveredXButtonIndex = i; HoverAnimationManager.SetProgress(0); HoverAnimationManager.StartNewAnimation(AnimationDirection.In); } HoveredXButtonSet = true; } } } } bool refresh = false; if (HoveredTab != -1 && !HoveredTabSet) { HoveredTab = -1; refresh = true; } if (HoveredXButtonIndex != -1 && !HoveredXButtonSet) { HoveredXButtonIndex = -1; refresh = true; } if (refresh) { Refresh(); } return; } } catch (Exception ex) { throw ex; } } protected override void OnMouseLeave(EventArgs e) { if (!ClientRectangle.Contains(PointToClient(Cursor.Position))) { HoveredXButtonIndex = -1; HoveredTab = -1; Refresh(); } } protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.Button == System.Windows.Forms.MouseButtons.Left) mouseDown = true; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button == System.Windows.Forms.MouseButtons.Left) { mouseDown = false; oldXLocation = -1; bool ignoreClick = false; if (Math.Abs(offset) > 5) { TabOffset += offset; ignoreClick = true; } offset = 0; if (tabRects == null) UpdateTabRects(); if (!ignoreClick) { for (int i = 0; i < tabRects.Count; i++) { if (tabRects[i].XButtonRect.Contains(e.Location)) { if (baseTabControl.TabCount > 1 && i == BaseTabControl.SelectedIndex) { if (i == 0) { baseTabControl.SelectTab(1); } else { baseTabControl.SelectTab(i - 1); } Application.DoEvents(); } baseTabControl.TabPages.RemoveAt(i); previousSelectedTabIndex = -1; UpdateTabRects(); return; } else if (tabRects[i].TabRect.Contains(e.Location)) { baseTabControl.SelectedIndex = i; } } } animationSource = e.Location; UpdateTabRects(); Invalidate(); } else { RightClickLocation = e.Location; RightClickMenu.Show(PointToScreen(e.Location)); } } private void UpdateTabRects() { try { tabRects = new List<TabRectangle>(); TabLength = 0; //If there isn't a base tab control, the rects shouldn't be calculated //If there aren't tab pages in the base tab control, the list should just be empty which has been set already; exit the void if (baseTabControl == null || baseTabControl.TabCount == 0) return; //Calculate the bounds of each tab header specified in the base tab control using (var b = new Bitmap(1, 1)) { using (var g = Graphics.FromImage(b)) { int xButtonSize = ((MaterialTabPage)BaseTabControl.TabPages[0]).Closable ? 18 : 0; TabRectangle CurrentTab = new TabRectangle(); CurrentTab.TabRect = new Rectangle(SkinManager.FORM_PADDING, 0, TAB_HEADER_PADDING * 2 + (int)g.MeasureString(baseTabControl.TabPages[0].Text, SkinManager.ROBOTO_MEDIUM_10).Width + 22, Height); CurrentTab.XButtonRect = new Rectangle(CurrentTab.TabRect.X + CurrentTab.TabRect.Width, CurrentTab.TabRect.Y + ((CurrentTab.TabRect.Height - 18) / 2), xButtonSize, xButtonSize); CurrentTab.TabRect.Width += CurrentTab.XButtonRect.Width; if (MaxTabWidht > 0 && CurrentTab.TabRect.Width > MaxTabWidht) { CurrentTab.TabRect.Width = MaxTabWidht; } TabLength += CurrentTab.TabRect.Width; tabRects.Add(CurrentTab); for (int i = 1; i < baseTabControl.TabPages.Count; i++) { xButtonSize = ((MaterialTabPage)BaseTabControl.TabPages[i]).Closable ? 18 : 0; CurrentTab = new TabRectangle(); CurrentTab.TabRect = new Rectangle(tabRects[i - 1].TabRect.Right, 0, TAB_HEADER_PADDING * 2 + (int)g.MeasureString(baseTabControl.TabPages[i].Text, SkinManager.ROBOTO_MEDIUM_10).Width + 22, Height); CurrentTab.XButtonRect = new Rectangle(CurrentTab.TabRect.X + CurrentTab.TabRect.Width, CurrentTab.TabRect.Y + ((CurrentTab.TabRect.Height - 18) / 2), xButtonSize, xButtonSize); CurrentTab.TabRect.Width += CurrentTab.XButtonRect.Width; if (MaxTabWidht > 0 && CurrentTab.TabRect.Width > MaxTabWidht) { CurrentTab.TabRect.Width = MaxTabWidht; } TabLength += CurrentTab.TabRect.Width; tabRects.Add(CurrentTab); } if (CenterTabs) { int FreeSpace = Width - (tabRects[tabRects.Count - 1].TabRect.Right - SkinManager.FORM_PADDING); FreeSpace = FreeSpace / 2; for (int i = 0; i < baseTabControl.TabPages.Count; i++) { TabRectangle Centered = tabRects[i]; Centered.TabRect.X += FreeSpace; Centered.XButtonRect.X += FreeSpace; tabRects[i] = Centered; } } if (TabOffset != 0) { CurrentTab = tabRects[0]; CurrentTab.TabRect = new Rectangle(CurrentTab.TabRect.X + TabOffset, 0, TAB_HEADER_PADDING * 2 + (int)g.MeasureString(baseTabControl.TabPages[0].Text, SkinManager.ROBOTO_MEDIUM_10).Width + 22, Height); CurrentTab.XButtonRect = new Rectangle(CurrentTab.TabRect.X + CurrentTab.TabRect.Width, CurrentTab.TabRect.Y + ((CurrentTab.TabRect.Height - 18) / 2), CurrentTab.XButtonRect.Width, CurrentTab.XButtonRect.Height); CurrentTab.TabRect.Width += CurrentTab.XButtonRect.Width; if (MaxTabWidht > 0 && CurrentTab.TabRect.Width > MaxTabWidht) { CurrentTab.TabRect.Width = MaxTabWidht; } tabRects[0] = CurrentTab; for (int i = 1; i < baseTabControl.TabPages.Count; i++) { CurrentTab = tabRects[i]; CurrentTab.TabRect = new Rectangle(tabRects[i - 1].TabRect.Right, 0, TAB_HEADER_PADDING * 2 + (int)g.MeasureString(baseTabControl.TabPages[i].Text, SkinManager.ROBOTO_MEDIUM_10).Width + 22, Height); CurrentTab.XButtonRect = new Rectangle(CurrentTab.TabRect.X + CurrentTab.TabRect.Width, CurrentTab.TabRect.Y + ((CurrentTab.TabRect.Height - 18) / 2), CurrentTab.XButtonRect.Width, CurrentTab.XButtonRect.Height); CurrentTab.TabRect.Width += CurrentTab.XButtonRect.Width; if (MaxTabWidht > 0 && CurrentTab.TabRect.Width > MaxTabWidht) { CurrentTab.TabRect.Width = MaxTabWidht; } tabRects[i] = CurrentTab; } } } } } catch (Exception ex) { throw ex; } } } }
42.599388
247
0.47893
[ "MIT" ]
glm9637/MaterialWinforms
MaterialWinforms/Controls/TabControls/MaterialTabSelector.cs
27,866
C#
// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! namespace Google.Cloud.DataCatalog.V1Beta1.Snippets { using Google.Cloud.DataCatalog.V1Beta1; using System.Threading.Tasks; public sealed partial class GeneratedDataCatalogClientStandaloneSnippets { /// <summary>Snippet for CreateTagAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateTagAsync() { // Create client DataCatalogClient dataCatalogClient = await DataCatalogClient.CreateAsync(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]/entryGroups/[ENTRY_GROUP]/entries/[ENTRY]/tags/[TAG]"; Tag tag = new Tag(); // Make the request Tag response = await dataCatalogClient.CreateTagAsync(parent, tag); } } }
39.146341
123
0.686604
[ "Apache-2.0" ]
googleapis/googleapis-gen
google/cloud/datacatalog/v1beta1/google-cloud-datacatalog-v1beta1-csharp/Google.Cloud.DataCatalog.V1Beta1.StandaloneSnippets/DataCatalogClient.CreateTagAsyncSnippet.g.cs
1,605
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Animatroller.Framework.LogicalDevice; using System.Drawing.Drawing2D; namespace Animatroller.Simulator.Control { public partial class PixelLight2D : UserControl { private Bitmap outputBitmap; private Bitmap overlay; private int scaleX; private int scaleY; public PixelLight2D(int scaleX = 4, int scaleY = 4) { InitializeComponent(); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.scaleX = scaleX; this.scaleY = scaleY; } public void SetImage(Bitmap image) { this.outputBitmap = image; Invalidate(); } private void RopeLight2_Paint(object sender, PaintEventArgs e) { if (this.outputBitmap != null) { e.Graphics.InterpolationMode = InterpolationMode.NearestNeighbor; e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; e.Graphics.DrawImage(this.outputBitmap, 0, 0, Width, Height); if (this.overlay != null) e.Graphics.DrawImageUnscaled(this.overlay, 0, 0); } } private void PixelLight2D_Resize(object sender, EventArgs e) { if (this.scaleX == 0 || this.scaleY == 0) return; this.overlay = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); using (var g = Graphics.FromImage(this.overlay)) using (var p = new Pen(Color.Black)) { for (int x = this.scaleX - 1; x < Width; x += this.scaleX) { g.DrawLine(p, x, 0, x, Height - 1); } for (int y = this.scaleY - 1; y < Height; y += this.scaleY) { g.DrawLine(p, 0, y, Width - 1, y); } } } } }
28.513158
105
0.558376
[ "Unlicense", "MIT" ]
HakanL/animatroller
Animatroller/src/Simulator/Control/PixelLight2D.cs
2,169
C#
//Copyright 2016 Scifoni Ivano // //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SharpBatch.Web { public class Model { } }
28.615385
74
0.751344
[ "Apache-2.0" ]
iscifoni/SharpBatch
src/SharpBatch.Web/model.cs
746
C#
using UnityEngine; using UnityEngine.SceneManagement; using System.Collections; public class LoadButtonClick : MonoBehaviour { public void LoadScene(string pSceneName) { SceneManager.LoadScene(pSceneName); } public void ShowCanvas(Canvas pCanvas) { pCanvas.gameObject.SetActive(true); Debug.Log(gameObject.name); Canvas[] canvases = gameObject.GetComponentsInChildren<Canvas>(); foreach (Canvas cnv in canvases) { if (cnv.name != pCanvas.name) { cnv.gameObject.SetActive(false); } } } }
20.225806
73
0.614035
[ "Apache-2.0" ]
Meatsak/AnthonySDV602Project
Assets/Scripts/LoadButtonClick.cs
629
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public static class Noise { public static float farFromZero = 1000; // perlin noise mirrors in negatives. this should keep all noise generated well away form 0 /// <summary> /// returns a grid of float values between 0 and 1 /// </summary> public static float[,] GenerateNoiseMap( int mapWidth, int mapHeight, float scale, float amplitude, Vector2 octaveOffset, Vector2 globalOffset, float zoom ) { // create the grid of floats float[,] noiseMap = new float[mapWidth, mapHeight]; if (scale <= 0) scale = 0.0001f; // this line prevents any divide by 0 errors // loop through the grid for (int y = 0; y < mapHeight; y++) { for(int x = 0; x < mapWidth; x++) { // perlin noise outputs are identical when inputs are whole numbers // this devision fixes that problem float sampleX = (globalOffset.x/zoom / scale) + (x/zoom / scale) + octaveOffset.x + farFromZero; float sampleY = (globalOffset.y/zoom / scale) + (y/zoom / scale) + octaveOffset.y + farFromZero; // using these new sample variables, generate the noise float perlinValue = (Mathf.PerlinNoise(sampleX, sampleY) * 2 - 1.0f) * amplitude; // add the noise to the grid noiseMap[x, y] = perlinValue; } } return noiseMap; } /// <summary> /// turns the grid of floats into a texture /// each value in the grid will represent a pixel in the texture /// 0 = black pixel /// 1 = white pixel /// 0.834 = somewhere inbetween /// </summary> public static Texture GenerateHeightMap(float[,] noiseMap) { // create a new texture int height = noiseMap.GetLength(0); int width = noiseMap.GetLength(1); Texture2D texture = new Texture2D(width, height); //generate an array of colours Color[] colorMap = new Color[width * height]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { // for each cell in the grid, set a pixels colour in the texture colorMap[y * width + x] = new Color(noiseMap[y, x], noiseMap[y, x], noiseMap[y, x]); } } // set the texture we just made texture.SetPixels(colorMap); texture.filterMode = FilterMode.Point; texture.wrapMode = TextureWrapMode.Clamp; texture.Apply(); return texture; } /// <summary> /// takes a noise map that doesn't range between 0 and 1 and makes it range betwen 0 and 1 /// </summary> public static float[,] NormalizeNoiseMap(float[,] noiseMap) { int mapWidth = noiseMap.GetLength(0); int mapHeight = noiseMap.GetLength(1); float maxValueFound = float.MinValue; float minValueFound = float.MaxValue; // first loop through the whole map and find the lowest and highest numbers for (int y = 0; y < mapHeight; y++) { for (int x = 0; x < mapWidth; x++) { if (noiseMap[x, y] < minValueFound) minValueFound = noiseMap[x, y]; if (noiseMap[x, y] > maxValueFound) maxValueFound = noiseMap[x, y]; } } // then loop through the whole map and find the inverse lerp (the percentage it was between the two) float[,] newNoiseMap = new float[mapWidth, mapHeight]; for (int y = 0; y < mapHeight; y++) { for (int x = 0; x < mapWidth; x++) { //newNoiseMap[x, y] = Mathf.InverseLerp(minValueFound, maxValueFound, noiseMap[x, y]); newNoiseMap[x, y] = Mathf.InverseLerp(MapGenerator.theoretical_min, MapGenerator.theoretical_max, noiseMap[x, y]); } } return newNoiseMap; } }
34.516949
135
0.567886
[ "MIT" ]
StrangeDevTeam/Strange-Unity-Demo
Assets/Strange/Map Generation/Noise.cs
4,075
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SourceAFIS.Matching.Minutia; namespace SourceAFIS.FingerprintAnalysis { public class MatchData : LogData { public MatchData(LogDecoder logs) { Probe = new ProbeMatchData(logs.Probe, this); Candidate = new CandidateMatchData(logs.Candidate, this); } public ProbeMatchData Probe; public CandidateMatchData Candidate; public bool PerformedMatch { get { return GetLog("PerformedMatch", "MinutiaMatcher.Score") != null; } } public float Score { get { return (float)GetLog("Score", "MinutiaMatcher.Score"); } } public bool AnyMatch { get { Link("Score", "AnyMatch"); return Score > 0; } } public MinutiaPair? Root { get { return (MinutiaPair?)GetLog("Root", "MinutiaMatcher.BestRoot"); } } public MinutiaPairing Pairing { get { return (MinutiaPairing)GetLog("Pairing", "MinutiaMatcher.BestPairing"); } } } }
32.83871
121
0.668959
[ "MIT" ]
HarmonIQ/noid
source/biometrics/fingerprint/test/fingerprint.thick.app.test/source.afis/SourceAFIS.FingerprintAnalysis/MatchData.cs
1,020
C#
using System.Collections.Generic; using Invenio.Core.Domain.Messages; namespace Invenio.Services.Messages { /// <summary> /// Email sender /// </summary> public partial interface IEmailSender { /// <summary> /// Sends an email /// </summary> /// <param name="emailAccount">Email account to use</param> /// <param name="subject">Subject</param> /// <param name="body">Body</param> /// <param name="fromAddress">From address</param> /// <param name="fromName">From display name</param> /// <param name="toAddress">To address</param> /// <param name="toName">To display name</param> /// <param name="replyToAddress">ReplyTo address</param> /// <param name="replyToName">ReplyTo display name</param> /// <param name="bcc">BCC addresses list</param> /// <param name="cc">CC addresses ist</param> /// <param name="attachmentFilePath">Attachment file path</param> /// <param name="attachmentFileName">Attachment file name. If specified, then this file name will be sent to a recipient. Otherwise, "AttachmentFilePath" name will be used.</param> /// <param name="attachedDownloadId">Attachment download ID (another attachedment)</param> /// <param name="headers">Headers</param> void SendEmail(EmailAccount emailAccount, string subject, string body, string fromAddress, string fromName, string toAddress, string toName, string replyToAddress = null, string replyToName = null, IEnumerable<string> bcc = null, IEnumerable<string> cc = null, string attachmentFilePath = null, string attachmentFileName = null, int attachedDownloadId = 0, IDictionary<string, string> headers = null); } }
49.081081
188
0.64207
[ "MIT" ]
ipetk0v/InvenioReportingSystem
Libraries/Invenio.Services/Messages/IEmailSender.cs
1,818
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Xamarin.Forms; namespace ContactManager { public class ContactCell : ViewCell { public ContactCell() { var label = new Label { YAlign = TextAlignment.Center }; label.SetBinding(Label.TextProperty, "FirstName"); var layout = new StackLayout { Padding = new Thickness(20, 0, 0, 0), Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.StartAndExpand, Children = { label } }; View = layout; } protected override void OnBindingContextChanged() { View.BindingContext = BindingContext; base.OnBindingContextChanged(); } } }
22.214286
65
0.555198
[ "Apache-2.0" ]
Doug-AWS/aws-sdk-net-samples
XamarinSamples/DynamoDB/ContactManager/Views/ContactCell.cs
935
C#
using System.Threading.Tasks; using Telegram.Bot.Tests.Integ.Framework; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; using Xunit; namespace Telegram.Bot.Tests.Integ.Sending_Messages { [Collection(Constants.TestCollections.SendVenueMessage)] [TestCaseOrderer(Constants.TestCaseOrderer, Constants.AssemblyName)] public class SendingVenueMessageTests { private ITelegramBotClient BotClient => _fixture.BotClient; private readonly TestsFixture _fixture; public SendingVenueMessageTests(TestsFixture fixture) { _fixture = fixture; } [OrderedFact(DisplayName = FactTitles.ShouldSendVenue)] [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.SendVenue)] public async Task Should_Send_Venue() { await _fixture.SendTestCaseNotificationAsync(FactTitles.ShouldSendVenue); const string title = "Rubirosa Ristorante"; const string address = "235 Mulberry St"; const float lat = 40.722728f; const float lon = -73.996006f; const string foursquareId = "4cc6222106c25481d7a4a047"; Message message = await BotClient.SendVenueAsync( chatId: _fixture.SupergroupChat, latitude: lat, longitude: lon, title: title, address: address, foursquareId: foursquareId ); Assert.Equal(MessageType.Venue, message.Type); Assert.Equal(title, message.Venue.Title); Assert.Equal(address, message.Venue.Address); Assert.Equal(foursquareId, message.Venue.FoursquareId); Assert.InRange(message.Venue.Location.Latitude, lat - 0.001f, lat + 0.001f); Assert.InRange(message.Venue.Location.Longitude, lon - 0.001f, lon + 0.001f); } private static class FactTitles { public const string ShouldSendVenue = "Should send a venue"; } } }
36.375
89
0.645557
[ "MIT" ]
Ali-YousefiTelori/Telegram.Bot
test/Telegram.Bot.Tests.Integ/Sending Messages/SendingVenueMessageTests.cs
2,039
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the directconnect-2012-10-25.normal.json service model. */ using System; using Amazon.Runtime; using Amazon.Util.Internal; namespace Amazon.DirectConnect { /// <summary> /// Configuration for accessing Amazon DirectConnect service /// </summary> public partial class AmazonDirectConnectConfig : ClientConfig { private static readonly string UserAgentString = InternalSDKUtils.BuildUserAgentString("3.3.104.60"); private string _userAgent = UserAgentString; /// <summary> /// Default constructor /// </summary> public AmazonDirectConnectConfig() { this.AuthenticationServiceName = "directconnect"; } /// <summary> /// The constant used to lookup in the region hash the endpoint. /// </summary> public override string RegionEndpointServiceName { get { return "directconnect"; } } /// <summary> /// Gets the ServiceVersion property. /// </summary> public override string ServiceVersion { get { return "2012-10-25"; } } /// <summary> /// Gets the value of UserAgent property. /// </summary> public override string UserAgent { get { return _userAgent; } } } }
26.5625
111
0.593882
[ "Apache-2.0" ]
Vfialkin/aws-sdk-net
sdk/src/Services/DirectConnect/Generated/AmazonDirectConnectConfig.cs
2,125
C#
namespace MiCha.Models { public enum Release { Master, NightlyBuild } }
11.222222
23
0.544554
[ "MIT" ]
mika-sandbox/mixier-chatviewer
Source/MiCha/Models/Release.cs
103
C#
namespace acmedesktop.MasterSetup { partial class FrmProductScheme { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.PanelHeader = new System.Windows.Forms.Panel(); this.BtnExit = new System.Windows.Forms.Button(); this.BtnDelete = new System.Windows.Forms.Button(); this.BtnEdit = new System.Windows.Forms.Button(); this.BtnNew = new System.Windows.Forms.Button(); this.PnlBorderHeaderTop = new System.Windows.Forms.Panel(); this.PnlBorderHeaderBottom = new System.Windows.Forms.Panel(); this.PanelFooter = new System.Windows.Forms.Panel(); this.BtnCancel = new System.Windows.Forms.Button(); this.BtnSave = new System.Windows.Forms.Button(); this.PnlBorderFooterBoootm = new System.Windows.Forms.Panel(); this.PnlBorderFooterTop = new System.Windows.Forms.Panel(); this.PanelContainer = new System.Windows.Forms.Panel(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.RdoSubGroupWiseSubGroup = new System.Windows.Forms.RadioButton(); this.RdoSubGroupWiseGroup = new System.Windows.Forms.RadioButton(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.RdoGroupWiseGroup = new System.Windows.Forms.RadioButton(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.TxtPercentRate = new acmedesktop.MyInputControls.MyTextBox(); this.label2 = new System.Windows.Forms.Label(); this.TxtDateFrom = new acmedesktop.MyInputControls.MyMaskedTextBox(); this.label3 = new System.Windows.Forms.Label(); this.TxtDateTo = new acmedesktop.MyInputControls.MyMaskedTextBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.RdoProductSubGroup = new System.Windows.Forms.RadioButton(); this.RdoProductGroup = new System.Windows.Forms.RadioButton(); this.RdoProduct = new System.Windows.Forms.RadioButton(); this.Grid = new System.Windows.Forms.DataGridView(); this.SNo = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ProductId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Product = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ProductGrpId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PGroup = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ProductSubGrpId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PSubGroup = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DisPercent = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ProductRate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Action = new System.Windows.Forms.DataGridViewImageColumn(); this.TxtDescription = new acmedesktop.MyInputControls.MyTextBox(); this.BtnSearchDescription = new System.Windows.Forms.Button(); this.label11 = new System.Windows.Forms.Label(); this.PanelHeader.SuspendLayout(); this.PanelFooter.SuspendLayout(); this.PanelContainer.SuspendLayout(); this.groupBox5.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit(); this.SuspendLayout(); // // PanelHeader // this.PanelHeader.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(196)))), ((int)(((byte)(197))))); this.PanelHeader.Controls.Add(this.BtnExit); this.PanelHeader.Controls.Add(this.BtnDelete); this.PanelHeader.Controls.Add(this.BtnEdit); this.PanelHeader.Controls.Add(this.BtnNew); this.PanelHeader.Controls.Add(this.PnlBorderHeaderTop); this.PanelHeader.Controls.Add(this.PnlBorderHeaderBottom); this.PanelHeader.Dock = System.Windows.Forms.DockStyle.Top; this.PanelHeader.Location = new System.Drawing.Point(0, 0); this.PanelHeader.Name = "PanelHeader"; this.PanelHeader.Size = new System.Drawing.Size(785, 42); this.PanelHeader.TabIndex = 0; // // BtnExit // this.BtnExit.Font = new System.Drawing.Font("Arial", 9F); this.BtnExit.Image = global::acmedesktop.Properties.Resources.Exit_24; this.BtnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnExit.Location = new System.Drawing.Point(690, 4); this.BtnExit.Name = "BtnExit"; this.BtnExit.Size = new System.Drawing.Size(70, 32); this.BtnExit.TabIndex = 4; this.BtnExit.Text = " E&XIT"; this.BtnExit.UseVisualStyleBackColor = true; this.BtnExit.Click += new System.EventHandler(this.BtnExit_Click); // // BtnDelete // this.BtnDelete.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BtnDelete.Image = global::acmedesktop.Properties.Resources.Delete_24; this.BtnDelete.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnDelete.Location = new System.Drawing.Point(149, 6); this.BtnDelete.Name = "BtnDelete"; this.BtnDelete.Size = new System.Drawing.Size(85, 32); this.BtnDelete.TabIndex = 3; this.BtnDelete.Text = " &DELETE"; this.BtnDelete.UseVisualStyleBackColor = true; this.BtnDelete.Click += new System.EventHandler(this.BtnDelete_Click); // // BtnEdit // this.BtnEdit.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BtnEdit.Image = global::acmedesktop.Properties.Resources.Edit_24; this.BtnEdit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnEdit.Location = new System.Drawing.Point(79, 6); this.BtnEdit.Name = "BtnEdit"; this.BtnEdit.Size = new System.Drawing.Size(70, 32); this.BtnEdit.TabIndex = 2; this.BtnEdit.Text = " &EDIT"; this.BtnEdit.UseVisualStyleBackColor = true; this.BtnEdit.Click += new System.EventHandler(this.BtnEdit_Click); // // BtnNew // this.BtnNew.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.BtnNew.Image = global::acmedesktop.Properties.Resources.New_24; this.BtnNew.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnNew.Location = new System.Drawing.Point(7, 6); this.BtnNew.Name = "BtnNew"; this.BtnNew.Size = new System.Drawing.Size(72, 32); this.BtnNew.TabIndex = 1; this.BtnNew.Text = " &NEW"; this.BtnNew.UseVisualStyleBackColor = true; this.BtnNew.Click += new System.EventHandler(this.BtnNew_Click); // // PnlBorderHeaderTop // this.PnlBorderHeaderTop.BackColor = System.Drawing.Color.White; this.PnlBorderHeaderTop.Dock = System.Windows.Forms.DockStyle.Top; this.PnlBorderHeaderTop.Location = new System.Drawing.Point(0, 0); this.PnlBorderHeaderTop.Name = "PnlBorderHeaderTop"; this.PnlBorderHeaderTop.Size = new System.Drawing.Size(785, 1); this.PnlBorderHeaderTop.TabIndex = 0; // // PnlBorderHeaderBottom // this.PnlBorderHeaderBottom.BackColor = System.Drawing.Color.White; this.PnlBorderHeaderBottom.Dock = System.Windows.Forms.DockStyle.Bottom; this.PnlBorderHeaderBottom.Location = new System.Drawing.Point(0, 41); this.PnlBorderHeaderBottom.Name = "PnlBorderHeaderBottom"; this.PnlBorderHeaderBottom.Size = new System.Drawing.Size(785, 1); this.PnlBorderHeaderBottom.TabIndex = 0; // // PanelFooter // this.PanelFooter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(196)))), ((int)(((byte)(197))))); this.PanelFooter.CausesValidation = false; this.PanelFooter.Controls.Add(this.BtnCancel); this.PanelFooter.Controls.Add(this.BtnSave); this.PanelFooter.Controls.Add(this.PnlBorderFooterBoootm); this.PanelFooter.Controls.Add(this.PnlBorderFooterTop); this.PanelFooter.Dock = System.Windows.Forms.DockStyle.Bottom; this.PanelFooter.Location = new System.Drawing.Point(0, 412); this.PanelFooter.Name = "PanelFooter"; this.PanelFooter.Size = new System.Drawing.Size(785, 42); this.PanelFooter.TabIndex = 3; // // BtnCancel // this.BtnCancel.CausesValidation = false; this.BtnCancel.Font = new System.Drawing.Font("Arial", 9.5F); this.BtnCancel.Image = global::acmedesktop.Properties.Resources.Cancel_24; this.BtnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnCancel.Location = new System.Drawing.Point(665, 6); this.BtnCancel.Name = "BtnCancel"; this.BtnCancel.Size = new System.Drawing.Size(95, 32); this.BtnCancel.TabIndex = 2; this.BtnCancel.Text = " &CANCEL"; this.BtnCancel.UseVisualStyleBackColor = true; this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click); // // BtnSave // this.BtnSave.Font = new System.Drawing.Font("Arial", 9.5F); this.BtnSave.Image = global::acmedesktop.Properties.Resources.Ok_24; this.BtnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.BtnSave.Location = new System.Drawing.Point(606, 6); this.BtnSave.Name = "BtnSave"; this.BtnSave.Size = new System.Drawing.Size(59, 32); this.BtnSave.TabIndex = 1; this.BtnSave.Text = " &OK"; this.BtnSave.UseVisualStyleBackColor = true; this.BtnSave.Click += new System.EventHandler(this.BtnSave_Click); // // PnlBorderFooterBoootm // this.PnlBorderFooterBoootm.BackColor = System.Drawing.Color.White; this.PnlBorderFooterBoootm.Dock = System.Windows.Forms.DockStyle.Bottom; this.PnlBorderFooterBoootm.Location = new System.Drawing.Point(0, 41); this.PnlBorderFooterBoootm.Name = "PnlBorderFooterBoootm"; this.PnlBorderFooterBoootm.Size = new System.Drawing.Size(785, 1); this.PnlBorderFooterBoootm.TabIndex = 3; // // PnlBorderFooterTop // this.PnlBorderFooterTop.BackColor = System.Drawing.Color.White; this.PnlBorderFooterTop.Dock = System.Windows.Forms.DockStyle.Top; this.PnlBorderFooterTop.Location = new System.Drawing.Point(0, 0); this.PnlBorderFooterTop.Name = "PnlBorderFooterTop"; this.PnlBorderFooterTop.Size = new System.Drawing.Size(785, 1); this.PnlBorderFooterTop.TabIndex = 0; // // PanelContainer // this.PanelContainer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(196)))), ((int)(((byte)(197))))); this.PanelContainer.Controls.Add(this.groupBox5); this.PanelContainer.Controls.Add(this.groupBox4); this.PanelContainer.Controls.Add(this.groupBox2); this.PanelContainer.Controls.Add(this.groupBox1); this.PanelContainer.Controls.Add(this.Grid); this.PanelContainer.Controls.Add(this.TxtDescription); this.PanelContainer.Controls.Add(this.BtnSearchDescription); this.PanelContainer.Controls.Add(this.label11); this.PanelContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.PanelContainer.Font = new System.Drawing.Font("Arial", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.PanelContainer.Location = new System.Drawing.Point(0, 42); this.PanelContainer.Name = "PanelContainer"; this.PanelContainer.Size = new System.Drawing.Size(785, 370); this.PanelContainer.TabIndex = 1; // // groupBox5 // this.groupBox5.CausesValidation = false; this.groupBox5.Controls.Add(this.RdoSubGroupWiseSubGroup); this.groupBox5.Controls.Add(this.RdoSubGroupWiseGroup); this.groupBox5.Location = new System.Drawing.Point(471, 41); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(268, 49); this.groupBox5.TabIndex = 5; this.groupBox5.TabStop = false; this.groupBox5.Text = "Sub Group wise"; // // RdoSubGroupWiseSubGroup // this.RdoSubGroupWiseSubGroup.AutoSize = true; this.RdoSubGroupWiseSubGroup.Location = new System.Drawing.Point(97, 20); this.RdoSubGroupWiseSubGroup.Name = "RdoSubGroupWiseSubGroup"; this.RdoSubGroupWiseSubGroup.Size = new System.Drawing.Size(88, 20); this.RdoSubGroupWiseSubGroup.TabIndex = 1; this.RdoSubGroupWiseSubGroup.TabStop = true; this.RdoSubGroupWiseSubGroup.Text = "Sub Group"; this.RdoSubGroupWiseSubGroup.UseVisualStyleBackColor = true; this.RdoSubGroupWiseSubGroup.CheckedChanged += new System.EventHandler(this.RdoSubGroupWiseSubGroup_CheckedChanged); // // RdoSubGroupWiseGroup // this.RdoSubGroupWiseGroup.AutoSize = true; this.RdoSubGroupWiseGroup.Location = new System.Drawing.Point(10, 20); this.RdoSubGroupWiseGroup.Name = "RdoSubGroupWiseGroup"; this.RdoSubGroupWiseGroup.Size = new System.Drawing.Size(61, 20); this.RdoSubGroupWiseGroup.TabIndex = 0; this.RdoSubGroupWiseGroup.TabStop = true; this.RdoSubGroupWiseGroup.Text = "Group"; this.RdoSubGroupWiseGroup.UseVisualStyleBackColor = true; this.RdoSubGroupWiseGroup.CheckedChanged += new System.EventHandler(this.RdoSubGroupWiseGroup_CheckedChanged); // // groupBox4 // this.groupBox4.CausesValidation = false; this.groupBox4.Controls.Add(this.RdoGroupWiseGroup); this.groupBox4.Location = new System.Drawing.Point(332, 41); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(121, 49); this.groupBox4.TabIndex = 4; this.groupBox4.TabStop = false; this.groupBox4.Text = "Group wise"; // // RdoGroupWiseGroup // this.RdoGroupWiseGroup.AutoSize = true; this.RdoGroupWiseGroup.Location = new System.Drawing.Point(22, 20); this.RdoGroupWiseGroup.Name = "RdoGroupWiseGroup"; this.RdoGroupWiseGroup.Size = new System.Drawing.Size(61, 20); this.RdoGroupWiseGroup.TabIndex = 0; this.RdoGroupWiseGroup.TabStop = true; this.RdoGroupWiseGroup.Text = "Group"; this.RdoGroupWiseGroup.UseVisualStyleBackColor = true; this.RdoGroupWiseGroup.CheckedChanged += new System.EventHandler(this.RdoGroupWiseGroup_CheckedChanged); // // groupBox2 // this.groupBox2.Controls.Add(this.TxtPercentRate); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.TxtDateFrom); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.TxtDateTo); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Location = new System.Drawing.Point(11, 91); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(728, 47); this.groupBox2.TabIndex = 6; this.groupBox2.TabStop = false; // // TxtPercentRate // this.TxtPercentRate.BackColor = System.Drawing.Color.White; this.TxtPercentRate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TxtPercentRate.Font = new System.Drawing.Font("Arial", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.TxtPercentRate.ForeColor = System.Drawing.SystemColors.WindowText; this.TxtPercentRate.Location = new System.Drawing.Point(511, 15); this.TxtPercentRate.Name = "TxtPercentRate"; this.TxtPercentRate.Size = new System.Drawing.Size(117, 22); this.TxtPercentRate.TabIndex = 5; this.TxtPercentRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.TxtPercentRate.Validating += new System.ComponentModel.CancelEventHandler(this.TxtPercentRate_Validating); // // label2 // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(196)))), ((int)(((byte)(197))))); this.label2.Font = new System.Drawing.Font("Arial", 9.5F); this.label2.Location = new System.Drawing.Point(366, 19); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(139, 16); this.label2.TabIndex = 4; this.label2.Text = "Discount Percent Rate"; // // TxtDateFrom // this.TxtDateFrom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TxtDateFrom.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite; this.TxtDateFrom.Location = new System.Drawing.Point(86, 15); this.TxtDateFrom.Mask = "99/99/9999"; this.TxtDateFrom.Name = "TxtDateFrom"; this.TxtDateFrom.Size = new System.Drawing.Size(95, 22); this.TxtDateFrom.TabIndex = 1; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(11, 21); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(69, 16); this.label3.TabIndex = 0; this.label3.Text = "Date From"; // // TxtDateTo // this.TxtDateTo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TxtDateTo.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite; this.TxtDateTo.Location = new System.Drawing.Point(253, 15); this.TxtDateTo.Mask = "99/99/9999"; this.TxtDateTo.Name = "TxtDateTo"; this.TxtDateTo.Size = new System.Drawing.Size(95, 22); this.TxtDateTo.TabIndex = 3; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(195, 19); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(52, 16); this.label1.TabIndex = 2; this.label1.Text = "Date To"; // // groupBox1 // this.groupBox1.CausesValidation = false; this.groupBox1.Controls.Add(this.RdoProductSubGroup); this.groupBox1.Controls.Add(this.RdoProductGroup); this.groupBox1.Controls.Add(this.RdoProduct); this.groupBox1.Location = new System.Drawing.Point(13, 41); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(304, 49); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "Product wise"; // // RdoProductSubGroup // this.RdoProductSubGroup.AutoSize = true; this.RdoProductSubGroup.Location = new System.Drawing.Point(204, 20); this.RdoProductSubGroup.Name = "RdoProductSubGroup"; this.RdoProductSubGroup.Size = new System.Drawing.Size(88, 20); this.RdoProductSubGroup.TabIndex = 2; this.RdoProductSubGroup.TabStop = true; this.RdoProductSubGroup.Text = "Sub Group"; this.RdoProductSubGroup.UseVisualStyleBackColor = true; this.RdoProductSubGroup.CheckedChanged += new System.EventHandler(this.RdoProductSubGroup_CheckedChanged); // // RdoProductGroup // this.RdoProductGroup.AutoSize = true; this.RdoProductGroup.Location = new System.Drawing.Point(109, 20); this.RdoProductGroup.Name = "RdoProductGroup"; this.RdoProductGroup.Size = new System.Drawing.Size(61, 20); this.RdoProductGroup.TabIndex = 1; this.RdoProductGroup.TabStop = true; this.RdoProductGroup.Text = "Group"; this.RdoProductGroup.UseVisualStyleBackColor = true; this.RdoProductGroup.CheckedChanged += new System.EventHandler(this.RdoProductGroup_CheckedChanged); // // RdoProduct // this.RdoProduct.AutoSize = true; this.RdoProduct.Location = new System.Drawing.Point(15, 20); this.RdoProduct.Name = "RdoProduct"; this.RdoProduct.Size = new System.Drawing.Size(71, 20); this.RdoProduct.TabIndex = 0; this.RdoProduct.TabStop = true; this.RdoProduct.Text = "Product"; this.RdoProduct.UseVisualStyleBackColor = true; this.RdoProduct.CheckedChanged += new System.EventHandler(this.RdoProduct_CheckedChanged); // // Grid // this.Grid.AllowUserToAddRows = false; this.Grid.AllowUserToDeleteRows = false; this.Grid.AllowUserToResizeColumns = false; this.Grid.AllowUserToResizeRows = false; dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.Grid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.Grid.BackgroundColor = System.Drawing.Color.White; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle2.Font = new System.Drawing.Font("Arial", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; this.Grid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.Grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.SNo, this.ProductId, this.Product, this.ProductGrpId, this.PGroup, this.ProductSubGrpId, this.PSubGroup, this.DisPercent, this.ProductRate, this.Action}); this.Grid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.Grid.Location = new System.Drawing.Point(3, 144); this.Grid.MultiSelect = false; this.Grid.Name = "Grid"; this.Grid.RowHeadersVisible = false; this.Grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.Grid.Size = new System.Drawing.Size(776, 214); this.Grid.StandardTab = true; this.Grid.TabIndex = 7; this.Grid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Grid_KeyDown); this.Grid.Leave += new System.EventHandler(this.Grid_Leave); // // SNo // this.SNo.HeaderText = "S.No"; this.SNo.Name = "SNo"; this.SNo.Width = 50; // // ProductId // this.ProductId.HeaderText = "ProductId"; this.ProductId.Name = "ProductId"; this.ProductId.Visible = false; this.ProductId.Width = 35; // // Product // this.Product.HeaderText = "Product"; this.Product.Name = "Product"; this.Product.ReadOnly = true; this.Product.Width = 200; // // ProductGrpId // this.ProductGrpId.HeaderText = "ProductGrpId"; this.ProductGrpId.Name = "ProductGrpId"; this.ProductGrpId.Visible = false; // // PGroup // this.PGroup.HeaderText = "Group"; this.PGroup.Name = "PGroup"; this.PGroup.ReadOnly = true; this.PGroup.Width = 150; // // ProductSubGrpId // this.ProductSubGrpId.HeaderText = "ProductSubGrpId"; this.ProductSubGrpId.Name = "ProductSubGrpId"; this.ProductSubGrpId.Visible = false; // // PSubGroup // this.PSubGroup.HeaderText = "SubGroup"; this.PSubGroup.Name = "PSubGroup"; this.PSubGroup.ReadOnly = true; this.PSubGroup.Width = 150; // // DisPercent // dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; this.DisPercent.DefaultCellStyle = dataGridViewCellStyle3; this.DisPercent.HeaderText = "Percent"; this.DisPercent.Name = "DisPercent"; this.DisPercent.Width = 70; // // ProductRate // dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; this.ProductRate.DefaultCellStyle = dataGridViewCellStyle4; this.ProductRate.HeaderText = "Rate"; this.ProductRate.Name = "ProductRate"; this.ProductRate.Width = 80; // // Action // this.Action.HeaderText = "#"; this.Action.Name = "Action"; this.Action.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.Action.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.Action.Width = 50; // // TxtDescription // this.TxtDescription.BackColor = System.Drawing.Color.White; this.TxtDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TxtDescription.Font = new System.Drawing.Font("Arial", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.TxtDescription.ForeColor = System.Drawing.SystemColors.WindowText; this.TxtDescription.Location = new System.Drawing.Point(112, 12); this.TxtDescription.Name = "TxtDescription"; this.TxtDescription.Size = new System.Drawing.Size(266, 22); this.TxtDescription.TabIndex = 1; this.TxtDescription.TextChanged += new System.EventHandler(this.TxtDescription_TextChanged); this.TxtDescription.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtDescription_KeyDown); this.TxtDescription.Validating += new System.ComponentModel.CancelEventHandler(this.TxtDescription_Validating); // // BtnSearchDescription // this.BtnSearchDescription.CausesValidation = false; this.BtnSearchDescription.Font = new System.Drawing.Font("Arial", 9F); this.BtnSearchDescription.Image = global::acmedesktop.Properties.Resources.search_16; this.BtnSearchDescription.Location = new System.Drawing.Point(378, 11); this.BtnSearchDescription.Name = "BtnSearchDescription"; this.BtnSearchDescription.Size = new System.Drawing.Size(33, 25); this.BtnSearchDescription.TabIndex = 2; this.BtnSearchDescription.TabStop = false; this.BtnSearchDescription.UseVisualStyleBackColor = true; this.BtnSearchDescription.Click += new System.EventHandler(this.BtnSearchDescription_Click); // // label11 // this.label11.AutoSize = true; this.label11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(196)))), ((int)(((byte)(197))))); this.label11.Font = new System.Drawing.Font("Arial", 9.5F); this.label11.Location = new System.Drawing.Point(12, 14); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(94, 16); this.label11.TabIndex = 0; this.label11.Text = "Scheme Name"; // // FrmProductScheme // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(785, 454); this.Controls.Add(this.PanelContainer); this.Controls.Add(this.PanelFooter); this.Controls.Add(this.PanelHeader); this.KeyPreview = true; this.Name = "FrmProductScheme"; this.ShowIcon = false; this.Text = "Product Rate Scheme "; this.Load += new System.EventHandler(this.FrmProductScheme_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FrmProductScheme_KeyDown); this.PanelHeader.ResumeLayout(false); this.PanelFooter.ResumeLayout(false); this.PanelContainer.ResumeLayout(false); this.PanelContainer.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Panel PanelHeader; private System.Windows.Forms.Button BtnExit; private System.Windows.Forms.Button BtnDelete; private System.Windows.Forms.Button BtnEdit; private System.Windows.Forms.Button BtnNew; private System.Windows.Forms.Panel PnlBorderHeaderTop; private System.Windows.Forms.Panel PnlBorderHeaderBottom; private System.Windows.Forms.Panel PanelFooter; private System.Windows.Forms.Button BtnCancel; private System.Windows.Forms.Button BtnSave; private System.Windows.Forms.Panel PnlBorderFooterBoootm; private System.Windows.Forms.Panel PnlBorderFooterTop; private System.Windows.Forms.Panel PanelContainer; private MyInputControls.MyTextBox TxtDescription; private System.Windows.Forms.Button BtnSearchDescription; private System.Windows.Forms.Label label11; private System.Windows.Forms.DataGridView Grid; private MyInputControls.MyMaskedTextBox TxtDateTo; private System.Windows.Forms.Label label1; private MyInputControls.MyMaskedTextBox TxtDateFrom; private System.Windows.Forms.Label label3; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.RadioButton RdoProduct; private System.Windows.Forms.RadioButton RdoProductSubGroup; private System.Windows.Forms.RadioButton RdoProductGroup; private System.Windows.Forms.GroupBox groupBox2; private MyInputControls.MyTextBox TxtPercentRate; private System.Windows.Forms.Label label2; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.RadioButton RdoSubGroupWiseSubGroup; private System.Windows.Forms.RadioButton RdoSubGroupWiseGroup; private System.Windows.Forms.RadioButton RdoGroupWiseGroup; private System.Windows.Forms.DataGridViewTextBoxColumn SNo; private System.Windows.Forms.DataGridViewTextBoxColumn ProductId; private System.Windows.Forms.DataGridViewTextBoxColumn Product; private System.Windows.Forms.DataGridViewTextBoxColumn ProductGrpId; private System.Windows.Forms.DataGridViewTextBoxColumn PGroup; private System.Windows.Forms.DataGridViewTextBoxColumn ProductSubGrpId; private System.Windows.Forms.DataGridViewTextBoxColumn PSubGroup; private System.Windows.Forms.DataGridViewTextBoxColumn DisPercent; private System.Windows.Forms.DataGridViewTextBoxColumn ProductRate; private System.Windows.Forms.DataGridViewImageColumn Action; } }
54.317147
163
0.626289
[ "MIT" ]
ajaykucse/LaraApp
acme/acmedesktop/MasterSetup/FrmProductScheme.Designer.cs
35,797
C#
// <auto-generated> // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto // </auto-generated> #pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Google.Cloud.Bigtable.Admin.V2 { /// <summary>Holder for reflection information generated from google/bigtable/admin/v2/table.proto</summary> public static partial class TableReflection { #region Descriptor /// <summary>File descriptor for google/bigtable/admin/v2/table.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; static TableReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CiRnb29nbGUvYmlndGFibGUvYWRtaW4vdjIvdGFibGUucHJvdG8SGGdvb2ds", "ZS5iaWd0YWJsZS5hZG1pbi52MhofZ29vZ2xlL2FwaS9maWVsZF9iZWhhdmlv", "ci5wcm90bxoZZ29vZ2xlL2FwaS9yZXNvdXJjZS5wcm90bxoeZ29vZ2xlL3By", "b3RvYnVmL2R1cmF0aW9uLnByb3RvGh9nb29nbGUvcHJvdG9idWYvdGltZXN0", "YW1wLnByb3RvGhdnb29nbGUvcnBjL3N0YXR1cy5wcm90byKbAQoLUmVzdG9y", "ZUluZm8SQAoLc291cmNlX3R5cGUYASABKA4yKy5nb29nbGUuYmlndGFibGUu", "YWRtaW4udjIuUmVzdG9yZVNvdXJjZVR5cGUSOwoLYmFja3VwX2luZm8YAiAB", "KAsyJC5nb29nbGUuYmlndGFibGUuYWRtaW4udjIuQmFja3VwSW5mb0gAQg0K", "C3NvdXJjZV9pbmZvIt0ICgVUYWJsZRIMCgRuYW1lGAEgASgJEkoKDmNsdXN0", "ZXJfc3RhdGVzGAIgAygLMjIuZ29vZ2xlLmJpZ3RhYmxlLmFkbWluLnYyLlRh", "YmxlLkNsdXN0ZXJTdGF0ZXNFbnRyeRJMCg9jb2x1bW5fZmFtaWxpZXMYAyAD", "KAsyMy5nb29nbGUuYmlndGFibGUuYWRtaW4udjIuVGFibGUuQ29sdW1uRmFt", "aWxpZXNFbnRyeRJJCgtncmFudWxhcml0eRgEIAEoDjI0Lmdvb2dsZS5iaWd0", "YWJsZS5hZG1pbi52Mi5UYWJsZS5UaW1lc3RhbXBHcmFudWxhcml0eRI7Cgxy", "ZXN0b3JlX2luZm8YBiABKAsyJS5nb29nbGUuYmlndGFibGUuYWRtaW4udjIu", "UmVzdG9yZUluZm8awQIKDENsdXN0ZXJTdGF0ZRJYChFyZXBsaWNhdGlvbl9z", "dGF0ZRgBIAEoDjI9Lmdvb2dsZS5iaWd0YWJsZS5hZG1pbi52Mi5UYWJsZS5D", "bHVzdGVyU3RhdGUuUmVwbGljYXRpb25TdGF0ZRJGCg9lbmNyeXB0aW9uX2lu", "Zm8YAiADKAsyKC5nb29nbGUuYmlndGFibGUuYWRtaW4udjIuRW5jcnlwdGlv", "bkluZm9CA+BBAyKOAQoQUmVwbGljYXRpb25TdGF0ZRITCg9TVEFURV9OT1Rf", "S05PV04QABIQCgxJTklUSUFMSVpJTkcQARIXChNQTEFOTkVEX01BSU5URU5B", "TkNFEAISGQoVVU5QTEFOTkVEX01BSU5URU5BTkNFEAMSCQoFUkVBRFkQBBIU", "ChBSRUFEWV9PUFRJTUlaSU5HEAUaYgoSQ2x1c3RlclN0YXRlc0VudHJ5EgsK", "A2tleRgBIAEoCRI7CgV2YWx1ZRgCIAEoCzIsLmdvb2dsZS5iaWd0YWJsZS5h", "ZG1pbi52Mi5UYWJsZS5DbHVzdGVyU3RhdGU6AjgBGl0KE0NvbHVtbkZhbWls", "aWVzRW50cnkSCwoDa2V5GAEgASgJEjUKBXZhbHVlGAIgASgLMiYuZ29vZ2xl", "LmJpZ3RhYmxlLmFkbWluLnYyLkNvbHVtbkZhbWlseToCOAEiSQoUVGltZXN0", "YW1wR3JhbnVsYXJpdHkSJQohVElNRVNUQU1QX0dSQU5VTEFSSVRZX1VOU1BF", "Q0lGSUVEEAASCgoGTUlMTElTEAEicQoEVmlldxIUChBWSUVXX1VOU1BFQ0lG", "SUVEEAASDQoJTkFNRV9PTkxZEAESDwoLU0NIRU1BX1ZJRVcQAhIUChBSRVBM", "SUNBVElPTl9WSUVXEAMSEwoPRU5DUllQVElPTl9WSUVXEAUSCAoERlVMTBAE", "Ol/qQVwKImJpZ3RhYmxlYWRtaW4uZ29vZ2xlYXBpcy5jb20vVGFibGUSNnBy", "b2plY3RzL3twcm9qZWN0fS9pbnN0YW5jZXMve2luc3RhbmNlfS90YWJsZXMv", "e3RhYmxlfSJBCgxDb2x1bW5GYW1pbHkSMQoHZ2NfcnVsZRgBIAEoCzIgLmdv", "b2dsZS5iaWd0YWJsZS5hZG1pbi52Mi5HY1J1bGUi1QIKBkdjUnVsZRIaChBt", "YXhfbnVtX3ZlcnNpb25zGAEgASgFSAASLAoHbWF4X2FnZRgCIAEoCzIZLmdv", "b2dsZS5wcm90b2J1Zi5EdXJhdGlvbkgAEkUKDGludGVyc2VjdGlvbhgDIAEo", "CzItLmdvb2dsZS5iaWd0YWJsZS5hZG1pbi52Mi5HY1J1bGUuSW50ZXJzZWN0", "aW9uSAASNwoFdW5pb24YBCABKAsyJi5nb29nbGUuYmlndGFibGUuYWRtaW4u", "djIuR2NSdWxlLlVuaW9uSAAaPwoMSW50ZXJzZWN0aW9uEi8KBXJ1bGVzGAEg", "AygLMiAuZ29vZ2xlLmJpZ3RhYmxlLmFkbWluLnYyLkdjUnVsZRo4CgVVbmlv", "bhIvCgVydWxlcxgBIAMoCzIgLmdvb2dsZS5iaWd0YWJsZS5hZG1pbi52Mi5H", "Y1J1bGVCBgoEcnVsZSLZAgoORW5jcnlwdGlvbkluZm8SVQoPZW5jcnlwdGlv", "bl90eXBlGAMgASgOMjcuZ29vZ2xlLmJpZ3RhYmxlLmFkbWluLnYyLkVuY3J5", "cHRpb25JbmZvLkVuY3J5cHRpb25UeXBlQgPgQQMSMgoRZW5jcnlwdGlvbl9z", "dGF0dXMYBCABKAsyEi5nb29nbGUucnBjLlN0YXR1c0ID4EEDEkkKD2ttc19r", "ZXlfdmVyc2lvbhgCIAEoCUIw4EED+kEqCihjbG91ZGttcy5nb29nbGVhcGlz", "LmNvbS9DcnlwdG9LZXlWZXJzaW9uInEKDkVuY3J5cHRpb25UeXBlEh8KG0VO", "Q1JZUFRJT05fVFlQRV9VTlNQRUNJRklFRBAAEh0KGUdPT0dMRV9ERUZBVUxU", "X0VOQ1JZUFRJT04QARIfChtDVVNUT01FUl9NQU5BR0VEX0VOQ1JZUFRJT04Q", "AiLMAwoIU25hcHNob3QSDAoEbmFtZRgBIAEoCRI1Cgxzb3VyY2VfdGFibGUY", "AiABKAsyHy5nb29nbGUuYmlndGFibGUuYWRtaW4udjIuVGFibGUSFwoPZGF0", "YV9zaXplX2J5dGVzGAMgASgDEi8KC2NyZWF0ZV90aW1lGAQgASgLMhouZ29v", "Z2xlLnByb3RvYnVmLlRpbWVzdGFtcBIvCgtkZWxldGVfdGltZRgFIAEoCzIa", "Lmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASNwoFc3RhdGUYBiABKA4yKC5n", "b29nbGUuYmlndGFibGUuYWRtaW4udjIuU25hcHNob3QuU3RhdGUSEwoLZGVz", "Y3JpcHRpb24YByABKAkiNQoFU3RhdGUSEwoPU1RBVEVfTk9UX0tOT1dOEAAS", "CQoFUkVBRFkQARIMCghDUkVBVElORxACOnvqQXgKJWJpZ3RhYmxlYWRtaW4u", "Z29vZ2xlYXBpcy5jb20vU25hcHNob3QST3Byb2plY3RzL3twcm9qZWN0fS9p", "bnN0YW5jZXMve2luc3RhbmNlfS9jbHVzdGVycy97Y2x1c3Rlcn0vc25hcHNo", "b3RzL3tzbmFwc2hvdH0ipAQKBkJhY2t1cBIRCgRuYW1lGAEgASgJQgPgQQMS", "HAoMc291cmNlX3RhYmxlGAIgASgJQgbgQQXgQQISNAoLZXhwaXJlX3RpbWUY", "AyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgPgQQISMwoKc3Rh", "cnRfdGltZRgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBCA+BB", "AxIxCghlbmRfdGltZRgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3Rh", "bXBCA+BBAxIXCgpzaXplX2J5dGVzGAYgASgDQgPgQQMSOgoFc3RhdGUYByAB", "KA4yJi5nb29nbGUuYmlndGFibGUuYWRtaW4udjIuQmFja3VwLlN0YXRlQgPg", "QQMSRgoPZW5jcnlwdGlvbl9pbmZvGAkgASgLMiguZ29vZ2xlLmJpZ3RhYmxl", "LmFkbWluLnYyLkVuY3J5cHRpb25JbmZvQgPgQQMiNwoFU3RhdGUSFQoRU1RB", "VEVfVU5TUEVDSUZJRUQQABIMCghDUkVBVElORxABEgkKBVJFQURZEAI6depB", "cgojYmlndGFibGVhZG1pbi5nb29nbGVhcGlzLmNvbS9CYWNrdXASS3Byb2pl", "Y3RzL3twcm9qZWN0fS9pbnN0YW5jZXMve2luc3RhbmNlfS9jbHVzdGVycy97", "Y2x1c3Rlcn0vYmFja3Vwcy97YmFja3VwfSKkAQoKQmFja3VwSW5mbxITCgZi", "YWNrdXAYASABKAlCA+BBAxIzCgpzdGFydF90aW1lGAIgASgLMhouZ29vZ2xl", "LnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEjEKCGVuZF90aW1lGAMgASgLMhou", "Z29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEhkKDHNvdXJjZV90YWJs", "ZRgEIAEoCUID4EEDKkQKEVJlc3RvcmVTb3VyY2VUeXBlEiMKH1JFU1RPUkVf", "U09VUkNFX1RZUEVfVU5TUEVDSUZJRUQQABIKCgZCQUNLVVAQAUL8AgocY29t", "Lmdvb2dsZS5iaWd0YWJsZS5hZG1pbi52MkIKVGFibGVQcm90b1ABWj1nb29n", "bGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2JpZ3RhYmxlL2Fk", "bWluL3YyO2FkbWluqgIeR29vZ2xlLkNsb3VkLkJpZ3RhYmxlLkFkbWluLlYy", "ygIeR29vZ2xlXENsb3VkXEJpZ3RhYmxlXEFkbWluXFYy6gIiR29vZ2xlOjpD", "bG91ZDo6QmlndGFibGU6OkFkbWluOjpWMupBpgEKKGNsb3Vka21zLmdvb2ds", "ZWFwaXMuY29tL0NyeXB0b0tleVZlcnNpb24SenByb2plY3RzL3twcm9qZWN0", "fS9sb2NhdGlvbnMve2xvY2F0aW9ufS9rZXlSaW5ncy97a2V5X3Jpbmd9L2Ny", "eXB0b0tleXMve2NyeXB0b19rZXl9L2NyeXB0b0tleVZlcnNpb25zL3tjcnlw", "dG9fa2V5X3ZlcnNpb259YgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Rpc.StatusReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo), global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo.Parser, new[]{ "SourceType", "BackupInfo" }, new[]{ "SourceInfo" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.Table), global::Google.Cloud.Bigtable.Admin.V2.Table.Parser, new[]{ "Name", "ClusterStates", "ColumnFamilies", "Granularity", "RestoreInfo" }, null, new[]{ typeof(global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity), typeof(global::Google.Cloud.Bigtable.Admin.V2.Table.Types.View) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState), global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Parser, new[]{ "ReplicationState", "EncryptionInfo" }, null, new[]{ typeof(global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState) }, null, null), null, null, }), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily), global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily.Parser, new[]{ "GcRule" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.GcRule), global::Google.Cloud.Bigtable.Admin.V2.GcRule.Parser, new[]{ "MaxNumVersions", "MaxAge", "Intersection", "Union" }, new[]{ "Rule" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection), global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection.Parser, new[]{ "Rules" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union), global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union.Parser, new[]{ "Rules" }, null, null, null, null)}), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo), global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Parser, new[]{ "EncryptionType", "EncryptionStatus", "KmsKeyVersion" }, null, new[]{ typeof(global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType) }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.Snapshot), global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Parser, new[]{ "Name", "SourceTable", "DataSizeBytes", "CreateTime", "DeleteTime", "State", "Description" }, null, new[]{ typeof(global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State) }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.Backup), global::Google.Cloud.Bigtable.Admin.V2.Backup.Parser, new[]{ "Name", "SourceTable", "ExpireTime", "StartTime", "EndTime", "SizeBytes", "State", "EncryptionInfo" }, null, new[]{ typeof(global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State) }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Bigtable.Admin.V2.BackupInfo), global::Google.Cloud.Bigtable.Admin.V2.BackupInfo.Parser, new[]{ "Backup", "StartTime", "EndTime", "SourceTable" }, null, null, null, null) })); } #endregion } #region Enums /// <summary> /// Indicates the type of the restore source. /// </summary> public enum RestoreSourceType { /// <summary> /// No restore associated. /// </summary> [pbr::OriginalName("RESTORE_SOURCE_TYPE_UNSPECIFIED")] Unspecified = 0, /// <summary> /// A backup was used as the source of the restore. /// </summary> [pbr::OriginalName("BACKUP")] Backup = 1, } #endregion #region Messages /// <summary> /// Information about a table restore. /// </summary> public sealed partial class RestoreInfo : pb::IMessage<RestoreInfo> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<RestoreInfo> _parser = new pb::MessageParser<RestoreInfo>(() => new RestoreInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<RestoreInfo> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RestoreInfo() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RestoreInfo(RestoreInfo other) : this() { sourceType_ = other.sourceType_; switch (other.SourceInfoCase) { case SourceInfoOneofCase.BackupInfo: BackupInfo = other.BackupInfo.Clone(); break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RestoreInfo Clone() { return new RestoreInfo(this); } /// <summary>Field number for the "source_type" field.</summary> public const int SourceTypeFieldNumber = 1; private global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType sourceType_ = global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified; /// <summary> /// The type of the restore source. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType SourceType { get { return sourceType_; } set { sourceType_ = value; } } /// <summary>Field number for the "backup_info" field.</summary> public const int BackupInfoFieldNumber = 2; /// <summary> /// Information about the backup used to restore the table. The backup /// may no longer exist. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.BackupInfo BackupInfo { get { return sourceInfoCase_ == SourceInfoOneofCase.BackupInfo ? (global::Google.Cloud.Bigtable.Admin.V2.BackupInfo) sourceInfo_ : null; } set { sourceInfo_ = value; sourceInfoCase_ = value == null ? SourceInfoOneofCase.None : SourceInfoOneofCase.BackupInfo; } } private object sourceInfo_; /// <summary>Enum of possible cases for the "source_info" oneof.</summary> public enum SourceInfoOneofCase { None = 0, BackupInfo = 2, } private SourceInfoOneofCase sourceInfoCase_ = SourceInfoOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SourceInfoOneofCase SourceInfoCase { get { return sourceInfoCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearSourceInfo() { sourceInfoCase_ = SourceInfoOneofCase.None; sourceInfo_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as RestoreInfo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(RestoreInfo other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (SourceType != other.SourceType) return false; if (!object.Equals(BackupInfo, other.BackupInfo)) return false; if (SourceInfoCase != other.SourceInfoCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (SourceType != global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified) hash ^= SourceType.GetHashCode(); if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) hash ^= BackupInfo.GetHashCode(); hash ^= (int) sourceInfoCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (SourceType != global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified) { output.WriteRawTag(8); output.WriteEnum((int) SourceType); } if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) { output.WriteRawTag(18); output.WriteMessage(BackupInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (SourceType != global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified) { output.WriteRawTag(8); output.WriteEnum((int) SourceType); } if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) { output.WriteRawTag(18); output.WriteMessage(BackupInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (SourceType != global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SourceType); } if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(BackupInfo); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(RestoreInfo other) { if (other == null) { return; } if (other.SourceType != global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType.Unspecified) { SourceType = other.SourceType; } switch (other.SourceInfoCase) { case SourceInfoOneofCase.BackupInfo: if (BackupInfo == null) { BackupInfo = new global::Google.Cloud.Bigtable.Admin.V2.BackupInfo(); } BackupInfo.MergeFrom(other.BackupInfo); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { SourceType = (global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType) input.ReadEnum(); break; } case 18: { global::Google.Cloud.Bigtable.Admin.V2.BackupInfo subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.BackupInfo(); if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) { subBuilder.MergeFrom(BackupInfo); } input.ReadMessage(subBuilder); BackupInfo = subBuilder; break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { SourceType = (global::Google.Cloud.Bigtable.Admin.V2.RestoreSourceType) input.ReadEnum(); break; } case 18: { global::Google.Cloud.Bigtable.Admin.V2.BackupInfo subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.BackupInfo(); if (sourceInfoCase_ == SourceInfoOneofCase.BackupInfo) { subBuilder.MergeFrom(BackupInfo); } input.ReadMessage(subBuilder); BackupInfo = subBuilder; break; } } } } #endif } /// <summary> /// A collection of user data indexed by row, column, and timestamp. /// Each table is served using the resources of its parent cluster. /// </summary> public sealed partial class Table : pb::IMessage<Table> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<Table> _parser = new pb::MessageParser<Table>(() => new Table()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<Table> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Table() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Table(Table other) : this() { name_ = other.name_; clusterStates_ = other.clusterStates_.Clone(); columnFamilies_ = other.columnFamilies_.Clone(); granularity_ = other.granularity_; restoreInfo_ = other.restoreInfo_ != null ? other.restoreInfo_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Table Clone() { return new Table(this); } /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; /// <summary> /// The unique name of the table. Values are of the form /// `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. /// Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "cluster_states" field.</summary> public const int ClusterStatesFieldNumber = 2; private static readonly pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState>.Codec _map_clusterStates_codec = new pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Parser), 18); private readonly pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState> clusterStates_ = new pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState>(); /// <summary> /// Output only. Map from cluster ID to per-cluster table state. /// If it could not be determined whether or not the table has data in a /// particular cluster (for example, if its zone is unavailable), then /// there will be an entry for the cluster with UNKNOWN `replication_status`. /// Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState> ClusterStates { get { return clusterStates_; } } /// <summary>Field number for the "column_families" field.</summary> public const int ColumnFamiliesFieldNumber = 3; private static readonly pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily>.Codec _map_columnFamilies_codec = new pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily>.Codec(pb::FieldCodec.ForString(10, ""), pb::FieldCodec.ForMessage(18, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily.Parser), 26); private readonly pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily> columnFamilies_ = new pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily>(); /// <summary> /// (`CreationOnly`) /// The column families configured for this table, mapped by column family ID. /// Views: `SCHEMA_VIEW`, `FULL` /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::MapField<string, global::Google.Cloud.Bigtable.Admin.V2.ColumnFamily> ColumnFamilies { get { return columnFamilies_; } } /// <summary>Field number for the "granularity" field.</summary> public const int GranularityFieldNumber = 4; private global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity granularity_ = global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified; /// <summary> /// (`CreationOnly`) /// The granularity (i.e. `MILLIS`) at which timestamps are stored in /// this table. Timestamps not matching the granularity will be rejected. /// If unspecified at creation time, the value will be set to `MILLIS`. /// Views: `SCHEMA_VIEW`, `FULL`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity Granularity { get { return granularity_; } set { granularity_ = value; } } /// <summary>Field number for the "restore_info" field.</summary> public const int RestoreInfoFieldNumber = 6; private global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo restoreInfo_; /// <summary> /// Output only. If this table was restored from another data source (e.g. a /// backup), this field will be populated with information about the restore. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo RestoreInfo { get { return restoreInfo_; } set { restoreInfo_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Table); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Table other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Name != other.Name) return false; if (!ClusterStates.Equals(other.ClusterStates)) return false; if (!ColumnFamilies.Equals(other.ColumnFamilies)) return false; if (Granularity != other.Granularity) return false; if (!object.Equals(RestoreInfo, other.RestoreInfo)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); hash ^= ClusterStates.GetHashCode(); hash ^= ColumnFamilies.GetHashCode(); if (Granularity != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified) hash ^= Granularity.GetHashCode(); if (restoreInfo_ != null) hash ^= RestoreInfo.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } clusterStates_.WriteTo(output, _map_clusterStates_codec); columnFamilies_.WriteTo(output, _map_columnFamilies_codec); if (Granularity != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified) { output.WriteRawTag(32); output.WriteEnum((int) Granularity); } if (restoreInfo_ != null) { output.WriteRawTag(50); output.WriteMessage(RestoreInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } clusterStates_.WriteTo(ref output, _map_clusterStates_codec); columnFamilies_.WriteTo(ref output, _map_columnFamilies_codec); if (Granularity != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified) { output.WriteRawTag(32); output.WriteEnum((int) Granularity); } if (restoreInfo_ != null) { output.WriteRawTag(50); output.WriteMessage(RestoreInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } size += clusterStates_.CalculateSize(_map_clusterStates_codec); size += columnFamilies_.CalculateSize(_map_columnFamilies_codec); if (Granularity != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Granularity); } if (restoreInfo_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(RestoreInfo); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Table other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } clusterStates_.Add(other.clusterStates_); columnFamilies_.Add(other.columnFamilies_); if (other.Granularity != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity.Unspecified) { Granularity = other.Granularity; } if (other.restoreInfo_ != null) { if (restoreInfo_ == null) { RestoreInfo = new global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo(); } RestoreInfo.MergeFrom(other.RestoreInfo); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); break; } case 18: { clusterStates_.AddEntriesFrom(input, _map_clusterStates_codec); break; } case 26: { columnFamilies_.AddEntriesFrom(input, _map_columnFamilies_codec); break; } case 32: { Granularity = (global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity) input.ReadEnum(); break; } case 50: { if (restoreInfo_ == null) { RestoreInfo = new global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo(); } input.ReadMessage(RestoreInfo); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { Name = input.ReadString(); break; } case 18: { clusterStates_.AddEntriesFrom(ref input, _map_clusterStates_codec); break; } case 26: { columnFamilies_.AddEntriesFrom(ref input, _map_columnFamilies_codec); break; } case 32: { Granularity = (global::Google.Cloud.Bigtable.Admin.V2.Table.Types.TimestampGranularity) input.ReadEnum(); break; } case 50: { if (restoreInfo_ == null) { RestoreInfo = new global::Google.Cloud.Bigtable.Admin.V2.RestoreInfo(); } input.ReadMessage(RestoreInfo); break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the Table message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// Possible timestamp granularities to use when keeping multiple versions /// of data in a table. /// </summary> public enum TimestampGranularity { /// <summary> /// The user did not specify a granularity. Should not be returned. /// When specified during table creation, MILLIS will be used. /// </summary> [pbr::OriginalName("TIMESTAMP_GRANULARITY_UNSPECIFIED")] Unspecified = 0, /// <summary> /// The table keeps data versioned at a granularity of 1ms. /// </summary> [pbr::OriginalName("MILLIS")] Millis = 1, } /// <summary> /// Defines a view over a table's fields. /// </summary> public enum View { /// <summary> /// Uses the default view for each method as documented in its request. /// </summary> [pbr::OriginalName("VIEW_UNSPECIFIED")] Unspecified = 0, /// <summary> /// Only populates `name`. /// </summary> [pbr::OriginalName("NAME_ONLY")] NameOnly = 1, /// <summary> /// Only populates `name` and fields related to the table's schema. /// </summary> [pbr::OriginalName("SCHEMA_VIEW")] SchemaView = 2, /// <summary> /// Only populates `name` and fields related to the table's replication /// state. /// </summary> [pbr::OriginalName("REPLICATION_VIEW")] ReplicationView = 3, /// <summary> /// Only populates 'name' and fields related to the table's encryption state. /// </summary> [pbr::OriginalName("ENCRYPTION_VIEW")] EncryptionView = 5, /// <summary> /// Populates all fields. /// </summary> [pbr::OriginalName("FULL")] Full = 4, } /// <summary> /// The state of a table's data in a particular cluster. /// </summary> public sealed partial class ClusterState : pb::IMessage<ClusterState> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<ClusterState> _parser = new pb::MessageParser<ClusterState>(() => new ClusterState()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<ClusterState> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.Table.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ClusterState() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ClusterState(ClusterState other) : this() { replicationState_ = other.replicationState_; encryptionInfo_ = other.encryptionInfo_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ClusterState Clone() { return new ClusterState(this); } /// <summary>Field number for the "replication_state" field.</summary> public const int ReplicationStateFieldNumber = 1; private global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState replicationState_ = global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown; /// <summary> /// Output only. The state of replication for the table in this cluster. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState ReplicationState { get { return replicationState_; } set { replicationState_ = value; } } /// <summary>Field number for the "encryption_info" field.</summary> public const int EncryptionInfoFieldNumber = 2; private static readonly pb::FieldCodec<global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo> _repeated_encryptionInfo_codec = pb::FieldCodec.ForMessage(18, global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Parser); private readonly pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo> encryptionInfo_ = new pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo>(); /// <summary> /// Output only. The encryption information for the table in this cluster. /// If the encryption key protecting this resource is customer managed, then /// its version can be rotated in Cloud Key Management Service (Cloud KMS). /// The primary version of the key and its status will be reflected here when /// changes propagate from Cloud KMS. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo> EncryptionInfo { get { return encryptionInfo_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ClusterState); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ClusterState other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (ReplicationState != other.ReplicationState) return false; if(!encryptionInfo_.Equals(other.encryptionInfo_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ReplicationState != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown) hash ^= ReplicationState.GetHashCode(); hash ^= encryptionInfo_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (ReplicationState != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown) { output.WriteRawTag(8); output.WriteEnum((int) ReplicationState); } encryptionInfo_.WriteTo(output, _repeated_encryptionInfo_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ReplicationState != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown) { output.WriteRawTag(8); output.WriteEnum((int) ReplicationState); } encryptionInfo_.WriteTo(ref output, _repeated_encryptionInfo_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ReplicationState != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ReplicationState); } size += encryptionInfo_.CalculateSize(_repeated_encryptionInfo_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ClusterState other) { if (other == null) { return; } if (other.ReplicationState != global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState.StateNotKnown) { ReplicationState = other.ReplicationState; } encryptionInfo_.Add(other.encryptionInfo_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { ReplicationState = (global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState) input.ReadEnum(); break; } case 18: { encryptionInfo_.AddEntriesFrom(input, _repeated_encryptionInfo_codec); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { ReplicationState = (global::Google.Cloud.Bigtable.Admin.V2.Table.Types.ClusterState.Types.ReplicationState) input.ReadEnum(); break; } case 18: { encryptionInfo_.AddEntriesFrom(ref input, _repeated_encryptionInfo_codec); break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the ClusterState message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// Table replication states. /// </summary> public enum ReplicationState { /// <summary> /// The replication state of the table is unknown in this cluster. /// </summary> [pbr::OriginalName("STATE_NOT_KNOWN")] StateNotKnown = 0, /// <summary> /// The cluster was recently created, and the table must finish copying /// over pre-existing data from other clusters before it can begin /// receiving live replication updates and serving Data API requests. /// </summary> [pbr::OriginalName("INITIALIZING")] Initializing = 1, /// <summary> /// The table is temporarily unable to serve Data API requests from this /// cluster due to planned internal maintenance. /// </summary> [pbr::OriginalName("PLANNED_MAINTENANCE")] PlannedMaintenance = 2, /// <summary> /// The table is temporarily unable to serve Data API requests from this /// cluster due to unplanned or emergency maintenance. /// </summary> [pbr::OriginalName("UNPLANNED_MAINTENANCE")] UnplannedMaintenance = 3, /// <summary> /// The table can serve Data API requests from this cluster. Depending on /// replication delay, reads may not immediately reflect the state of the /// table in other clusters. /// </summary> [pbr::OriginalName("READY")] Ready = 4, /// <summary> /// The table is fully created and ready for use after a restore, and is /// being optimized for performance. When optimizations are complete, the /// table will transition to `READY` state. /// </summary> [pbr::OriginalName("READY_OPTIMIZING")] ReadyOptimizing = 5, } } #endregion } } #endregion } /// <summary> /// A set of columns within a table which share a common configuration. /// </summary> public sealed partial class ColumnFamily : pb::IMessage<ColumnFamily> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<ColumnFamily> _parser = new pb::MessageParser<ColumnFamily>(() => new ColumnFamily()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<ColumnFamily> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ColumnFamily() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ColumnFamily(ColumnFamily other) : this() { gcRule_ = other.gcRule_ != null ? other.gcRule_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ColumnFamily Clone() { return new ColumnFamily(this); } /// <summary>Field number for the "gc_rule" field.</summary> public const int GcRuleFieldNumber = 1; private global::Google.Cloud.Bigtable.Admin.V2.GcRule gcRule_; /// <summary> /// Garbage collection rule specified as a protobuf. /// Must serialize to at most 500 bytes. /// /// NOTE: Garbage collection executes opportunistically in the background, and /// so it's possible for reads to return a cell even if it matches the active /// GC expression for its family. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.GcRule GcRule { get { return gcRule_; } set { gcRule_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ColumnFamily); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ColumnFamily other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (!object.Equals(GcRule, other.GcRule)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (gcRule_ != null) hash ^= GcRule.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (gcRule_ != null) { output.WriteRawTag(10); output.WriteMessage(GcRule); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (gcRule_ != null) { output.WriteRawTag(10); output.WriteMessage(GcRule); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (gcRule_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(GcRule); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ColumnFamily other) { if (other == null) { return; } if (other.gcRule_ != null) { if (gcRule_ == null) { GcRule = new global::Google.Cloud.Bigtable.Admin.V2.GcRule(); } GcRule.MergeFrom(other.GcRule); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (gcRule_ == null) { GcRule = new global::Google.Cloud.Bigtable.Admin.V2.GcRule(); } input.ReadMessage(GcRule); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { if (gcRule_ == null) { GcRule = new global::Google.Cloud.Bigtable.Admin.V2.GcRule(); } input.ReadMessage(GcRule); break; } } } } #endif } /// <summary> /// Rule for determining which cells to delete during garbage collection. /// </summary> public sealed partial class GcRule : pb::IMessage<GcRule> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<GcRule> _parser = new pb::MessageParser<GcRule>(() => new GcRule()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<GcRule> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GcRule() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GcRule(GcRule other) : this() { switch (other.RuleCase) { case RuleOneofCase.MaxNumVersions: MaxNumVersions = other.MaxNumVersions; break; case RuleOneofCase.MaxAge: MaxAge = other.MaxAge.Clone(); break; case RuleOneofCase.Intersection: Intersection = other.Intersection.Clone(); break; case RuleOneofCase.Union: Union = other.Union.Clone(); break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GcRule Clone() { return new GcRule(this); } /// <summary>Field number for the "max_num_versions" field.</summary> public const int MaxNumVersionsFieldNumber = 1; /// <summary> /// Delete all cells in a column except the most recent N. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int MaxNumVersions { get { return ruleCase_ == RuleOneofCase.MaxNumVersions ? (int) rule_ : 0; } set { rule_ = value; ruleCase_ = RuleOneofCase.MaxNumVersions; } } /// <summary>Field number for the "max_age" field.</summary> public const int MaxAgeFieldNumber = 2; /// <summary> /// Delete cells in a column older than the given age. /// Values must be at least one millisecond, and will be truncated to /// microsecond granularity. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Duration MaxAge { get { return ruleCase_ == RuleOneofCase.MaxAge ? (global::Google.Protobuf.WellKnownTypes.Duration) rule_ : null; } set { rule_ = value; ruleCase_ = value == null ? RuleOneofCase.None : RuleOneofCase.MaxAge; } } /// <summary>Field number for the "intersection" field.</summary> public const int IntersectionFieldNumber = 3; /// <summary> /// Delete cells that would be deleted by every nested rule. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection Intersection { get { return ruleCase_ == RuleOneofCase.Intersection ? (global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection) rule_ : null; } set { rule_ = value; ruleCase_ = value == null ? RuleOneofCase.None : RuleOneofCase.Intersection; } } /// <summary>Field number for the "union" field.</summary> public const int UnionFieldNumber = 4; /// <summary> /// Delete cells that would be deleted by any nested rule. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union Union { get { return ruleCase_ == RuleOneofCase.Union ? (global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union) rule_ : null; } set { rule_ = value; ruleCase_ = value == null ? RuleOneofCase.None : RuleOneofCase.Union; } } private object rule_; /// <summary>Enum of possible cases for the "rule" oneof.</summary> public enum RuleOneofCase { None = 0, MaxNumVersions = 1, MaxAge = 2, Intersection = 3, Union = 4, } private RuleOneofCase ruleCase_ = RuleOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public RuleOneofCase RuleCase { get { return ruleCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearRule() { ruleCase_ = RuleOneofCase.None; rule_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GcRule); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GcRule other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (MaxNumVersions != other.MaxNumVersions) return false; if (!object.Equals(MaxAge, other.MaxAge)) return false; if (!object.Equals(Intersection, other.Intersection)) return false; if (!object.Equals(Union, other.Union)) return false; if (RuleCase != other.RuleCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ruleCase_ == RuleOneofCase.MaxNumVersions) hash ^= MaxNumVersions.GetHashCode(); if (ruleCase_ == RuleOneofCase.MaxAge) hash ^= MaxAge.GetHashCode(); if (ruleCase_ == RuleOneofCase.Intersection) hash ^= Intersection.GetHashCode(); if (ruleCase_ == RuleOneofCase.Union) hash ^= Union.GetHashCode(); hash ^= (int) ruleCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (ruleCase_ == RuleOneofCase.MaxNumVersions) { output.WriteRawTag(8); output.WriteInt32(MaxNumVersions); } if (ruleCase_ == RuleOneofCase.MaxAge) { output.WriteRawTag(18); output.WriteMessage(MaxAge); } if (ruleCase_ == RuleOneofCase.Intersection) { output.WriteRawTag(26); output.WriteMessage(Intersection); } if (ruleCase_ == RuleOneofCase.Union) { output.WriteRawTag(34); output.WriteMessage(Union); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ruleCase_ == RuleOneofCase.MaxNumVersions) { output.WriteRawTag(8); output.WriteInt32(MaxNumVersions); } if (ruleCase_ == RuleOneofCase.MaxAge) { output.WriteRawTag(18); output.WriteMessage(MaxAge); } if (ruleCase_ == RuleOneofCase.Intersection) { output.WriteRawTag(26); output.WriteMessage(Intersection); } if (ruleCase_ == RuleOneofCase.Union) { output.WriteRawTag(34); output.WriteMessage(Union); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ruleCase_ == RuleOneofCase.MaxNumVersions) { size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumVersions); } if (ruleCase_ == RuleOneofCase.MaxAge) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(MaxAge); } if (ruleCase_ == RuleOneofCase.Intersection) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Intersection); } if (ruleCase_ == RuleOneofCase.Union) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Union); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GcRule other) { if (other == null) { return; } switch (other.RuleCase) { case RuleOneofCase.MaxNumVersions: MaxNumVersions = other.MaxNumVersions; break; case RuleOneofCase.MaxAge: if (MaxAge == null) { MaxAge = new global::Google.Protobuf.WellKnownTypes.Duration(); } MaxAge.MergeFrom(other.MaxAge); break; case RuleOneofCase.Intersection: if (Intersection == null) { Intersection = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection(); } Intersection.MergeFrom(other.Intersection); break; case RuleOneofCase.Union: if (Union == null) { Union = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union(); } Union.MergeFrom(other.Union); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 8: { MaxNumVersions = input.ReadInt32(); break; } case 18: { global::Google.Protobuf.WellKnownTypes.Duration subBuilder = new global::Google.Protobuf.WellKnownTypes.Duration(); if (ruleCase_ == RuleOneofCase.MaxAge) { subBuilder.MergeFrom(MaxAge); } input.ReadMessage(subBuilder); MaxAge = subBuilder; break; } case 26: { global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection(); if (ruleCase_ == RuleOneofCase.Intersection) { subBuilder.MergeFrom(Intersection); } input.ReadMessage(subBuilder); Intersection = subBuilder; break; } case 34: { global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union(); if (ruleCase_ == RuleOneofCase.Union) { subBuilder.MergeFrom(Union); } input.ReadMessage(subBuilder); Union = subBuilder; break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 8: { MaxNumVersions = input.ReadInt32(); break; } case 18: { global::Google.Protobuf.WellKnownTypes.Duration subBuilder = new global::Google.Protobuf.WellKnownTypes.Duration(); if (ruleCase_ == RuleOneofCase.MaxAge) { subBuilder.MergeFrom(MaxAge); } input.ReadMessage(subBuilder); MaxAge = subBuilder; break; } case 26: { global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Intersection(); if (ruleCase_ == RuleOneofCase.Intersection) { subBuilder.MergeFrom(Intersection); } input.ReadMessage(subBuilder); Intersection = subBuilder; break; } case 34: { global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union subBuilder = new global::Google.Cloud.Bigtable.Admin.V2.GcRule.Types.Union(); if (ruleCase_ == RuleOneofCase.Union) { subBuilder.MergeFrom(Union); } input.ReadMessage(subBuilder); Union = subBuilder; break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the GcRule message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// A GcRule which deletes cells matching all of the given rules. /// </summary> public sealed partial class Intersection : pb::IMessage<Intersection> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<Intersection> _parser = new pb::MessageParser<Intersection>(() => new Intersection()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<Intersection> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.GcRule.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Intersection() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Intersection(Intersection other) : this() { rules_ = other.rules_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Intersection Clone() { return new Intersection(this); } /// <summary>Field number for the "rules" field.</summary> public const int RulesFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Cloud.Bigtable.Admin.V2.GcRule> _repeated_rules_codec = pb::FieldCodec.ForMessage(10, global::Google.Cloud.Bigtable.Admin.V2.GcRule.Parser); private readonly pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule> rules_ = new pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule>(); /// <summary> /// Only delete cells which would be deleted by every element of `rules`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule> Rules { get { return rules_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Intersection); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Intersection other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if(!rules_.Equals(other.rules_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= rules_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else rules_.WriteTo(output, _repeated_rules_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { rules_.WriteTo(ref output, _repeated_rules_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += rules_.CalculateSize(_repeated_rules_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Intersection other) { if (other == null) { return; } rules_.Add(other.rules_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { rules_.AddEntriesFrom(input, _repeated_rules_codec); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { rules_.AddEntriesFrom(ref input, _repeated_rules_codec); break; } } } } #endif } /// <summary> /// A GcRule which deletes cells matching any of the given rules. /// </summary> public sealed partial class Union : pb::IMessage<Union> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<Union> _parser = new pb::MessageParser<Union>(() => new Union()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<Union> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.GcRule.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Union() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Union(Union other) : this() { rules_ = other.rules_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Union Clone() { return new Union(this); } /// <summary>Field number for the "rules" field.</summary> public const int RulesFieldNumber = 1; private static readonly pb::FieldCodec<global::Google.Cloud.Bigtable.Admin.V2.GcRule> _repeated_rules_codec = pb::FieldCodec.ForMessage(10, global::Google.Cloud.Bigtable.Admin.V2.GcRule.Parser); private readonly pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule> rules_ = new pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule>(); /// <summary> /// Delete cells which would be deleted by any element of `rules`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField<global::Google.Cloud.Bigtable.Admin.V2.GcRule> Rules { get { return rules_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Union); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Union other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if(!rules_.Equals(other.rules_)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= rules_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else rules_.WriteTo(output, _repeated_rules_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { rules_.WriteTo(ref output, _repeated_rules_codec); if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += rules_.CalculateSize(_repeated_rules_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Union other) { if (other == null) { return; } rules_.Add(other.rules_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { rules_.AddEntriesFrom(input, _repeated_rules_codec); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { rules_.AddEntriesFrom(ref input, _repeated_rules_codec); break; } } } } #endif } } #endregion } /// <summary> /// Encryption information for a given resource. /// If this resource is protected with customer managed encryption, the in-use /// Cloud Key Management Service (Cloud KMS) key version is specified along with /// its status. /// </summary> public sealed partial class EncryptionInfo : pb::IMessage<EncryptionInfo> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<EncryptionInfo> _parser = new pb::MessageParser<EncryptionInfo>(() => new EncryptionInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<EncryptionInfo> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EncryptionInfo() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EncryptionInfo(EncryptionInfo other) : this() { encryptionType_ = other.encryptionType_; encryptionStatus_ = other.encryptionStatus_ != null ? other.encryptionStatus_.Clone() : null; kmsKeyVersion_ = other.kmsKeyVersion_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public EncryptionInfo Clone() { return new EncryptionInfo(this); } /// <summary>Field number for the "encryption_type" field.</summary> public const int EncryptionTypeFieldNumber = 3; private global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType encryptionType_ = global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified; /// <summary> /// Output only. The type of encryption used to protect this resource. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType EncryptionType { get { return encryptionType_; } set { encryptionType_ = value; } } /// <summary>Field number for the "encryption_status" field.</summary> public const int EncryptionStatusFieldNumber = 4; private global::Google.Rpc.Status encryptionStatus_; /// <summary> /// Output only. The status of encrypt/decrypt calls on underlying data for /// this resource. Regardless of status, the existing data is always encrypted /// at rest. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Rpc.Status EncryptionStatus { get { return encryptionStatus_; } set { encryptionStatus_ = value; } } /// <summary>Field number for the "kms_key_version" field.</summary> public const int KmsKeyVersionFieldNumber = 2; private string kmsKeyVersion_ = ""; /// <summary> /// Output only. The version of the Cloud KMS key specified in the parent /// cluster that is in use for the data underlying this table. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string KmsKeyVersion { get { return kmsKeyVersion_; } set { kmsKeyVersion_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as EncryptionInfo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(EncryptionInfo other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (EncryptionType != other.EncryptionType) return false; if (!object.Equals(EncryptionStatus, other.EncryptionStatus)) return false; if (KmsKeyVersion != other.KmsKeyVersion) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (EncryptionType != global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified) hash ^= EncryptionType.GetHashCode(); if (encryptionStatus_ != null) hash ^= EncryptionStatus.GetHashCode(); if (KmsKeyVersion.Length != 0) hash ^= KmsKeyVersion.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (KmsKeyVersion.Length != 0) { output.WriteRawTag(18); output.WriteString(KmsKeyVersion); } if (EncryptionType != global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified) { output.WriteRawTag(24); output.WriteEnum((int) EncryptionType); } if (encryptionStatus_ != null) { output.WriteRawTag(34); output.WriteMessage(EncryptionStatus); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (KmsKeyVersion.Length != 0) { output.WriteRawTag(18); output.WriteString(KmsKeyVersion); } if (EncryptionType != global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified) { output.WriteRawTag(24); output.WriteEnum((int) EncryptionType); } if (encryptionStatus_ != null) { output.WriteRawTag(34); output.WriteMessage(EncryptionStatus); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (EncryptionType != global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) EncryptionType); } if (encryptionStatus_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(EncryptionStatus); } if (KmsKeyVersion.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(KmsKeyVersion); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(EncryptionInfo other) { if (other == null) { return; } if (other.EncryptionType != global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType.Unspecified) { EncryptionType = other.EncryptionType; } if (other.encryptionStatus_ != null) { if (encryptionStatus_ == null) { EncryptionStatus = new global::Google.Rpc.Status(); } EncryptionStatus.MergeFrom(other.EncryptionStatus); } if (other.KmsKeyVersion.Length != 0) { KmsKeyVersion = other.KmsKeyVersion; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 18: { KmsKeyVersion = input.ReadString(); break; } case 24: { EncryptionType = (global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType) input.ReadEnum(); break; } case 34: { if (encryptionStatus_ == null) { EncryptionStatus = new global::Google.Rpc.Status(); } input.ReadMessage(EncryptionStatus); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 18: { KmsKeyVersion = input.ReadString(); break; } case 24: { EncryptionType = (global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo.Types.EncryptionType) input.ReadEnum(); break; } case 34: { if (encryptionStatus_ == null) { EncryptionStatus = new global::Google.Rpc.Status(); } input.ReadMessage(EncryptionStatus); break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the EncryptionInfo message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// Possible encryption types for a resource. /// </summary> public enum EncryptionType { /// <summary> /// Encryption type was not specified, though data at rest remains encrypted. /// </summary> [pbr::OriginalName("ENCRYPTION_TYPE_UNSPECIFIED")] Unspecified = 0, /// <summary> /// The data backing this resource is encrypted at rest with a key that is /// fully managed by Google. No key version or status will be populated. /// This is the default state. /// </summary> [pbr::OriginalName("GOOGLE_DEFAULT_ENCRYPTION")] GoogleDefaultEncryption = 1, /// <summary> /// The data backing this resource is encrypted at rest with a key that is /// managed by the customer. /// The in-use version of the key and its status are populated for /// CMEK-protected tables. /// CMEK-protected backups are pinned to the key version that was in use at /// the time the backup was taken. This key version is populated but its /// status is not tracked and is reported as `UNKNOWN`. /// </summary> [pbr::OriginalName("CUSTOMER_MANAGED_ENCRYPTION")] CustomerManagedEncryption = 2, } } #endregion } /// <summary> /// A snapshot of a table at a particular time. A snapshot can be used as a /// checkpoint for data restoration or a data source for a new table. /// /// Note: This is a private alpha release of Cloud Bigtable snapshots. This /// feature is not currently available to most Cloud Bigtable customers. This /// feature might be changed in backward-incompatible ways and is not recommended /// for production use. It is not subject to any SLA or deprecation policy. /// </summary> public sealed partial class Snapshot : pb::IMessage<Snapshot> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<Snapshot> _parser = new pb::MessageParser<Snapshot>(() => new Snapshot()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<Snapshot> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Snapshot() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Snapshot(Snapshot other) : this() { name_ = other.name_; sourceTable_ = other.sourceTable_ != null ? other.sourceTable_.Clone() : null; dataSizeBytes_ = other.dataSizeBytes_; createTime_ = other.createTime_ != null ? other.createTime_.Clone() : null; deleteTime_ = other.deleteTime_ != null ? other.deleteTime_.Clone() : null; state_ = other.state_; description_ = other.description_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Snapshot Clone() { return new Snapshot(this); } /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; /// <summary> /// Output only. The unique name of the snapshot. /// Values are of the form /// `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "source_table" field.</summary> public const int SourceTableFieldNumber = 2; private global::Google.Cloud.Bigtable.Admin.V2.Table sourceTable_; /// <summary> /// Output only. The source table at the time the snapshot was taken. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.Table SourceTable { get { return sourceTable_; } set { sourceTable_ = value; } } /// <summary>Field number for the "data_size_bytes" field.</summary> public const int DataSizeBytesFieldNumber = 3; private long dataSizeBytes_; /// <summary> /// Output only. The size of the data in the source table at the time the /// snapshot was taken. In some cases, this value may be computed /// asynchronously via a background process and a placeholder of 0 will be used /// in the meantime. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DataSizeBytes { get { return dataSizeBytes_; } set { dataSizeBytes_ = value; } } /// <summary>Field number for the "create_time" field.</summary> public const int CreateTimeFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Timestamp createTime_; /// <summary> /// Output only. The time when the snapshot is created. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp CreateTime { get { return createTime_; } set { createTime_ = value; } } /// <summary>Field number for the "delete_time" field.</summary> public const int DeleteTimeFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.Timestamp deleteTime_; /// <summary> /// Output only. The time when the snapshot will be deleted. The maximum amount /// of time a snapshot can stay active is 365 days. If 'ttl' is not specified, /// the default maximum of 365 days will be used. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp DeleteTime { get { return deleteTime_; } set { deleteTime_ = value; } } /// <summary>Field number for the "state" field.</summary> public const int StateFieldNumber = 6; private global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State state_ = global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown; /// <summary> /// Output only. The current state of the snapshot. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State State { get { return state_; } set { state_ = value; } } /// <summary>Field number for the "description" field.</summary> public const int DescriptionFieldNumber = 7; private string description_ = ""; /// <summary> /// Output only. Description of the snapshot. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Description { get { return description_; } set { description_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Snapshot); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Snapshot other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Name != other.Name) return false; if (!object.Equals(SourceTable, other.SourceTable)) return false; if (DataSizeBytes != other.DataSizeBytes) return false; if (!object.Equals(CreateTime, other.CreateTime)) return false; if (!object.Equals(DeleteTime, other.DeleteTime)) return false; if (State != other.State) return false; if (Description != other.Description) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); if (sourceTable_ != null) hash ^= SourceTable.GetHashCode(); if (DataSizeBytes != 0L) hash ^= DataSizeBytes.GetHashCode(); if (createTime_ != null) hash ^= CreateTime.GetHashCode(); if (deleteTime_ != null) hash ^= DeleteTime.GetHashCode(); if (State != global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown) hash ^= State.GetHashCode(); if (Description.Length != 0) hash ^= Description.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } if (sourceTable_ != null) { output.WriteRawTag(18); output.WriteMessage(SourceTable); } if (DataSizeBytes != 0L) { output.WriteRawTag(24); output.WriteInt64(DataSizeBytes); } if (createTime_ != null) { output.WriteRawTag(34); output.WriteMessage(CreateTime); } if (deleteTime_ != null) { output.WriteRawTag(42); output.WriteMessage(DeleteTime); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown) { output.WriteRawTag(48); output.WriteEnum((int) State); } if (Description.Length != 0) { output.WriteRawTag(58); output.WriteString(Description); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } if (sourceTable_ != null) { output.WriteRawTag(18); output.WriteMessage(SourceTable); } if (DataSizeBytes != 0L) { output.WriteRawTag(24); output.WriteInt64(DataSizeBytes); } if (createTime_ != null) { output.WriteRawTag(34); output.WriteMessage(CreateTime); } if (deleteTime_ != null) { output.WriteRawTag(42); output.WriteMessage(DeleteTime); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown) { output.WriteRawTag(48); output.WriteEnum((int) State); } if (Description.Length != 0) { output.WriteRawTag(58); output.WriteString(Description); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } if (sourceTable_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceTable); } if (DataSizeBytes != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(DataSizeBytes); } if (createTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(CreateTime); } if (deleteTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(DeleteTime); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) State); } if (Description.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Description); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Snapshot other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.sourceTable_ != null) { if (sourceTable_ == null) { SourceTable = new global::Google.Cloud.Bigtable.Admin.V2.Table(); } SourceTable.MergeFrom(other.SourceTable); } if (other.DataSizeBytes != 0L) { DataSizeBytes = other.DataSizeBytes; } if (other.createTime_ != null) { if (createTime_ == null) { CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } CreateTime.MergeFrom(other.CreateTime); } if (other.deleteTime_ != null) { if (deleteTime_ == null) { DeleteTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } DeleteTime.MergeFrom(other.DeleteTime); } if (other.State != global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State.NotKnown) { State = other.State; } if (other.Description.Length != 0) { Description = other.Description; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); break; } case 18: { if (sourceTable_ == null) { SourceTable = new global::Google.Cloud.Bigtable.Admin.V2.Table(); } input.ReadMessage(SourceTable); break; } case 24: { DataSizeBytes = input.ReadInt64(); break; } case 34: { if (createTime_ == null) { CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(CreateTime); break; } case 42: { if (deleteTime_ == null) { DeleteTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(DeleteTime); break; } case 48: { State = (global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State) input.ReadEnum(); break; } case 58: { Description = input.ReadString(); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { Name = input.ReadString(); break; } case 18: { if (sourceTable_ == null) { SourceTable = new global::Google.Cloud.Bigtable.Admin.V2.Table(); } input.ReadMessage(SourceTable); break; } case 24: { DataSizeBytes = input.ReadInt64(); break; } case 34: { if (createTime_ == null) { CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(CreateTime); break; } case 42: { if (deleteTime_ == null) { DeleteTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(DeleteTime); break; } case 48: { State = (global::Google.Cloud.Bigtable.Admin.V2.Snapshot.Types.State) input.ReadEnum(); break; } case 58: { Description = input.ReadString(); break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the Snapshot message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// Possible states of a snapshot. /// </summary> public enum State { /// <summary> /// The state of the snapshot could not be determined. /// </summary> [pbr::OriginalName("STATE_NOT_KNOWN")] NotKnown = 0, /// <summary> /// The snapshot has been successfully created and can serve all requests. /// </summary> [pbr::OriginalName("READY")] Ready = 1, /// <summary> /// The snapshot is currently being created, and may be destroyed if the /// creation process encounters an error. A snapshot may not be restored to a /// table while it is being created. /// </summary> [pbr::OriginalName("CREATING")] Creating = 2, } } #endregion } /// <summary> /// A backup of a Cloud Bigtable table. /// </summary> public sealed partial class Backup : pb::IMessage<Backup> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<Backup> _parser = new pb::MessageParser<Backup>(() => new Backup()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<Backup> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Backup() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Backup(Backup other) : this() { name_ = other.name_; sourceTable_ = other.sourceTable_; expireTime_ = other.expireTime_ != null ? other.expireTime_.Clone() : null; startTime_ = other.startTime_ != null ? other.startTime_.Clone() : null; endTime_ = other.endTime_ != null ? other.endTime_.Clone() : null; sizeBytes_ = other.sizeBytes_; state_ = other.state_; encryptionInfo_ = other.encryptionInfo_ != null ? other.encryptionInfo_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Backup Clone() { return new Backup(this); } /// <summary>Field number for the "name" field.</summary> public const int NameFieldNumber = 1; private string name_ = ""; /// <summary> /// Output only. A globally unique identifier for the backup which cannot be /// changed. Values are of the form /// `projects/{project}/instances/{instance}/clusters/{cluster}/ /// backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` /// The final segment of the name must be between 1 and 50 characters /// in length. /// /// The backup is stored in the cluster identified by the prefix of the backup /// name of the form /// `projects/{project}/instances/{instance}/clusters/{cluster}`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "source_table" field.</summary> public const int SourceTableFieldNumber = 2; private string sourceTable_ = ""; /// <summary> /// Required. Immutable. Name of the table from which this backup was created. /// This needs to be in the same instance as the backup. Values are of the form /// `projects/{project}/instances/{instance}/tables/{source_table}`. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SourceTable { get { return sourceTable_; } set { sourceTable_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "expire_time" field.</summary> public const int ExpireTimeFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Timestamp expireTime_; /// <summary> /// Required. The expiration time of the backup, with microseconds /// granularity that must be at least 6 hours and at most 30 days /// from the time the request is received. Once the `expire_time` /// has passed, Cloud Bigtable will delete the backup and free the /// resources used by the backup. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp ExpireTime { get { return expireTime_; } set { expireTime_ = value; } } /// <summary>Field number for the "start_time" field.</summary> public const int StartTimeFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Timestamp startTime_; /// <summary> /// Output only. `start_time` is the time that the backup was started /// (i.e. approximately the time the /// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] /// request is received). The row data in this backup will be no older than /// this timestamp. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp StartTime { get { return startTime_; } set { startTime_ = value; } } /// <summary>Field number for the "end_time" field.</summary> public const int EndTimeFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.Timestamp endTime_; /// <summary> /// Output only. `end_time` is the time that the backup was finished. The row /// data in the backup will be no newer than this timestamp. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp EndTime { get { return endTime_; } set { endTime_ = value; } } /// <summary>Field number for the "size_bytes" field.</summary> public const int SizeBytesFieldNumber = 6; private long sizeBytes_; /// <summary> /// Output only. Size of the backup in bytes. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long SizeBytes { get { return sizeBytes_; } set { sizeBytes_ = value; } } /// <summary>Field number for the "state" field.</summary> public const int StateFieldNumber = 7; private global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State state_ = global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified; /// <summary> /// Output only. The current state of the backup. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State State { get { return state_; } set { state_ = value; } } /// <summary>Field number for the "encryption_info" field.</summary> public const int EncryptionInfoFieldNumber = 9; private global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo encryptionInfo_; /// <summary> /// Output only. The encryption information for the backup. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo EncryptionInfo { get { return encryptionInfo_; } set { encryptionInfo_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Backup); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Backup other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Name != other.Name) return false; if (SourceTable != other.SourceTable) return false; if (!object.Equals(ExpireTime, other.ExpireTime)) return false; if (!object.Equals(StartTime, other.StartTime)) return false; if (!object.Equals(EndTime, other.EndTime)) return false; if (SizeBytes != other.SizeBytes) return false; if (State != other.State) return false; if (!object.Equals(EncryptionInfo, other.EncryptionInfo)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); if (SourceTable.Length != 0) hash ^= SourceTable.GetHashCode(); if (expireTime_ != null) hash ^= ExpireTime.GetHashCode(); if (startTime_ != null) hash ^= StartTime.GetHashCode(); if (endTime_ != null) hash ^= EndTime.GetHashCode(); if (SizeBytes != 0L) hash ^= SizeBytes.GetHashCode(); if (State != global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified) hash ^= State.GetHashCode(); if (encryptionInfo_ != null) hash ^= EncryptionInfo.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } if (SourceTable.Length != 0) { output.WriteRawTag(18); output.WriteString(SourceTable); } if (expireTime_ != null) { output.WriteRawTag(26); output.WriteMessage(ExpireTime); } if (startTime_ != null) { output.WriteRawTag(34); output.WriteMessage(StartTime); } if (endTime_ != null) { output.WriteRawTag(42); output.WriteMessage(EndTime); } if (SizeBytes != 0L) { output.WriteRawTag(48); output.WriteInt64(SizeBytes); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified) { output.WriteRawTag(56); output.WriteEnum((int) State); } if (encryptionInfo_ != null) { output.WriteRawTag(74); output.WriteMessage(EncryptionInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); output.WriteString(Name); } if (SourceTable.Length != 0) { output.WriteRawTag(18); output.WriteString(SourceTable); } if (expireTime_ != null) { output.WriteRawTag(26); output.WriteMessage(ExpireTime); } if (startTime_ != null) { output.WriteRawTag(34); output.WriteMessage(StartTime); } if (endTime_ != null) { output.WriteRawTag(42); output.WriteMessage(EndTime); } if (SizeBytes != 0L) { output.WriteRawTag(48); output.WriteInt64(SizeBytes); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified) { output.WriteRawTag(56); output.WriteEnum((int) State); } if (encryptionInfo_ != null) { output.WriteRawTag(74); output.WriteMessage(EncryptionInfo); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); } if (SourceTable.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(SourceTable); } if (expireTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExpireTime); } if (startTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartTime); } if (endTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(EndTime); } if (SizeBytes != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(SizeBytes); } if (State != global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) State); } if (encryptionInfo_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(EncryptionInfo); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Backup other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.SourceTable.Length != 0) { SourceTable = other.SourceTable; } if (other.expireTime_ != null) { if (expireTime_ == null) { ExpireTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } ExpireTime.MergeFrom(other.ExpireTime); } if (other.startTime_ != null) { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } StartTime.MergeFrom(other.StartTime); } if (other.endTime_ != null) { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EndTime.MergeFrom(other.EndTime); } if (other.SizeBytes != 0L) { SizeBytes = other.SizeBytes; } if (other.State != global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State.Unspecified) { State = other.State; } if (other.encryptionInfo_ != null) { if (encryptionInfo_ == null) { EncryptionInfo = new global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo(); } EncryptionInfo.MergeFrom(other.EncryptionInfo); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Name = input.ReadString(); break; } case 18: { SourceTable = input.ReadString(); break; } case 26: { if (expireTime_ == null) { ExpireTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(ExpireTime); break; } case 34: { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(StartTime); break; } case 42: { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(EndTime); break; } case 48: { SizeBytes = input.ReadInt64(); break; } case 56: { State = (global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State) input.ReadEnum(); break; } case 74: { if (encryptionInfo_ == null) { EncryptionInfo = new global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo(); } input.ReadMessage(EncryptionInfo); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { Name = input.ReadString(); break; } case 18: { SourceTable = input.ReadString(); break; } case 26: { if (expireTime_ == null) { ExpireTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(ExpireTime); break; } case 34: { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(StartTime); break; } case 42: { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(EndTime); break; } case 48: { SizeBytes = input.ReadInt64(); break; } case 56: { State = (global::Google.Cloud.Bigtable.Admin.V2.Backup.Types.State) input.ReadEnum(); break; } case 74: { if (encryptionInfo_ == null) { EncryptionInfo = new global::Google.Cloud.Bigtable.Admin.V2.EncryptionInfo(); } input.ReadMessage(EncryptionInfo); break; } } } } #endif #region Nested types /// <summary>Container for nested types declared in the Backup message type.</summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// <summary> /// Indicates the current state of the backup. /// </summary> public enum State { /// <summary> /// Not specified. /// </summary> [pbr::OriginalName("STATE_UNSPECIFIED")] Unspecified = 0, /// <summary> /// The pending backup is still being created. Operations on the /// backup may fail with `FAILED_PRECONDITION` in this state. /// </summary> [pbr::OriginalName("CREATING")] Creating = 1, /// <summary> /// The backup is complete and ready for use. /// </summary> [pbr::OriginalName("READY")] Ready = 2, } } #endregion } /// <summary> /// Information about a backup. /// </summary> public sealed partial class BackupInfo : pb::IMessage<BackupInfo> #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { private static readonly pb::MessageParser<BackupInfo> _parser = new pb::MessageParser<BackupInfo>(() => new BackupInfo()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser<BackupInfo> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Google.Cloud.Bigtable.Admin.V2.TableReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BackupInfo() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BackupInfo(BackupInfo other) : this() { backup_ = other.backup_; startTime_ = other.startTime_ != null ? other.startTime_.Clone() : null; endTime_ = other.endTime_ != null ? other.endTime_.Clone() : null; sourceTable_ = other.sourceTable_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public BackupInfo Clone() { return new BackupInfo(this); } /// <summary>Field number for the "backup" field.</summary> public const int BackupFieldNumber = 1; private string backup_ = ""; /// <summary> /// Output only. Name of the backup. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Backup { get { return backup_; } set { backup_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// <summary>Field number for the "start_time" field.</summary> public const int StartTimeFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Timestamp startTime_; /// <summary> /// Output only. The time that the backup was started. Row data in the backup /// will be no older than this timestamp. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp StartTime { get { return startTime_; } set { startTime_ = value; } } /// <summary>Field number for the "end_time" field.</summary> public const int EndTimeFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Timestamp endTime_; /// <summary> /// Output only. This time that the backup was finished. Row data in the /// backup will be no newer than this timestamp. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Google.Protobuf.WellKnownTypes.Timestamp EndTime { get { return endTime_; } set { endTime_ = value; } } /// <summary>Field number for the "source_table" field.</summary> public const int SourceTableFieldNumber = 4; private string sourceTable_ = ""; /// <summary> /// Output only. Name of the table the backup was created from. /// </summary> [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string SourceTable { get { return sourceTable_; } set { sourceTable_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as BackupInfo); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(BackupInfo other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Backup != other.Backup) return false; if (!object.Equals(StartTime, other.StartTime)) return false; if (!object.Equals(EndTime, other.EndTime)) return false; if (SourceTable != other.SourceTable) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Backup.Length != 0) hash ^= Backup.GetHashCode(); if (startTime_ != null) hash ^= StartTime.GetHashCode(); if (endTime_ != null) hash ^= EndTime.GetHashCode(); if (SourceTable.Length != 0) hash ^= SourceTable.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); #else if (Backup.Length != 0) { output.WriteRawTag(10); output.WriteString(Backup); } if (startTime_ != null) { output.WriteRawTag(18); output.WriteMessage(StartTime); } if (endTime_ != null) { output.WriteRawTag(26); output.WriteMessage(EndTime); } if (SourceTable.Length != 0) { output.WriteRawTag(34); output.WriteString(SourceTable); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Backup.Length != 0) { output.WriteRawTag(10); output.WriteString(Backup); } if (startTime_ != null) { output.WriteRawTag(18); output.WriteMessage(StartTime); } if (endTime_ != null) { output.WriteRawTag(26); output.WriteMessage(EndTime); } if (SourceTable.Length != 0) { output.WriteRawTag(34); output.WriteString(SourceTable); } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } } #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Backup.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Backup); } if (startTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartTime); } if (endTime_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(EndTime); } if (SourceTable.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(SourceTable); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(BackupInfo other) { if (other == null) { return; } if (other.Backup.Length != 0) { Backup = other.Backup; } if (other.startTime_ != null) { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } StartTime.MergeFrom(other.StartTime); } if (other.endTime_ != null) { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EndTime.MergeFrom(other.EndTime); } if (other.SourceTable.Length != 0) { SourceTable = other.SourceTable; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); #else uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Backup = input.ReadString(); break; } case 18: { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(StartTime); break; } case 26: { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(EndTime); break; } case 34: { SourceTable = input.ReadString(); break; } } } #endif } #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); break; case 10: { Backup = input.ReadString(); break; } case 18: { if (startTime_ == null) { StartTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(StartTime); break; } case 26: { if (endTime_ == null) { EndTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } input.ReadMessage(EndTime); break; } case 34: { SourceTable = input.ReadString(); break; } } } } #endif } #endregion } #endregion Designer generated code
40.232783
777
0.652559
[ "Apache-2.0" ]
AlexandrTrf/google-cloud-dotnet
apis/Google.Cloud.Bigtable.Admin.V2/Google.Cloud.Bigtable.Admin.V2/Table.g.cs
153,649
C#
using System; namespace FastBuild.Dashboard.Services.Worker { internal interface IWorkerAgent { event EventHandler<WorkerRunStateChangedEventArgs> WorkerRunStateChanged; bool IsRunning { get; } void SetCoreCount(int coreCount); void SetWorkerMode(WorkerMode mode); void Initialize(); WorkerCoreStatus[] GetStatus(); } }
22.466667
75
0.780415
[ "MIT" ]
hillin/FASTBuild-Dashboard
Source/Services/Worker/IWorkerAgent.cs
339
C#
using System; using System.Collections.Generic; using CommandLine; namespace Fritz.StaticBlog { class Program { static void Main(string[] args) { var arguments = Parser.Default.ParseArguments<ActionBuild, ActionCreate>(args).MapResult( (ActionBuild options) => options.Execute(), (ActionCreate options) => options.Execute(), errors => 1 ); } } }
17.478261
93
0.654229
[ "MIT" ]
csharpfritz/Fritz.StaticWeb
Fritz.StaticBlog/Program.cs
404
C#
namespace DeltaX.Modules.RealTimeRpcWebSocket { using DeltaX.RealTime.Interfaces; using DeltaX.RealTime.RtExpression; using System; using System.Collections.Generic; using System.Linq; public class TagChangeTrackerManager { List<TagChangeTracker> cacheTags = new List<TagChangeTracker>(); public TagChangeTracker GetOrAdd(IRtConnector connector, string tagExpression) { lock (cacheTags) { var t = cacheTags.FirstOrDefault(t => t.TagName == tagExpression); if (t == null) { var tag = RtTagExpression.AddExpression(connector, tagExpression); t = new TagChangeTracker(tag, tagExpression); cacheTags.Add(t); } return t; } } public int GetTagsCount() { return cacheTags.Count(); } public List<TagChangeTracker> GetTagsChanged() { return cacheTags.Where(t => t.IsChanged()).ToList(); } } public class TagChangeTracker { internal TagChangeTracker(IRtTag tag, string tagName) { this.TagName = tagName; this.tag = tag; this.IsChanged(); } private IRtTag tag; public string TagName { get; private set; } public DateTime Updated { get; set; } public DateTime PrevUpdated { get; set; } public IRtValue Value { get; set; } public IRtValue PrevValue { get; set; } public bool Status { get; set; } public bool PrevStatus { get; set; } public object ValueObject => double.IsNaN(Value.Numeric) || double.IsInfinity(Value.Numeric) ? (object)Value.Text : (object)Value.Numeric; public bool IsChanged() { PrevStatus = Status; PrevUpdated = Updated; PrevValue = Value; Status = tag.Status; Updated = tag.Updated; Value = tag.Value; return PrevStatus != Status || PrevUpdated != Updated || PrevValue?.Text != Value.Text; } } }
29.783784
100
0.55127
[ "Apache-2.0" ]
DeltaX-Community/DeltaX
Source/Modules/DeltaX.Modules.RealTimeRpcWebSocket/TagChangeTracker.cs
2,206
C#
using System; using System.Collections.Generic; using System.Linq; using MagicLockScreen_Helper; using MagicLockScreen_Helper.Resources; using MagicLockScreen_Service_WikiMediaPODService.Models; using NoteOne_Core; using NoteOne_Core.Command; using NoteOne_Core.Common; using NoteOne_Core.Contract; using NoteOne_Core.UI.Common; using NoteOne_Utility.Converters; using NoteOne_Utility.Extensions; using Windows.ApplicationModel.Background; using Windows.Storage; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using System.Globalization; namespace MagicLockScreen_Service_WikiMediaPODService.UI.ViewModels { public class WikiMediaPODServiceChannelPageViewModel : ViewModelBase { private readonly WikiMediaPODBackgroundTaskService wikiMediaPODBackgroundTaskService; private readonly WikiMediaPODQueryService wikiMediaPODQueryService; private readonly WikiMediaPODServiceChannel wikiMediaPODServiceChannel; public WikiMediaPODServiceChannelPageViewModel(FrameworkElement view, Dictionary<string, object> pageState) : base(view, pageState) { wikiMediaPODServiceChannel = ServiceChannelManager.CurrentServiceChannelManager["WMPSC"] as WikiMediaPODServiceChannel; wikiMediaPODQueryService = wikiMediaPODServiceChannel["WMPQS"] as WikiMediaPODQueryService; if (wikiMediaPODQueryService.IsSupportBackgroundTask) wikiMediaPODBackgroundTaskService = wikiMediaPODQueryService.BackgroundTaskService as WikiMediaPODBackgroundTaskService; this["WikiMediaPODCollection"] = new WikiMediaPODCollection(wikiMediaPODQueryService.MaxItemCount, new IService[] {wikiMediaPODQueryService}); this["WikiMediaPODSelectedItem"] = null; if (wikiMediaPODBackgroundTaskService != null) { this["BackgroundTaskTimeTiggerTimes"] = wikiMediaPODBackgroundTaskService.TimeTriggerTimes; this["BackgroundTaskTimeTiggerTime"] = "15"; this["BackgroundTaskService"] = wikiMediaPODBackgroundTaskService; this["UpdateLockScreen"] = true; this["UpdateWallpaper"] = true; } this["IsBackgroundTaskPopupOpen"] = false; #region Commands #region PopupBackgroundTaskCommand this["PopupBackgroundTaskCommand"] = new RelayCommand(() => { this["IsBackgroundTaskPopupOpen"] = true; }); #endregion #region RegisterBackgroundTaskCommand this["RegisterBackgroundTaskCommand"] = new RelayCommand(async () => { try { if ((bool)this["UpdateWallpaper"]) { this["UpdateWallpaper"] = await ApplicationHelper.CheckPromptDesktopService(); } if ((bool)this["UpdateLockScreen"] || (bool)this["UpdateWallpaper"]) { string parameters = string.Format("LockScreen:{0}|Wallpaper:{1}", (bool)this["UpdateLockScreen"], (bool)this["UpdateWallpaper"]); if (wikiMediaPODBackgroundTaskService != null) wikiMediaPODQueryService.BackgroundTaskService.InitializeBackgroundTask( new TimeTrigger(this["BackgroundTaskTimeTiggerTime"].ToString().StringToUInt(), false), null, parameters); dynamic selectTriggerTimeDesc = (from dynamic obj in wikiMediaPODBackgroundTaskService.TimeTriggerTimes where obj.Value == this["BackgroundTaskTimeTiggerTime"].ToString() select obj.Name).First(); new MessagePopup(string.Format(ResourcesLoader.Loader["SetBackgroundTaskSucessfully"], selectTriggerTimeDesc)).Show(); } } catch (Exception ex) { ex.WriteLog(); } finally { this["IsBackgroundTaskPopupOpen"] = false; } }); #endregion #region UnregisterBackgroundTaskCommand this["UnregisterBackgroundTaskCommand"] = new RelayCommand(() => { try { if (wikiMediaPODBackgroundTaskService != null) { wikiMediaPODBackgroundTaskService.UnregisterBackgroundTask(); new MessagePopup(ResourcesLoader.Loader["UnregisterBackgroundTaskSucessfully"]).Show(); } } catch (Exception ex) { ex.WriteLog(); } }); #endregion #region SetAsLockScreenCommand this["SetAsLockScreenCommand"] = ApplicationHelper.SetAsLockScreenCommand; #endregion #region SetWallpaperCommand this["SetWallpaperCommand"] = ApplicationHelper.SetWallpaperCommand; #endregion #region SetAppBackgroundCommand this["SetAppBackgroundCommand"] = ApplicationHelper.SetAppBackgroundCommand; #endregion #region RefreshCommand this["RefreshCommand"] = new RelayCommand(() => { (this["WikiMediaPODCollection"] as WikiMediaPODCollection).RefreshCollection(); (View as LayoutAwarePage).RefreshContent(); }); #endregion #region SaveAsCommand this["SaveAsCommand"] = ApplicationHelper.SaveAsCommand; #endregion #region ShowInfoCommand this["ShowInfoCommand"] = (wikiMediaPODServiceChannel.Model as WikiMediaPODServiceChannelModel).ShowInfoCommand; #endregion #region ShareCommand this["ShareCommand"] = new RelayCommand<string>(async url => { try { StorageFile imageFile = await ApplicationHelper.GetTemporaryStorageImageAsync(url); var shareImage = new ShareImage(imageFile, (this["WikiMediaPODSelectedItem"] as WikiMediaPOD).Title, (this["WikiMediaPODSelectedItem"] as WikiMediaPOD).Explanation); } catch (Exception ex) { ex.WriteLog(); } }); #endregion #region ZoomInCommand this["ZoomInCommand"] = new RelayCommand<object>(p => { var imageScrollViewer = p as ScrollViewer; if (imageScrollViewer != null) { float zoomInterval = AppSettings.Instance[AppSettings.ZOOM_FACTORY_INTERVAL].ToString(CultureInfo.InvariantCulture).StringToFloat(); imageScrollViewer.ChangeView(null, null, imageScrollViewer.ZoomFactor + zoomInterval); } }); #endregion #region ZoomOutCommand this["ZoomOutCommand"] = new RelayCommand<object>(p => { var imageScrollViewer = p as ScrollViewer; if (imageScrollViewer != null) { float zoomInterval = AppSettings.Instance[AppSettings.ZOOM_FACTORY_INTERVAL].ToString(CultureInfo.InvariantCulture).StringToFloat(); imageScrollViewer.ChangeView(null, null, imageScrollViewer.ZoomFactor - zoomInterval); } }); #endregion #endregion } public override void LoadState() { } public override void SaveState(Dictionary<string, object> pageState) { } } }
37.818584
157
0.551539
[ "MIT" ]
Jarrey/MagicLockScreen
src/MagicLockScreen.Service.WikiMediaPODService/UI/ViewModels/WikiMediaPODServiceChannelPageViewModel.cs
8,549
C#
using KCommon.Core.Autofac; using KCommon.Core.Components; using KCommon.Core.UnitTests.Mocks; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace KCommon.Core.UnitTests.Components { [TestClass] public class ObjectContainerTest { [TestMethod] public void TestBasic() { ObjectContainer.SetContainer(new MockObjectContainer()); ObjectContainer.Build(); } [TestMethod] public void TestAutofac() { ObjectContainer.SetContainer(new AutofacObjectContainer()); ObjectContainer.Register<MockTestService, MockTestService>(); ObjectContainer.Build(); var service = ObjectContainer.Resolve<MockTestService>(); Assert.AreNotEqual(service, null); Assert.AreEqual(service.Test(), true); } [TestMethod] public void TestAspect() { ObjectContainer.SetContainer(new AutofacObjectContainer()); ObjectContainer.Register<ITestAspect, TestAspect>(); ObjectContainer.Build(); var service = ObjectContainer.Resolve<ITestAspect>(); Assert.AreEqual(service.T(), true); } } }
30.04878
73
0.62987
[ "MIT" ]
Xiangrui2019/kcommon
tests/UnitTests/KCommon.Core.UnitTests/Components/ObjectContainerTest.cs
1,234
C#
using System.Windows.Controls; namespace Coding4Fun.Phone.Controls { public class ColorSliderThumb : Control { public ColorSliderThumb() { DefaultStyleKey = typeof(ColorSliderThumb); } } }
17.461538
55
0.665198
[ "MIT" ]
kevingosse/Imageboard-Browser
Coding4Fun.Phone/Coding4Fun.Phone.Controls/ColorSliderThumb.cs
229
C#
namespace Carter { using System; using System.Collections.Generic; using System.Threading.Tasks; using Carter.OpenApi; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; /// <summary> /// A class for defining routes in your Carter application /// </summary> public class CarterModule { internal readonly Dictionary<(string verb, string path), (RequestDelegate handler, RouteConventions conventions)> Routes; internal readonly Dictionary<(string verb, string path), RouteMetaData> RouteMetaData; private readonly string basePath; internal bool RequiresAuth { get; set; } internal string[] AuthPolicies { get; set; } = Array.Empty<string>(); /// <summary> /// A handler that can be invoked before the defined route /// </summary> public Func<HttpContext, Task<bool>> Before { get; set; } /// <summary> /// A handler that can be invoked after the defined route /// </summary> public RequestDelegate After { get; protected set; } /// <summary> /// Initializes a new instance of <see cref="CarterModule"/> /// </summary> protected CarterModule() : this(string.Empty) { } /// <summary> /// Initializes a new instance of <see cref="CarterModule"/> /// </summary> /// <param name="basePath">A base path to group routes in your <see cref="CarterModule"/></param> protected CarterModule(string basePath) { this.Routes = new Dictionary<(string verb, string path), (RequestDelegate handler, RouteConventions conventions)>(RouteComparer.Comparer); this.RouteMetaData = new Dictionary<(string verb, string path), RouteMetaData>(RouteComparer.Comparer); this.basePath = basePath; } /// <summary> /// Declares a route for GET requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Get(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Get(path, RequestDelegate); } /// <summary> /// Declares a route for GET requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Get(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Get, path), (handler, conventions)); this.Routes.Add((HttpMethods.Head, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for GET requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Get<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Get<T>(path, RequestDelegate); } /// <summary> /// Declares a route for GET requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Get<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Get, path), (handler, conventions)); this.Routes.Add((HttpMethods.Head, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Get, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Post(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Post(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Post(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Post, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Post<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Post<T>(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Post<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Post, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Post, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for DELETE requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Delete(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Delete(path, RequestDelegate); } /// <summary> /// Declares a route for DELETE requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Delete(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Delete, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for DELETE requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Delete<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Delete<T>(path, RequestDelegate); } /// <summary> /// Declares a route for DELETE requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Delete<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Delete, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Delete, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for PUT requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Put(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Put(path, RequestDelegate); } /// <summary> /// Declares a route for PUT requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Put(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Put, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Put<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Put<T>(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Put<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Put, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Put, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for HEAD requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Head(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Head(path, RequestDelegate); } /// <summary> /// Declares a route for HEAD requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Head(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Head, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Head<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Head<T>(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Head<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Head, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Head, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for PATCH requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Patch(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Patch(path, RequestDelegate); } /// <summary> /// Declares a route for PATCH requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Patch(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Patch, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Patch<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Patch<T>(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Patch<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Patch, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Patch, path), Activator.CreateInstance<T>()); return conventions; } /// <summary> /// Declares a route for OPTIONS requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Options(string path, Func<HttpRequest, HttpResponse, Task> handler) { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Options(path, RequestDelegate); } /// <summary> /// Declares a route for OPTIONS requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> protected IEndpointConventionBuilder Options(string path, RequestDelegate handler) { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Options, path), (handler, conventions)); return conventions; } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Options<T>(string path, Func<HttpRequest, HttpResponse, Task> handler) where T : RouteMetaData { Task RequestDelegate(HttpContext httpContext) => handler(httpContext.Request, httpContext.Response); return this.Options<T>(path, RequestDelegate); } /// <summary> /// Declares a route for POST requests /// </summary> /// <param name="path">The path for your route</param> /// <param name="handler">The handler that is invoked when the route is hit</param> /// <typeparam name="T">The <see cref="OpenApi.RouteMetaData"/> implementation for OpenApi use</typeparam> protected IEndpointConventionBuilder Options<T>(string path, RequestDelegate handler) where T : RouteMetaData { path = this.PrependBasePath(path); var conventions = new RouteConventions(); this.Routes.Add((HttpMethods.Options, path), (handler, conventions)); this.RouteMetaData.Add((HttpMethods.Options, path), Activator.CreateInstance<T>()); return conventions; } private string PrependBasePath(string path) { if (string.IsNullOrEmpty(this.basePath)) { return path; } return $"{this.basePath}{path}"; } /// <summary> /// Case-insensitive comparer for routes. /// </summary> private class RouteComparer : IEqualityComparer<(string verb, string path)> { /// <summary> /// Shared comparer instance. /// </summary> public static RouteComparer Comparer = new RouteComparer(); public bool Equals((string verb, string path) x, (string verb, string path) y) => StringComparer.OrdinalIgnoreCase.Equals(x.verb, y.verb) && StringComparer.OrdinalIgnoreCase.Equals(x.path, y.path); public int GetHashCode((string verb, string path) obj) => (StringComparer.OrdinalIgnoreCase.GetHashCode(obj.verb), StringComparer.OrdinalIgnoreCase.GetHashCode(obj.path)).GetHashCode(); } } }
45.784188
150
0.625706
[ "MIT" ]
CarterCommunity/Carter
src/Carter/CarterModule.cs
21,427
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/immdev.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System.Runtime.InteropServices; namespace TerraFX.Interop.UnitTests { /// <summary>Provides validation of the <see cref="SOFTKBDDATA" /> struct.</summary> public static unsafe class SOFTKBDDATATests { /// <summary>Validates that the <see cref="SOFTKBDDATA" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<SOFTKBDDATA>(), Is.EqualTo(sizeof(SOFTKBDDATA))); } /// <summary>Validates that the <see cref="SOFTKBDDATA" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(SOFTKBDDATA).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="SOFTKBDDATA" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { Assert.That(sizeof(SOFTKBDDATA), Is.EqualTo(516)); } } }
37.083333
145
0.657678
[ "MIT" ]
phizch/terrafx.interop.windows
tests/Interop/Windows/um/immdev/SOFTKBDDATATests.cs
1,337
C#
using System.Collections.Generic; using System.Linq; using extOSC; using Unity.VisualScripting; using UnityEngine; namespace MyOscComponents { public class OscMessageGroup : OscTriggeredEffect { [SerializeField] private OscTriggeredEffect[] effects; [SerializeField] private bool getChildrenOnAwake; private void Awake() { if (getChildrenOnAwake) effects = GetComponentsInChildren<OscTriggeredEffect>(); } public override void HandleValue(OSCValue val) { foreach (var fx in effects.Except(this.Yield())) { fx.HandleValue(val); } } } }
25.407407
92
0.625364
[ "MIT" ]
JonLevin25/SonicPi-Unity-OSC-Experiment
Unity-OSC-Receiver/Assets/Scripts/MyOscComponents/OscMessageGroup.cs
688
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Rmit.Asr.Application.Data; namespace Rmit.Asr.Application.Migrations { [DbContext(typeof(ApplicationDataContext))] [Migration("20190125230501_UpdatedModelProperties")] partial class UpdatedModelProperties { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<string>("Name") .HasMaxLength(256); b.Property<string>("NormalizedName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<string>("RoleId") .IsRequired(); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<string>("UserId") .IsRequired(); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.Property<string>("LoginProvider"); b.Property<string>("ProviderKey"); b.Property<string>("ProviderDisplayName"); b.Property<string>("UserId") .IsRequired(); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.Property<string>("UserId"); b.Property<string>("RoleId"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.Property<string>("UserId"); b.Property<string>("LoginProvider"); b.Property<string>("Name"); b.Property<string>("Value"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("Rmit.Asr.Application.Models.ApplicationUser", b => { b.Property<string>("Id"); b.Property<int>("AccessFailedCount"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<string>("Discriminator") .IsRequired(); b.Property<string>("Email") .HasMaxLength(256); b.Property<bool>("EmailConfirmed"); b.Property<string>("FirstName") .IsRequired(); b.Property<string>("LastName") .IsRequired(); b.Property<bool>("LockoutEnabled"); b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<string>("NormalizedEmail") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .HasMaxLength(256); b.Property<string>("PasswordHash"); b.Property<string>("PhoneNumber"); b.Property<bool>("PhoneNumberConfirmed"); b.Property<string>("SecurityStamp"); b.Property<bool>("TwoFactorEnabled"); b.Property<string>("UserName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers"); b.HasDiscriminator<string>("Discriminator").HasValue("ApplicationUser"); }); modelBuilder.Entity("Rmit.Asr.Application.Models.Room", b => { b.Property<string>("RoomId") .ValueGeneratedOnAdd(); b.HasKey("RoomId"); b.ToTable("Room"); }); modelBuilder.Entity("Rmit.Asr.Application.Models.Slot", b => { b.Property<string>("RoomId"); b.Property<DateTime>("StartTime"); b.Property<string>("StaffId"); b.Property<string>("StudentId"); b.HasKey("RoomId", "StartTime"); b.HasIndex("StaffId"); b.HasIndex("StudentId"); b.ToTable("Slot"); }); modelBuilder.Entity("Rmit.Asr.Application.Models.Staff", b => { b.HasBaseType("Rmit.Asr.Application.Models.ApplicationUser"); b.ToTable("Staff"); b.HasDiscriminator().HasValue("Staff"); }); modelBuilder.Entity("Rmit.Asr.Application.Models.Student", b => { b.HasBaseType("Rmit.Asr.Application.Models.ApplicationUser"); b.ToTable("Student"); b.HasDiscriminator().HasValue("Student"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.HasOne("Rmit.Asr.Application.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.HasOne("Rmit.Asr.Application.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Rmit.Asr.Application.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.HasOne("Rmit.Asr.Application.Models.ApplicationUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Rmit.Asr.Application.Models.Slot", b => { b.HasOne("Rmit.Asr.Application.Models.Room", "Room") .WithMany("Slots") .HasForeignKey("RoomId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Rmit.Asr.Application.Models.Staff", "Staff") .WithMany() .HasForeignKey("StaffId"); b.HasOne("Rmit.Asr.Application.Models.Student", "Student") .WithMany() .HasForeignKey("StudentId"); }); #pragma warning restore 612, 618 } } }
34.279221
125
0.479542
[ "MIT" ]
johnnyhuy/dotnet-appointment-system
Rmit.Asr.Application/Rmit.Asr.Application/Migrations/20190125230501_UpdatedModelProperties.Designer.cs
10,560
C#
//------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. // Laufzeitversion:4.0.30319.42000 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ namespace NppMarkdownPanel.Forms { using System; /// <summary> /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// </summary> // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class MainResources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal MainResources() { } /// <summary> /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NppMarkdownPanel.Forms.MainResources", typeof(MainResources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Sucht eine lokalisierte Zeichenfolge, die /* ///Copyright (c) 2017 Chris Patuzzo ///https://twitter.com/chrispatuzzo ///Permission is hereby granted, free of charge, to any person obtaining a copy ///of this software and associated documentation files (the &quot;Software&quot;), to deal ///in the Software without restriction, including without limitation the rights ///to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ///copies of the Software, and to permit persons to whom the Software is ///furnished to do so, subject to the following conditions: ///T [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt. /// </summary> internal static string DefaultCss { get { return ResourceManager.GetString("DefaultCss", resourceCulture); } } } }
48.365854
185
0.636409
[ "MIT" ]
linpengcheng/NppMarkdownPanel
NppMarkdownPanel/Forms/MainResources.Designer.cs
3,977
C#
#define COMMAND_NAME_UPPER #if DEBUG #undef LS #define LS #endif #if LS using System; using System.Collections.Generic; using System.IO; using System.Security.AccessControl; using System.Security.Principal; using Apollo.Jobs; using Apollo.Tasks; using Mythic.Structs; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Text; namespace Apollo.CommandModules { public class DirectoryList { private static Dictionary<string, string>[] GetPermissions(FileInfo fi) { List<Dictionary<string, string>> permissions = new List<Dictionary<string, string>>(); try { FileSecurity fsec = fi.GetAccessControl(AccessControlSections.Access); foreach (FileSystemAccessRule FSAR in fsec.GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount))) { var tmp = GetAceInformation(FSAR); if (tmp.Keys.Count == 0) continue; permissions.Add(tmp); } } catch { } return permissions.ToArray(); } private static Dictionary<string, string>[] GetPermissions(DirectoryInfo di) { List<Dictionary<string, string>> permissions = new List<Dictionary<string, string>>(); try { DirectorySecurity DirSec = di.GetAccessControl(AccessControlSections.Access); foreach (FileSystemAccessRule FSAR in DirSec.GetAccessRules(true, true, typeof(System.Security.Principal.NTAccount))) { var tmp = GetAceInformation(FSAR); if (tmp.Keys.Count == 0) continue; permissions.Add(tmp); } } catch { } return permissions.ToArray(); } private static Dictionary<string, string> GetAceInformation(FileSystemAccessRule ace) { StringBuilder info = new StringBuilder(); Dictionary<string, string> results = new Dictionary<string, string>(); results["account"] = ace.IdentityReference.Value; results["type"] = ace.AccessControlType.ToString(); results["rights"] = ace.FileSystemRights.ToString(); results["is_inherited"] = ace.IsInherited.ToString(); return results; } internal static string FormatPath(FileBrowserParameters parameters) { string path = ""; if (!string.IsNullOrEmpty(parameters.host) && parameters.host != Environment.GetEnvironmentVariable("COMPUTERNAME") && parameters.host.ToLower() != "localhost" && parameters.host.ToLower() != "127.0.0.1" && !string.IsNullOrEmpty(parameters.path) && parameters.path[0] != '\\') { path = string.Format("\\\\{0}\\{1}", parameters.host, parameters.path); } else { path = parameters.path; } if (string.IsNullOrEmpty(path)) path = "."; return path; } /// <summary> /// List all files and directories in a specified path. /// </summary> /// <param name="job"> /// Job responsible for this task. job.Task.parameters is /// a string of the path to list. /// </param> /// <param name="implant">Agent this task is run on.</param> public static void Execute(Job job, Agent implant) { WindowsIdentity ident = Credentials.CredentialManager.CurrentIdentity; Task task = job.Task; FileBrowserParameters parameters = JsonConvert.DeserializeObject<FileBrowserParameters>(task.parameters); if (string.IsNullOrEmpty(parameters.host)) parameters.host = Environment.GetEnvironmentVariable("COMPUTERNAME"); string path = FormatPath(parameters); List<Mythic.Structs.FileInformation> fileListResults = new List<Mythic.Structs.FileInformation>(); FileBrowserResponse resp; if (File.Exists(path)) { try { FileInfo finfo = new FileInfo(path); resp = new FileBrowserResponse() { host = parameters.host, is_file = true, permissions = GetPermissions(finfo), name = finfo.Name, parent_path = finfo.DirectoryName, success = true, access_time = finfo.LastAccessTimeUtc.ToString(), modify_time = finfo.LastWriteTimeUtc.ToString(), size = finfo.Length, files = new FileInformation[0] }; } catch (Exception ex) { resp = new FileBrowserResponse() { host = parameters.host, is_file = true, permissions = new Dictionary<string, string>[0], name = path, parent_path = "", success = false, access_time = "", modify_time = "", size = -1, files = new FileInformation[0] }; job.SetError(string.Format("Error attempting to get file {0}: {1}", path, ex.Message)); } } else { try // Invalid path causes a crash if we don't handle exceptions { DirectoryInfo pathDir = new DirectoryInfo(path); resp = new FileBrowserResponse() { host = parameters.host, is_file = false, permissions = GetPermissions(pathDir), name = pathDir.Name, parent_path = pathDir.Parent != null ? pathDir.Parent.FullName : "", success = true, access_time = pathDir.LastAccessTimeUtc.ToString(), modify_time = pathDir.LastWriteTimeUtc.ToString(), size = 0, files = new FileInformation[0] }; string[] directories = Directory.GetDirectories(path); foreach (string dir in directories) { try { DirectoryInfo dirInfo = new DirectoryInfo(dir); fileListResults.Add(new Mythic.Structs.FileInformation() { full_name = dirInfo.FullName, name = dirInfo.Name, directory = dirInfo.Parent.ToString(), creation_date = dirInfo.CreationTimeUtc.ToString(), modify_time = dirInfo.LastWriteTimeUtc.ToString(), access_time = dirInfo.LastAccessTimeUtc.ToString(), permissions = GetPermissions(dirInfo), // This isn't gonna be right. extended_attributes = dirInfo.Attributes.ToString(), // This isn't gonna be right. size = 0, is_file = false, owner = File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString(), group = "", hidden = ((dirInfo.Attributes & System.IO.FileAttributes.Hidden) == FileAttributes.Hidden) }); } catch { // Suppress exceptions } } } catch (DirectoryNotFoundException e) { resp = new FileBrowserResponse() { host = parameters.host, is_file = false, permissions = new Dictionary<string, string>[0], name = path, parent_path = "", success = false, access_time = "", modify_time = "", size = 0, files = new FileInformation[0] }; job.SetError($"Error: {e.Message}"); return; } catch (Exception e) { resp = new FileBrowserResponse() { host = parameters.host, is_file = true, permissions = new Dictionary<string, string>[0], name = path, parent_path = "", success = false, access_time = "", modify_time = "", size = 0, files = new FileInformation[0] }; job.SetError($"Error: {e.Message}"); return; } try // Catch exceptions from Directory.GetFiles { string[] files = Directory.GetFiles(path); foreach (string file in files) { try { FileInfo fileInfo = new FileInfo(file); fileListResults.Add(new Mythic.Structs.FileInformation() { full_name = fileInfo.FullName, name = fileInfo.Name, directory = fileInfo.DirectoryName, creation_date = fileInfo.CreationTimeUtc.ToString(), modify_time = fileInfo.LastWriteTimeUtc.ToString(), access_time = fileInfo.LastAccessTimeUtc.ToString(), permissions = GetPermissions(fileInfo), // This isn't gonna be right. extended_attributes = fileInfo.Attributes.ToString(), // This isn't gonna be right. size = fileInfo.Length, is_file = true, owner = File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString(), group = "", hidden = ((fileInfo.Attributes & System.IO.FileAttributes.Hidden) == FileAttributes.Hidden) }); } catch { // Suppress exceptions } } } catch (Exception e) { } } resp.files = fileListResults.ToArray(); job.SetComplete(resp); } } } #endif
41.05614
133
0.450987
[ "BSD-3-Clause" ]
reznok/Apollo
Payload_Type/Apollo/agent_code/Apollo/CommandModules/DirectoryList.cs
11,703
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using System.Linq.Expressions; using System.Reflection; using Microsoft.EntityFrameworkCore.Query.Expressions; using Microsoft.EntityFrameworkCore.Query.ExpressionTranslators; using NetTopologySuite.Geometries; namespace Microsoft.EntityFrameworkCore.SqlServer.Query.ExpressionTranslators.Internal { /// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public class SqlServerLineStringMemberTranslator : IMemberTranslator { private static readonly MemberInfo _count = typeof(LineString).GetRuntimeProperty(nameof(LineString.Count)); /// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public virtual Expression Translate(MemberExpression memberExpression) { if (Equals(memberExpression.Member, _count)) { return new SqlFunctionExpression( memberExpression.Expression, "STNumPoints", memberExpression.Type, Enumerable.Empty<Expression>()); } return null; } } }
40.25
116
0.677019
[ "Apache-2.0" ]
Alecu100/EntityFrameworkCore
src/EFCore.SqlServer.NTS/Query/ExpressionTranslators/Internal/SqlServerLineStringMemberTranslator.cs
1,612
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the lex-models-2017-04-19.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.LexModelBuildingService.Model { /// <summary> /// The name of a context that must be active for an intent to be selected by Amazon Lex. /// </summary> public partial class InputContext { private string _name; /// <summary> /// Gets and sets the property Name. /// <para> /// The name of the context. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=100)] public string Name { get { return this._name; } set { this._name = value; } } // Check to see if Name property is set internal bool IsSetName() { return this._name != null; } } }
29.172414
109
0.620567
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/LexModelBuildingService/Generated/Model/InputContext.cs
1,692
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CoreModule.Shapes; namespace CoreModule.Ballistics { public static class Ballistics { public static void Fire(Point from, Point through) { } } }
19.1875
60
0.693811
[ "CC0-1.0" ]
azbstozcorp/Game
CoreModule/Ballistics/Ballistics.cs
309
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace Nopyfy_Decrypter { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
22.391304
65
0.615534
[ "MIT" ]
APT-37/Nopyfy-Ransomware
Nopyfy-Decrypter/Nopyfy-Decrypter/Program.cs
517
C#
using CSharpier.Tests.TestFileTests; using NUnit.Framework; namespace CSharpier.Tests.TestFiles { public class EventFieldDeclarationTests : BaseTest { [Test] public void BasicEventFieldDeclaration() { this.RunTest("EventFieldDeclaration", "BasicEventFieldDeclaration"); } } }
22.2
80
0.678679
[ "MIT" ]
askazakov/csharpier
Src/CSharpier.Tests/TestFiles/EventFieldDeclaration/_EventFieldDeclarationTests.cs
333
C#
using System; using System.Threading.Tasks; using FluentValidation; using MediatR; using SFA.DAS.Commitments.Application.Exceptions; using SFA.DAS.Commitments.Application.Interfaces; using SFA.DAS.Commitments.Application.Services; using SFA.DAS.Commitments.Domain; using SFA.DAS.Commitments.Domain.Data; using SFA.DAS.Commitments.Domain.Entities; using SFA.DAS.Commitments.Domain.Entities.History; using SFA.DAS.Commitments.Domain.Interfaces; namespace SFA.DAS.Commitments.Application.Commands.UpdateApprenticeshipStatus { public sealed class PauseApprenticeshipCommandHandler : AsyncRequestHandler<PauseApprenticeshipCommand> { private readonly IApprenticeshipRepository _apprenticeshipRepository; private readonly ICommitmentRepository _commitmentRepository; private readonly ICurrentDateTime _currentDate; private readonly IApprenticeshipEvents _eventsApi; private readonly IHistoryRepository _historyRepository; private readonly IV2EventsPublisher _v2EventsPublisher; private readonly ICommitmentsLogger _logger; private readonly ApprenticeshipStatusChangeCommandValidator _validator; public PauseApprenticeshipCommandHandler( ICommitmentRepository commitmentRepository, IApprenticeshipRepository apprenticeshipRepository, ApprenticeshipStatusChangeCommandValidator validator, ICurrentDateTime currentDate, IApprenticeshipEvents eventsApi, ICommitmentsLogger logger, IHistoryRepository historyRepository, IV2EventsPublisher v2EventsPublisher ) { _commitmentRepository = commitmentRepository; _apprenticeshipRepository = apprenticeshipRepository; _validator = validator; _currentDate = currentDate; _eventsApi = eventsApi; _logger = logger; _historyRepository = historyRepository; _v2EventsPublisher = v2EventsPublisher; } protected override async Task HandleCore(PauseApprenticeshipCommand command) { _logger.Info($"Employer: {command.AccountId} has called PauseApprenticeshipCommand", command.AccountId, apprenticeshipId: command.ApprenticeshipId, caller: command.Caller); var validationResult = _validator.Validate(command); if (!validationResult.IsValid) throw new ValidationException(validationResult.Errors); var apprenticeship = await _apprenticeshipRepository.GetApprenticeship(command.ApprenticeshipId); var commitment = await _commitmentRepository.GetCommitmentById(apprenticeship.CommitmentId); CheckAuthorization(command, commitment); ValidateChangeDate(command.DateOfChange); await SaveChange(command, commitment, apprenticeship); await CreateEvent(command, apprenticeship, commitment); } private Task CreateEvent(PauseApprenticeshipCommand command, Apprenticeship apprenticeship, Commitment commitment) { return Task.WhenAll(_eventsApi.PublishChangeApprenticeshipStatusEvent(commitment, apprenticeship, PaymentStatus.Paused, command.DateOfChange.Date), _v2EventsPublisher.PublishApprenticeshipPaused(commitment, apprenticeship)); } private async Task SaveChange(PauseApprenticeshipCommand command, Commitment commitment, Apprenticeship apprenticeship) { var historyService = new HistoryService(_historyRepository); historyService.TrackUpdate(apprenticeship, ApprenticeshipChangeType.ChangeOfStatus.ToString(), null, apprenticeship.Id, CallerType.Employer, command.UserId, commitment.ProviderId, commitment.EmployerAccountId, command.UserName); await _apprenticeshipRepository.PauseApprenticeship(commitment.Id, command.ApprenticeshipId, command.DateOfChange); apprenticeship.PaymentStatus = PaymentStatus.Paused; apprenticeship.PauseDate = command.DateOfChange; await historyService.Save(); } private void ValidateChangeDate(DateTime dateOfChange) { if (dateOfChange.Date > _currentDate.Now.Date) throw new ValidationException("Invalid Date of Change. Date should be todays date."); } private static void CheckAuthorization(PauseApprenticeshipCommand message, Commitment commitment) { if (commitment.EmployerAccountId != message.AccountId) throw new UnauthorizedException( $"Employer {message.AccountId} not authorised to access commitment {commitment.Id}, expected employer {commitment.EmployerAccountId}"); } } }
44.796296
155
0.721166
[ "MIT" ]
SkillsFundingAgency/das-commitments
src/SFA.DAS.Commitments.Application/Commands/UpdateApprenticeshipStatus/PauseApprenticeshipCommandHandler.cs
4,838
C#
namespace MyWebShop.Data.Models { using System.Collections.Generic; public class Colour { public int Id { get; init; } public string Name { get; set; } public IEnumerable<Cartridge> Cartridges { get; init; } = new List<Cartridge>(); } }
25.272727
88
0.622302
[ "MIT" ]
KatyaDimitrova/ASP.NET-My-Web-Shop
MyWebShop/Data/Models/Colour.cs
280
C#
using BUTR.NexusMods.Shared.Models; namespace BUTR.NexusMods.Blazor.Core.Models { internal readonly struct DemoUserState { public static Task<DemoUserState> CreateAsync(IHttpClientFactory factory) => Task.FromResult<DemoUserState>( new(new(31179975, "Pickysaurus", "demo@demo.com", "https://forums.nexusmods.com/uploads/profile/photo-31179975.png", true, true))); public readonly ProfileModel Profile; private DemoUserState(ProfileModel profile) { Profile = profile; } } public class DemoUser { public static async Task<DemoUser> CreateAsync(IHttpClientFactory factory) => new(await DemoUserState.CreateAsync(factory)); public virtual ProfileModel Profile => _state.Profile; private readonly DemoUserState _state; private DemoUser(DemoUserState state) => _state = state; protected DemoUser() { } } }
31.2
143
0.684829
[ "MIT" ]
BUTR/BUTR.NexusMods.Core
src/BUTR.NexusMods.Blazor.Core/Models/DemoUser.cs
938
C#
using System; using System.IO; namespace PakReader { public sealed class UAnimSequence : ExportObject { public UObject super_object; public FGuid skeleton_guid; public byte key_encoding_format; public byte translation_compression_format; public byte rotation_compression_format; public byte scale_compression_format; public int[] compressed_track_offsets; public FCompressedOffsetData compressed_scale_offsets; public FCompressedSegment[] compressed_segments; public int[] compressed_track_to_skeleton_table; public FSmartName[] compressed_curve_names; public int compressed_raw_data_size; public int compressed_num_frames; public FTrack[] tracks; internal UAnimSequence(BinaryReader reader, FNameEntrySerialized[] name_map, FObjectImport[] import_map) { super_object = new UObject(reader, name_map, import_map, "AnimSequence", true); skeleton_guid = new FGuid(reader); new FStripDataFlags(reader); if (reader.ReadUInt32() == 0) { throw new FileLoadException("Could not decode AnimSequence (must be compressed)"); } key_encoding_format = reader.ReadByte(); translation_compression_format = reader.ReadByte(); rotation_compression_format = reader.ReadByte(); scale_compression_format = reader.ReadByte(); compressed_track_offsets = reader.ReadTArray(() => reader.ReadInt32()); compressed_scale_offsets = new FCompressedOffsetData { offset_data = reader.ReadTArray(() => reader.ReadInt32()), strip_size = reader.ReadInt32() }; compressed_segments = reader.ReadTArray(() => new FCompressedSegment(reader)); compressed_track_to_skeleton_table = reader.ReadTArray(() => reader.ReadInt32()); compressed_curve_names = reader.ReadTArray(() => new FSmartName(reader, name_map)); compressed_raw_data_size = reader.ReadInt32(); compressed_num_frames = reader.ReadInt32(); int num_bytes = reader.ReadInt32(); if (reader.ReadUInt32() != 0) { throw new NotImplementedException("Bulk data for animations not supported yet"); } tracks = read_tracks(new MemoryStream(reader.ReadBytes(num_bytes))); } static float read_fixed48(ushort val) => val - 255f; static float read_fixed48_q(ushort val) => (val / 32767f) - 1; const uint X_MASK = 0x000003ff; const uint Y_MASK = 0x001ffc00; static FVector read_fixed32_vec(uint val, FVector min, FVector max) { return new FVector { X = ((val & X_MASK) - 511) / 511f * max.X + min.X, Y = (((val & Y_MASK) >> 10) - 1023) / 1023f * max.Y + min.Y, Z = ((val >> 21) - 1023) / 1023f * max.Z + min.Z }; } static FQuat read_fixed32_quat(uint val, FVector min, FVector max) { var q = new FQuat { X = ((val >> 21) - 1023) / 1023f * max.X + min.X, Y = (((val & Y_MASK) >> 10) - 1023) / 1023f * max.Y + min.Y, Z = ((val & X_MASK) - 511) / 511f * max.Z + min.Z, W = 1 }; q.rebuild_w(); return q; } static void align_reader(BinaryReader reader) { var pos = reader.BaseStream.Position % 4; if (pos != 0) reader.BaseStream.Seek(4 - pos, SeekOrigin.Current); } static float[] read_times(BinaryReader reader, uint num_keys, uint num_frames) { if (num_keys <= 1) return new float[0]; align_reader(reader); var ret = new float[num_keys]; if (num_frames < 256) { for (int i = 0; i < num_keys; i++) { ret[i] = reader.ReadByte(); } } else { for (int i = 0; i < num_keys; i++) { ret[i] = reader.ReadUInt16(); } } return ret; } private FTrack[] read_tracks(MemoryStream stream) { if (key_encoding_format != 2) { throw new NotImplementedException("Can only parse PerTrackCompression"); } using (stream) using (var reader = new BinaryReader(stream)) { var num_tracks = compressed_track_offsets.Length / 2; var num_frames = compressed_num_frames; FTrack[] ret = new FTrack[num_tracks]; for (int i = 0; i < ret.Length; i++) { FTrack track = new FTrack(); // translation var offset = compressed_track_offsets[i * 2]; if (offset != -1) { var header = new FAnimKeyHeader(reader); var min = new FVector(); var max = new FVector(); if (header.key_format == AnimationCompressionFormat.IntervalFixed32NoW) { if ((header.component_mask & 1) != 0) { min.X = reader.ReadSingle(); max.X = reader.ReadSingle(); } if ((header.component_mask & 2) != 0) { min.Y = reader.ReadSingle(); max.Y = reader.ReadSingle(); } if ((header.component_mask & 4) != 0) { min.Z = reader.ReadSingle(); max.Z = reader.ReadSingle(); } } track.translation = new FVector[header.num_keys]; for (int j = 0; j < track.translation.Length; j++) { switch (header.key_format) { case AnimationCompressionFormat.None: case AnimationCompressionFormat.Float96NoW: var fvec = new FVector(); if ((header.component_mask & 7) != 0) { if ((header.component_mask & 1) != 0) fvec.X = reader.ReadSingle(); if ((header.component_mask & 2) != 0) fvec.Y = reader.ReadSingle(); if ((header.component_mask & 4) != 0) fvec.Z = reader.ReadSingle(); } else { fvec = new FVector(reader); } track.translation[j] = fvec; break; case AnimationCompressionFormat.Fixed48NoW: fvec = new FVector(); if ((header.component_mask & 1) != 0) fvec.X = read_fixed48(reader.ReadUInt16()); if ((header.component_mask & 2) != 0) fvec.Y = read_fixed48(reader.ReadUInt16()); if ((header.component_mask & 4) != 0) fvec.Z = read_fixed48(reader.ReadUInt16()); track.translation[j] = fvec; break; case AnimationCompressionFormat.IntervalFixed32NoW: track.translation[j] = read_fixed32_vec(reader.ReadUInt32(), min, max); break; } } if (header.has_time_tracks) { track.translation_times = read_times(reader, header.num_keys, (uint)num_frames); } align_reader(reader); } // rotation offset = compressed_track_offsets[(i * 2) + 1]; if (offset != -1) { var header = new FAnimKeyHeader(reader); var min = new FVector(); var max = new FVector(); if (header.key_format == AnimationCompressionFormat.IntervalFixed32NoW) { if ((header.component_mask & 1) != 0) { min.X = reader.ReadSingle(); max.X = reader.ReadSingle(); } if ((header.component_mask & 2) != 0) { min.Y = reader.ReadSingle(); max.Y = reader.ReadSingle(); } if ((header.component_mask & 4) != 0) { min.Z = reader.ReadSingle(); max.Z = reader.ReadSingle(); } } track.rotation = new FQuat[header.num_keys]; for (int j = 0; j < track.rotation.Length; j++) { switch (header.key_format) { case AnimationCompressionFormat.None: case AnimationCompressionFormat.Float96NoW: var fvec = new FVector(); if ((header.component_mask & 7) != 0) { if ((header.component_mask & 1) != 0) fvec.X = reader.ReadSingle(); if ((header.component_mask & 2) != 0) fvec.Y = reader.ReadSingle(); if ((header.component_mask & 4) != 0) fvec.Z = reader.ReadSingle(); } else { fvec = new FVector(reader); } var fquat = new FQuat() { X = fvec.X, Y = fvec.Y, Z = fvec.Z }; fquat.rebuild_w(); track.rotation[j] = fquat; break; case AnimationCompressionFormat.Fixed48NoW: fquat = new FQuat(); if ((header.component_mask & 1) != 0) fquat.X = read_fixed48_q(reader.ReadUInt16()); if ((header.component_mask & 2) != 0) fquat.Y = read_fixed48_q(reader.ReadUInt16()); if ((header.component_mask & 4) != 0) fquat.Z = read_fixed48_q(reader.ReadUInt16()); fquat.rebuild_w(); track.rotation[j] = fquat; break; case AnimationCompressionFormat.IntervalFixed32NoW: track.rotation[j] = read_fixed32_quat(reader.ReadUInt32(), min, max); break; } } if (header.has_time_tracks) { track.rotation_times = read_times(reader, header.num_keys, (uint)num_frames); } align_reader(reader); } // scale offset = compressed_scale_offsets.offset_data[i * compressed_scale_offsets.strip_size]; if (offset != -1) { var header = new FAnimKeyHeader(reader); var min = new FVector(); var max = new FVector(); if (header.key_format == AnimationCompressionFormat.IntervalFixed32NoW) { if ((header.component_mask & 1) != 0) { min.X = reader.ReadSingle(); max.X = reader.ReadSingle(); } if ((header.component_mask & 2) != 0) { min.Y = reader.ReadSingle(); max.Y = reader.ReadSingle(); } if ((header.component_mask & 4) != 0) { min.Z = reader.ReadSingle(); max.Z = reader.ReadSingle(); } } track.scale = new FVector[header.num_keys]; for (int j = 0; j < track.scale.Length; j++) { switch (header.key_format) { case AnimationCompressionFormat.None: case AnimationCompressionFormat.Float96NoW: var fvec = new FVector(); if ((header.component_mask & 7) != 0) { if ((header.component_mask & 1) != 0) fvec.X = reader.ReadSingle(); if ((header.component_mask & 2) != 0) fvec.Y = reader.ReadSingle(); if ((header.component_mask & 4) != 0) fvec.Z = reader.ReadSingle(); } else { fvec = new FVector(reader); } track.scale[j] = fvec; break; case AnimationCompressionFormat.Fixed48NoW: fvec = new FVector(); if ((header.component_mask & 1) != 0) fvec.X = read_fixed48(reader.ReadUInt16()); if ((header.component_mask & 2) != 0) fvec.Y = read_fixed48(reader.ReadUInt16()); if ((header.component_mask & 4) != 0) fvec.Z = read_fixed48(reader.ReadUInt16()); track.scale[j] = fvec; break; case AnimationCompressionFormat.IntervalFixed32NoW: track.scale[j] = read_fixed32_vec(reader.ReadUInt32(), min, max); break; } } if (header.has_time_tracks) { track.scale_times = read_times(reader, header.num_keys, (uint)num_frames); } align_reader(reader); } ret[i] = track; } if (reader.BaseStream.Position != stream.Length) { throw new FileLoadException($"Could not read tracks correctly, {reader.BaseStream.Position - stream.Length} bytes remaining"); } return ret; } } } }
47.296296
146
0.399374
[ "MIT" ]
msx752/FTN-Power
src/UnrealEngine4/FortnitePakManager/PakReader/ExportObject/UAnimSequence/UAnimSequence.cs
16,603
C#
using Framework.Core.Runtime; using UnityEngine; namespace Projects.ThirdPerson { public abstract class ActorControllerComponent : MonoBehaviour { public GamePlayerProxy player { get; set; } protected Transform selfTrans; public MovementComponent MovementComp { get; private set; } public RotationComponent RotationComp { get; private set; } public virtual void onAwake() { } private void Awake() { selfTrans = transform; MovementComp = GetComponent<MovementComponent>(); RotationComp = GetComponent<RotationComponent>(); onAwake(); } public virtual void onUpdate() { } private void Update() { onUpdate(); } public virtual void onDestory() { } private void OnDestroy() { onDestory(); } } }
20.405405
66
0.70596
[ "MIT" ]
kedlly/XDFramework
Assets/Projects/ThirdPerson/ActorControllerComponent.cs
755
C#
/* 3. Всички латински букви Напишете програма, която отпечатва всички букви от латинската азбука: a, b, c, …, z. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _03.Latin_Letters { class Program { static void Main() { string alphabet = "abcdefghijklmnopqrstuvwxyz"; foreach (char c in alphabet) { Console.WriteLine(c); } } } }
19.692308
84
0.601563
[ "MIT" ]
Hmmrpss/Programming-Basics-2016-Course-Homeworks
05.Simple_Loops/03.Latin_Letters/03.Latin_Letters.cs
594
C#
using System; using System.Collections.Generic; using System.Text; using DesignPatternsDemo.Creational.工厂模式.抽象工厂模式.V1.Model; namespace DesignPatternsDemo.Creational.工厂模式.抽象工厂模式.V1 { public interface ISkinFactory { IButton CreateButton(); IComboBox CreateComboBox(); ITextField CreateTextField(); } }
22.533333
57
0.733728
[ "Apache-2.0" ]
ManagerSi/DesignPatterns
src/DesignPatternsDemo/Creational/工厂模式/抽象工厂模式/V1/ISkinFactory.cs
380
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace WorkbenchWPF.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
34.419355
151
0.582006
[ "MIT" ]
ScottLilly/CSharpDesignPatterns
WorkbenchWPF/Properties/Settings.Designer.cs
1,069
C#
using UnityEngine; /// <summary> /// Different functions to interpolate /// </summary> public enum InterpolationFunction { Invalid = -1, Linear, Exponential, ExponentialSquared, Cubic, Cubic2, EaseInOutCubic, SuperSmooth, //... Count } /// <summary> /// Static class to map interpolation t parameter belonging to [0..1] according to mathematical /// functions to smooth in, smooth out, etc... /// </summary> public static class CustomInterpolation { public static float Interpolate(float t, InterpolationFunction function) { float s = 0.0f; // choose the right function and map t switch (function) { case InterpolationFunction.Linear: s = t; break; case InterpolationFunction.Exponential: s = t * t; break; case InterpolationFunction.ExponentialSquared: s = Mathf.Pow((t * t), 2); break; case InterpolationFunction.Cubic: s = t * t * t; break; case InterpolationFunction.Cubic2: s = ((t - 3.0f) * t + 3.0f) * t; break; case InterpolationFunction.EaseInOutCubic: s = t < 0.5f ? 4.0f * t * t * t : (t - 1.0f) * (2.0f * t - 2.0f) * (2.0f * t - 2.0f) + 1.0f; break; case InterpolationFunction.SuperSmooth: s = t * t * t * (t * (6.0f * t - 15.0f) + 10.0f); break; default: Debug.Log("Invalid InterpolationFunction : " + function); break; } return s; } }
24.485714
108
0.508168
[ "MIT" ]
CristianQiu/Serious-game
Assets/Code/Maths/CustomInterpolation.cs
1,716
C#
using System; using System.Xml.Serialization; using System.Collections.Generic; namespace Aop.Api.Domain { /// <summary> /// AlipayCommerceIotMdeviceprodDeviceUnbindModel Data Structure. /// </summary> [Serializable] public class AlipayCommerceIotMdeviceprodDeviceUnbindModel : AopObject { /// <summary> /// 设备唯一标识,设备id;identity_type='ID'时必填 /// </summary> [XmlElement("biz_tid")] public string BizTid { get; set; } /// <summary> /// 设备SN,与supplier_id配合作为设备识别的唯一标识;identity_type='SN'时必填 /// </summary> [XmlElement("device_sn")] public string DeviceSn { get; set; } /// <summary> /// 可选项[SN,ID] SN-使用device_sn、supplier_id联合作为设备唯一识别标识 ID-使用biz_tid作为设备唯一识别标识 /// </summary> [XmlElement("identify_type")] public string IdentifyType { get; set; } /// <summary> /// 原绑定关系,必须与已存在的绑定关系一致才允许解绑 /// </summary> [XmlArray("principal")] [XmlArrayItem("iot_device_principal")] public List<IotDevicePrincipal> Principal { get; set; } /// <summary> /// 设备供应商id,与device_sn配合作为设备识别唯一标识;identity_type='SN'时必填 /// </summary> [XmlElement("supplier_id")] public string SupplierId { get; set; } } }
30.288889
87
0.584006
[ "Apache-2.0" ]
554393109/alipay-sdk-net-all
AlipaySDKNet.Standard/Domain/AlipayCommerceIotMdeviceprodDeviceUnbindModel.cs
1,579
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Comp229_Assign02 { public partial class WebForm3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }
18.823529
60
0.69375
[ "MIT" ]
luizerico/Comp229-Assign02
Comp229-Assign02/privacy.aspx.cs
322
C#
using System; using System.Collections.Concurrent; namespace Rabbit.Kernel.Caching.Impl { internal sealed class DefaultCacheHolder : ICacheHolder { #region Field private readonly ICacheContextAccessor _cacheContextAccessor; private readonly ConcurrentDictionary<CacheKey, object> _caches = new ConcurrentDictionary<CacheKey, object>(); #endregion Field #region Constructor public DefaultCacheHolder(ICacheContextAccessor cacheContextAccessor) { _cacheContextAccessor = cacheContextAccessor; } #endregion Constructor #region Implementation of ICacheHolder /// <summary> /// 获取缓存。 /// </summary> /// <typeparam name="TKey">键类型。</typeparam> /// <typeparam name="TResult">结果类型。</typeparam> /// <param name="component">组件类型。</param> /// <returns>缓存实例。</returns> public ICache<TKey, TResult> GetCache<TKey, TResult>(Type component) { var cacheKey = new CacheKey(component, typeof(TKey), typeof(TResult)); var result = _caches.GetOrAdd(cacheKey, k => new Cache<TKey, TResult>(_cacheContextAccessor)); return (Cache<TKey, TResult>)result; } #endregion Implementation of ICacheHolder #region Help Class private sealed class CacheKey : Tuple<Type, Type, Type> { public CacheKey(Type component, Type key, Type result) : base(component, key, result) { } } #endregion Help Class } }
29.666667
119
0.617978
[ "Apache-2.0" ]
RabbitTeam/RabbitHub
Rabbit.Kernel/Caching/Impl/DefaultCacheHolder.cs
1,652
C#
/* * Copyright (c) 2021 ETH Zürich, Educational Development and Technology (LET) * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ namespace SafeExamBrowser.Settings.Security { /// <summary> /// Defines all kiosk modes which SEB supports. /// </summary> public enum KioskMode { /// <summary> /// No kiosk mode - should only be used for testing / debugging. /// </summary> None, /// <summary> /// Creates a new desktop and runs the client on it, without modifying the default desktop. /// </summary> CreateNewDesktop, /// <summary> /// Terminates the Windows explorer shell and runs the client on the default desktop. /// </summary> DisableExplorerShell } }
26.625
93
0.683099
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
Bien-Technologies/seb-win-refactoring
SafeExamBrowser.Settings/Security/KioskMode.cs
855
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Net.Sockets; // For SCP Transfer using System.IO; using StatZilla.Models; namespace StatZilla.Forms { public partial class MethodSelect : Form { public new string Name { get; set; } public string Type { get; set; } public FtpProtocol FtpForm; public SCP_Protocol ScpForm; public S3_Protocol s3Form; public MethodSelect() { InitializeComponent(); } public MethodSelect(MethodSelect returnToForm) { InitializeComponent(); returnToForm.Show(); } private void ChangeForm() { this.Hide(); if (ftpRadioButton.Checked == true) { FtpForm = new FtpProtocol(this); FtpForm.ShowDialog(); } else if (s3radioButton.Checked == true) { s3Form = new S3_Protocol(this); s3Form.ShowDialog(); } else if (scpRadioButton.Checked == true) { ScpForm = new SCP_Protocol(this); ScpForm.ShowDialog(); } else MessageBox.Show("Please Select a transfer type."); } private void NextButton_Click(object sender, EventArgs e) { if(TextBox_Validator()) { this.Name = DomainNicknameBox.Text; this.Type = GetType(); ChangeForm(); } } private new string GetType() { string currentType = "FTP"; if (scpRadioButton.Checked == true) currentType = "SCP"; else if (s3radioButton.Checked == true) currentType = "S3"; else if(ftpRadioButton.Checked == false) MessageBox.Show("Please Select a transfer type."); return currentType; } private bool TextBox_Validator() { // Check if text box empty if (DomainNicknameBox.Text == "" || GetType() == null) { MessageBox.Show("Please do not leave any text box empty"); // Log error return false; } return true; } private void TypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { } private void MethodSelect_Load(object sender, EventArgs e) { } private void Button1_Click(object sender, EventArgs e) { this.Close(); } } }
26.219048
112
0.538322
[ "MIT" ]
D-D-Development/StatZilla
StatZilla_UIUX/Source/Forms/MethodSelect.cs
2,755
C#
#region License // Copyright (c) 2007 James Newton-King // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Collections; using System.Collections.Generic; namespace Newtonsoft.Json.Bson { internal abstract class BsonToken { public abstract BsonType Type { get; } public BsonToken Parent { get; set; } public int CalculatedSize { get; set; } } internal class BsonObject : BsonToken, IEnumerable<BsonProperty> { private readonly List<BsonProperty> _children = new List<BsonProperty>(); public void Add(string name, BsonToken token) { _children.Add(new BsonProperty { Name = new BsonString(name, false), Value = token }); token.Parent = this; } public override BsonType Type => BsonType.Object; public IEnumerator<BsonProperty> GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonArray : BsonToken, IEnumerable<BsonToken> { private readonly List<BsonToken> _children = new List<BsonToken>(); public void Add(BsonToken token) { _children.Add(token); token.Parent = this; } public override BsonType Type => BsonType.Array; public IEnumerator<BsonToken> GetEnumerator() { return _children.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } internal class BsonEmpty : BsonToken { public static readonly BsonToken Null = new BsonEmpty(BsonType.Null); public static readonly BsonToken Undefined = new BsonEmpty(BsonType.Undefined); private BsonEmpty(BsonType type) { Type = type; } public override BsonType Type { get; } } internal class BsonValue : BsonToken { private readonly object _value; private readonly BsonType _type; public BsonValue(object value, BsonType type) { _value = value; _type = type; } public object Value => _value; public override BsonType Type => _type; } internal class BsonBoolean : BsonValue { public static readonly BsonBoolean False = new BsonBoolean(false); public static readonly BsonBoolean True = new BsonBoolean(true); private BsonBoolean(bool value) : base(value, BsonType.Boolean) { } } internal class BsonString : BsonValue { public int ByteCount { get; set; } public bool IncludeLength { get; } public BsonString(object value, bool includeLength) : base(value, BsonType.String) { IncludeLength = includeLength; } } internal class BsonBinary : BsonValue { public BsonBinaryType BinaryType { get; set; } public BsonBinary(byte[] value, BsonBinaryType binaryType) : base(value, BsonType.Binary) { BinaryType = binaryType; } } internal class BsonRegex : BsonToken { public BsonString Pattern { get; set; } public BsonString Options { get; set; } public BsonRegex(string pattern, string options) { Pattern = new BsonString(pattern, false); Options = new BsonString(options, false); } public override BsonType Type => BsonType.Regex; } internal class BsonProperty { public BsonString Name { get; set; } public BsonToken Value { get; set; } } }
28.559524
98
0.633806
[ "MIT" ]
Wehmeyer100/CoI.Mod.Better
Source Code/src/Newtonsoft.Json/Bson/BsonToken.cs
4,798
C#
using Microsoft.Win32; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace SpammD { class stringFunctions { private static readonly char[] asciiChars = { '█', '░', '@', '&', '$', '%', '!', '(', ')', '=', '+', '^', '*', ';', ':', '_', '-', '"', '/', ',', '.', ' ' }; public string openFileDialogFile(string userFilter) { try { OpenFileDialog openFileDialog = new OpenFileDialog { Filter = userFilter }; if (openFileDialog.ShowDialog() == true) { return openFileDialog.FileName; } else { return ""; } } catch(Exception ex) { MessageBox.Show("ERROR: An Error Occured When Loading The File \nERROR:" + ex); return ""; } } public List<string> openImage(int asciiWidth, string asciiImageDirectory) { List<string> asciiStringArray = new List<string>(); try { System.Drawing.Image inputImage = System.Drawing.Image.FromFile(asciiImageDirectory); Bitmap inputImageResize = resizeImage(inputImage, asciiWidth); asciiStringArray = new List<string>(); for (int y = 0; y < inputImageResize.Height; y++) { StringBuilder stringBuilder = new StringBuilder(); for (int x = 0; x < inputImageResize.Width; x++) { System.Drawing.Color colour = inputImageResize.GetPixel(x, y); int brightness = findBrightness(colour); string pxlToChar = brightnessToChar(brightness); stringBuilder.Append(pxlToChar); stringBuilder.Append(pxlToChar); } asciiStringArray.Add(stringBuilder.ToString()); } return asciiStringArray; } catch (Exception ex) { MessageBox.Show("ERROR: An Error Occured When Loading The File \nERROR:" + ex); asciiStringArray = new List<string>(); return asciiStringArray; } } public static Bitmap resizeImage(System.Drawing.Image inputImage, int asciiWidth) { //Gains proper ratio height in characters int asciiHeight = (int)Math.Ceiling((double)inputImage.Height * asciiWidth / inputImage.Width); //Defines new rescaled bitmap Bitmap outputImage = new Bitmap(asciiWidth, asciiHeight); Graphics g = Graphics.FromImage((System.Drawing.Image)outputImage); g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.DrawImage(inputImage, 0, 0, asciiWidth, asciiHeight); g.Dispose(); return outputImage; } public static int findBrightness(System.Drawing.Color inputColour) { int brightness = (inputColour.R + inputColour.G + inputColour.B) / 3; return brightness; } public static string brightnessToChar(int brightness) { int index = brightness * 10 / 255; return asciiChars[index].ToString(); } public List<string> openTXT() { List<string> randomPhraseArray = new List<string>(); OpenFileDialog openFileDialog = new OpenFileDialog { Filter = "TXT|*.txt" }; if (openFileDialog.ShowDialog() == true) { string randomPhrasesDirectory = openFileDialog.FileName; using (StreamReader sr = new StreamReader(randomPhrasesDirectory)) { string data; while ((data = sr.ReadLine()) != null) { randomPhraseArray.Add(data); } } } return randomPhraseArray; } } }
35.306452
165
0.51005
[ "MPL-2.0" ]
ShaanCoding/SpammD
SpammD/SpammD/stringFunctions.cs
4,384
C#
// // Copyright (c) 2022 karamem0 // // This software is released under the MIT License. // // https://github.com/karamem0/sp-client-core/blob/main/LICENSE // using Karamem0.SharePoint.PowerShell.Models.V1; using Karamem0.SharePoint.PowerShell.Runtime.Commands; using Karamem0.SharePoint.PowerShell.Services.V1; using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; namespace Karamem0.SharePoint.PowerShell.Commands { [Cmdlet("Remove", "KshList")] [OutputType(typeof(void))] public class RemoveListCommand : ClientObjectCmdlet<IListService> { public RemoveListCommand() { } [Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = "ParamSet1")] [Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true, ParameterSetName = "ParamSet2")] public List Identity { get; private set; } [Parameter(Mandatory = true, ParameterSetName = "ParamSet2")] public SwitchParameter RecycleBin { get; private set; } protected override void ProcessRecordCore() { if (this.ParameterSetName == "ParamSet1") { this.Service.RemoveObject(this.Identity); } if (this.ParameterSetName == "ParamSet2") { this.ValidateSwitchParameter(nameof(this.RecycleBin)); this.Outputs.Add(this.Service.RecycleObject(this.Identity)); } } } }
30.150943
110
0.636421
[ "MIT" ]
karamem0/SPClientCore
source/Karamem0.SPClientCore/Commands/RemoveListCommand.cs
1,598
C#
using System; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Media.Animation; using System.Windows.Threading; namespace AutoUpdater.Controls { /// <summary> /// A metrofied ProgressBar. /// <see cref="ProgressBar"/> /// </summary> public class MetroProgressBar : ProgressBar { public static readonly DependencyProperty EllipseDiameterProperty = DependencyProperty.Register("EllipseDiameter", typeof(double), typeof(MetroProgressBar), new PropertyMetadata(default(double))); public static readonly DependencyProperty EllipseOffsetProperty = DependencyProperty.Register("EllipseOffset", typeof(double), typeof(MetroProgressBar), new PropertyMetadata(default(double))); private readonly object lockme = new object(); private Storyboard indeterminateStoryboard; static MetroProgressBar() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MetroProgressBar), new FrameworkPropertyMetadata(typeof(MetroProgressBar))); IsIndeterminateProperty.OverrideMetadata(typeof(MetroProgressBar), new FrameworkPropertyMetadata(OnIsIndeterminateChanged)); } public MetroProgressBar() { IsVisibleChanged += VisibleChangedHandler; } private void VisibleChangedHandler(object sender, DependencyPropertyChangedEventArgs e) { // reset Storyboard if Visibility is set to Visible #1300 if (IsIndeterminate) { ToggleIndeterminate(this, (bool)e.OldValue, (bool)e.NewValue); } } private static void OnIsIndeterminateChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { ToggleIndeterminate(dependencyObject as MetroProgressBar, (bool)e.OldValue, (bool)e.NewValue); } private static void ToggleIndeterminate(MetroProgressBar bar, bool oldValue, bool newValue) { if (bar != null && newValue != oldValue) { var indeterminateState = bar.GetIndeterminate(); var containingObject = bar.GetTemplateChild("ContainingGrid") as FrameworkElement; if (indeterminateState != null && containingObject != null) { if (oldValue && indeterminateState.Storyboard != null) { // remove the previous storyboard from the Grid #1855 indeterminateState.Storyboard.Stop(containingObject); indeterminateState.Storyboard.Remove(containingObject); } if (newValue) { var resetAction = new Action(() => { bar.InvalidateMeasure(); bar.InvalidateArrange(); bar.ResetStoryboard(bar.ActualWidth, false); }); bar.Dispatcher.BeginInvoke(DispatcherPriority.Background, resetAction); } } } } /// <summary> /// Gets/sets the diameter of the ellipses used in the indeterminate animation. /// </summary> public double EllipseDiameter { get { return (double)GetValue(EllipseDiameterProperty); } set { SetValue(EllipseDiameterProperty, value); } } /// <summary> /// Gets/sets the offset of the ellipses used in the indeterminate animation. /// </summary> public double EllipseOffset { get { return (double)GetValue(EllipseOffsetProperty); } set { SetValue(EllipseOffsetProperty, value); } } private void SizeChangedHandler(object sender, SizeChangedEventArgs e) { var actualWidth = ActualWidth; var bar = this; if (this.Visibility == Visibility.Visible && this.IsIndeterminate) { bar.ResetStoryboard(actualWidth, true); } } private void ResetStoryboard(double width, bool removeOldStoryboard) { if (!this.IsIndeterminate) { return; } lock (this.lockme) { //perform calculations var containerAnimStart = CalcContainerAnimStart(width); var containerAnimEnd = CalcContainerAnimEnd(width); var ellipseAnimWell = CalcEllipseAnimWell(width); var ellipseAnimEnd = CalcEllipseAnimEnd(width); //reset the main double animation try { var indeterminate = GetIndeterminate(); if (indeterminate != null && this.indeterminateStoryboard != null) { var newStoryboard = this.indeterminateStoryboard.Clone(); var doubleAnim = newStoryboard.Children.First(t => t.Name == "MainDoubleAnim"); doubleAnim.SetValue(DoubleAnimation.FromProperty, containerAnimStart); doubleAnim.SetValue(DoubleAnimation.ToProperty, containerAnimEnd); var namesOfElements = new[] { "E1", "E2", "E3", "E4", "E5" }; foreach (var elemName in namesOfElements) { var doubleAnimParent = (DoubleAnimationUsingKeyFrames)newStoryboard.Children.First(t => t.Name == elemName + "Anim"); DoubleKeyFrame first, second, third; if (elemName == "E1") { first = doubleAnimParent.KeyFrames[1]; second = doubleAnimParent.KeyFrames[2]; third = doubleAnimParent.KeyFrames[3]; } else { first = doubleAnimParent.KeyFrames[2]; second = doubleAnimParent.KeyFrames[3]; third = doubleAnimParent.KeyFrames[4]; } first.Value = ellipseAnimWell; second.Value = ellipseAnimWell; third.Value = ellipseAnimEnd; first.InvalidateProperty(DoubleKeyFrame.ValueProperty); second.InvalidateProperty(DoubleKeyFrame.ValueProperty); third.InvalidateProperty(DoubleKeyFrame.ValueProperty); doubleAnimParent.InvalidateProperty(Storyboard.TargetPropertyProperty); doubleAnimParent.InvalidateProperty(Storyboard.TargetNameProperty); } var containingGrid = (FrameworkElement)GetTemplateChild("ContainingGrid"); if (removeOldStoryboard && indeterminate.Storyboard != null) { // remove the previous storyboard from the Grid #1855 indeterminate.Storyboard.Stop(containingGrid); indeterminate.Storyboard.Remove(containingGrid); } indeterminate.Storyboard = newStoryboard; if (indeterminate.Storyboard != null) { indeterminate.Storyboard.Begin(containingGrid, true); } } } catch (Exception) { //we just ignore } } } private VisualState GetIndeterminate() { var templateGrid = GetTemplateChild("ContainingGrid") as FrameworkElement; if (templateGrid == null) { this.ApplyTemplate(); templateGrid = GetTemplateChild("ContainingGrid") as FrameworkElement; if (templateGrid == null) return null; } var groups = VisualStateManager.GetVisualStateGroups(templateGrid); return groups != null ? groups.Cast<VisualStateGroup>() .SelectMany(@group => @group.States.Cast<VisualState>()) .FirstOrDefault(state => state.Name == "Indeterminate") : null; } private void SetEllipseDiameter(double width) { if (width <= 180) { EllipseDiameter = 4; return; } if (width <= 280) { EllipseDiameter = 5; return; } EllipseDiameter = 6; } private void SetEllipseOffset(double width) { if (width <= 180) { EllipseOffset = 4; return; } if (width <= 280) { EllipseOffset = 7; return; } EllipseOffset = 9; } private double CalcContainerAnimStart(double width) { if (width <= 180) { return -34; } if (width <= 280) { return -50.5; } return -63; } private double CalcContainerAnimEnd(double width) { var firstPart = 0.4352 * width; if (width <= 180) { return firstPart - 25.731; } if (width <= 280) { return firstPart + 27.84; } return firstPart + 58.862; } private double CalcEllipseAnimWell(double width) { return width * 1.0 / 3.0; } private double CalcEllipseAnimEnd(double width) { return width * 2.0 / 3.0; } public override void OnApplyTemplate() { base.OnApplyTemplate(); lock (this.lockme) { this.indeterminateStoryboard = this.TryFindResource("IndeterminateStoryboard") as Storyboard; } Loaded -= LoadedHandler; Loaded += LoadedHandler; } private void LoadedHandler(object sender, RoutedEventArgs routedEventArgs) { Loaded -= LoadedHandler; SizeChangedHandler(null, null); SizeChanged += SizeChangedHandler; } protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); // Update the Ellipse properties to their default values // only if they haven't been user-set. if (EllipseDiameter.Equals(0)) { SetEllipseDiameter(ActualWidth); } if (EllipseOffset.Equals(0)) { SetEllipseOffset(ActualWidth); } } } }
37.119741
145
0.506539
[ "MIT" ]
gisewa/AutoUpdater
src/AutoUpdater/Controls/MetroProgressBar.cs
11,472
C#
using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; namespace WebApp_OpenIDConnect_DotNet { public interface Imyservice { IEnumerable<Claim> GetClaims(); } }
18.142857
39
0.751969
[ "MIT" ]
ezedesaeger/RepoDeCasa
Interfaces/Imyservice.cs
256
C#
using HarmonyLib; using System; using System.Reflection; using System.Reflection.Emit; using System.Collections.Generic; using KianCommons; using KianCommons.Patches; namespace AdaptiveRoads.Patches.Lane { [HarmonyPatch] [InGamePatch] [HarmonyBefore("com.klyte.redirectors.PS")] public static class PopulateGroupData { //public void PopulateGroupData(ushort segmentID, uint laneID, NetInfo.Lane laneInfo, bool destroyed, //NetNode.Flags startFlags, NetNode.Flags endFlags, float startAngle, float endAngle, bool invert, bool terrainHeight, //int layer, ref int vertexIndex, ref int triangleIndex, Vector3 groupPosition, RenderGroup.MeshData data, //ref Vector3 min, ref Vector3 max, ref float maxRenderDistance, ref float maxInstanceDistance, ref bool hasProps) public static MethodBase TargetMethod() => typeof(global::NetLane). GetMethod("PopulateGroupData", BindingFlags.Public | BindingFlags.Instance, true); public static IEnumerable<CodeInstruction> Transpiler(MethodBase original, IEnumerable<CodeInstruction> instructions, ILGenerator il) { try { var codes = TranspilerUtils.ToCodeList(instructions); CheckPropFlagsCommons.PatchCheckFlags(codes, original, il); Log.Info($"{ReflectionHelpers.ThisMethod} patched {original} successfully!"); return codes; } catch (Exception e) { Log.Error(e.ToString()); throw e; } } } // end class } // end name space
46.794118
143
0.686361
[ "MIT" ]
Elesbaan70/AdaptiveNetworks
AdaptiveRoads/Patches/Lane/PopulateGroupData.cs
1,591
C#
/* * Copyright (c) Citrix Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1) Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Collections; using System.Collections.Generic; using CookComputing.XmlRpc; namespace XenAPI { /// <summary> /// Management of remote authentication services /// First published in XenServer 5.5. /// </summary> public partial class Auth : XenObject<Auth> { public Auth() { } /// <summary> /// Creates a new Auth from a Proxy_Auth. /// </summary> /// <param name="proxy"></param> public Auth(Proxy_Auth proxy) { this.UpdateFromProxy(proxy); } public override void UpdateFrom(Auth update) { } internal void UpdateFromProxy(Proxy_Auth proxy) { } public Proxy_Auth ToProxy() { Proxy_Auth result_ = new Proxy_Auth(); return result_; } /// <summary> /// Creates a new Auth from a Hashtable. /// </summary> /// <param name="table"></param> public Auth(Hashtable table) { } public bool DeepEquals(Auth other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return false; } public override string SaveChanges(Session session, string opaqueRef, Auth server) { if (opaqueRef == null) { System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); return ""; } else { throw new InvalidOperationException("This type has no read/write properties"); } } /// <summary> /// This call queries the external directory service to obtain the subject_identifier as a string from the human-readable subject_name /// First published in XenServer 5.5. /// </summary> /// <param name="session">The session</param> /// <param name="_subject_name">The human-readable subject_name, such as a username or a groupname</param> public static string get_subject_identifier(Session session, string _subject_name) { return (string)session.proxy.auth_get_subject_identifier(session.uuid, (_subject_name != null) ? _subject_name : "").parse(); } /// <summary> /// This call queries the external directory service to obtain the user information (e.g. username, organization etc) from the specified subject_identifier /// First published in XenServer 5.5. /// </summary> /// <param name="session">The session</param> /// <param name="_subject_identifier">A string containing the subject_identifier, unique in the external directory service</param> public static Dictionary<string, string> get_subject_information_from_identifier(Session session, string _subject_identifier) { return Maps.convert_from_proxy_string_string(session.proxy.auth_get_subject_information_from_identifier(session.uuid, (_subject_identifier != null) ? _subject_identifier : "").parse()); } /// <summary> /// This calls queries the external directory service to obtain the transitively-closed set of groups that the the subject_identifier is member of. /// First published in XenServer 5.5. /// </summary> /// <param name="session">The session</param> /// <param name="_subject_identifier">A string containing the subject_identifier, unique in the external directory service</param> public static string[] get_group_membership(Session session, string _subject_identifier) { return (string [])session.proxy.auth_get_group_membership(session.uuid, (_subject_identifier != null) ? _subject_identifier : "").parse(); } } }
39.666667
198
0.633175
[ "BSD-2-Clause" ]
GaborApatiNagy/xenadmin
XenModel/XenAPI/Auth.cs
5,474
C#
using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; namespace api.Models { [Table("invoices")] public partial class Invoice { [Key] [JsonIgnore] public int Id { get; set; } [Required(ErrorMessage = "O campo Data de Contratação é obrigatório.")] public DateTime ContractDate { get; set; } [Required(ErrorMessage = "O campo Método de cobrança é Obrigatório")] public string BillingMethod { get; set; } [Required(ErrorMessage = "O campo Dia de cobrança é Obrigatório")] public int BillingDay { get; set; } public int CustomerId { get; set; } public Customer Customer { get; set; } public int PlanId { get; set; } public Plan Plan { get; set; } } }
27.1875
79
0.64023
[ "MIT" ]
costajvsc/easyinvoices
api/Models/Invoice.cs
881
C#
namespace Antrv.FFMpeg.Interop; public struct AVReplayGain { /// <summary> /// Track replay gain in microbels (divide by 100000 to get the value in dB). /// Should be set to INT32_MIN when unknown. /// </summary> public int TrackGain; /// <summary> /// Peak track amplitude, with 100000 representing full scale (but values /// may overflow). 0 when unknown. /// </summary> public uint TrackPeak; /// <summary> /// Same as track_gain, but for the whole album. /// </summary> public int AlbumGain; /// <summary> /// Same as track_peak, but for the whole album. /// </summary> public uint AlbumPeak; }
25.037037
81
0.62426
[ "MIT" ]
antrv/ffmpeg-net
Antrv.FFMpeg/Interop/libavutil/replaygain.h/AVReplayGain.cs
678
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Radio_Tests")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] [assembly: System.Reflection.AssemblyProductAttribute("Radio_Tests")] [assembly: System.Reflection.AssemblyTitleAttribute("Radio_Tests")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] // Generated by the MSBuild WriteCodeFragment class.
40.958333
80
0.648016
[ "MIT" ]
Otomkins/RadioApplication
Radio_TESTS/obj/Debug/netcoreapp3.1/Radio_TESTS.AssemblyInfo.cs
983
C#
using AutoFilterer.Extensions; using AutoFilterer.Tests.Core; using AutoFilterer.Tests.Environment.Dtos; using AutoFilterer.Tests.Environment.Models; using AutoFilterer.Types; using System; using System.Collections.Generic; using System.Linq; using Xunit; namespace AutoFilterer.Tests.Types { public class StringFilterTests { [Theory, AutoMoqData(count:64)] public void BuildExpression_TitleWithContains_ShouldMatchCount(List<Book> data) { // Arrange var filter = new BookFilter_StringFilter_Title { Title = new StringFilter { Contains = "ab" } }; // Act var query = data.AsQueryable().ApplyFilter(filter); var result = query.ToList(); // Assert var actualResult = data.AsQueryable().Where(x => x.Title.Contains(filter.Title.Contains)).ToList(); Assert.Equal(actualResult.Count, result.Count); foreach (var item in actualResult) Assert.Contains(item, result); } [Theory, AutoMoqData(count:64)] public void BuildExpression_TitleWithContainsCaseInsensitive_ShouldMatchCount(List<Book> data) { // Arrange var filter = new BookFilter_StringFilter_Title { Title = new StringFilter { Contains = "Ab", Compare = StringComparison.InvariantCultureIgnoreCase } }; // Act var query = data.AsQueryable().ApplyFilter(filter); var result = query.ToList(); // Assert var actualResult = data.AsQueryable().Where(x => x.Title.Contains(filter.Title.Contains, StringComparison.InvariantCultureIgnoreCase)).ToList(); Assert.Equal(actualResult.Count, result.Count); foreach (var item in actualResult) Assert.Contains(item, result); } } }
31.6
156
0.583739
[ "MIT" ]
enisn/AutoFilterer
tests/AutoFilterer.Tests/Types/StringFilterTests.cs
2,056
C#
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! namespace Google.Cloud.Metastore.V1Alpha.Snippets { // [START metastore_v1alpha_generated_DataprocMetastore_ListMetadataImports_sync_flattened_resourceNames] using Google.Api.Gax; using Google.Cloud.Metastore.V1Alpha; using System; public sealed partial class GeneratedDataprocMetastoreClientSnippets { /// <summary>Snippet for ListMetadataImports</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ListMetadataImportsResourceNames() { // Create client DataprocMetastoreClient dataprocMetastoreClient = DataprocMetastoreClient.Create(); // Initialize request argument(s) ServiceName parent = ServiceName.FromProjectLocationService("[PROJECT]", "[LOCATION]", "[SERVICE]"); // Make the request PagedEnumerable<ListMetadataImportsResponse, MetadataImport> response = dataprocMetastoreClient.ListMetadataImports(parent); // Iterate over all response items, lazily performing RPCs as required foreach (MetadataImport item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListMetadataImportsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (MetadataImport item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page<MetadataImport> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (MetadataImport item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; } } // [END metastore_v1alpha_generated_DataprocMetastore_ListMetadataImports_sync_flattened_resourceNames] }
43.96
136
0.651501
[ "Apache-2.0" ]
AlexandrTrf/google-cloud-dotnet
apis/Google.Cloud.Metastore.V1Alpha/Google.Cloud.Metastore.V1Alpha.GeneratedSnippets/DataprocMetastoreClient.ListMetadataImportsResourceNamesSnippet.g.cs
3,297
C#
using BinanceAPI.Authentication; using BinanceAPI.Enums; using BinanceAPI.Options; using System; using System.Net.Http; namespace BinanceAPI.Objects { /// <summary> /// Options for the binance client /// </summary> public class BinanceClientOptions : RestClientOptions { /// <summary> /// The delay before the internal timer starts and begins synchronizing the server time /// </summary> public int ServerTimeStartTime { get; set; } = 2000; /// <summary> /// The interval at which to sync the time automatically /// </summary> public int ServerTimeUpdateTime { get; set; } = 125; /// <summary> /// Automatic Server Time Sync Update Mode /// </summary> public ServerTimeSyncType ServerTimeSyncType { get; set; } = ServerTimeSyncType.Manual; /// <summary> /// The default receive window for requests /// </summary> public TimeSpan ReceiveWindow { get; set; } = TimeSpan.FromSeconds(5); /// <summary> /// Constructor with default endpoints /// </summary> public BinanceClientOptions() : this(BinanceApiAddresses.Default) { } /// <summary> /// Constructor with default endpoints /// </summary> /// <param name="client">HttpClient to use for requests from this client</param> public BinanceClientOptions(HttpClient client) : this(BinanceApiAddresses.Default, client) { } /// <summary> /// Constructor with custom endpoints /// </summary> /// <param name="addresses">The base addresses to use</param> public BinanceClientOptions(BinanceApiAddresses addresses) : this(addresses.RestClientAddress, null) { } /// <summary> /// Constructor with custom endpoints /// </summary> /// <param name="addresses">The base addresses to use</param> /// <param name="client">HttpClient to use for requests from this client</param> public BinanceClientOptions(BinanceApiAddresses addresses, HttpClient client) : this(addresses.RestClientAddress, client) { } /// <summary> /// Constructor with custom endpoints /// </summary> /// <param name="spotBaseAddress">Сustom url for the SPOT API</param> public BinanceClientOptions(string spotBaseAddress) : this(spotBaseAddress, null) { } /// <summary> /// Constructor with custom endpoints /// </summary> /// <param name="spotBaseAddress">Сustom url for the SPOT API</param> /// <param name="client">HttpClient to use for requests from this client</param> public BinanceClientOptions(string spotBaseAddress, HttpClient? client) : base(spotBaseAddress) { HttpClient = client; } /// <summary> /// Return a copy of these options /// </summary> /// <returns></returns> public BinanceClientOptions Copy() { var copy = Copy<BinanceClientOptions>(); copy.ServerTimeStartTime = ServerTimeStartTime; copy.ServerTimeUpdateTime = ServerTimeUpdateTime; copy.ServerTimeSyncType = ServerTimeSyncType; copy.ReceiveWindow = ReceiveWindow; copy.LogLevel = LogLevel; copy.LogPath = LogPath; copy.LogToConsole = LogToConsole; return copy; } } }
34.617647
129
0.603512
[ "MIT" ]
HypsyNZ/Binance-API
Binance-API/Binance-API/Objects/Options/Client/BinanceClientOptions.cs
3,535
C#
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("PrismSample")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PrismSample")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから // 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] //ローカライズ可能なアプリケーションのビルドを開始するには、 //.csproj ファイルの <UICulture>CultureYouAreCodingWith</UICulture> を //<PropertyGroup> 内部で設定します。たとえば、 //ソース ファイルで英語を使用している場合、<UICulture> を en-US に設定します。次に、 //下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を //プロジェクト ファイルの UICulture 設定と一致するよう更新します。 //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所 //(リソースがページ、 //またはアプリケーション リソース ディクショナリに見つからない場合に使用されます) ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所 //(リソースがページ、 //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます) )] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // Revision // // すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
34
101
0.68645
[ "MIT" ]
oika/NComputed
PrismSample/Properties/AssemblyInfo.cs
2,999
C#
namespace K1vs.DotChat.Dependency { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public interface IDependencyRegistrationBuilder<out TImplementation> { IDependencyRegistrationBuilder<TImplementation> As<TService>(); IDependencyRegistrationBuilder<TImplementation> As(Type type); IDependencyRegistrationBuilder<TImplementation> AsSelf(); IDependencyRegistrationBuilder<TImplementation> AsSingleton(); IDependencyRegistrationBuilder<TImplementation> AsTransient(); IDependencyRegistrationBuilder<TImplementation> AsScoped(); void Build(); } }
32
72
0.742898
[ "MIT" ]
K1vs/DotChat
DotChat/DotChat/Dependency/IDependencyRegistrationBuilder.cs
706
C#
// WARNING // // This file has been generated automatically by Visual Studio from the outlets and // actions declared in your storyboard file. // Manual changes to this file will not be maintained. // using Foundation; using System; using System.CodeDom.Compiler; namespace Acquaint.Native.iOS { [Register ("SettingsViewController")] partial class SettingsViewController { [Outlet] UIKit.UITextField BackendUrlEntry { get; set; } [Outlet] UIKit.UISwitch ClearImageCacheSwitch { get; set; } [Outlet] UIKit.UITextField DataPartitionPhraseEntry { get; set; } [Outlet] UIKit.UITextField ImageCacheDurationEntry { get; set; } [Outlet] UIKit.UISwitch ResetToDefaultsSwitch { get; set; } void ReleaseDesignerOutlets () { if (BackendUrlEntry != null) { BackendUrlEntry.Dispose (); BackendUrlEntry = null; } if (ClearImageCacheSwitch != null) { ClearImageCacheSwitch.Dispose (); ClearImageCacheSwitch = null; } if (DataPartitionPhraseEntry != null) { DataPartitionPhraseEntry.Dispose (); DataPartitionPhraseEntry = null; } if (ImageCacheDurationEntry != null) { ImageCacheDurationEntry.Dispose (); ImageCacheDurationEntry = null; } if (ResetToDefaultsSwitch != null) { ResetToDefaultsSwitch.Dispose (); ResetToDefaultsSwitch = null; } } } }
27.095238
84
0.559461
[ "Apache-2.0" ]
Acidburn0zzz/.NET-SDK
Samples/Acquaint/Acquaint.Native/Acquaint.Native.iOS/SettingsViewController.designer.cs
1,707
C#
using Microsoft.AspNet.SignalR.Hubs; using System.Threading; using System.Collections.Generic; namespace Microsoft.AspNet.SignalR.Hosting.AspNet.Samples.Hubs.DrawingPad { [HubName("DrawingPad")] public class DrawingPad : Hub { #region Data structures public class Point { public int X { get; set; } public int Y { get; set; } } public class Line { public Point From { get; set; } public Point To { get; set; } public string Color { get; set; } } #endregion private static long _id; // defines some colors private readonly static string[] colors = new string[]{ "red", "green", "blue", "orange", "navy", "silver", "black", "lime" }; public void Join() { Clients.Caller.color = colors[Interlocked.Increment(ref _id) % colors.Length]; } // A user has drawed a line ... [HubMethodName("Draw")] public void Draw(Line data) { // ... propagate it to all users Clients.Others.draw(data); } } }
26.133333
90
0.538265
[ "Apache-2.0" ]
MacawNL/SignalR
samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Hubs/DrawingPad/DrawingPad.cs
1,178
C#
// <auto-generated /> using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using SG.TestRunService.Data; namespace SG.TestRunService.Migrations { [DbContext(typeof(TSDbContext))] partial class TSDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "3.1.6") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("SG.TestRunService.Data.Attachment", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<byte[]>("Data") .HasColumnType("varbinary(max)"); b.Property<string>("Name") .HasColumnType("nvarchar(max)"); b.Property<int?>("TestRunId") .HasColumnType("int"); b.Property<int?>("TestRunSessionId") .HasColumnType("int"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.Property<string>("Type") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("TestRunId"); b.HasIndex("TestRunSessionId"); b.ToTable("Attachment"); }); modelBuilder.Entity("SG.TestRunService.Data.BuildInfo", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AzureBuildDefinitionId") .HasColumnType("int"); b.Property<int>("AzureBuildId") .HasColumnType("int"); b.Property<string>("BuildNumber") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<DateTime>("Date") .HasColumnType("datetime2"); b.Property<string>("SourceVersion") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<string>("TeamProject") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AzureBuildDefinitionId", "AzureBuildId") .IsUnique(); b.ToTable("BuildInfo"); }); modelBuilder.Entity("SG.TestRunService.Data.CodeSignature", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("Path") .HasColumnType("nvarchar(max)"); b.Property<string>("Signature") .IsRequired() .HasColumnType("nvarchar(50)") .HasMaxLength(50); b.Property<byte>("Type") .HasColumnType("tinyint"); b.HasKey("Id"); b.HasIndex("Signature") .IsUnique(); b.ToTable("CodeSignature"); }); modelBuilder.Entity("SG.TestRunService.Data.ExtraData", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("Name") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<int?>("TestCaseId") .HasColumnType("int"); b.Property<int?>("TestRunId") .HasColumnType("int"); b.Property<int?>("TestRunSessionId") .HasColumnType("int"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.Property<string>("Url") .HasColumnType("nvarchar(max)"); b.Property<string>("Value") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("TestCaseId"); b.HasIndex("TestRunId"); b.HasIndex("TestRunSessionId"); b.ToTable("ExtraData"); }); modelBuilder.Entity("SG.TestRunService.Data.LastImpactUpdate", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("ProductBuildInfoId") .HasColumnType("int"); b.Property<int>("ProductLineId") .HasColumnType("int"); b.Property<int?>("TestRunSessionId") .HasColumnType("int"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.Property<DateTime>("UpdateDate") .HasColumnType("datetime2"); b.HasKey("Id"); b.HasIndex("ProductBuildInfoId"); b.HasIndex("ProductLineId") .IsUnique(); b.HasIndex("TestRunSessionId"); b.ToTable("LastImpactUpdate"); }); modelBuilder.Entity("SG.TestRunService.Data.ProductLine", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int?>("AzureProductBuildDefinitionId") .HasColumnType("int"); b.Property<string>("Key") .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.ToTable("ProductLine"); }); modelBuilder.Entity("SG.TestRunService.Data.TestCase", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AzureTestCaseId") .HasColumnType("int"); b.Property<string>("TeamProject") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.Property<string>("Title") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); b.HasIndex("AzureTestCaseId") .IsUnique(); b.ToTable("TestCase"); }); modelBuilder.Entity("SG.TestRunService.Data.TestCaseImpactHistory", b => { b.Property<int>("ProductLineId") .HasColumnType("int"); b.Property<int>("CodeSignatureId") .HasColumnType("int"); b.Property<int>("TestCaseId") .HasColumnType("int"); b.Property<int>("ProductBuildInfoId") .HasColumnType("int"); b.Property<DateTime>("Date") .HasColumnType("datetime2"); b.HasKey("ProductLineId", "CodeSignatureId", "TestCaseId", "ProductBuildInfoId"); b.HasIndex("CodeSignatureId"); b.HasIndex("ProductBuildInfoId"); b.HasIndex("TestCaseId"); b.ToTable("TestCaseImpactHistory"); }); modelBuilder.Entity("SG.TestRunService.Data.TestCaseImpactItem", b => { b.Property<int>("ProductLineId") .HasColumnType("int"); b.Property<int>("CodeSignatureId") .HasColumnType("int"); b.Property<int>("TestCaseId") .HasColumnType("int"); b.Property<DateTime>("DateAdded") .HasColumnType("datetime2"); b.Property<DateTime?>("DateRemoved") .HasColumnType("datetime2"); b.Property<bool>("IsDeleted") .HasColumnType("bit"); b.HasKey("ProductLineId", "CodeSignatureId", "TestCaseId"); b.HasIndex("CodeSignatureId"); b.HasIndex("TestCaseId"); b.HasIndex("ProductLineId", "TestCaseId"); b.ToTable("TestCaseImpactItem"); }); modelBuilder.Entity("SG.TestRunService.Data.TestLastState", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<DateTime?>("LastImpactedDate") .HasColumnType("datetime2"); b.Property<int?>("LastImpactedProductBuildInfoId") .HasColumnType("int"); b.Property<int>("LastOutcome") .HasColumnType("int"); b.Property<DateTime>("LastOutcomeDate") .HasColumnType("datetime2"); b.Property<int>("LastOutcomeProductBuildInfoId") .HasColumnType("int"); b.Property<int>("ProductLineId") .HasColumnType("int"); b.Property<int?>("RunReason") .HasColumnType("int"); b.Property<bool>("ShouldBeRun") .HasColumnType("bit"); b.Property<int>("TestCaseId") .HasColumnType("int"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.HasKey("Id"); b.HasIndex("LastImpactedProductBuildInfoId"); b.HasIndex("LastOutcomeProductBuildInfoId"); b.HasIndex("ProductLineId"); b.HasIndex("TestCaseId", "ProductLineId") .IsUnique(); b.ToTable("TestLastState"); }); modelBuilder.Entity("SG.TestRunService.Data.TestRun", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<string>("ErrorMessage") .HasColumnType("nvarchar(max)"); b.Property<DateTime?>("FinishTime") .HasColumnType("datetime2"); b.Property<int>("Outcome") .HasColumnType("int"); b.Property<DateTime?>("StartTime") .HasColumnType("datetime2"); b.Property<int>("State") .HasColumnType("int"); b.Property<int>("TestCaseId") .HasColumnType("int"); b.Property<int>("TestRunSessionId") .HasColumnType("int"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.HasKey("Id"); b.HasIndex("TestCaseId"); b.HasIndex("TestRunSessionId", "TestCaseId") .IsUnique(); b.ToTable("TestRun"); }); modelBuilder.Entity("SG.TestRunService.Data.TestRunSession", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property<int>("AzureTestBuildId") .HasColumnType("int"); b.Property<string>("AzureTestBuildNumber") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<DateTime?>("FinishTime") .HasColumnType("datetime2"); b.Property<int>("ProductBuildInfoId") .HasColumnType("int"); b.Property<int>("ProductLineId") .HasColumnType("int"); b.Property<DateTime>("StartTime") .HasColumnType("datetime2"); b.Property<int>("State") .HasColumnType("int"); b.Property<string>("SuiteName") .IsRequired() .HasColumnType("nvarchar(max)"); b.Property<byte[]>("Timestamp") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("rowversion"); b.HasKey("Id"); b.HasIndex("ProductBuildInfoId"); b.HasIndex("ProductLineId"); b.ToTable("TestRunSession"); }); modelBuilder.Entity("SG.TestRunService.Data.Attachment", b => { b.HasOne("SG.TestRunService.Data.TestRun", null) .WithMany("Attachments") .HasForeignKey("TestRunId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("SG.TestRunService.Data.TestRunSession", null) .WithMany("Attachments") .HasForeignKey("TestRunSessionId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("SG.TestRunService.Data.ExtraData", b => { b.HasOne("SG.TestRunService.Data.TestCase", null) .WithMany("ExtraData") .HasForeignKey("TestCaseId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("SG.TestRunService.Data.TestRun", null) .WithMany("ExtraData") .HasForeignKey("TestRunId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("SG.TestRunService.Data.TestRunSession", null) .WithMany("ExtraData") .HasForeignKey("TestRunSessionId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("SG.TestRunService.Data.LastImpactUpdate", b => { b.HasOne("SG.TestRunService.Data.BuildInfo", "ProductBuildInfo") .WithMany() .HasForeignKey("ProductBuildInfoId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.ProductLine", "ProductLine") .WithMany() .HasForeignKey("ProductLineId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.TestRunSession", "TestRunSession") .WithMany() .HasForeignKey("TestRunSessionId") .OnDelete(DeleteBehavior.Restrict); }); modelBuilder.Entity("SG.TestRunService.Data.TestCaseImpactHistory", b => { b.HasOne("SG.TestRunService.Data.CodeSignature", "CodeSignature") .WithMany() .HasForeignKey("CodeSignatureId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("SG.TestRunService.Data.BuildInfo", "ProductBuildInfo") .WithMany() .HasForeignKey("ProductBuildInfoId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("SG.TestRunService.Data.TestCase", "TestCase") .WithMany() .HasForeignKey("TestCaseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("SG.TestRunService.Data.TestCaseImpactItem", b => { b.HasOne("SG.TestRunService.Data.CodeSignature", "CodeSignature") .WithMany() .HasForeignKey("CodeSignatureId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.ProductLine", "ProductLine") .WithMany() .HasForeignKey("ProductLineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("SG.TestRunService.Data.TestCase", "TestCase") .WithMany() .HasForeignKey("TestCaseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("SG.TestRunService.Data.TestLastState", b => { b.HasOne("SG.TestRunService.Data.BuildInfo", "LastImpactedProductBuildInfo") .WithMany() .HasForeignKey("LastImpactedProductBuildInfoId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("SG.TestRunService.Data.BuildInfo", "LastOutcomeProductBuildInfo") .WithMany() .HasForeignKey("LastOutcomeProductBuildInfoId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.ProductLine", "ProductLine") .WithMany() .HasForeignKey("ProductLineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("SG.TestRunService.Data.TestCase", "TestCase") .WithMany() .HasForeignKey("TestCaseId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("SG.TestRunService.Data.TestRun", b => { b.HasOne("SG.TestRunService.Data.TestCase", "TestCase") .WithMany() .HasForeignKey("TestCaseId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.TestRunSession", "TestRunSession") .WithMany("TestRuns") .HasForeignKey("TestRunSessionId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); modelBuilder.Entity("SG.TestRunService.Data.TestRunSession", b => { b.HasOne("SG.TestRunService.Data.BuildInfo", "ProductBuildInfo") .WithMany() .HasForeignKey("ProductBuildInfoId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("SG.TestRunService.Data.ProductLine", "ProductLine") .WithMany() .HasForeignKey("ProductLineId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); }); #pragma warning restore 612, 618 } } }
38.036606
125
0.458443
[ "MIT" ]
systemgroupnet/SG.TestRunService
SG.TestRunService/Migrations/TSDbContextModelSnapshot.cs
22,862
C#
using RabbitMQ.Client; using System; using System.Globalization; using System.Text; using System.Windows.Forms; namespace IM { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { var factory = new ConnectionFactory() { HostName = "localhost" }; using (var connection = factory.CreateConnection()) using (var channel = connection.CreateModel()) { channel.QueueDeclare(queue: "hello", durable: false, exclusive: false, autoDelete: false, arguments: null); string message = DateTime.Now.ToString(CultureInfo.InvariantCulture); var body = Encoding.UTF8.GetBytes(message); channel.BasicPublish(exchange: "", routingKey: "hello", basicProperties: null, body: body); string text = $" [x] Sent {message}"; richTextBox1.Text += text + "\r"; } } } }
32.073171
85
0.469962
[ "MIT" ]
festone000/IM
IM/Form1.cs
1,317
C#
// Copyright (c) MOSA Project. Licensed under the New BSD License. // This code was generated by an automated template. namespace Mosa.Compiler.Framework.IR { /// <summary> /// AddCarryIn64 /// </summary> /// <seealso cref="Mosa.Compiler.Framework.IR.BaseIRInstruction" /> public sealed class AddCarryIn64 : BaseIRInstruction { public AddCarryIn64() : base(3, 1) { } } }
20.473684
68
0.694087
[ "BSD-3-Clause" ]
AnErrupTion/MOSA-Project
Source/Mosa.Compiler.Framework/IR/AddCarryIn64.cs
389
C#
using FluentAssertions; using System; using System.Collections.Generic; using System.Linq; using Utils; using Xunit; namespace Advent2020 { public class Day23 { //[Theory] //[InlineData("Data/Day23_test.txt", 0)] //[InlineData("Data/Day23.txt", 0)] public void Problem1(string input, int expected) { } //[Theory] //[InlineData("Data/Day23_test.txt", 0)] //[InlineData("Data/Day23.txt", 0)] public void Problem2(string input, int expected) { } } }
20.275862
57
0.552721
[ "MIT" ]
elpollouk/Advent2017
Advent2020/Day23.cs
590
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Constants { public class Levels { public static readonly byte MainMenu = 0x0; public static readonly byte SampleScene = 0x1; } public class ByteGroups { public static readonly byte FIRST = 0x0; public static readonly byte SECOND = 0x1; } public class ColorLibrary { public static readonly string blue = "blue"; public static readonly string green = "green"; public static readonly string red = "red"; public static readonly string yellow = "yellow"; } public class EntityColor { public static readonly string blue = "blue"; public static readonly string green = "green"; public static readonly string red = "red"; public static readonly string yellow = "yellow"; public static Dictionary<string, string> hexCode = new Dictionary<string, string>() { {blue, "#4D4DFF"}, {green, "#00B359"}, {red, "#FF6666"}, {yellow, "#FFFF4D"} }; public static List<string> GetAllColorKeys() { return new List<string>(){ blue, green, red, yellow }; } private static string GetRandomColorHexFromList(List<string> colors) { int index = Random.Range(0, colors.Count); string key = colors[index]; return hexCode[key]; } public static string GetRandomColorHex() { List<string> colors = GetAllColorKeys(); return GetRandomColorHexFromList(colors); } public static string GetRandomColorHex(List<string> excludes) { List<string> colors = GetAllColorKeys(); colors.RemoveAll(color => excludes.Contains(color)); return GetRandomColorHexFromList(colors); } public static Color TranslateHexToColor(string hex) { Color color; ColorUtility.TryParseHtmlString(hex, out color); return color; } } }
28.088608
91
0.570978
[ "MIT" ]
TheRayOfSeasons/space-shooter
Assets/Scripts/Core/Constants.cs
2,221
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Compute { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; /// <summary> /// VirtualMachineScaleSetExtensionsOperations operations. /// </summary> internal partial class VirtualMachineScaleSetExtensionsOperations : IServiceOperations<ComputeManagementClient>, IVirtualMachineScaleSetExtensionsOperations { /// <summary> /// Initializes a new instance of the VirtualMachineScaleSetExtensionsOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal VirtualMachineScaleSetExtensionsOperations(ComputeManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } Client = client; } /// <summary> /// Gets a reference to the ComputeManagementClient /// </summary> public ComputeManagementClient Client { get; private set; } /// <summary> /// The operation to create or update an extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be create or /// updated. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='extensionParameters'> /// Parameters supplied to the Create VM scale set Extension operation. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<VirtualMachineScaleSetExtension>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse<VirtualMachineScaleSetExtension> _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// The operation to update an extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be updated. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='extensionParameters'> /// Parameters supplied to the Update VM scale set Extension operation. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse<VirtualMachineScaleSetExtension>> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request AzureOperationResponse<VirtualMachineScaleSetExtension> _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// The operation to delete the extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be deleted. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public async Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// <summary> /// The operation to get the extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set containing the extension. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='expand'> /// The expand expression to apply on the operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<VirtualMachineScaleSetExtension>> GetWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vmScaleSetName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); } if (vmssExtensionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); tracingParameters.Add("expand", expand); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (expand != null) { _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<VirtualMachineScaleSetExtension>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<VirtualMachineScaleSetExtension>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets a list of all extensions in a VM scale set. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set containing the extension. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<VirtualMachineScaleSetExtension>>> ListWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vmScaleSetName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<VirtualMachineScaleSetExtension>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page1<VirtualMachineScaleSetExtension>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// The operation to create or update an extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be create or /// updated. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='extensionParameters'> /// Parameters supplied to the Create VM scale set Extension operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<VirtualMachineScaleSetExtension>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtension extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vmScaleSetName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); } if (vmssExtensionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); } if (extensionParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); tracingParameters.Add("extensionParameters", extensionParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(extensionParameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<VirtualMachineScaleSetExtension>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<VirtualMachineScaleSetExtension>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<VirtualMachineScaleSetExtension>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// The operation to update an extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be updated. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='extensionParameters'> /// Parameters supplied to the Update VM scale set Extension operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<VirtualMachineScaleSetExtension>> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, VirtualMachineScaleSetExtensionUpdate extensionParameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vmScaleSetName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); } if (vmssExtensionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); } if (extensionParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "extensionParameters"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); tracingParameters.Add("extensionParameters", extensionParameters); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(extensionParameters != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(extensionParameters, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<VirtualMachineScaleSetExtension>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<VirtualMachineScaleSetExtension>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<VirtualMachineScaleSetExtension>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// The operation to delete the extension. /// </summary> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='vmScaleSetName'> /// The name of the VM scale set where the extension should be deleted. /// </param> /// <param name='vmssExtensionName'> /// The name of the VM scale set extension. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmScaleSetName, string vmssExtensionName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vmScaleSetName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmScaleSetName"); } if (vmssExtensionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vmssExtensionName"); } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } string apiVersion = "2019-12-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vmScaleSetName", vmScaleSetName); tracingParameters.Add("vmssExtensionName", vmssExtensionName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vmScaleSetName}", System.Uri.EscapeDataString(vmScaleSetName)); _url = _url.Replace("{vmssExtensionName}", System.Uri.EscapeDataString(vmssExtensionName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List<string> _queryParameters = new List<string>(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Gets a list of all extensions in a VM scale set. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IPage<VirtualMachineScaleSetExtension>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); List<string> _queryParameters = new List<string>(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IPage<VirtualMachineScaleSetExtension>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page1<VirtualMachineScaleSetExtension>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
47.821637
372
0.576001
[ "MIT" ]
AzureDataBox/azure-sdk-for-net
sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/VirtualMachineScaleSetExtensionsOperations.cs
65,420
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace SqlSyringe.Practice.NetCore_v2._1 { public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } }
25.16
76
0.699523
[ "MIT" ]
suterma/ContosoUniversityDotNetCore-Pages
SqlSyringe.Practice.NetCore-v2.1/Program.cs
631
C#
namespace FluentAssertions.Primitives { public enum TimeSpanCondition { MoreThan, AtLeast, Exactly, Within, LessThan } }
14.416667
37
0.566474
[ "Apache-2.0" ]
0xced/fluentassertions
Src/FluentAssertions/Primitives/TimeSpanCondition.cs
173
C#
// ***************************************************************************** // BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE) // © Component Factory Pty Ltd, 2006 - 2016, All rights reserved. // The software and associated documentation supplied hereunder are the // proprietary information of Component Factory Pty Ltd, 13 Swallows Close, // Mornington, Vic 3931, Australia and are supplied subject to license terms. // // Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2020. All rights reserved. (https://github.com/Wagnerp/Krypton-Toolkit-Suite-NET-Core) // Version 5.500.0.0 www.ComponentFactory.com // ***************************************************************************** using System; using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; using Microsoft.Win32; namespace Krypton.Toolkit { /// <summary> /// Provides a professional appearance using colors/fonts generated from system settings. /// </summary> public class PaletteProfessionalSystem : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new Padding(2, 1, 2, 1); private static readonly Padding _contentPaddingHeader1 = new Padding(3, 2, 3, 2); private static readonly Padding _contentPaddingHeader2 = new Padding(3, 2, 3, 2); private static readonly Padding _contentPaddingHeader3 = new Padding(2, 1, 2, 1); private static readonly Padding _contentPaddingCalendar = new Padding(2); private static readonly Padding _contentPaddingHeaderForm = new Padding(5, 1, 3, 1); private static readonly Padding _contentPaddingLabel = new Padding(3, 2, 3, 2); private static readonly Padding _contentPaddingLabel2 = new Padding(8, 2, 8, 2); private static readonly Padding _contentPaddingButtonCalendar = new Padding(0); private static readonly Padding _contentPaddingButtonInputControl = new Padding(1); private static readonly Padding _contentPaddingButton12 = new Padding(3, 2, 3, 2); private static readonly Padding _contentPaddingButton3 = new Padding(1, 1, 1, 1); private static readonly Padding _contentPaddingButton4 = new Padding(4, 3, 4, 3); private static readonly Padding _contentPaddingButton5 = new Padding(3, 3, 3, 2); private static readonly Padding _contentPaddingButton6 = new Padding(3); private static readonly Padding _contentPaddingButton7 = new Padding(1, 1, 3, 1); private static readonly Padding _contentPaddingButtonForm = new Padding(5, 5, 5, 5); private static readonly Padding _contentPaddingButtonGallery = new Padding(1, 0, 1, 0); private static readonly Padding _contentPaddingToolTip = new Padding(2, 2, 2, 2); private static readonly Padding _contentPaddingSuperTip = new Padding(4, 4, 4, 4); private static readonly Padding _contentPaddingKeyTip = new Padding(1, -1, 0, -2); private static readonly Padding _contentPaddingContextMenuHeading = new Padding(8, 2, 8, 0); private static readonly Padding _contentPaddingContextMenuImage = new Padding(1); private static readonly Padding _contentPaddingContextMenuItemText = new Padding(9, 1, 7, 0); private static readonly Padding _contentPaddingContextMenuItemTextAlt = new Padding(7, 1, 6, 0); private static readonly Padding _contentPaddingContextMenuItemShortcutText = new Padding(3, 1, 4, 0); private static readonly Padding _metricPaddingInputControl = new Padding(0, 1, 0, 1); private static readonly Padding _metricPaddingRibbon = new Padding(0, 1, 1, 1); private static readonly Padding _metricPaddingRibbonAppButton = new Padding(3, 0, 3, 0); private static readonly Padding _metricPaddingHeader = new Padding(0, 3, 1, 3); private static readonly Padding _metricPaddingHeaderForm = new Padding(0, 0, 0, 0); private static readonly Padding _metricPaddingBarInside = new Padding(3, 3, 3, 3); private static readonly Padding _metricPaddingBarTabs = new Padding(0, 0, 0, 0); private static readonly Padding _metricPaddingBarOutside = new Padding(0, 0, 0, 3); private static readonly Padding _metricPaddingPageButtons = new Padding(1, 3, 1, 3); private static readonly Padding _metricPaddingContextMenuItemHighlight = new Padding(1, 0, 1, 0); private static readonly Padding _metricPaddingContextMenuItemsCollection = new Padding(0, 1, 0, 1); private static readonly Image _buttonSpecClose = Properties.Resources.ProfessionalCloseButton; private static readonly Image _buttonSpecContext = Properties.Resources.ProfessionalContextButton; private static readonly Image _buttonSpecNext = Properties.Resources.ProfessionalNextButton; private static readonly Image _buttonSpecPrevious = Properties.Resources.ProfessionalPreviousButton; private static readonly Image _buttonSpecArrowLeft = Properties.Resources.ProfessionalArrowLeftButton; private static readonly Image _buttonSpecArrowRight = Properties.Resources.ProfessionalArrowRightButton; private static readonly Image _buttonSpecArrowUp = Properties.Resources.ProfessionalArrowUpButton; private static readonly Image _buttonSpecArrowDown = Properties.Resources.ProfessionalArrowDownButton; private static readonly Image _buttonSpecDropDown = Properties.Resources.ProfessionalDropDownButton; private static readonly Image _buttonSpecPinVertical = Properties.Resources.ProfessionalPinVerticalButton; private static readonly Image _buttonSpecPinHorizontal = Properties.Resources.ProfessionalPinHorizontalButton; private static readonly Image _buttonSpecWorkspaceMaximize = Properties.Resources.ProfessionalMaximize; private static readonly Image _buttonSpecWorkspaceRestore = Properties.Resources.ProfessionalRestore; private static readonly Image _buttonSpecRibbonMinimize = Properties.Resources.RibbonUp2010; private static readonly Image _buttonSpecRibbonExpand = Properties.Resources.RibbonDown2010; private static readonly Image _systemCloseA = Properties.Resources.ProfessionalButtonCloseA; private static readonly Image _systemCloseI = Properties.Resources.ProfessionalButtonCloseI; private static readonly Image _systemMaxA = Properties.Resources.ProfessionalButtonMaxA; private static readonly Image _systemMaxI = Properties.Resources.ProfessionalButtonMaxI; private static readonly Image _systemMinA = Properties.Resources.ProfessionalButtonMinA; private static readonly Image _systemMinI = Properties.Resources.ProfessionalButtonMinI; private static readonly Image _systemRestoreA = Properties.Resources.ProfessionalButtonRestoreA; private static readonly Image _systemRestoreI = Properties.Resources.ProfessionalButtonRestoreI; private static readonly Image _pendantCloseA = Properties.Resources.ProfessionalPendantCloseA; private static readonly Image _pendantCloseI = Properties.Resources.ProfessionalPendantCloseI; private static readonly Image _pendantMinA = Properties.Resources.ProfessionalPendantMinA; private static readonly Image _pendantMinI = Properties.Resources.ProfessionalPendantMinI; private static readonly Image _pendantRestoreA = Properties.Resources.ProfessionalPendantRestoreA; private static readonly Image _pendantRestoreI = Properties.Resources.ProfessionalPendantRestoreI; private static readonly Image _pendantExpandA = Properties.Resources.ProfessionalPendantExpandA; private static readonly Image _pendantExpandI = Properties.Resources.ProfessionalPendantExpandI; private static readonly Image _pendantMinimizeA = Properties.Resources.ProfessionalPendantMinimizeA; private static readonly Image _pendantMinimizeI = Properties.Resources.ProfessionalPendantMinimizeI; private static readonly Image _contextMenuChecked = Properties.Resources.SystemChecked; private static readonly Image _contextMenuIndeterminate = Properties.Resources.SystemIndeterminate; private static readonly Image _contextMenuSubMenu = Properties.Resources.SystemContextMenuSub; private static readonly Image _treeExpandPlus = Properties.Resources.TreeExpandPlus; private static readonly Image _treeCollapseMinus = Properties.Resources.TreeCollapseMinus; private static readonly Color _contextTextColor = Color.White; private static readonly Color _lightGray = Color.FromArgb(242, 242, 242); private static readonly Color _contextCheckedTabBorder1 = Color.FromArgb(223, 119, 0); private static readonly Color _contextCheckedTabBorder2 = Color.FromArgb(230, 190, 129); private static readonly Color _contextCheckedTabBorder3 = Color.FromArgb(220, 202, 171); private static readonly Color _contextCheckedTabBorder4 = Color.FromArgb(255, 252, 247); #endregion #region Instance Fields private KryptonProfessionalKCT _table; private Font _header1ShortFont; private Font _header2ShortFont; private Font _header1LongFont; private Font _header2LongFont; private Font _superToolFont; private Font _headerFormFont; private Font _buttonFont; private Font _buttonFontNavigatorMini; private Font _tabFontNormal; private Font _tabFontSelected; private Font _gridFont; private Font _calendarFont; private Font _calendarBoldFont; private Font _boldFont; private Font _italicFont; private Image _disabledDropDownImage; private Image _normalDropDownImage; private Color _disabledDropDownColor; private Color _normalDropDownColor; private Color[] _ribbonColors; private Color _disabledText; private Color _disabledGlyphDark; private Color _disabledGlyphLight; private Color _contextCheckedTabBorder; private Color _contextCheckedTabFill; private Color _contextGroupAreaBorder; private Color _contextGroupAreaInside; private Color _contextGroupFrameTop; private Color _contextGroupFrameBottom; private Color _contextTabSeparator; private Color _focusTabFill; private Color _toolTipBack1; private Color _toolTipBack2; private Color _toolTipBorder; private Color _toolTipText; private Color[] _ribbonGroupCollapsedBackContext; private Color[] _ribbonGroupCollapsedBackContextTracking; private Color[] _ribbonGroupCollapsedBorderContext; private Color[] _ribbonGroupCollapsedBorderContextTracking; private Color[] _appButtonNormal; private Color[] _appButtonTrack; private Color[] _appButtonPressed; private Image _galleryImageUp; private Image _galleryImageDown; private Image _galleryImageDropDown; #endregion #region Identity /// <summary> /// Initialize a new instance of the PaletteProfessionalSystem class. /// </summary> public PaletteProfessionalSystem() { // Get the font settings from the system DefineFonts(); // Generate the myriad ribbon colors from system settings DefineRibbonColors(); } #endregion #region AllowFormChrome /// <summary> /// Gets a value indicating if KryptonForm instances should show custom chrome. /// </summary> /// <returns>InheritBool value.</returns> public override InheritBool GetAllowFormChrome() { return InheritBool.True; } #endregion #region Renderer /// <summary> /// Gets the renderer to use for this palette. /// </summary> /// <returns>Renderer to use for drawing palette settings.</returns> public override IRenderer GetRenderer() { // We always want the professional renderer return KryptonManager.RenderProfessional; } #endregion #region Back /// <summary> /// Gets a value indicating if background should be drawn. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } switch (style) { case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: return InheritBool.False; case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonNavigatorOverflow: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } default: // Default to drawing the background return InheritBool.True; } } /// <summary> /// Gets the graphics drawing hint for the background. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteGraphicsHint value.</returns> public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteGraphicsHint.Inherit; } switch (style) { case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: return PaletteGraphicsHint.None; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the first background color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor1(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideStateExclude(state, PaletteState.NormalDefaultOverride)) { return Color.Empty; } switch (style) { case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: switch (state) { case PaletteState.Disabled: return SystemColors.Control; default: case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: return ColorTable.MenuStripGradientBegin; case PaletteState.CheckedNormal: return ColorTable.CheckBackground; } case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: if (state == PaletteState.CheckedNormal) { return ColorTable.ButtonPressedHighlight; } else { return SystemColors.Window; } case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderForm: if (state == PaletteState.Disabled) { return SystemColors.GradientInactiveCaption; } return SystemColors.GradientActiveCaption;// ColorTable.MenuStripGradientBegin; case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: return ColorTable.MenuStripGradientEnd; case PaletteBackStyle.PanelAlternate: return ColorTable.MenuStripGradientBegin; case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: return SystemColors.Window; case PaletteBackStyle.ContextMenuHeading: return ColorTable.OverflowButtonGradientBegin; case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; default: return ColorTable.MenuBorder; } case PaletteBackStyle.ContextMenuItemImageColumn: return ColorTable.ImageMarginGradientBegin; case PaletteBackStyle.ContextMenuItemImage: return ColorTable.ButtonSelectedHighlight; case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return SystemColors.Window; } case PaletteBackStyle.ControlRibbon: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected4]; case PaletteBackStyle.ControlRibbonAppMenu: return _ribbonColors[(int)SchemeOfficeColors.AppButtonBack1]; case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: return ColorTable.ToolStripDropDownBackground; case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return Table.Header1Begin; } case PaletteBackStyle.HeaderDockInactive: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return SystemColors.InactiveCaption; } case PaletteBackStyle.HeaderDockActive: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return SystemColors.ActiveCaption; } case PaletteBackStyle.HeaderSecondary: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return ColorTable.MenuStripGradientEnd; } case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: switch (state) { case PaletteState.Disabled: if (style == PaletteBackStyle.TabLowProfile) { return Color.Empty; } else { return SystemColors.Control; } case PaletteState.Normal: if (style == PaletteBackStyle.TabLowProfile) { return Color.Empty; } else { return SystemColors.Window; } case PaletteState.Pressed: case PaletteState.Tracking: switch (style) { case PaletteBackStyle.TabLowProfile: return Color.Empty; case PaletteBackStyle.TabHighProfile: return ColorTable.ButtonPressedGradientMiddle; default: return SystemColors.Window; } case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: if (style == PaletteBackStyle.TabHighProfile) { return ColorTable.ButtonPressedGradientMiddle; } else { return SystemColors.Window; } default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return SystemColors.Window; case PaletteState.Pressed: case PaletteState.Tracking: case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return SystemColors.Window; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ControlToolTip: return _toolTipBack1; case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientEnd; case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: case PaletteState.CheckedPressed: if (style == PaletteBackStyle.ButtonAlternate) { return ColorTable.SeparatorDark; } else { return ColorTable.ButtonPressedGradientBegin; } case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ButtonCalendarDay: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientEnd; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ButtonInputControl: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return Color.Empty; case PaletteState.Tracking: return ColorTable.MenuItemSelectedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideStateExclude(state, PaletteState.NormalDefaultOverride)) { return Color.Empty; } switch (style) { case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: switch (state) { case PaletteState.Disabled: return SystemColors.Control; default: case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: return ColorTable.MenuStripGradientBegin; case PaletteState.CheckedNormal: return ColorTable.CheckBackground; } case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: if (state == PaletteState.CheckedNormal) { return ColorTable.ButtonPressedHighlight; } else { return SystemColors.Window; } case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderForm: if (state == PaletteState.Disabled) { return SystemColors.InactiveCaption; } return SystemColors.ActiveCaption; //ColorTable.MenuStripGradientBegin; case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: return ColorTable.MenuStripGradientEnd; case PaletteBackStyle.PanelAlternate: return ColorTable.MenuStripGradientBegin; case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: return SystemColors.Window; case PaletteBackStyle.ContextMenuHeading: return ColorTable.OverflowButtonGradientBegin; case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; default: return ColorTable.MenuBorder; } case PaletteBackStyle.ContextMenuItemImageColumn: return ColorTable.ImageMarginGradientEnd; case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return SystemColors.Window; } case PaletteBackStyle.ControlRibbon: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected4]; case PaletteBackStyle.ControlRibbonAppMenu: return _ribbonColors[(int)SchemeOfficeColors.AppButtonBack2]; case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: return ColorTable.ToolStripDropDownBackground; case PaletteBackStyle.ContextMenuItemImage: return ColorTable.ButtonSelectedHighlight; case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return Table.Header1End; } case PaletteBackStyle.HeaderSecondary: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return ColorTable.MenuStripGradientBegin; } case PaletteBackStyle.HeaderDockInactive: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return ControlPaint.Light(SystemColors.GradientInactiveCaption); } case PaletteBackStyle.HeaderDockActive: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return ControlPaint.Light(SystemColors.GradientActiveCaption); } case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: switch (state) { case PaletteState.Disabled: if (style == PaletteBackStyle.TabLowProfile) { return Color.Empty; } else { return SystemColors.Control; } case PaletteState.Normal: if (style == PaletteBackStyle.TabLowProfile) { return Color.Empty; } else { return MergeColors(SystemColors.Window, 0.9f, SystemColors.ControlText, 0.1f); } case PaletteState.Tracking: case PaletteState.Pressed: if (style == PaletteBackStyle.TabLowProfile) { return Color.Empty; } else { return MergeColors(SystemColors.Window, 0.95f, SystemColors.ControlText, 0.05f); } case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return SystemColors.Window; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.TabDock: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return MergeColors(SystemColors.Control, 0.8f, SystemColors.ControlDark, 0.2f); case PaletteState.Pressed: case PaletteState.Tracking: return MergeColors(SystemColors.Window, 0.8f, SystemColors.Highlight, 0.2f); case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return SystemColors.Window; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.TabDockAutoHidden: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: case PaletteState.CheckedNormal: return MergeColors(SystemColors.Control, 0.8f, SystemColors.ControlDark, 0.2f); case PaletteState.Pressed: case PaletteState.CheckedPressed: case PaletteState.Tracking: case PaletteState.CheckedTracking: return MergeColors(SystemColors.Window, 0.8f, SystemColors.Highlight, 0.2f); default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ControlToolTip: return _toolTipBack2; case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientMiddle; case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientEnd; case PaletteState.Pressed: case PaletteState.CheckedPressed: if (style == PaletteBackStyle.ButtonAlternate) { return ColorTable.MenuStripGradientBegin; } else { return ColorTable.ButtonPressedGradientEnd; } case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientEnd; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ButtonCalendarDay: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientEnd; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ButtonInputControl: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; case PaletteState.CheckedNormal: return ColorTable.MenuStripGradientBegin; case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientEnd; case PaletteState.Pressed: return ColorTable.ButtonPressedGradientEnd; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return Color.Empty; case PaletteState.Tracking: return ColorTable.MenuItemSelectedGradientEnd; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color background drawing style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteColorStyle.Inherit; } switch (style) { case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: return PaletteColorStyle.Linear; case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.ButtonNavigatorMini: return PaletteColorStyle.Solid; case PaletteBackStyle.ControlRibbonAppMenu: return PaletteColorStyle.Switch90; case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemHighlight: return PaletteColorStyle.Rounded; case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.TabHighProfile: return PaletteColorStyle.QuarterPhase; case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: return PaletteColorStyle.OneNote; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color alignment. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color alignment style.</returns> public override PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: return PaletteRectangleAlign.Control; case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: case PaletteBackStyle.ContextMenuItemImageColumn: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color background angle. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetBackColorAngle(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1f; } switch (style) { case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: return 90f; case PaletteBackStyle.ContextMenuItemImageColumn: return 0f; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets a background image. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image instance.</returns> public override Image GetBackImage(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return null; } switch (style) { case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: return null; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the background image style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image style value.</returns> public override PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteImageStyle.Inherit; } switch (style) { case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: return PaletteImageStyle.Tile; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image alignment. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.PanelCustom2: case PaletteBackStyle.PanelCustom3: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.SeparatorCustom2: case PaletteBackStyle.SeparatorCustom3: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ControlCustom2: case PaletteBackStyle.ControlCustom3: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.InputControlCustom2: case PaletteBackStyle.InputControlCustom3: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.FormCustom2: case PaletteBackStyle.FormCustom3: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.HeaderCustom3: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderColumnCustom2: case PaletteBackStyle.GridHeaderColumnCustom3: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridHeaderRowCustom2: case PaletteBackStyle.GridHeaderRowCustom3: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.GridDataCellCustom2: case PaletteBackStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } #endregion #region Border /// <summary> /// Gets a value indicating if border should be drawn. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetBorderDraw(PaletteBorderStyle style, PaletteState state) { // Check for the calendar day today override if (state == PaletteState.TodayOverride) { if (style == PaletteBorderStyle.ButtonCalendarDay) { return InheritBool.True; } } // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: return InheritBool.False; case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return InheritBool.True; case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: return InheritBool.False; case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets a value indicating which borders to draw. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteDrawBorders value.</returns> public override PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteDrawBorders.Inherit; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteDrawBorders.All; case PaletteBorderStyle.ContextMenuHeading: return PaletteDrawBorders.Bottom; case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: return PaletteDrawBorders.None; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the graphics drawing hint for the border. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteGraphicsHint value.</returns> public override PaletteGraphicsHint GetBorderGraphicsHint(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteGraphicsHint.Inherit; } switch (style) { case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: return PaletteGraphicsHint.AntiAlias; case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteGraphicsHint.None; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the first border color. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBorderColor1(PaletteBorderStyle style, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { if (state == PaletteState.TodayOverride) { if (style == PaletteBorderStyle.ButtonCalendarDay) { if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.ButtonPressedBorder; } } } return Color.Empty; } switch (style) { case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderForm: if (state == PaletteState.Disabled) { return SystemColors.InactiveCaption; // ColorTable.MenuBorder; } return SystemColors.ActiveCaption;// ColorTable.MenuBorder; case PaletteBorderStyle.ControlToolTip: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return _toolTipBorder; } case PaletteBorderStyle.HeaderCalendar: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return Table.Header1Begin; } case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.MenuBorder; } case PaletteBorderStyle.ContextMenuHeading: return ColorTable.MenuBorder; case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; default: return ColorTable.MenuBorder; } case PaletteBorderStyle.ContextMenuItemImageColumn: return ColorTable.ToolStripDropDownBackground; case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.MenuBorder; } case PaletteBorderStyle.InputControlRibbon: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; default: return ColorTable.ButtonSelectedBorder; } case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: case PaletteBorderStyle.GridDataCellSheet: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.SeparatorDark; } case PaletteBorderStyle.ControlRibbon: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea1]; } case PaletteBorderStyle.ControlRibbonAppMenu: if (state == PaletteState.Disabled) { return FadedColor(_ribbonColors[(int)SchemeOfficeColors.AppButtonBorder]); } else { return _ribbonColors[(int)SchemeOfficeColors.AppButtonBorder]; } case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: return ColorTable.MenuBorder; case PaletteBorderStyle.ContextMenuItemImage: return ColorTable.MenuItemBorder; case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: switch (state) { case PaletteState.Disabled: if (style == PaletteBorderStyle.TabLowProfile) { return Color.Empty; } else { return FadedColor(ColorTable.ButtonSelectedBorder); } case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: if (style == PaletteBorderStyle.TabLowProfile) { return Color.Empty; } else { return ColorTable.OverflowButtonGradientEnd; } case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.MenuBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.TabDock: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.OverflowButtonGradientEnd; case PaletteState.Pressed: case PaletteState.Tracking: return MergeColors(ColorTable.OverflowButtonGradientEnd, 0.5f, SystemColors.Highlight, 0.5f); case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.MenuBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.TabDockAutoHidden: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: case PaletteState.CheckedNormal: return ColorTable.OverflowButtonGradientEnd; case PaletteState.Pressed: case PaletteState.CheckedPressed: case PaletteState.Tracking: case PaletteState.CheckedTracking: return MergeColors(ColorTable.OverflowButtonGradientEnd, 0.5f, SystemColors.Highlight, 0.5f); default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.MenuBorder; case PaletteState.CheckedNormal: return ColorTable.MenuBorder; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; case PaletteState.Pressed: case PaletteState.CheckedPressed: if (style == PaletteBorderStyle.ButtonAlternate) { return ColorTable.SeparatorDark; } else { return ColorTable.ButtonPressedBorder; } case PaletteState.CheckedTracking: return ColorTable.ButtonPressedBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.ButtonCalendarDay: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientEnd; case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: case PaletteState.CheckedPressed: return ColorTable.ButtonPressedGradientBegin; case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the second border color. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBorderColor2(PaletteBorderStyle style, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { if (state == PaletteState.TodayOverride) { if (style == PaletteBorderStyle.ButtonCalendarDay) { if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.ButtonPressedBorder; } } } return Color.Empty; } switch (style) { case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderForm: if (state == PaletteState.Disabled) { return SystemColors.InactiveCaption; } return SystemColors.ActiveCaption; case PaletteBorderStyle.ControlToolTip: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return _toolTipBorder; } case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.MenuBorder; } case PaletteBorderStyle.HeaderCalendar: if (state == PaletteState.Disabled) { return SystemColors.Control; } else { return Table.Header1Begin; } case PaletteBorderStyle.ContextMenuHeading: return ColorTable.MenuBorder; case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; default: return ColorTable.MenuBorder; } case PaletteBorderStyle.ContextMenuItemImageColumn: return ColorTable.ToolStripDropDownBackground; case PaletteBorderStyle.ContextMenuItemImage: return ColorTable.MenuItemBorder; case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return ColorTable.MenuBorder; } case PaletteBorderStyle.InputControlRibbon: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; default: return ColorTable.ButtonSelectedBorder; } case PaletteBorderStyle.ControlRibbon: if (state == PaletteState.Disabled) { return FadedColor(ColorTable.ButtonSelectedBorder); } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea1]; } case PaletteBorderStyle.ControlRibbonAppMenu: if (state == PaletteState.Disabled) { return FadedColor(_ribbonColors[(int)SchemeOfficeColors.AppButtonBorder]); } else { return _ribbonColors[(int)SchemeOfficeColors.AppButtonBorder]; } case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: return ColorTable.MenuBorder; case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: switch (state) { case PaletteState.Disabled: if (style == PaletteBorderStyle.TabLowProfile) { return Color.Empty; } else { return FadedColor(ColorTable.ButtonSelectedBorder); } case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: if (style == PaletteBorderStyle.TabLowProfile) { return Color.Empty; } else { return ColorTable.ButtonPressedHighlightBorder; } case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.MenuBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.TabDock: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.OverflowButtonGradientEnd; case PaletteState.Pressed: case PaletteState.Tracking: return MergeColors(ColorTable.OverflowButtonGradientEnd, 0.5f, SystemColors.Highlight, 0.5f); case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return ColorTable.MenuBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.TabDockAutoHidden: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: case PaletteState.CheckedNormal: return ColorTable.OverflowButtonGradientEnd; case PaletteState.Pressed: case PaletteState.CheckedPressed: case PaletteState.Tracking: case PaletteState.CheckedTracking: return MergeColors(ColorTable.OverflowButtonGradientEnd, 0.5f, SystemColors.Highlight, 0.5f); default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: return ColorTable.MenuBorder; case PaletteState.CheckedNormal: return ColorTable.MenuBorder; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; case PaletteState.Pressed: case PaletteState.CheckedPressed: if (style == PaletteBorderStyle.ButtonAlternate) { return ColorTable.SeparatorDark; } else { return ColorTable.ButtonPressedBorder; } case PaletteState.CheckedTracking: return ColorTable.ButtonPressedBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } case PaletteBorderStyle.ButtonCalendarDay: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return ColorTable.MenuStripGradientEnd; case PaletteState.CheckedNormal: return ColorTable.ButtonPressedGradientEnd; case PaletteState.NormalDefaultOverride: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: case PaletteState.CheckedPressed: return ColorTable.ButtonPressedGradientBegin; case PaletteState.CheckedTracking: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color border drawing style. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetBorderColorStyle(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteColorStyle.Inherit; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteColorStyle.Solid; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color border alignment. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color alignment style.</returns> public override PaletteRectangleAlign GetBorderColorAlign(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: return PaletteRectangleAlign.Control; case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color border angle. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetBorderColorAngle(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1f; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return 90f; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the border width. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Integer width.</returns> public override int GetBorderWidth(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: return 0; case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return 1; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the border corner rounding. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Integer rounding.</returns> public override int GetBorderRounding(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1; } switch (style) { case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return 0; case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlGroupBox: return 3; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets a border image. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image instance.</returns> public override Image GetBorderImage(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return null; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return null; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the border image style. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image style value.</returns> public override PaletteImageStyle GetBorderImageStyle(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteImageStyle.Inherit; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteImageStyle.Tile; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image border alignment. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetBorderImageAlign(PaletteBorderStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteBorderStyle.SeparatorLowProfile: case PaletteBorderStyle.SeparatorHighInternalProfile: case PaletteBorderStyle.SeparatorHighProfile: case PaletteBorderStyle.SeparatorCustom1: case PaletteBorderStyle.SeparatorCustom2: case PaletteBorderStyle.SeparatorCustom3: case PaletteBorderStyle.ControlClient: case PaletteBorderStyle.ControlAlternate: case PaletteBorderStyle.ControlGroupBox: case PaletteBorderStyle.ControlToolTip: case PaletteBorderStyle.ControlRibbon: case PaletteBorderStyle.ControlRibbonAppMenu: case PaletteBorderStyle.ControlCustom1: case PaletteBorderStyle.ControlCustom2: case PaletteBorderStyle.ControlCustom3: case PaletteBorderStyle.ContextMenuOuter: case PaletteBorderStyle.ContextMenuInner: case PaletteBorderStyle.ContextMenuHeading: case PaletteBorderStyle.ContextMenuSeparator: case PaletteBorderStyle.ContextMenuItemSplit: case PaletteBorderStyle.ContextMenuItemImageColumn: case PaletteBorderStyle.InputControlStandalone: case PaletteBorderStyle.InputControlRibbon: case PaletteBorderStyle.InputControlCustom1: case PaletteBorderStyle.InputControlCustom2: case PaletteBorderStyle.InputControlCustom3: case PaletteBorderStyle.FormMain: case PaletteBorderStyle.FormCustom1: case PaletteBorderStyle.FormCustom2: case PaletteBorderStyle.FormCustom3: case PaletteBorderStyle.HeaderPrimary: case PaletteBorderStyle.HeaderDockInactive: case PaletteBorderStyle.HeaderDockActive: case PaletteBorderStyle.HeaderCalendar: case PaletteBorderStyle.HeaderSecondary: case PaletteBorderStyle.HeaderForm: case PaletteBorderStyle.HeaderCustom1: case PaletteBorderStyle.HeaderCustom2: case PaletteBorderStyle.HeaderCustom3: case PaletteBorderStyle.TabHighProfile: case PaletteBorderStyle.TabStandardProfile: case PaletteBorderStyle.TabLowProfile: case PaletteBorderStyle.TabOneNote: case PaletteBorderStyle.TabDock: case PaletteBorderStyle.TabDockAutoHidden: case PaletteBorderStyle.TabCustom1: case PaletteBorderStyle.TabCustom2: case PaletteBorderStyle.TabCustom3: case PaletteBorderStyle.ButtonStandalone: case PaletteBorderStyle.ButtonGallery: case PaletteBorderStyle.ButtonAlternate: case PaletteBorderStyle.ButtonLowProfile: case PaletteBorderStyle.ButtonBreadCrumb: case PaletteBorderStyle.ButtonListItem: case PaletteBorderStyle.ButtonCommand: case PaletteBorderStyle.ButtonButtonSpec: case PaletteBorderStyle.ButtonCalendarDay: case PaletteBorderStyle.ButtonCluster: case PaletteBorderStyle.ButtonNavigatorStack: case PaletteBorderStyle.ButtonNavigatorOverflow: case PaletteBorderStyle.ButtonNavigatorMini: case PaletteBorderStyle.ButtonForm: case PaletteBorderStyle.ButtonFormClose: case PaletteBorderStyle.ButtonCustom1: case PaletteBorderStyle.ButtonCustom2: case PaletteBorderStyle.ButtonCustom3: case PaletteBorderStyle.ButtonInputControl: case PaletteBorderStyle.ContextMenuItemImage: case PaletteBorderStyle.ContextMenuItemHighlight: case PaletteBorderStyle.GridHeaderColumnList: case PaletteBorderStyle.GridHeaderColumnSheet: case PaletteBorderStyle.GridHeaderColumnCustom1: case PaletteBorderStyle.GridHeaderColumnCustom2: case PaletteBorderStyle.GridHeaderColumnCustom3: case PaletteBorderStyle.GridHeaderRowList: case PaletteBorderStyle.GridHeaderRowSheet: case PaletteBorderStyle.GridHeaderRowCustom1: case PaletteBorderStyle.GridHeaderRowCustom2: case PaletteBorderStyle.GridHeaderRowCustom3: case PaletteBorderStyle.GridDataCellList: case PaletteBorderStyle.GridDataCellSheet: case PaletteBorderStyle.GridDataCellCustom1: case PaletteBorderStyle.GridDataCellCustom2: case PaletteBorderStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } #endregion #region Content /// <summary> /// Gets a value indicating if content should be drawn. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetContentDraw(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } // Always draw everything return InheritBool.True; } /// <summary> /// Gets a value indicating if content should be drawn with focus indication. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetContentDrawFocus(PaletteContentStyle style, PaletteState state) { // By default the focus override shows the focus! if (state == PaletteState.FocusOverride) { return InheritBool.True; } // We do not override the other override states if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } // By default, never show the focus indication, we let individual controls // override this functionality as required by the controls requirements return InheritBool.False; } /// <summary> /// Gets the horizontal relative alignment of the image. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentImageH(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: return PaletteRelativeAlign.Near; case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ButtonNavigatorMini: return PaletteRelativeAlign.Center; case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return PaletteRelativeAlign.Center; case PaletteContentStyle.ContextMenuItemShortcutText: return PaletteRelativeAlign.Far; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the vertical relative alignment of the image. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentImageV(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return PaletteRelativeAlign.Center; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the effect applied to drawing of the image. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteImageEffect value.</returns> public override PaletteImageEffect GetContentImageEffect(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteImageEffect.Inherit; } switch (style) { case PaletteContentStyle.HeaderForm: return PaletteImageEffect.Normal; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: if (state == PaletteState.Disabled) { return PaletteImageEffect.Disabled; } else { return PaletteImageEffect.Normal; } default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image color to remap into another color. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentImageColorMap(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return Color.Empty; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color to use in place of the image map color. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentImageColorTo(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return Color.Empty; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image color that should be transparent. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentImageColorTransparent(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return Color.Empty; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the font for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetContentShortTextFont(PaletteContentStyle style, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { if ((state == PaletteState.BoldedOverride) && (style == PaletteContentStyle.ButtonCalendarDay)) { return _calendarBoldFont; } else { return null; } } switch (style) { case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: case PaletteContentStyle.HeaderCalendar: return _gridFont; case PaletteContentStyle.HeaderForm: return _headerFormFont; case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.ButtonCommand: return _header1ShortFont; case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: return _superToolFont; case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemShortcutText: return _header2ShortFont; case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelBoldPanel: return _boldFont; case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelItalicControl: return _italicFont; case PaletteContentStyle.ContextMenuItemTextAlternate: return _superToolFont; case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: return _tabFontNormal; case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return _tabFontSelected; default: return _tabFontNormal; } case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return _buttonFont; case PaletteContentStyle.ButtonNavigatorMini: return _buttonFontNavigatorMini; case PaletteContentStyle.ButtonCalendarDay: return _calendarFont; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the font for the short text by generating a new font instance. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetContentShortTextNewFont(PaletteContentStyle style, PaletteState state) { DefineFonts(); return GetContentShortTextFont(style, state); } /// <summary> /// Gets the rendering hint for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextHint value.</returns> public override PaletteTextHint GetContentShortTextHint(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextHint.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteTextHint.ClearTypeGridFit; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the prefix drawing setting for short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextPrefix value.</returns> public override PaletteTextHotkeyPrefix GetContentShortTextPrefix(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextHotkeyPrefix.Inherit; } switch (style) { case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.HeaderForm: return PaletteTextHotkeyPrefix.Show; case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemShortcutText: return PaletteTextHotkeyPrefix.None; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the flag indicating if multiline text is allowed for short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetContentShortTextMultiLine(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return InheritBool.True; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the text trimming to use for short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextTrim value.</returns> public override PaletteTextTrim GetContentShortTextTrim(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextTrim.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteTextTrim.EllipsisCharacter; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the horizontal relative alignment of the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentShortTextH(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Near; case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.HeaderCalendar: return PaletteRelativeAlign.Center; case PaletteContentStyle.ContextMenuItemShortcutText: return PaletteRelativeAlign.Far; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the vertical relative alignment of the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentShortTextV(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Center; case PaletteContentStyle.LabelSuperTip: return PaletteRelativeAlign.Near; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the horizontal relative alignment of multiline short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentShortTextMultiLineH(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Near; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the first back color for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentShortTextColor1(PaletteContentStyle style, PaletteState state) { // Always work out value for an override state if (CommonHelper.IsOverrideState(state)) { switch (state) { case PaletteState.LinkNotVisitedOverride: return Color.Blue; case PaletteState.LinkVisitedOverride: return Color.Purple; case PaletteState.LinkPressedOverride: return Color.Red; default: // All other override states do nothing return Color.Empty; } } switch (style) { case PaletteContentStyle.HeaderForm: if (state == PaletteState.Disabled) { return SystemColors.InactiveCaptionText; } return SystemColors.ActiveCaptionText; } switch (style) { case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: return SystemColors.InfoText; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return ColorTable.SeparatorLight; case PaletteContentStyle.HeaderDockInactive: return SystemColors.InactiveCaptionText; case PaletteContentStyle.HeaderDockActive: return SystemColors.ActiveCaptionText; case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return SystemColors.ControlText; case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: if (state == PaletteState.CheckedNormal) { return SystemColors.HighlightText; } else { return SystemColors.ControlText; } case PaletteContentStyle.TabDock: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return SystemColors.ControlText; default: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); } case PaletteContentStyle.TabDockAutoHidden: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: return ColorTable.MenuItemText; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the second back color for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentShortTextColor2(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderForm: return ColorTable.SeparatorLight; } if ((state == PaletteState.Disabled) && (style != PaletteContentStyle.ButtonInputControl)) { return SystemColors.InactiveCaptionText; } switch (style) { case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: return _toolTipText; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return ColorTable.SeparatorLight; case PaletteContentStyle.HeaderDockInactive: return SystemColors.InactiveCaptionText; case PaletteContentStyle.HeaderDockActive: return SystemColors.ActiveCaptionText; case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return SystemColors.ControlText; case PaletteContentStyle.TabDock: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return SystemColors.ControlText; default: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); } case PaletteContentStyle.TabDockAutoHidden: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: if (state == PaletteState.CheckedNormal) { return SystemColors.HighlightText; } else { return SystemColors.ControlText; } case PaletteContentStyle.ButtonInputControl: return Color.Transparent; case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: return ColorTable.MenuItemText; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color drawing style for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetContentShortTextColorStyle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteColorStyle.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteColorStyle.Solid; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color alignment for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color alignment style.</returns> public override PaletteRectangleAlign GetContentShortTextColorAlign(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color background angle for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetContentShortTextColorAngle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1f; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return 90f; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets a background image for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image instance.</returns> public override Image GetContentShortTextImage(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return null; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return null; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the background image style. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image style value.</returns> public override PaletteImageStyle GetContentShortTextImageStyle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteImageStyle.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteImageStyle.TileFlipXY; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image alignment for the short text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetContentShortTextImageAlign(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the font for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetContentLongTextFont(PaletteContentStyle style, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { if ((state == PaletteState.BoldedOverride) && (style == PaletteContentStyle.ButtonCalendarDay)) { return _calendarBoldFont; } else { return null; } } switch (style) { case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: case PaletteContentStyle.HeaderCalendar: return _gridFont; case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return _header1LongFont; case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.HeaderSecondary: return _header2LongFont; case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: return _tabFontNormal; case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return _tabFontSelected; default: return _tabFontNormal; } case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return _buttonFont; case PaletteContentStyle.ButtonCalendarDay: return _calendarFont; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the font for the long text by generating a new font instance. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetContentLongTextNewFont(PaletteContentStyle style, PaletteState state) { DefineFonts(); return GetContentLongTextFont(style, state); } /// <summary> /// Gets the rendering hint for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextHint value.</returns> public override PaletteTextHint GetContentLongTextHint(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextHint.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteTextHint.ClearTypeGridFit; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the flag indicating if multiline text is allowed for long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetContentLongTextMultiLine(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return InheritBool.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return InheritBool.True; case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return InheritBool.False; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the text trimming to use for long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextTrim value.</returns> public override PaletteTextTrim GetContentLongTextTrim(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextTrim.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteTextTrim.EllipsisCharacter; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the prefix drawing setting for long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextPrefix value.</returns> public override PaletteTextHotkeyPrefix GetContentLongTextPrefix(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteTextHotkeyPrefix.Inherit; } switch (style) { case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: return PaletteTextHotkeyPrefix.Show; case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteTextHotkeyPrefix.None; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the horizontal relative alignment of the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentLongTextH(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.ContextMenuItemTextAlternate: return PaletteRelativeAlign.Near; case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Far; case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnSheet: return PaletteRelativeAlign.Center; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the vertical relative alignment of the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentLongTextV(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Center; case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.ContextMenuItemTextAlternate: return PaletteRelativeAlign.Far; case PaletteContentStyle.LabelSuperTip: return PaletteRelativeAlign.Center; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the horizontal relative alignment of multiline long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>RelativeAlignment value.</returns> public override PaletteRelativeAlign GetContentLongTextMultiLineH(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRelativeAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRelativeAlign.Center; case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ButtonCommand: return PaletteRelativeAlign.Near; case PaletteContentStyle.ContextMenuItemShortcutText: return PaletteRelativeAlign.Near; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the first back color for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentLongTextColor1(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderForm: return ColorTable.SeparatorLight; } if (state == PaletteState.Disabled) { return SystemColors.InactiveCaptionText; } switch (style) { case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: return _toolTipText; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return ColorTable.SeparatorLight; case PaletteContentStyle.HeaderDockInactive: return SystemColors.InactiveCaptionText; case PaletteContentStyle.HeaderDockActive: return SystemColors.ActiveCaptionText; case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return SystemColors.ControlText; case PaletteContentStyle.TabDock: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return SystemColors.ControlText; default: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); } case PaletteContentStyle.TabDockAutoHidden: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: return ColorTable.MenuItemText; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the second back color for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (style) { case PaletteContentStyle.HeaderForm: return ColorTable.SeparatorLight; } if ((state == PaletteState.Disabled) && (style != PaletteContentStyle.ButtonInputControl)) { return SystemColors.ControlDark; } switch (style) { case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: return _toolTipText; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return ColorTable.SeparatorLight; case PaletteContentStyle.HeaderDockInactive: return SystemColors.InactiveCaptionText; case PaletteContentStyle.HeaderDockActive: return SystemColors.ActiveCaptionText; case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return SystemColors.ControlText; case PaletteContentStyle.TabDock: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return SystemColors.ControlText; default: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); } case PaletteContentStyle.TabDockAutoHidden: return MergeColors(SystemColors.Window, 0.3f, SystemColors.ControlText, 0.7f); case PaletteContentStyle.ButtonInputControl: return Color.Transparent; case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: return ColorTable.MenuItemText; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color drawing style for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetContentLongTextColorStyle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteColorStyle.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteColorStyle.Solid; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color alignment for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color alignment style.</returns> public override PaletteRectangleAlign GetContentLongTextColorAlign(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the color background angle for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetContentLongTextColorAngle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1f; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return 90f; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets a background image for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image instance.</returns> public override Image GetContentLongTextImage(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return null; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return null; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the background image style for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image style value.</returns> public override PaletteImageStyle GetContentLongTextImageStyle(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteImageStyle.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteImageStyle.TileFlipXY; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the image alignment for the long text. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetContentLongTextImageAlign(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return PaletteRectangleAlign.Inherit; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelSuperTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the padding between the border and content drawing. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Padding value.</returns> public override Padding GetContentPadding(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return CommonHelper.InheritPadding; } switch (style) { case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return _contentPaddingGrid; case PaletteContentStyle.HeaderForm: return _contentPaddingHeaderForm; case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: return _contentPaddingHeader1; case PaletteContentStyle.HeaderSecondary: return _contentPaddingHeader2; case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: return _contentPaddingHeader3; case PaletteContentStyle.HeaderCalendar: return _contentPaddingCalendar; case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: return _contentPaddingLabel; case PaletteContentStyle.LabelGroupBoxCaption: return _contentPaddingLabel2; case PaletteContentStyle.ContextMenuItemTextStandard: return _contentPaddingContextMenuItemText; case PaletteContentStyle.ContextMenuItemTextAlternate: return _contentPaddingContextMenuItemTextAlt; case PaletteContentStyle.ContextMenuItemShortcutText: return _contentPaddingContextMenuItemShortcutText; case PaletteContentStyle.LabelToolTip: return _contentPaddingToolTip; case PaletteContentStyle.LabelSuperTip: return _contentPaddingSuperTip; case PaletteContentStyle.LabelKeyTip: return _contentPaddingKeyTip; case PaletteContentStyle.ContextMenuHeading: return _contentPaddingContextMenuHeading; case PaletteContentStyle.ContextMenuItemImage: return _contentPaddingContextMenuImage; case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: return InputControlPadding; case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: return _contentPaddingButton12; case PaletteContentStyle.ButtonInputControl: return _contentPaddingButtonInputControl; case PaletteContentStyle.ButtonCalendarDay: return _contentPaddingButtonCalendar; case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonListItem: return _contentPaddingButton3; case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: return _contentPaddingButton4; case PaletteContentStyle.ButtonBreadCrumb: return _contentPaddingButton6; case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: return _contentPaddingButtonForm; case PaletteContentStyle.ButtonGallery: return _contentPaddingButtonGallery; case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: return _contentPaddingButton5; case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: return _contentPaddingButton7; default: throw new ArgumentOutOfRangeException(nameof(style)); } } /// <summary> /// Gets the padding between adjacent content items. /// </summary> /// <param name="style">Content style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Integer value.</returns> public override int GetContentAdjacentGap(PaletteContentStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return -1; } switch (style) { case PaletteContentStyle.HeaderPrimary: case PaletteContentStyle.HeaderDockInactive: case PaletteContentStyle.HeaderDockActive: case PaletteContentStyle.HeaderCalendar: case PaletteContentStyle.HeaderSecondary: case PaletteContentStyle.HeaderForm: case PaletteContentStyle.HeaderCustom1: case PaletteContentStyle.HeaderCustom2: case PaletteContentStyle.HeaderCustom3: case PaletteContentStyle.LabelNormalControl: case PaletteContentStyle.LabelBoldControl: case PaletteContentStyle.LabelItalicControl: case PaletteContentStyle.LabelTitleControl: case PaletteContentStyle.LabelNormalPanel: case PaletteContentStyle.LabelBoldPanel: case PaletteContentStyle.LabelItalicPanel: case PaletteContentStyle.LabelTitlePanel: case PaletteContentStyle.LabelGroupBoxCaption: case PaletteContentStyle.LabelToolTip: case PaletteContentStyle.LabelKeyTip: case PaletteContentStyle.LabelCustom1: case PaletteContentStyle.LabelCustom2: case PaletteContentStyle.LabelCustom3: case PaletteContentStyle.ContextMenuHeading: case PaletteContentStyle.ContextMenuItemImage: case PaletteContentStyle.ContextMenuItemTextStandard: case PaletteContentStyle.ContextMenuItemTextAlternate: case PaletteContentStyle.ContextMenuItemShortcutText: case PaletteContentStyle.InputControlStandalone: case PaletteContentStyle.InputControlRibbon: case PaletteContentStyle.InputControlCustom1: case PaletteContentStyle.InputControlCustom2: case PaletteContentStyle.InputControlCustom3: case PaletteContentStyle.TabHighProfile: case PaletteContentStyle.TabStandardProfile: case PaletteContentStyle.TabLowProfile: case PaletteContentStyle.TabOneNote: case PaletteContentStyle.TabDock: case PaletteContentStyle.TabDockAutoHidden: case PaletteContentStyle.TabCustom1: case PaletteContentStyle.TabCustom2: case PaletteContentStyle.TabCustom3: case PaletteContentStyle.ButtonStandalone: case PaletteContentStyle.ButtonGallery: case PaletteContentStyle.ButtonAlternate: case PaletteContentStyle.ButtonLowProfile: case PaletteContentStyle.ButtonBreadCrumb: case PaletteContentStyle.ButtonListItem: case PaletteContentStyle.ButtonCommand: case PaletteContentStyle.ButtonButtonSpec: case PaletteContentStyle.ButtonCalendarDay: case PaletteContentStyle.ButtonCluster: case PaletteContentStyle.ButtonNavigatorStack: case PaletteContentStyle.ButtonNavigatorOverflow: case PaletteContentStyle.ButtonNavigatorMini: case PaletteContentStyle.ButtonForm: case PaletteContentStyle.ButtonFormClose: case PaletteContentStyle.ButtonCustom1: case PaletteContentStyle.ButtonCustom2: case PaletteContentStyle.ButtonCustom3: case PaletteContentStyle.ButtonInputControl: case PaletteContentStyle.GridHeaderColumnList: case PaletteContentStyle.GridHeaderColumnSheet: case PaletteContentStyle.GridHeaderColumnCustom1: case PaletteContentStyle.GridHeaderColumnCustom2: case PaletteContentStyle.GridHeaderColumnCustom3: case PaletteContentStyle.GridHeaderRowList: case PaletteContentStyle.GridHeaderRowSheet: case PaletteContentStyle.GridHeaderRowCustom1: case PaletteContentStyle.GridHeaderRowCustom2: case PaletteContentStyle.GridHeaderRowCustom3: case PaletteContentStyle.GridDataCellList: case PaletteContentStyle.GridDataCellSheet: case PaletteContentStyle.GridDataCellCustom1: case PaletteContentStyle.GridDataCellCustom2: case PaletteContentStyle.GridDataCellCustom3: return 1; case PaletteContentStyle.LabelSuperTip: return 5; default: throw new ArgumentOutOfRangeException(nameof(style)); } } #endregion #region Metric /// <summary> /// Gets an integer metric value. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="metric">Requested metric.</param> /// <returns>Integer value.</returns> public override int GetMetricInt(PaletteState state, PaletteMetricInt metric) { switch (metric) { case PaletteMetricInt.PageButtonInset: case PaletteMetricInt.RibbonTabGap: case PaletteMetricInt.HeaderButtonEdgeInsetCalendar: return 2; case PaletteMetricInt.CheckButtonGap: return 5; case PaletteMetricInt.HeaderButtonEdgeInsetForm: return 4; case PaletteMetricInt.HeaderButtonEdgeInsetInputControl: return 1; case PaletteMetricInt.HeaderButtonEdgeInsetPrimary: case PaletteMetricInt.HeaderButtonEdgeInsetSecondary: case PaletteMetricInt.HeaderButtonEdgeInsetDockInactive: case PaletteMetricInt.HeaderButtonEdgeInsetDockActive: case PaletteMetricInt.HeaderButtonEdgeInsetCustom1: case PaletteMetricInt.HeaderButtonEdgeInsetCustom2: case PaletteMetricInt.HeaderButtonEdgeInsetCustom3: case PaletteMetricInt.BarButtonEdgeOutside: case PaletteMetricInt.BarButtonEdgeInside: return 3; case PaletteMetricInt.None: return 0; default: // Should never happen! Debug.Assert(false); break; } return -1; } /// <summary> /// Gets a boolean metric value. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="metric">Requested metric.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric) { switch (metric) { case PaletteMetricBool.HeaderGroupOverlay: case PaletteMetricBool.SplitWithFading: case PaletteMetricBool.TreeViewLines: return InheritBool.True; case PaletteMetricBool.RibbonTabsSpareCaption: return InheritBool.False; default: // Should never happen! Debug.Assert(false); break; } return InheritBool.Inherit; } /// <summary> /// Gets a padding metric value. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="metric">Requested metric.</param> /// <returns>Padding value.</returns> public override Padding GetMetricPadding(PaletteState state, PaletteMetricPadding metric) { switch (metric) { case PaletteMetricPadding.PageButtonPadding: return _metricPaddingPageButtons; case PaletteMetricPadding.BarPaddingTabs: return _metricPaddingBarTabs; case PaletteMetricPadding.BarPaddingInside: case PaletteMetricPadding.BarPaddingOnly: return _metricPaddingBarInside; case PaletteMetricPadding.BarPaddingOutside: return _metricPaddingBarOutside; case PaletteMetricPadding.HeaderButtonPaddingForm: return _metricPaddingHeaderForm; case PaletteMetricPadding.RibbonButtonPadding: return _metricPaddingRibbon; case PaletteMetricPadding.RibbonAppButton: return _metricPaddingRibbonAppButton; case PaletteMetricPadding.HeaderButtonPaddingInputControl: return _metricPaddingInputControl; case PaletteMetricPadding.HeaderButtonPaddingPrimary: case PaletteMetricPadding.HeaderButtonPaddingSecondary: case PaletteMetricPadding.HeaderButtonPaddingDockInactive: case PaletteMetricPadding.HeaderButtonPaddingDockActive: case PaletteMetricPadding.HeaderButtonPaddingCustom1: case PaletteMetricPadding.HeaderButtonPaddingCustom2: case PaletteMetricPadding.HeaderButtonPaddingCustom3: case PaletteMetricPadding.HeaderButtonPaddingCalendar: case PaletteMetricPadding.BarButtonPadding: return _metricPaddingHeader; case PaletteMetricPadding.ContextMenuItemHighlight: return _metricPaddingContextMenuItemHighlight; case PaletteMetricPadding.ContextMenuItemsCollection: return _metricPaddingContextMenuItemsCollection; case PaletteMetricPadding.ContextMenuItemOuter: case PaletteMetricPadding.HeaderGroupPaddingPrimary: case PaletteMetricPadding.HeaderGroupPaddingSecondary: case PaletteMetricPadding.HeaderGroupPaddingDockInactive: case PaletteMetricPadding.HeaderGroupPaddingDockActive: case PaletteMetricPadding.SeparatorPaddingLowProfile: case PaletteMetricPadding.SeparatorPaddingHighProfile: case PaletteMetricPadding.SeparatorPaddingHighInternalProfile: case PaletteMetricPadding.SeparatorPaddingCustom1: case PaletteMetricPadding.SeparatorPaddingCustom2: case PaletteMetricPadding.SeparatorPaddingCustom3: return Padding.Empty; default: // Should never happen! Debug.Assert(false); break; } return Padding.Empty; } #endregion #region Images /// <summary> /// Gets a tree view image appropriate for the provided state. /// </summary> /// <param name="expanded">Is the node expanded</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetTreeViewImage(bool expanded) { if (expanded) { return _treeCollapseMinus; } else { return _treeExpandPlus; } } /// <summary> /// Gets a check box image appropriate for the provided state. /// </summary> /// <param name="enabled">Is the check box enabled.</param> /// <param name="checkState">Is the check box checked/unchecked/indeterminate.</param> /// <param name="tracking">Is the check box being hot tracked.</param> /// <param name="pressed">Is the check box being pressed.</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetCheckBoxImage(bool enabled, CheckState checkState, bool tracking, bool pressed) { return null; } /// <summary> /// Gets a check box image appropriate for the provided state. /// </summary> /// <param name="enabled">Is the radio button enabled.</param> /// <param name="checkState">Is the radio button checked.</param> /// <param name="tracking">Is the radio button being hot tracked.</param> /// <param name="pressed">Is the radio button being pressed.</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetRadioButtonImage(bool enabled, bool checkState, bool tracking, bool pressed) { return null; } /// <summary> /// Gets a drop down button image appropriate for the provided state. /// </summary> /// <param name="state">PaletteState for which image is required.</param> public override Image GetDropDownButtonImage(PaletteState state) { if (state != PaletteState.Disabled) { if (_normalDropDownImage == null) { _normalDropDownImage = CreateDropDownImage(SystemColors.ControlText); _normalDropDownColor = SystemColors.ControlText; } return _normalDropDownImage; } else { if (_disabledDropDownImage == null) { _disabledDropDownImage = CreateDropDownImage(SystemColors.ControlDark); _disabledDropDownColor = SystemColors.ControlDark; } return _disabledDropDownImage; } } /// <summary> /// Gets a checked image appropriate for a context menu item. /// </summary> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetContextMenuCheckedImage() { return _contextMenuChecked; } /// <summary> /// Gets a indeterminate image appropriate for a context menu item. /// </summary> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetContextMenuIndeterminateImage() { return _contextMenuIndeterminate; } /// <summary> /// Gets an image indicating a sub-menu on a context menu item. /// </summary> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetContextMenuSubMenuImage() { return _contextMenuSubMenu; } /// <summary> /// Gets a check box image appropriate for the provided state. /// </summary> /// <param name="button">Enum of the button to fetch.</param> /// <param name="state">State of the button to fetch.</param> /// <returns>Appropriate image for drawing; otherwise null.</returns> public override Image GetGalleryButtonImage(PaletteRibbonGalleryButton button, PaletteState state) { switch (button) { default: case PaletteRibbonGalleryButton.Up: return _galleryImageUp ?? (_galleryImageUp = CreateGalleryUpImage(SystemColors.ControlText)); case PaletteRibbonGalleryButton.Down: return _galleryImageDown ?? (_galleryImageDown = CreateGalleryDownImage(SystemColors.ControlText)); case PaletteRibbonGalleryButton.DropDown: return _galleryImageDropDown ?? (_galleryImageDropDown = CreateGalleryDropDownImage(SystemColors.ControlText)); } } #endregion #region ButtonSpec /// <summary> /// Gets the icon to display for the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>Icon value.</returns> public override Icon GetButtonSpecIcon(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return null; default: // Should never happen! Debug.Assert(false); return null; } } /// <summary> /// Gets the image to display for the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <param name="state">State for which image is required.</param> /// <returns>Image value.</returns> public override Image GetButtonSpecImage(PaletteButtonSpecStyle style, PaletteState state) { switch (style) { case PaletteButtonSpecStyle.Close: return _buttonSpecClose; case PaletteButtonSpecStyle.Context: return _buttonSpecContext; case PaletteButtonSpecStyle.Next: return _buttonSpecNext; case PaletteButtonSpecStyle.Previous: return _buttonSpecPrevious; case PaletteButtonSpecStyle.ArrowLeft: return _buttonSpecArrowLeft; case PaletteButtonSpecStyle.ArrowRight: return _buttonSpecArrowRight; case PaletteButtonSpecStyle.ArrowUp: return _buttonSpecArrowUp; case PaletteButtonSpecStyle.ArrowDown: return _buttonSpecArrowDown; case PaletteButtonSpecStyle.DropDown: return _buttonSpecDropDown; case PaletteButtonSpecStyle.PinVertical: return _buttonSpecPinVertical; case PaletteButtonSpecStyle.PinHorizontal: return _buttonSpecPinHorizontal; case PaletteButtonSpecStyle.WorkspaceMaximize: return _buttonSpecWorkspaceMaximize; case PaletteButtonSpecStyle.WorkspaceRestore: return _buttonSpecWorkspaceRestore; case PaletteButtonSpecStyle.RibbonMinimize: if (state == PaletteState.Disabled) { return _pendantMinimizeI; } else { return _pendantMinimizeA; } case PaletteButtonSpecStyle.RibbonExpand: if (state == PaletteState.Disabled) { return _pendantExpandI; } else { return _pendantExpandA; } case PaletteButtonSpecStyle.FormClose: if (state == PaletteState.Disabled) { return _systemCloseI; } else { return _systemCloseA; } case PaletteButtonSpecStyle.FormMin: if (state == PaletteState.Disabled) { return _systemMinI; } else { return _systemMinA; } case PaletteButtonSpecStyle.FormMax: if (state == PaletteState.Disabled) { return _systemMaxI; } else { return _systemMaxA; } case PaletteButtonSpecStyle.FormRestore: if (state == PaletteState.Disabled) { return _systemRestoreI; } else { return _systemRestoreA; } case PaletteButtonSpecStyle.PendantClose: if (state == PaletteState.Disabled) { return _pendantCloseI; } else { return _pendantCloseA; } case PaletteButtonSpecStyle.PendantMin: if (state == PaletteState.Disabled) { return _pendantMinI; } else { return _pendantMinA; } case PaletteButtonSpecStyle.PendantRestore: if (state == PaletteState.Disabled) { return _pendantRestoreI; } else { return _pendantRestoreA; } case PaletteButtonSpecStyle.Generic: return null; default: // Should never happen! Debug.Assert(false); return null; } } /// <summary> /// Gets the image transparent color. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>Color value.</returns> public override Color GetButtonSpecImageTransparentColor(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: return Color.Empty; case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return Color.Magenta; default: // Should never happen! Debug.Assert(false); return Color.Empty; } } /// <summary> /// Gets the short text to display for the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>String value.</returns> public override string GetButtonSpecShortText(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return string.Empty; default: // Should never happen! Debug.Assert(false); return null; } } /// <summary> /// Gets the long text to display for the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>String value.</returns> public override string GetButtonSpecLongText(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return string.Empty; default: // Should never happen! Debug.Assert(false); return null; } } /// <summary> /// Gets the color to remap from the image to the container foreground. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>Color value.</returns> public override Color GetButtonSpecColorMap(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: return Color.Empty; case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return Color.Black; default: // Should never happen! Debug.Assert(false); return Color.Empty; } } /// <summary> /// Gets the color to remap to transparent. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>Color value.</returns> public override Color GetButtonSpecColorTransparent(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: return Color.Empty; case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return Color.Magenta; default: // Should never happen! Debug.Assert(false); return Color.Empty; } } /// <summary> /// Gets the button style used for drawing the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>PaletteButtonStyle value.</returns> public override PaletteButtonStyle GetButtonSpecStyle(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: return PaletteButtonStyle.Form; case PaletteButtonSpecStyle.FormClose: return PaletteButtonStyle.FormClose; case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return PaletteButtonStyle.ButtonSpec; default: // Should never happen! Debug.Assert(false); return PaletteButtonStyle.ButtonSpec; } } /// <summary> /// Get the location for the button. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>HeaderLocation value.</returns> public override HeaderLocation GetButtonSpecLocation(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return HeaderLocation.PrimaryHeader; default: // Should never happen! Debug.Assert(false); return HeaderLocation.PrimaryHeader; } } /// <summary> /// Gets the edge to positon the button against. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>PaletteRelativeEdgeAlign value.</returns> public override PaletteRelativeEdgeAlign GetButtonSpecEdge(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return PaletteRelativeEdgeAlign.Far; default: // Should never happen! Debug.Assert(false); return PaletteRelativeEdgeAlign.Far; } } /// <summary> /// Gets the button orientation. /// </summary> /// <param name="style">Style of button spec.</param> /// <returns>PaletteButtonOrientation value.</returns> public override PaletteButtonOrientation GetButtonSpecOrientation(PaletteButtonSpecStyle style) { switch (style) { case PaletteButtonSpecStyle.Close: case PaletteButtonSpecStyle.Context: case PaletteButtonSpecStyle.ArrowLeft: case PaletteButtonSpecStyle.ArrowRight: case PaletteButtonSpecStyle.ArrowUp: case PaletteButtonSpecStyle.ArrowDown: case PaletteButtonSpecStyle.DropDown: case PaletteButtonSpecStyle.PinVertical: case PaletteButtonSpecStyle.PinHorizontal: case PaletteButtonSpecStyle.FormClose: case PaletteButtonSpecStyle.FormMax: case PaletteButtonSpecStyle.FormMin: case PaletteButtonSpecStyle.FormRestore: case PaletteButtonSpecStyle.PendantClose: case PaletteButtonSpecStyle.PendantMin: case PaletteButtonSpecStyle.PendantRestore: case PaletteButtonSpecStyle.WorkspaceMaximize: case PaletteButtonSpecStyle.WorkspaceRestore: case PaletteButtonSpecStyle.RibbonMinimize: case PaletteButtonSpecStyle.RibbonExpand: return PaletteButtonOrientation.FixedTop; case PaletteButtonSpecStyle.Generic: case PaletteButtonSpecStyle.Next: case PaletteButtonSpecStyle.Previous: return PaletteButtonOrientation.Auto; default: // Should never happen! Debug.Assert(false); return PaletteButtonOrientation.Auto; } } #endregion #region RibbonGeneral /// <summary> /// Gets the ribbon shape that should be used. /// </summary> /// <returns>Ribbon shape value.</returns> public override PaletteRibbonShape GetRibbonShape() { return PaletteRibbonShape.Office2010; } /// <summary> /// Gets the text alignment for the ribbon context text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override PaletteRelativeAlign GetRibbonContextTextAlign(PaletteState state) { return PaletteRelativeAlign.Near; } /// <summary> /// Gets the font for the ribbon context text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetRibbonContextTextFont(PaletteState state) { return _buttonFont; } /// <summary> /// Gets the color for the ribbon context text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Color GetRibbonContextTextColor(PaletteState state) { return _contextTextColor; } /// <summary> /// Gets the dark disabled color used for ribbon glyphs. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonDisabledDark(PaletteState state) { return _disabledGlyphDark; } /// <summary> /// Gets the light disabled color used for ribbon glyphs. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonDisabledLight(PaletteState state) { return _disabledGlyphLight; } /// <summary> /// Gets the color for the drop arrow light. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonDropArrowLight(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupDialogLight]; } /// <summary> /// Gets the color for the drop arrow dark. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonDropArrowDark(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupDialogDark]; } /// <summary> /// Gets the color for the dialog launcher dark. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonGroupDialogDark(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupDialogDark]; } /// <summary> /// Gets the color for the dialog launcher light. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonGroupDialogLight(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupDialogLight]; } /// <summary> /// Gets the color for the group separator dark. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonGroupSeparatorDark(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupSeparatorDark]; } /// <summary> /// Gets the color for the group separator light. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonGroupSeparatorLight(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupSeparatorLight]; } /// <summary> /// Gets the color for the minimize bar dark. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonMinimizeBarDark(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonMinimizeBarDark]; } /// <summary> /// Gets the color for the minimize bar light. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonMinimizeBarLight(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonMinimizeBarLight]; } /// <summary> /// Gets the color for the tab separator. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTabSeparatorColor(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSeparatorColor]; } /// <summary> /// Gets the color for the tab context separators. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTabSeparatorContextColor(PaletteState state) { return _contextTabSeparator; } /// <summary> /// Gets the font for the ribbon text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Font value.</returns> public override Font GetRibbonTextFont(PaletteState state) { return _buttonFont; } /// <summary> /// Gets the rendering hint for the ribbon font. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteTextHint value.</returns> public override PaletteTextHint GetRibbonTextHint(PaletteState state) { return PaletteTextHint.SystemDefault; } /// <summary> /// Gets the color for the extra QAT button dark content color. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonQATButtonDark(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATButtonDark]; } /// <summary> /// Gets the color for the extra QAT button light content color. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonQATButtonLight(PaletteState state) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATButtonLight]; } #endregion #region RibbonBack /// <summary> /// Gets the method used to draw the background of a ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteRibbonBackStyle value.</returns> public override PaletteRibbonColorStyle GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonAppMenuDocs: return PaletteRibbonColorStyle.Solid; case PaletteRibbonBackStyle.RibbonAppMenuInner: return PaletteRibbonColorStyle.RibbonAppMenuInner; case PaletteRibbonBackStyle.RibbonAppMenuOuter: return PaletteRibbonColorStyle.RibbonAppMenuOuter; case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.CheckedNormal) { return PaletteRibbonColorStyle.RibbonQATMinibarDouble; } else { return PaletteRibbonColorStyle.RibbonQATMinibarSingle; } case PaletteRibbonBackStyle.RibbonQATFullbar: return PaletteRibbonColorStyle.RibbonQATFullbarSquare; case PaletteRibbonBackStyle.RibbonQATOverflow: return PaletteRibbonColorStyle.RibbonQATOverflow; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: return PaletteRibbonColorStyle.LinearBorder; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: if (state == PaletteState.Pressed) { return PaletteRibbonColorStyle.Empty; } else { return PaletteRibbonColorStyle.Linear; } case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: switch (state) { case PaletteState.Normal: case PaletteState.ContextNormal: return PaletteRibbonColorStyle.RibbonGroupNormalBorderSep; case PaletteState.Tracking: case PaletteState.ContextTracking: return PaletteRibbonColorStyle.RibbonGroupNormalBorderSepTrackingLight; case PaletteState.Pressed: case PaletteState.ContextPressed: return PaletteRibbonColorStyle.RibbonGroupNormalBorderSepPressedLight; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: return PaletteRibbonColorStyle.Empty; case PaletteRibbonBackStyle.RibbonGroupArea: switch (state) { case PaletteState.Normal: case PaletteState.CheckedNormal: return PaletteRibbonColorStyle.RibbonGroupAreaBorder3; case PaletteState.ContextCheckedNormal: return PaletteRibbonColorStyle.RibbonGroupAreaBorder4; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: return PaletteRibbonColorStyle.Empty; case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextTracking: return PaletteRibbonColorStyle.RibbonTabTracking2010; case PaletteState.FocusOverride: return PaletteRibbonColorStyle.RibbonTabFocus2010; case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: return PaletteRibbonColorStyle.RibbonTabSelected2010; default: // Should never happen! Debug.Assert(false); break; } break; default: // Should never happen! Debug.Assert(false); break; } return PaletteRibbonColorStyle.Empty; } /// <summary> /// Gets the first background color for the ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonBackColor1(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonGalleryBack: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Tracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonGalleryBackTracking]; case PaletteState.Normal: default: return _ribbonColors[(int)SchemeOfficeColors.RibbonGalleryBackNormal]; } case PaletteRibbonBackStyle.RibbonGalleryBorder: switch (state) { case PaletteState.Disabled: return FadedColor(ColorTable.ButtonSelectedBorder); case PaletteState.Normal: case PaletteState.Tracking: default: return _ribbonColors[(int)SchemeOfficeColors.RibbonGalleryBorder]; } case PaletteRibbonBackStyle.RibbonAppMenuDocs: return _ribbonColors[(int)SchemeOfficeColors.AppButtonMenuDocsBack]; case PaletteRibbonBackStyle.RibbonAppMenuInner: return _ribbonColors[(int)SchemeOfficeColors.AppButtonInner1]; case PaletteRibbonBackStyle.RibbonAppMenuOuter: return _ribbonColors[(int)SchemeOfficeColors.AppButtonOuter1]; case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.Normal) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini1]; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini1I]; } case PaletteRibbonBackStyle.RibbonQATFullbar: return _ribbonColors[(int)SchemeOfficeColors.RibbonQATFullbar1]; case PaletteRibbonBackStyle.RibbonQATOverflow: return _ribbonColors[(int)SchemeOfficeColors.RibbonQATOverflow1]; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupFrameBorder1]; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupFrameInside1]; case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: switch (state) { case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextNormal: case PaletteState.ContextTracking: case PaletteState.ContextPressed: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupBorder1]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: return Color.Empty; case PaletteRibbonBackStyle.RibbonAppButton: switch (state) { case PaletteState.Normal: return _appButtonNormal[0]; case PaletteState.Tracking: return _appButtonTrack[0]; case PaletteState.Pressed: return _appButtonPressed[0]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupArea: if (state == PaletteState.ContextCheckedNormal) { return _contextGroupAreaBorder; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea1]; } case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTracking1]; case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected1]; case PaletteState.FocusOverride: return _contextCheckedTabBorder1; case PaletteState.Normal: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } break; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the second background color for the ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonBackColor2(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonAppMenuInner: return _ribbonColors[(int)SchemeOfficeColors.AppButtonInner2]; case PaletteRibbonBackStyle.RibbonAppMenuOuter: return _ribbonColors[(int)SchemeOfficeColors.AppButtonOuter2]; case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.Normal) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini2]; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini2I]; } case PaletteRibbonBackStyle.RibbonQATFullbar: return _ribbonColors[(int)SchemeOfficeColors.RibbonQATFullbar2]; case PaletteRibbonBackStyle.RibbonQATOverflow: return _ribbonColors[(int)SchemeOfficeColors.RibbonQATOverflow2]; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupFrameBorder2]; case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupFrameInside2]; case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: switch (state) { case PaletteState.Normal: case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextNormal: case PaletteState.ContextTracking: case PaletteState.ContextPressed: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupBorder2]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: return Color.Empty; case PaletteRibbonBackStyle.RibbonAppButton: switch (state) { case PaletteState.Normal: return _appButtonNormal[1]; case PaletteState.Tracking: return _appButtonTrack[1]; case PaletteState.Pressed: return _appButtonPressed[1]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupArea: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea2]; case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTracking2]; case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextCheckedTracking: case PaletteState.ContextCheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected2]; case PaletteState.FocusOverride: return _contextCheckedTabBorder2; case PaletteState.Normal: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonAppMenuDocs: case PaletteRibbonBackStyle.RibbonGalleryBack: case PaletteRibbonBackStyle.RibbonGalleryBorder: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the third background color for the ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonBackColor3(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonAppMenuOuter: return _ribbonColors[(int)SchemeOfficeColors.AppButtonOuter3]; case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.Normal) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini3]; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini3I]; } case PaletteRibbonBackStyle.RibbonQATFullbar: return _ribbonColors[(int)SchemeOfficeColors.RibbonQATFullbar3]; case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupBorder3]; case PaletteRibbonBackStyle.RibbonAppMenuDocs: case PaletteRibbonBackStyle.RibbonAppMenuInner: case PaletteRibbonBackStyle.RibbonQATOverflow: case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: return Color.Empty; case PaletteRibbonBackStyle.RibbonGalleryBack: case PaletteRibbonBackStyle.RibbonGalleryBorder: return Color.Empty; case PaletteRibbonBackStyle.RibbonAppButton: switch (state) { case PaletteState.Normal: return _appButtonNormal[2]; case PaletteState.Tracking: return _appButtonTrack[2]; case PaletteState.Pressed: return _appButtonPressed[2]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupArea: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea3]; case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTracking3]; case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected3]; case PaletteState.FocusOverride: return _contextCheckedTabBorder3; case PaletteState.Normal: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } break; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the fourth background color for the ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonBackColor4(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.Normal) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini4]; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini4I]; } case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupBorder4]; case PaletteRibbonBackStyle.RibbonAppMenuDocs: case PaletteRibbonBackStyle.RibbonAppMenuInner: case PaletteRibbonBackStyle.RibbonAppMenuOuter: case PaletteRibbonBackStyle.RibbonQATFullbar: case PaletteRibbonBackStyle.RibbonQATOverflow: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonGalleryBack: case PaletteRibbonBackStyle.RibbonGalleryBorder: return Color.Empty; case PaletteRibbonBackStyle.RibbonAppButton: switch (state) { case PaletteState.Normal: return _appButtonNormal[3]; case PaletteState.Tracking: return _appButtonTrack[3]; case PaletteState.Pressed: return _appButtonPressed[3]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupArea: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea4]; case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.ContextTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTracking4]; case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected4]; case PaletteState.FocusOverride: return _contextCheckedTabBorder4; case PaletteState.Normal: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } break; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the fifth background color for the ribbon item. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonBackColor5(PaletteRibbonBackStyle style, PaletteState state) { switch (style) { case PaletteRibbonBackStyle.RibbonGroupNormalBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedBorder: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupBorder5]; case PaletteRibbonBackStyle.RibbonAppMenuDocs: case PaletteRibbonBackStyle.RibbonAppMenuInner: case PaletteRibbonBackStyle.RibbonAppMenuOuter: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder: case PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack: case PaletteRibbonBackStyle.RibbonGroupCollapsedBack: case PaletteRibbonBackStyle.RibbonGroupNormalTitle: case PaletteRibbonBackStyle.RibbonQATFullbar: case PaletteRibbonBackStyle.RibbonQATOverflow: case PaletteRibbonBackStyle.RibbonGalleryBack: case PaletteRibbonBackStyle.RibbonGalleryBorder: return Color.Empty; case PaletteRibbonBackStyle.RibbonQATMinibar: if (state == PaletteState.Normal) { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini5]; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonQATMini5I]; } case PaletteRibbonBackStyle.RibbonAppButton: switch (state) { case PaletteState.Normal: return _appButtonNormal[4]; case PaletteState.Tracking: return _appButtonTrack[4]; case PaletteState.Pressed: return _appButtonPressed[4]; default: // Should never happen! Debug.Assert(false); break; } break; case PaletteRibbonBackStyle.RibbonGroupArea: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupsArea5]; case PaletteRibbonBackStyle.RibbonTab: switch (state) { case PaletteState.Disabled: return _disabledText; case PaletteState.Pressed: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTracking2]; case PaletteState.Tracking: case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: case PaletteState.ContextTracking: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: case PaletteState.FocusOverride: case PaletteState.Normal: return Color.Empty; default: // Should never happen! Debug.Assert(false); break; } break; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } #endregion #region RibbonText /// <summary> /// Gets the =color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { switch (style) { case PaletteRibbonTextStyle.RibbonAppMenuDocsEntry: case PaletteRibbonTextStyle.RibbonAppMenuDocsTitle: return SystemColors.ControlText; case PaletteRibbonTextStyle.RibbonGroupNormalTitle: switch (state) { case PaletteState.Disabled: return _disabledText; default: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupTitleText]; } case PaletteRibbonTextStyle.RibbonTab: switch (state) { case PaletteState.Disabled: return _disabledText; case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: case PaletteState.FocusOverride: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTextChecked]; default: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTextNormal]; } case PaletteRibbonTextStyle.RibbonGroupCollapsedText: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupCollapsedText]; case PaletteRibbonTextStyle.RibbonGroupButtonText: case PaletteRibbonTextStyle.RibbonGroupLabelText: case PaletteRibbonTextStyle.RibbonGroupCheckBoxText: case PaletteRibbonTextStyle.RibbonGroupRadioButtonText: if (state == PaletteState.Disabled) { return _disabledText; } else { return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupCollapsedText]; } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } #endregion #region ElementColor /// <summary> /// Gets the first element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor1(PaletteElement element, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (element) { case PaletteElement.TrackBarTick: return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: return ColorTable.OverflowButtonGradientEnd; case PaletteElement.TrackBarPosition: return Color.FromArgb(128, Color.White); default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the second element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor2(PaletteElement element, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (element) { case PaletteElement.TrackBarTick: return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: return ColorTable.MenuStripGradientBegin; case PaletteElement.TrackBarPosition: switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(ColorTable.MenuBorder); case PaletteState.Normal: return ColorTable.MenuBorder; case PaletteState.Tracking: return ColorTable.ButtonSelectedBorder; case PaletteState.Pressed: return ColorTable.ButtonPressedBorder; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the third element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor3(PaletteElement element, PaletteState state) { if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } switch (element) { case PaletteElement.TrackBarTick: return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: return ColorTable.OverflowButtonGradientBegin; case PaletteElement.TrackBarPosition: switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(ColorTable.MenuStripGradientBegin); case PaletteState.Normal: case PaletteState.FocusOverride: return ControlPaint.Light(ColorTable.MenuStripGradientBegin); case PaletteState.Tracking: return ControlPaint.Light(ColorTable.ButtonSelectedGradientBegin); case PaletteState.Pressed: return ControlPaint.Light(ColorTable.ButtonPressedGradientBegin); default: throw new ArgumentOutOfRangeException(nameof(state)); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the fourth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor4(PaletteElement element, PaletteState state) { switch (element) { case PaletteElement.TrackBarTick: if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } return SystemColors.Control; case PaletteElement.TrackBarPosition: if (CommonHelper.IsOverrideStateExclude(state, PaletteState.FocusOverride)) { return Color.Empty; } switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(ColorTable.MenuStripGradientEnd); case PaletteState.Normal: return ColorTable.MenuStripGradientEnd; case PaletteState.Tracking: case PaletteState.FocusOverride: return ColorTable.ButtonSelectedGradientBegin; case PaletteState.Pressed: return ColorTable.ButtonPressedGradientBegin; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } /// <summary> /// Gets the fifth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor5(PaletteElement element, PaletteState state) { switch (element) { case PaletteElement.TrackBarTick: if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: if (CommonHelper.IsOverrideState(state)) { return Color.Empty; } return SystemColors.Control; case PaletteElement.TrackBarPosition: if (CommonHelper.IsOverrideStateExclude(state, PaletteState.FocusOverride)) { return Color.Empty; } switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(ColorTable.MenuStripGradientBegin); case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: case PaletteState.FocusOverride: return ColorTable.ButtonSelectedGradientEnd; case PaletteState.Pressed: return ColorTable.ButtonPressedGradientEnd; default: throw new ArgumentOutOfRangeException(nameof(state)); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; } #endregion #region ColorTable /// <summary> /// Gets access to the color table instance. /// </summary> public override KryptonColorTable ColorTable => Table; internal KryptonProfessionalKCT Table => _table ?? (_table = GenerateColorTable(false)); /// <summary> /// Generate an appropriate color table. /// </summary> /// <returns>KryptonProfessionalKCT instance.</returns> internal virtual KryptonProfessionalKCT GenerateColorTable(bool useSystemColors) { // Create the color table to use as the base for getting krypton colors KryptonColorTable kct = new KryptonColorTable(this) { // Always turn off the use of any theme specific colors UseSystemColors = useSystemColors }; // Calculate the krypton specific colors Color[] colors = { kct.OverflowButtonGradientEnd, // Header1Begin kct.OverflowButtonGradientEnd, // Header1End }; // Create a krypton extension color table return new KryptonProfessionalKCT(colors, true, this); } #endregion #region OnUserPreferenceChanged /// <summary> /// Handle a change in the user preferences. /// </summary> /// <param name="sender">Source of event.</param> /// <param name="e">Event data.</param> protected override void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) { // Remove the current table, so it gets regenerated when next requested _table = null; if (_disabledDropDownImage != null) { _disabledDropDownImage.Dispose(); _disabledDropDownImage = null; } if (_normalDropDownImage != null) { _normalDropDownImage.Dispose(); _normalDropDownImage = null; } if (_galleryImageUp != null) { _galleryImageUp.Dispose(); _galleryImageUp = null; } if (_galleryImageDown != null) { _galleryImageDown.Dispose(); _galleryImageDown = null; } if (_galleryImageDropDown != null) { _galleryImageDropDown.Dispose(); _galleryImageDropDown = null; } // Update fonts to reflect any change in system settings DefineFonts(); // Generate the myriad ribbon colors from system settings DefineRibbonColors(); base.OnUserPreferenceChanged(sender, e); } #endregion #region Protected /// <summary> /// Update the fonts to reflect system or user defined changes. /// </summary> protected override void DefineFonts() { // Release existing resources _header1ShortFont?.Dispose(); _header2ShortFont?.Dispose(); _headerFormFont?.Dispose(); _header1LongFont?.Dispose(); _header2LongFont?.Dispose(); _buttonFont?.Dispose(); _buttonFontNavigatorMini?.Dispose(); _tabFontSelected?.Dispose(); _tabFontNormal?.Dispose(); _gridFont?.Dispose(); _calendarFont?.Dispose(); _calendarBoldFont?.Dispose(); _superToolFont?.Dispose(); _boldFont?.Dispose(); _italicFont?.Dispose(); _header1ShortFont = SystemFonts.IconTitleFont; //new Font("Arial", baseFontSize + 4.5f, FontStyle.Bold); _header2ShortFont = SystemFonts.DefaultFont; _header1LongFont = SystemFonts.MenuFont; _header2LongFont = SystemFonts.IconTitleFont; _headerFormFont = SystemFonts.CaptionFont; _buttonFont = SystemFonts.IconTitleFont; _buttonFontNavigatorMini = SystemFonts.SmallCaptionFont; _tabFontNormal = SystemFonts.IconTitleFont; _tabFontSelected = new Font(_tabFontNormal, FontStyle.Bold); _gridFont = SystemFonts.IconTitleFont; _superToolFont = SystemFonts.SmallCaptionFont; _calendarFont = SystemFonts.DialogFont; ; _calendarBoldFont = new Font(SystemFonts.DialogFont, FontStyle.Bold); _boldFont = new Font(SystemFonts.DialogFont, FontStyle.Bold); _italicFont = new Font(SystemFonts.DialogFont, FontStyle.Italic); } #endregion #region Implementation private void DefineRibbonColors() { // Main values Color groupLight = ColorTable.MenuStripGradientEnd; Color groupStart = ColorTable.RaftingContainerGradientBegin; Color groupEnd = ColorTable.MenuBorder; // Spot standard background colors and then tweak values // so it looks good under the standard windows settings. switch (SystemColors.Control.ToArgb()) { case -986896: // Vista Aero/Basic case -1250856: // XP Themes - Blue & Olive case -2039837: // XP Themes - Silver groupLight = MergeColors(groupLight, 0.93f, Color.Black, 0.07f); groupStart = MergeColors(groupStart, 0.93f, Color.Black, 0.07f); groupEnd = MergeColors(groupEnd, 0.93f, Color.Black, 0.07f); break; case -2830136: // Windows Standard case -4144960: // Windows Classic groupLight = MergeColors(groupLight, 0.95f, Color.Black, 0.05f); groupStart = MergeColors(groupStart, 0.95f, Color.Black, 0.05f); groupEnd = MergeColors(groupEnd, 0.95f, Color.Black, 0.05f); break; } // Create colors, mainly by merging between two main values Color ribbonGroupsArea1 = MergeColors(groupStart, 0.80f, groupEnd, 0.20f); Color ribbonGroupsArea2 = MergeColors(groupStart, 0.20f, groupEnd, 0.80f); Color ribbonGroupsArea3 = MergeColors(groupStart, 0.10f, Color.White, 0.90f); Color ribbonGroupsArea4 = MergeColors(groupStart, 0.70f, Color.White, 0.30f); Color ribbonGroupsArea5 = MergeColors(groupStart, 0.90f, groupEnd, 0.10f); Color ribbonGroupBorder1 = Color.FromArgb(128, Color.White); Color ribbonGroupBorder2 = Color.FromArgb(196, Color.White); Color ribbonGroupBorder3 = MergeColors(groupStart, 0.20f, groupEnd, 0.80f); Color ribbonGroupBorder4 = MergeColors(groupStart, 0.30f, Color.White, 0.70f); Color ribbonGroupBorder5 = Color.FromArgb(249, 250, 250); Color ribbonGroupFrameBorder1 = MergeColors(groupStart, 0.60f, groupEnd, 0.40f); Color ribbonGroupFrameInside1 = MergeColors(groupStart, 0.40f, Color.White, 0.60f); Color ribbonGroupTitleText = Color.FromArgb(152, SystemColors.ControlText); Color ribbonGroupDialogDark = Color.FromArgb(104, SystemColors.ControlText); Color ribbonGroupDialogLight = Color.FromArgb(72, SystemColors.ControlText); Color ribbonGroupSepDark = MergeColors(groupStart, 0.50f, groupEnd, 0.50f); Color ribbonMinimizeLight = MergeColors(ColorTable.MenuStripGradientEnd, 0.40f, Color.White, 0.60f); Color ribbonMinimizeDark = MergeColors(groupStart, 0.70f, groupEnd, 0.30f); Color ribbonTabSelected1 = MergeColors(groupStart, 0.80f, groupEnd, 0.20f); Color ribbonTabSelected2 = MergeColors(groupStart, 0.10f, Color.White, 0.90f); Color ribbonTabSelected3 = MergeColors(groupStart, 0.10f, Color.White, 0.90f); Color ribbonTabSelected4 = MergeColors(groupStart, 0.10f, Color.White, 0.90f); Color ribbonTabTracking1 = MergeColors(groupStart, 0.80f, groupEnd, 0.20f); Color ribbonTabTracking2 = MergeColors(groupStart, 0.20f, Color.White, 0.80f); Color ribbonTabTracking3 = MergeColors(groupStart, 0.50f, Color.White, 0.50f); Color ribbonTabTracking4 = MergeColors(groupStart, 0.75f, Color.White, 0.25f); Color ribbonQATOverflowInside = MergeColors(ColorTable.MenuStripGradientEnd, 0.75f, groupStart, 0.25f); Color ribbonQATOverflowInside2 = MergeColors(ColorTable.MenuStripGradientEnd, 0.65f, groupStart, 0.35f); Color ribbonQATMini1 = MergeColors(groupStart, 0.70f, groupEnd, 0.30f); Color ribbonQATMini3 = MergeColors(groupStart, 0.90f, groupEnd, 0.10f); // Generate first set of ribbon colors _ribbonColors = new Color[] { // Non ribbon colors Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, // Ribbon colors SystemColors.ControlText, // RibbonTabTextNormal SystemColors.ControlText, // RibbonTabTextChecked ribbonTabSelected1, // RibbonTabSelected1 ribbonTabSelected2, // RibbonTabSelected2 ribbonTabSelected3, // RibbonTabSelected3 ribbonTabSelected4, // RibbonTabSelected4 Color.Empty, // RibbonTabSelected5 ribbonTabTracking1, // RibbonTabTracking1 ribbonTabTracking2, // RibbonTabTracking2 Color.FromArgb(196, ColorTable.ButtonSelectedGradientMiddle), // RibbonTabHighlight1 ColorTable.ButtonSelectedGradientMiddle, // RibbonTabHighlight2 ColorTable.ButtonPressedGradientMiddle, // RibbonTabHighlight3 ColorTable.ButtonPressedGradientMiddle, // RibbonTabHighlight4 ColorTable.ButtonSelectedGradientMiddle, // RibbonTabHighlight5 ColorTable.MenuBorder, // RibbonTabSeparatorColor ribbonGroupsArea1, // RibbonGroupsArea1 ribbonGroupsArea2, // RibbonGroupsArea2 ribbonGroupsArea3, // RibbonGroupsArea3 ribbonGroupsArea4, // RibbonGroupsArea4 ribbonGroupsArea4, // RibbonGroupsArea5 ribbonGroupBorder1, // RibbonGroupBorder1 ribbonGroupBorder2, // RibbonGroupBorder2 Color.Red, // RibbonGroupTitle1 Color.Red, // RibbonGroupTitle2 ribbonGroupBorder1, // RibbonGroupBorderContext1 ribbonGroupBorder2, // RibbonGroupBorderContext2 Color.Red, // RibbonGroupTitleContext1 Color.Red, // RibbonGroupTitleContext2 ribbonGroupDialogDark, // RibbonGroupDialogDark ribbonGroupDialogLight, // RibbonGroupDialogLight Color.Red, // RibbonGroupTitleTracking1 Color.Red, // RibbonGroupTitleTracking2 ribbonMinimizeDark, // RibbonMinimizeBarDark ribbonMinimizeLight, // RibbonMinimizeBarLight ribbonGroupBorder1, // RibbonGroupCollapsedBorder1 ribbonGroupBorder2, // RibbonGroupCollapsedBorder2 ribbonGroupsArea4, // RibbonGroupCollapsedBorder3 ribbonGroupsArea2, // RibbonGroupCollapsedBorder4 ribbonGroupsArea4, // RibbonGroupCollapsedBack1 Color.Red, // RibbonGroupCollapsedBack2 Color.Red, // RibbonGroupCollapsedBack3 ribbonGroupsArea2, // RibbonGroupCollapsedBack4 Color.Red, // RibbonGroupCollapsedBorderT1 Color.Red, // RibbonGroupCollapsedBorderT2 Color.Red, // RibbonGroupCollapsedBorderT3 Color.Red, // RibbonGroupCollapsedBorderT4 Color.Red, // RibbonGroupCollapsedBackT1 Color.Red, // RibbonGroupCollapsedBackT2 Color.Red, // RibbonGroupCollapsedBackT3 Color.Red, // RibbonGroupCollapsedBackT4 ribbonGroupFrameBorder1, // RibbonGroupFrameBorder1 ribbonGroupFrameBorder1, // RibbonGroupFrameBorder2 ribbonGroupFrameInside1, // RibbonGroupFrameInside1 ribbonGroupFrameInside1, // RibbonGroupFrameInside2 Color.Empty, // RibbonGroupFrameInside3 Color.Empty, // RibbonGroupFrameInside4 SystemColors.ControlText, // RibbonGroupCollapsedText // Non ribbon colors Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, // Ribbon colors ColorTable.MenuBorder, // RibbonQATMini1 groupStart, // RibbonQATMini2 ribbonQATMini3, // RibbonQATMini3 Color.FromArgb(32, Color.White), // RibbonQATMini4 Color.FromArgb(32, Color.White), // RibbonQATMini5 ColorTable.MenuBorder, // RibbonQATMini1I groupStart, // RibbonQATMini2I ribbonQATMini3, // RibbonQATMini3I Color.FromArgb(32, Color.White), // RibbonQATMini4I Color.FromArgb(32, Color.White), // RibbonQATMini5I groupStart, // RibbonQATFullbar1 ribbonQATMini3, // RibbonQATFullbar2 ribbonGroupsArea1, // RibbonQATFullbar3 SystemColors.ControlText, // RibbonQATButtonDark SystemColors.ControlLight, // RibbonQATButtonLight groupStart, // RibbonQATOverflow1 ColorTable.MenuBorder, // RibbonQATOverflow2 ribbonGroupSepDark, // RibbonGroupSeparatorDark ColorTable.GripLight, // RibbonGroupSeparatorLight // Non ribbon colors Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, Color.Red, SystemColors.Window, // AppButtonBack1 ribbonGroupsArea1, // AppButtonBack2 ColorTable.MenuBorder, // AppButtonBorder ColorTable.SeparatorDark, // AppButtonOuter1 ColorTable.SeparatorDark, // AppButtonOuter2 ColorTable.StatusStripGradientBegin, // AppButtonOuter3 ColorTable.ToolStripDropDownBackground, // AppButtonInner1 ColorTable.MenuBorder, // AppButtonInner2 ColorTable.ImageMarginGradientMiddle, // AppButtonMenuDocs SystemColors.ControlText, // AppButtonMenuDocsText // Non ribbon colors Color.Red, Color.Red, ColorTable.MenuBorder, // RibbonGalleryBorder ribbonTabSelected4, // RibbonGalleryBackNormal SystemColors.Window, // RibbonGalleryBackTracking Color.Red, // RibbonGalleryBack1 Color.Red, // RibbonGalleryBack2 ribbonTabTracking3, // RibbonTabTracking3 ribbonTabTracking4, // RibbonTabTracking4 ribbonGroupBorder3, // RibbonGroupBorder3 ribbonGroupBorder4, // RibbonGroupBorder4 ribbonGroupBorder5, // RibbonGroupBorder5 ribbonGroupTitleText, // RibbonGroupTitleText Color.Red, // RibbonDropArrowLight Color.Red, // RibbonDropArrowDark Color.Red, // HeaderDockInactiveBack1 Color.Red, // HeaderDockInactiveBack2 Color.Red, // ButtonNavigatorBorder Color.Red, // ButtonNavigatorText Color.Red, // ButtonNavigatorTrack1 Color.Red, // ButtonNavigatorTrack2 Color.Red, // ButtonNavigatorPressed1 Color.Red, // ButtonNavigatorPressed2 Color.Red, // ButtonNavigatorChecked1 Color.Red, // ButtonNavigatorChecked2 }; // Generate second set of ribbon colors _disabledText = SystemColors.ControlDark; _disabledGlyphDark = Color.FromArgb(183, 183, 183); _disabledGlyphLight = Color.FromArgb(237, 237, 237); _contextCheckedTabBorder = ribbonGroupsArea1; _contextCheckedTabFill = ColorTable.CheckBackground; _contextGroupAreaBorder = ribbonGroupsArea1; _contextGroupAreaInside = ribbonGroupsArea2; _contextGroupFrameTop = Color.FromArgb(250, 250, 250); _contextGroupFrameBottom = _contextGroupFrameTop; _contextTabSeparator = ColorTable.MenuBorder; _focusTabFill = ColorTable.CheckBackground; _toolTipBack1 = SystemColors.Info; _toolTipBack2 = SystemColors.Info; _toolTipBorder = SystemColors.WindowFrame; _toolTipText = SystemColors.InfoText; _disabledDropDownColor = Color.Empty; _normalDropDownColor = Color.Empty; _ribbonGroupCollapsedBackContext = new Color[] { Color.FromArgb(48, 235, 235, 235), Color.FromArgb(235, 235, 235) }; _ribbonGroupCollapsedBackContextTracking = _ribbonGroupCollapsedBackContext; _ribbonGroupCollapsedBorderContext = new Color[] { Color.FromArgb(160, ribbonGroupBorder1), ribbonGroupBorder1, Color.FromArgb(48, ribbonGroupsArea4), ribbonGroupsArea4 }; _ribbonGroupCollapsedBorderContextTracking = new Color[] { Color.FromArgb(200, ribbonGroupBorder1), ribbonGroupBorder1, Color.FromArgb(48, ribbonGroupBorder1), Color.FromArgb(196, ribbonGroupBorder1) }; Color highlight1 = MergeColors(Color.White, 0.50f, ColorTable.ButtonSelectedGradientEnd, 0.50f); Color highlight2 = MergeColors(Color.White, 0.25f, ColorTable.ButtonSelectedGradientEnd, 0.75f); Color highlight3 = MergeColors(Color.White, 0.60f, ColorTable.ButtonPressedGradientMiddle, 0.40f); Color highlight4 = MergeColors(Color.White, 0.25f, ColorTable.ButtonPressedGradientMiddle, 0.75f); Color pressed3 = MergeColors(Color.White, 0.50f, ColorTable.CheckBackground, 0.50f); Color pressed4 = MergeColors(Color.White, 0.25f, ColorTable.CheckPressedBackground, 0.75f); _appButtonNormal = new Color[] { ColorTable.SeparatorLight, ColorTable.ImageMarginGradientBegin, ColorTable.ImageMarginGradientMiddle, ColorTable.GripLight, ColorTable.ImageMarginGradientBegin }; _appButtonTrack = new Color[] { highlight1, highlight2, ColorTable.ButtonSelectedGradientEnd, highlight3, highlight4 }; _appButtonPressed = new Color[] { highlight1, pressed4, ColorTable.CheckPressedBackground, highlight2, pressed4 }; } private Image CreateDropDownImage(Color color) { // Create image that has an alpha channel Image image = new Bitmap(9, 9, PixelFormat.Format32bppArgb); // Use a graphics instance for drawing the image using (Graphics g = Graphics.FromImage(image)) { // Draw a solid arrow using (SolidBrush fill = new SolidBrush(color)) { g.FillPolygon(fill, new Point[] { new Point(2, 3), new Point(4, 6), new Point(7, 3) }); } // Draw semi-transparent outline around the arrow using (Pen outline = new Pen(Color.FromArgb(128, color))) { g.DrawLines(outline, new Point[] { new Point(1, 3), new Point(4, 6), new Point(7, 3) }); } } return image; } private Image CreateGalleryUpImage(Color color) { // Create image that has an alpha channel Image image = new Bitmap(13, 7, PixelFormat.Format32bppArgb); // Use a graphics instance for drawing the image using (Graphics g = Graphics.FromImage(image)) { // Draw a solid arrow using (SolidBrush fill = new SolidBrush(color)) { g.FillPolygon(fill, new Point[] { new Point(3, 6), new Point(6, 2), new Point(9, 6) }); } } return image; } private Image CreateGalleryDownImage(Color color) { // Create image that has an alpha channel Image image = new Bitmap(13, 7, PixelFormat.Format32bppArgb); // Use a graphics instance for drawing the image using (Graphics g = Graphics.FromImage(image)) { // Draw a solid arrow using (SolidBrush fill = new SolidBrush(color)) { g.FillPolygon(fill, new Point[] { new Point(4, 3), new Point(6, 6), new Point(9, 3) }); } } return image; } private Image CreateGalleryDropDownImage(Color color) { // Create image that has an alpha channel Image image = new Bitmap(13, 7, PixelFormat.Format32bppArgb); // Use a graphics instance for drawing the image using (Graphics g = Graphics.FromImage(image)) { // Draw a solid arrow using (SolidBrush fill = new SolidBrush(color)) { g.FillPolygon(fill, new Point[] { new Point(4, 3), new Point(6, 6), new Point(9, 3) }); } // Draw the line above the arrow using (Pen pen = new Pen(color)) { g.DrawLine(pen, 4, 1, 8, 1); } } return image; } #endregion } }
51.555272
214
0.597229
[ "BSD-3-Clause" ]
Krypton-Suite-Legacy-Archive/Krypton-Toolkit-Suite-NET-Core
Source/Truncated Namespaces/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteProfessionalSystem.cs
525,609
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("13. Queue ADT")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("13. Queue ADT")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9455f5cd-e319-4e45-8392-a0198426de90")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
37.810811
84
0.741244
[ "MIT" ]
wIksS/Telerik-Academy
Programming with C#/5. C# Data Structures and Algorithms/02. Linear Data Structures/13. Queue ADT/Properties/AssemblyInfo.cs
1,402
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using windows = Windows; namespace Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT { /// <summary> /// <see cref="windows.Media.Playback.MediaPlayer"/> /// </summary> public class MediaPlayer { internal windows.Media.Playback.MediaPlayer UwpInstance { get; } /// <summary> /// Initializes a new instance of the <see cref="MediaPlayer"/> class, a /// Wpf-enabled wrapper for <see cref="windows.Media.Playback.MediaPlayer"/> /// </summary> public MediaPlayer(windows.Media.Playback.MediaPlayer instance) { this.UwpInstance = instance; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.Volume"/> /// </summary> public double Volume { get => UwpInstance.Volume; set => UwpInstance.Volume = value; } /* OBSOLETE /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.Position"/> /// </summary> public System.TimeSpan Position { get => UwpInstance.Position; set => UwpInstance.Position = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.PlaybackRate"/> /// </summary> public double PlaybackRate { get => UwpInstance.PlaybackRate; set => UwpInstance.PlaybackRate = value; } */ /// <summary> /// Gets or sets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.IsLoopingEnabled"/> /// </summary> public bool IsLoopingEnabled { get => UwpInstance.IsLoopingEnabled; set => UwpInstance.IsLoopingEnabled = value; } /// <summary> /// Gets or sets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.IsMuted"/> /// </summary> public bool IsMuted { get => UwpInstance.IsMuted; set => UwpInstance.IsMuted = value; } /// <summary> /// Gets or sets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.AutoPlay"/> /// </summary> public bool AutoPlay { get => UwpInstance.AutoPlay; set => UwpInstance.AutoPlay = value; } /* OBSOLETE /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.CurrentState"/> /// </summary> public windows.Media.Playback.MediaPlayerState CurrentState { get => UwpInstance.CurrentState; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.NaturalDuration"/> /// </summary> public System.TimeSpan NaturalDuration { get => UwpInstance.NaturalDuration; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.PlaybackMediaMarkers"/> /// </summary> public windows.Media.Playback.PlaybackMediaMarkerSequence PlaybackMediaMarkers { get => UwpInstance.PlaybackMediaMarkers; } /// <summary> /// Gets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.IsProtected"/> /// </summary> public bool IsProtected { get => UwpInstance.IsProtected; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.BufferingProgress"/> /// </summary> public double BufferingProgress { get => UwpInstance.BufferingProgress; } /// <summary> /// Gets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.CanPause"/> /// </summary> public bool CanPause { get => UwpInstance.CanPause; } /// <summary> /// Gets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.CanSeek"/> /// </summary> public bool CanSeek { get => UwpInstance.CanSeek; } */ /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.AudioDeviceType"/> /// </summary> public windows.Media.Playback.MediaPlayerAudioDeviceType AudioDeviceType { get => UwpInstance.AudioDeviceType; set => UwpInstance.AudioDeviceType = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.AudioCategory"/> /// </summary> public windows.Media.Playback.MediaPlayerAudioCategory AudioCategory { get => UwpInstance.AudioCategory; set => UwpInstance.AudioCategory = value; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.SystemMediaTransportControls"/> /// </summary> public windows.Media.SystemMediaTransportControls SystemMediaTransportControls { get => UwpInstance.SystemMediaTransportControls; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.TimelineControllerPositionOffset"/> /// </summary> public System.TimeSpan TimelineControllerPositionOffset { get => UwpInstance.TimelineControllerPositionOffset; set => UwpInstance.TimelineControllerPositionOffset = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.TimelineController"/> /// </summary> public windows.Media.MediaTimelineController TimelineController { get => UwpInstance.TimelineController; set => UwpInstance.TimelineController = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.StereoscopicVideoRenderMode"/> /// </summary> public windows.Media.Playback.StereoscopicVideoRenderMode StereoscopicVideoRenderMode { get => UwpInstance.StereoscopicVideoRenderMode; set => UwpInstance.StereoscopicVideoRenderMode = value; } /// <summary> /// Gets or sets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.RealTimePlayback"/> /// </summary> public bool RealTimePlayback { get => UwpInstance.RealTimePlayback; set => UwpInstance.RealTimePlayback = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.AudioDevice"/> /// </summary> public windows.Devices.Enumeration.DeviceInformation AudioDevice { get => UwpInstance.AudioDevice; set => UwpInstance.AudioDevice = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.AudioBalance"/> /// </summary> public double AudioBalance { get => UwpInstance.AudioBalance; set => UwpInstance.AudioBalance = value; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.CommandManager"/> /// </summary> public windows.Media.Playback.MediaPlaybackCommandManager CommandManager { get => UwpInstance.CommandManager; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.BreakManager"/> /// </summary> public windows.Media.Playback.MediaBreakManager BreakManager { get => UwpInstance.BreakManager; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.PlaybackSession"/> /// </summary> public windows.Media.Playback.MediaPlaybackSession PlaybackSession { get => UwpInstance.PlaybackSession; } /// <summary> /// Gets or sets a value indicating whether <see cref="windows.Media.Playback.MediaPlayer.IsVideoFrameServerEnabled"/> /// </summary> public bool IsVideoFrameServerEnabled { get => UwpInstance.IsVideoFrameServerEnabled; set => UwpInstance.IsVideoFrameServerEnabled = value; } /// <summary> /// Gets <see cref="windows.Media.Playback.MediaPlayer.AudioStateMonitor"/> /// </summary> public windows.Media.Audio.AudioStateMonitor AudioStateMonitor { get => UwpInstance.AudioStateMonitor; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.ProtectionManager"/> /// </summary> public windows.Media.Protection.MediaProtectionManager ProtectionManager { get => UwpInstance.ProtectionManager; set => UwpInstance.ProtectionManager = value; } /// <summary> /// Gets or sets <see cref="windows.Media.Playback.MediaPlayer.Source"/> /// </summary> public windows.Media.Playback.IMediaPlaybackSource Source { get => UwpInstance.Source; set => UwpInstance.Source = value; } /// <summary> /// Performs an implicit conversion from <see cref="windows.Media.Playback.MediaPlayer"/> to <see cref="MediaPlayer"/>. /// </summary> /// <param name="args">The <see cref="windows.Media.Playback.MediaPlayer"/> instance containing the event data.</param> /// <returns>The result of the conversion.</returns> public static implicit operator MediaPlayer( windows.Media.Playback.MediaPlayer args) { return FromMediaPlayer(args); } /// <summary> /// Creates a <see cref="MediaPlayer"/> from <see cref="windows.Media.Playback.MediaPlayer"/>. /// </summary> /// <param name="args">The <see cref="windows.Media.Playback.MediaPlayer"/> instance containing the event data.</param> /// <returns><see cref="MediaPlayer"/></returns> public static MediaPlayer FromMediaPlayer(windows.Media.Playback.MediaPlayer args) { return new MediaPlayer(args); } } }
35.207358
127
0.590577
[ "MIT" ]
Andreas-Hjortland/Microsoft.Toolkit.Win32
Microsoft.Toolkit.Win32.UI.Controls/Interop/WinRT/MediaPlayer.cs
10,527
C#
/* * MIT License * * Copyright (c) Microsoft Corporation. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Drawing; using System.Globalization; using System.IO; using System.Runtime.Serialization; using System.Text.Json; using System.Text.Json.Serialization; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; #nullable enable namespace Microsoft.Playwright { public class LocatorUncheckOptions { public LocatorUncheckOptions() { } public LocatorUncheckOptions(LocatorUncheckOptions clone) { if (clone == null) return; Force = clone.Force; NoWaitAfter = clone.NoWaitAfter; Position = clone.Position; Timeout = clone.Timeout; Trial = clone.Trial; } /// <summary> /// <para> /// Whether to bypass the <a href="./actionability.md">actionability</a> checks. Defaults /// to <c>false</c>. /// </para> /// </summary> [JsonPropertyName("force")] public bool? Force { get; set; } /// <summary> /// <para> /// Actions that initiate navigations are waiting for these navigations to happen and /// for pages to start loading. You can opt out of waiting via setting this flag. You /// would only need this option in the exceptional cases such as navigating to inaccessible /// pages. Defaults to <c>false</c>. /// </para> /// </summary> [JsonPropertyName("noWaitAfter")] public bool? NoWaitAfter { get; set; } /// <summary> /// <para> /// A point to use relative to the top-left corner of element padding box. If not specified, /// uses some visible point of the element. /// </para> /// </summary> [JsonPropertyName("position")] public Position? Position { get; set; } /// <summary> /// <para> /// Maximum time in milliseconds, defaults to 30 seconds, pass <c>0</c> to disable timeout. /// The default value can be changed by using the <see cref="IBrowserContext.SetDefaultTimeout"/> /// or <see cref="IPage.SetDefaultTimeout"/> methods. /// </para> /// </summary> [JsonPropertyName("timeout")] public float? Timeout { get; set; } /// <summary> /// <para> /// When set, this method only performs the <a href="./actionability.md">actionability</a> /// checks and skips the action. Defaults to <c>false</c>. Useful to wait until the /// element is ready for the action without performing it. /// </para> /// </summary> [JsonPropertyName("trial")] public bool? Trial { get; set; } } } #nullable disable
36.546296
105
0.64606
[ "MIT" ]
Archish27/playwright-dotnet
src/Playwright/API/Generated/Options/LocatorUncheckOptions.cs
3,947
C#
using Chat.Server.Dal.LocalJson.Attributes; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Chat.Server.Dal.MongoDB.Models { public class ConnectedUser { internal const string CollectionName = "ConnectedsUsers"; [PrimaryKey] [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } [Required] public DateTime LastUpdateTime { get; set; } [Required] public string Username { get; set; } } }
26.8
65
0.707463
[ "Apache-2.0" ]
juandouglaspe/Chat
Server/Chat.Server.Dal/MongoDB/Models/ConnectedUser.cs
672
C#
using System; using System.Threading; using System.Threading.Tasks; using EventStore.ClientAPI; using EventStore.ClientAPI.SystemData; using EventStore.Core.Messages; using EventStore.Core.Messaging; using EventStore.Core.Services; using EventStore.Core.Services.UserManagement; using EventStore.Core.Tests.ClientAPI.Helpers; using EventStore.Core.Tests.Helpers; using NUnit.Framework; namespace EventStore.Core.Tests.ClientAPI.Security { public abstract class AuthenticationTestBase : SpecificationWithDirectoryPerTestFixture { private readonly UserCredentials _userCredentials; private MiniNode _node; protected IEventStoreConnection Connection; protected AuthenticationTestBase(UserCredentials userCredentials = null) { _userCredentials = userCredentials; } public virtual IEventStoreConnection SetupConnection(MiniNode node) { return TestConnection.Create(node.TcpEndPoint, TcpType.Normal, _userCredentials); } [OneTimeSetUp] public override void TestFixtureSetUp() { base.TestFixtureSetUp(); _node = new MiniNode(PathName, enableTrustedAuth: true); try { _node.Start(); var userCreateEvent1 = new ManualResetEventSlim(); _node.Node.MainQueue.Publish( new UserManagementMessage.Create( new CallbackEnvelope( m => { Assert.IsTrue(m is UserManagementMessage.UpdateResult); var msg = (UserManagementMessage.UpdateResult)m; Assert.IsTrue(msg.Success); userCreateEvent1.Set(); }), SystemAccount.Principal, "user1", "Test User 1", new string[0], "pa$$1")); var userCreateEvent2 = new ManualResetEventSlim(); _node.Node.MainQueue.Publish( new UserManagementMessage.Create( new CallbackEnvelope( m => { Assert.IsTrue(m is UserManagementMessage.UpdateResult); var msg = (UserManagementMessage.UpdateResult)m; Assert.IsTrue(msg.Success); userCreateEvent2.Set(); }), SystemAccount.Principal, "user2", "Test User 2", new string[0], "pa$$2")); var adminCreateEvent2 = new ManualResetEventSlim(); _node.Node.MainQueue.Publish( new UserManagementMessage.Create( new CallbackEnvelope( m => { Assert.IsTrue(m is UserManagementMessage.UpdateResult); var msg = (UserManagementMessage.UpdateResult)m; Assert.IsTrue(msg.Success); adminCreateEvent2.Set(); }), SystemAccount.Principal, "adm", "Administrator User", new[] { SystemRoles.Admins }, "admpa$$")); Assert.IsTrue(userCreateEvent1.Wait(10000), "User 1 creation failed"); Assert.IsTrue(userCreateEvent2.Wait(10000), "User 2 creation failed"); Assert.IsTrue(adminCreateEvent2.Wait(10000), "Administrator User creation failed"); Connection = SetupConnection(_node); Connection.ConnectAsync().Wait(); Connection.SetStreamMetadataAsync("noacl-stream", ExpectedVersion.NoStream, StreamMetadata.Build()) .Wait(); Connection.SetStreamMetadataAsync( "read-stream", ExpectedVersion.NoStream, StreamMetadata.Build().SetReadRole("user1")).Wait(); Connection.SetStreamMetadataAsync( "write-stream", ExpectedVersion.NoStream, StreamMetadata.Build().SetWriteRole("user1")).Wait(); Connection.SetStreamMetadataAsync( "metaread-stream", ExpectedVersion.NoStream, StreamMetadata.Build().SetMetadataReadRole("user1")).Wait(); Connection.SetStreamMetadataAsync( "metawrite-stream", ExpectedVersion.NoStream, StreamMetadata.Build().SetMetadataWriteRole("user1")).Wait(); Connection.SetStreamMetadataAsync( "$all", ExpectedVersion.Any, StreamMetadata.Build().SetReadRole("user1"), new UserCredentials("adm", "admpa$$")).Wait(); Connection.SetStreamMetadataAsync( "$system-acl", ExpectedVersion.NoStream, StreamMetadata.Build() .SetReadRole("user1") .SetWriteRole("user1") .SetMetadataReadRole("user1") .SetMetadataWriteRole("user1"), new UserCredentials("adm", "admpa$$")).Wait(); Connection.SetStreamMetadataAsync( "$system-adm", ExpectedVersion.NoStream, StreamMetadata.Build() .SetReadRole(SystemRoles.Admins) .SetWriteRole(SystemRoles.Admins) .SetMetadataReadRole(SystemRoles.Admins) .SetMetadataWriteRole(SystemRoles.Admins), new UserCredentials("adm", "admpa$$")).Wait(); Connection.SetStreamMetadataAsync( "normal-all", ExpectedVersion.NoStream, StreamMetadata.Build() .SetReadRole(SystemRoles.All) .SetWriteRole(SystemRoles.All) .SetMetadataReadRole(SystemRoles.All) .SetMetadataWriteRole(SystemRoles.All)).Wait(); Connection.SetStreamMetadataAsync( "$system-all", ExpectedVersion.NoStream, StreamMetadata.Build() .SetReadRole(SystemRoles.All) .SetWriteRole(SystemRoles.All) .SetMetadataReadRole(SystemRoles.All) .SetMetadataWriteRole(SystemRoles.All), new UserCredentials("adm", "admpa$$")).Wait(); } catch { if (_node != null) try { _node.Shutdown(); } catch { } throw; } } [OneTimeTearDown] public override void TestFixtureTearDown() { _node.Shutdown(); Connection.Close(); base.TestFixtureTearDown(); } protected void ReadEvent(string streamId, string login, string password) { Connection.ReadEventAsync(streamId, -1, false, login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void ReadStreamForward(string streamId, string login, string password) { Connection.ReadStreamEventsForwardAsync(streamId, 0, 1, false, login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void ReadStreamBackward(string streamId, string login, string password) { Connection.ReadStreamEventsBackwardAsync(streamId, 0, 1, false, login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void WriteStream(string streamId, string login, string password) { Connection.AppendToStreamAsync(streamId, ExpectedVersion.Any, CreateEvents(), login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected EventStoreTransaction TransStart(string streamId, string login, string password) { return Connection.StartTransactionAsync(streamId, ExpectedVersion.Any, login == null && password == null ? null : new UserCredentials(login, password)) .Result; } protected void ReadAllForward(string login, string password) { Connection.ReadAllEventsForwardAsync(Position.Start, 1, false, login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void ReadAllBackward(string login, string password) { Connection.ReadAllEventsBackwardAsync(Position.End, 1, false, login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void ReadMeta(string streamId, string login, string password) { Connection.GetStreamMetadataAsRawBytesAsync(streamId, login == null && password == null ? null : new UserCredentials(login, password)).Wait(); } protected void WriteMeta(string streamId, string login, string password, string metawriteRole) { Connection.SetStreamMetadataAsync(streamId, ExpectedVersion.Any, metawriteRole == null ? StreamMetadata.Build() : StreamMetadata.Build().SetReadRole(metawriteRole) .SetWriteRole(metawriteRole) .SetMetadataReadRole(metawriteRole) .SetMetadataWriteRole(metawriteRole), login == null && password == null ? null : new UserCredentials(login, password)) .Wait(); } protected void SubscribeToStream(string streamId, string login, string password) { using (Connection.SubscribeToStreamAsync(streamId, false, (x, y) => Task.CompletedTask, (x, y, z) => { }, login == null && password == null ? null : new UserCredentials(login, password)).Result) { } } protected void SubscribeToAll(string login, string password) { using (Connection.SubscribeToAllAsync(false, (x, y) => Task.CompletedTask, (x, y, z) => { }, login == null && password == null ? null : new UserCredentials(login, password)).Result) { } } protected string CreateStreamWithMeta(StreamMetadata metadata, string streamPrefix = null) { var stream = (streamPrefix ?? string.Empty) + TestContext.CurrentContext.Test.Name; Connection.SetStreamMetadataAsync(stream, ExpectedVersion.NoStream, metadata, new UserCredentials("adm", "admpa$$")).Wait(); return stream; } protected void DeleteStream(string streamId, string login, string password) { Connection.DeleteStreamAsync(streamId, ExpectedVersion.Any, true, login == null && password == null ? null : new UserCredentials(login, password)).Wait(); } protected void Expect<T>(Action action) where T : Exception { Assert.That(() => action(), Throws.Exception.InstanceOf<AggregateException>().With.InnerException.InstanceOf<T>()); } protected void ExpectNoException(Action action) { Assert.That(() => action(), Throws.Nothing); } protected EventData[] CreateEvents() { return new[] { new EventData(Guid.NewGuid(), "some-type", false, new byte[] { 1, 2, 3 }, null) }; } } }
43.808725
154
0.507009
[ "Apache-2.0", "CC0-1.0" ]
BertschiAG/EventStore
src/EventStore.Core.Tests/ClientAPI/Security/AuthenticationTestBase.cs
13,057
C#
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; using ICSharpCode.PackageManagement; using ICSharpCode.PackageManagement.Design; using ICSharpCode.PackageManagement.Scripting; using ICSharpCode.Scripting; using ICSharpCode.Scripting.Tests.Utils; using NuGet; namespace PackageManagement.Tests.Helpers { public class TestablePackageManagementConsoleViewModel : PackageManagementConsoleViewModel { public PackageManagementConsole FakeConsole = new PackageManagementConsole(new FakeScriptingConsole(), new FakeControlDispatcher()); public RegisteredPackageSources RegisteredPackageSources; public FakePackageManagementProjectService FakeProjectService; public TestablePackageManagementConsoleViewModel(IPackageManagementConsoleHost consoleHost) : this(new RegisteredPackageSources(new PackageSource[0]), consoleHost) { } public TestablePackageManagementConsoleViewModel( IEnumerable<PackageSource> packageSources, IPackageManagementConsoleHost consoleHost) : this(new RegisteredPackageSources(packageSources), consoleHost, new FakePackageManagementProjectService()) { } public TestablePackageManagementConsoleViewModel( IPackageManagementConsoleHost consoleHost, FakePackageManagementProjectService projectService) : this(new RegisteredPackageSources(new PackageSource[0]), consoleHost, projectService) { } public TestablePackageManagementConsoleViewModel( RegisteredPackageSources registeredPackageSources, IPackageManagementConsoleHost consoleHost, FakePackageManagementProjectService projectService) : base(registeredPackageSources, projectService, consoleHost) { this.RegisteredPackageSources = registeredPackageSources; this.FakeProjectService = projectService; } protected override PackageManagementConsole CreateConsole() { return FakeConsole; } } }
35.37931
111
0.825536
[ "MIT" ]
Plankankul/SharpDevelop-w-Framework
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestablePackageManagementConsoleViewModel.cs
2,054
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Base : MonoBehaviour { public int baseNumber=0; void Start() { if (baseNumber == 4) baseNumber = 0; } // Update is called once per frame void Update() { } void OnTriggerEnter(Collider coll) { if (coll.CompareTag("Runner")) { GameManager.instance.onBase[baseNumber] = coll.gameObject; coll.gameObject.GetComponent<Runner>().isRun = false; coll.gameObject.transform.LookAt(Camera.main.transform.position); Animator a = coll.gameObject.GetComponent<Animator>(); a.SetBool("isIdle1", false); a.SetBool("isIdle2", false); a.SetBool("isIdle3", false); a.SetBool("isIdle" + baseNumber, true); a.SetBool("isRun", false); if (baseNumber == 0) { GameManager.instance.GameOver(); } } } }
24.023256
77
0.553727
[ "MIT" ]
SeoWon430/AR-Project-Vuforia-
Pika Baseball/UnityProject/AR_PickBaseBall/Assets/Script/Entity/Base.cs
1,035
C#
using commercetools.Sdk.Client; using commercetools.Sdk.Domain.Common; namespace commercetools.Sdk.HttpApi.CommandBuilders { /// <summary> /// entryPoint for commands/functions that we can do in this entityType /// </summary> /// <typeparam name="T">type of entity</typeparam> public class DomainCommandBuilder<T> where T : Resource<T> { public DomainCommandBuilder(IClient client) { this.Client = client; } public IClient Client { get; } } }
26.2
75
0.64313
[ "Apache-2.0" ]
commercetools/commercetools-dotnet-core-sdk
commercetools.Sdk/commercetools.Sdk.HttpApi/CommandBuilders/DomainCommandBuilder.cs
524
C#
using System.ComponentModel; using System.Runtime.CompilerServices; namespace FCSVisualChart { public abstract class NotifyPropertyChanged : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }
30
92
0.74
[ "MIT" ]
Lvwl-CN/FCSVisualChart
src/FCSVisualChart/NotifyPropertyChanged.cs
452
C#
using System.Collections.Generic; namespace Giles.Core.Utility { public static class CollectionExtensions { public static bool IsNullOrEmpty<T>(this IList<T> list) { return list == null || list.Count == 0; } } }
21.75
63
0.609195
[ "MIT" ]
codereflection/Giles
src/Giles.Core/Utility/CollectionExtensions.cs
263
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace CertiPath.BlockchainGateway.DataLayer { using System; using System.Collections.Generic; public partial class Role_UserGroup { public System.Guid GUID { get; set; } public System.Guid RoleGUID { get; set; } public System.Guid UserGroupGUID { get; set; } public bool Deleted { get; set; } public Nullable<System.Guid> BusinessNetworkGUID { get; set; } public virtual BusinessNetwork BusinessNetwork { get; set; } public virtual Role Role { get; set; } public virtual UserGroup UserGroup { get; set; } } }
37.785714
86
0.547259
[ "Apache-2.0" ]
CertiPath/DLTGateway
src/DLTGatewaySolution/Database/CertiPath.BlockchainGateway.DataLayer/Role_UserGroup.cs
1,058
C#
using Quartz; using Quartz.Impl; using Quartz.Spi; namespace FeedAggregaror_API.TasksSheduler { public class Quartz { private IScheduler _scheduler; /// <summary> /// Used scheduler /// </summary> public static IScheduler Scheduler { get { return Instance._scheduler; } } // Singleton private static Quartz _instance = null; /// <summary> /// Singleton /// </summary> public static Quartz Instance { get { if (_instance == null) { _instance = new Quartz(); } return _instance; } } private Quartz() { // Initialize Init(); } private async void Init() { // Scheduler set with standard scheduler factory _scheduler = await new StdSchedulerFactory().GetScheduler(); } /// <summary> /// Defines the JobFactory from which the jobs are generated /// </summary> /// <param name="jobFactory"></param> /// <returns></returns> public IScheduler UseJobFactory(IJobFactory jobFactory) { Scheduler.JobFactory = jobFactory; return Scheduler; } /// <summary> /// Adds a new job to the scheduler /// </summary> /// <typeparam name="T">Job is generated</typeparam> /// <param name="name">Name of the job</param> /// <param name="group">Group of jobs</param> /// <param name="interval">Interval between execution in seconds</param> public async void AddJob<T>(string name, string group, int interval) where T : IJob { // Create a job IJobDetail job = JobBuilder.Create<T>() .WithIdentity(name, group) .Build(); // Create triggers ITrigger jobTrigger = TriggerBuilder.Create() .WithIdentity(name + "Trigger", group) .StartNow() // Start now .WithSimpleSchedule(t => t.WithIntervalInMinutes(interval).RepeatForever()) // With repetition every interval minutes .Build(); // Attach job await Scheduler.ScheduleJob(job, jobTrigger); } /// <summary> /// Adds a new hourly job to the scheduler /// </summary> /// <typeparam name="T">Job is generated</typeparam> /// <param name="name">Name of the job</param> /// <param name="group">Group of jobs</param> public async void AddHourlyJob<T>(string name, string group) where T : IJob { // Create a job IJobDetail job = JobBuilder.Create<T>() .WithIdentity(name, group) .Build(); // Create triggers ITrigger jobTrigger = TriggerBuilder.Create() .WithIdentity(name + "Trigger", group) .StartNow() // Start now .WithSchedule(CronScheduleBuilder.CronSchedule("0 0 0/1 * * ?")) // With repetition every hour .Build(); // Attach job await Scheduler.ScheduleJob(job, jobTrigger); } /// <summary> /// Starts the scheduler /// </summary> public static async void Start() { await Scheduler.Start(); } } }
30.111111
133
0.512915
[ "MIT" ]
oleksiitymchenko/FeedAggregaror
RSS_FeedAggregaror/RSS_FeedAggregaror/TasksSheduler/Quartz.cs
3,525
C#