text
stringlengths
13
6.01M
/* * Created by SharpDevelop. * User: nk1449 * Date: 2017/05/29 * Time: 11:56 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; using System.Windows.Forms; using System.IO; using Tesseract; using System.Drawing; using System.Threading.Tasks; namespace UyghurEditPP { /// <summary> /// Description of MainForm. /// </summary> public partial class OCRForm : Form { TesseractEngine gOcr = null; TextEditor gEditor; string gImgFile = null; ToolTip gTip; bool gRunning = false; public OCRForm(TextEditor curedit, string imgFile = null) { // // The InitializeComponent() call is required for Windows Forms designer support. // gEditor = curedit; gImgFile = imgFile; InitializeComponent(); System.Reflection.Assembly asm =System.Reflection.Assembly.GetExecutingAssembly(); gTip = new ToolTip(); } string Til{ get; set; } void OCRFormPaint(object sender, PaintEventArgs e) { if(Til.Length==0 || ramka.Image == null){ butTonu.Enabled = false; } else{ butAch.Enabled = !gRunning; butTonu.Enabled = !gRunning; chkUyghur.Enabled = !gRunning; chkEng.Enabled = !gRunning; chkRus.Enabled = !gRunning; chkChi.Enabled = !gRunning; radAuto.Enabled = !gRunning; radSingle.Enabled = !gRunning; } } async void ButtonRight(object sender, EventArgs e) { try{ gRunning = true; if(radAuto.Checked){ gOcr.DefaultPageSegMode = PageSegMode.Auto; } else{ gOcr.DefaultPageSegMode = PageSegMode.SingleBlock; } Invalidate(); Bitmap roibmp; Pix roipix; Rectangle roi = ramka.getRoi(); Cursor=Cursors.WaitCursor; ramka.Enabled = false; roibmp = ramka.Image.Clone(roi,ramka.Image.PixelFormat); roipix = PixConverter.ToPix(roibmp); roibmp.Dispose(); roipix = roipix.Deskew(); Task<string> ocr = Task.Run<string>(() =>{return DoOCR(roipix);}); string txt = await ocr; roipix.Dispose(); ramka.Enabled = true; gEditor.AppendText(txt); Cursor=Cursors.Default; } catch(Exception ee){ System.Diagnostics.Debug.WriteLine(ee.Message); MessageBox.Show(ee.Message, "UyghurEdit++", MessageBoxButtons.OK, MessageBoxIcon.Error); } gRunning = false; Invalidate(); } string DoOCR(Pix pix){ gOcr.DefaultPageSegMode = PageSegMode.SingleBlock; Page pg = gOcr.Process(pix); String buf = pg.GetText(); pix.Dispose(); pg.Dispose(); return buf.Replace("ی","ي").Replace("ه","ە").Replace("\n",Environment.NewLine); } void MainFormLoad(object sender, EventArgs e) { } void OCRFormShown(object sender, EventArgs e) { butAch.Text = MainForm.gLang.GetText("Ach"); gTip.SetToolTip(butAch,MainForm.gLang.GetText("Bu yerni chékip resimni éching yaki resimni tutup bu köznekke tashlang.")); gTip.SetToolTip(ramka,MainForm.gLang.GetText("Resim körün’gende, Chashqinek bilen tonutidighan da’irini tallang.")); butTonu.Text = MainForm.gLang.GetText("Tonu"); label1.Text = MainForm.gLang.GetText("Tonuydighan Tillar")+":"; label2.Text = MainForm.gLang.GetText("Bet Qurulmisi")+":"; chkUyghur.Text = MainForm.gLang.GetText("Uyghurche"); chkEng.Text = MainForm.gLang.GetText("In’glizche"); chkTur.Text = MainForm.gLang.GetText("Türkche"); chkChi.Text = MainForm.gLang.GetText("Xenzuche"); chkRus.Text = MainForm.gLang.GetText("Slawyanche"); radAuto.Text = MainForm.gLang.GetText("Özüng Tap"); radSingle.Text = MainForm.gLang.GetText("Birla Bölek"); chkUyghur.Checked = true; radAuto.Checked = true; if(gImgFile!=null){ Bitmap bimg = new Bitmap(gImgFile); ramka.Image=bimg; } int startx = this.Owner.Location.X + (this.Owner.Width-this.Width)/2; int starty = this.Owner.Location.Y + (this.Owner.Height-this.Height)/2; this.Location = new Point(startx,starty); } void MainFormDragEnter(object sender, DragEventArgs e) { String[] file=(String[])e.Data.GetData(DataFormats.FileDrop); String extName = Path.GetExtension(file[0]); if(MainForm.gImgexts.IndexOf(extName,StringComparison.OrdinalIgnoreCase)!=-1) { e.Effect= DragDropEffects.All; } } void MainFormDragDrop(object sender, DragEventArgs e) { String[] file=(String[])e.Data.GetData(DataFormats.FileDrop); gImgFile=file[0]; Bitmap bimg = new Bitmap(gImgFile); ramka.Image=bimg; Invalidate(); } void ButAchClick(object sender, EventArgs e) { OpenFileDialog opnFileDlg = new OpenFileDialog(); String filter = "Image files|" + MainForm.gImgexts; opnFileDlg.Filter = filter; opnFileDlg.Multiselect = false; if(opnFileDlg.ShowDialog(this)== DialogResult.OK){ Bitmap bimg = new Bitmap(opnFileDlg.FileName); ramka.Image=bimg; } Invalidate(); } void CheckedChanged(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; char[] tr = {'+'}; string lang = ""; if(chkUyghur.Checked){ lang += "ukij+uig"; } if(chkEng.Checked){ lang += "+eng"; } if(chkTur.Checked){ lang += "+tur"; } if(chkChi.Checked){ lang += "+chi_sim"; } if(chkRus.Checked){ lang += "+rus"; } lang = lang.Trim(tr); System.Diagnostics.Debug.WriteLine(lang); if(gOcr!=null){ gOcr.Dispose(); gOcr = null; } Til = lang; if(lang.Length >=3){ gOcr= new TesseractEngine(@".\tessdata",lang,EngineMode.LstmOnly); Text = MainForm.gLang.GetText("Uyghurche OCR(Resimdiki Yéziqni Tonush) Programmisi")+ "Tessract[v " + gOcr.Version + "]" + " neshrini ishletken"; } this.Cursor = Cursors.Default; Invalidate(); } void OCRFormFormClosing(object sender, FormClosingEventArgs e) { if(gRunning){ e.Cancel = true; } else{ if(gOcr!=null){ gOcr.Dispose(); } } } } }
using EmberCore.KernelServices.PluginResolver; using EmberCore.KernelServices.UI.View; using EmberCore.Services; using EmberCore.Utils; using EmberKernel; using EmberKernel.Services.UI.Extension; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Serilog; using Serilog.Sinks.SystemConsole.Themes; using System.IO; using System.Windows; namespace EmberCore { class Program { private static string GetLoggerFilePath(IConfigurationSection config) { var loggerFolder = config["LogFolder"] ?? "logs"; var loggerPath = Path.Combine(Directory.GetCurrentDirectory(), loggerFolder); if (!Directory.Exists(loggerPath)) Directory.CreateDirectory(loggerPath); var loggerFileName = config["LogFilePattern"] ?? "logs_.txt"; return Path.Combine(loggerPath, loggerFileName); } private static string GetLoggerConsoleLogFormat(IConfigurationSection config) { return config["ConsoleLogFormat"] ?? "[{Timestamp:HH:mm:ss} {Level:u3}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"; } private static string GetFileLogFormat(IConfigurationSection config) { return config["FileLogFormat"] ?? "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"; } public static void Main() { new KernelBuilder() .UseConfiguration((config) => { config .SetBasePath(Directory.GetCurrentDirectory()) .AddEnvironmentVariables() .AddJsonFile("CoreAppSetting.json", optional: false, reloadOnChange: true); }) .UsePluginOptions(Path.Combine(Directory.GetCurrentDirectory(), "CoreAppSetting.json")) .UseConfigurationModel<CoreAppSetting>() .UseLogger((context, logger) => { var config = context.Configuration.GetSection("Logging"); var loggerFile = GetLoggerFilePath(config); logger .AddConfiguration(config) .AddSerilog((builder) => builder .Enrich.FromLogContext() .WriteTo.Console( theme: SystemConsoleTheme.Colored, outputTemplate: GetLoggerConsoleLogFormat(config)) .WriteTo.File( path: loggerFile, rollingInterval: RollingInterval.Day, outputTemplate: GetFileLogFormat(config))) .AddDebug(); }) .UseEventBus() .UseCommandService() .UseKernelService<CorePluginResolver>() .UsePlugins<PluginsManager>() .UseWindowManager<EmberWpfUIService, Window>() .UseMvvmInterface((mvvm) => mvvm .UseConfigurationModel()) .UseEFSqlite() .UseStatistic(statistic => statistic .ConfigureEventSourceManager() .ConfigureDefaultDataSource() .ConfigureDefaultFormatter() .ConfigureDefaultHub()) .Build() .Run(); } } }
namespace CouponMerchant.Utility { public static class SD { public const string AdminEndUser = "Admin"; public const string CustomerEndUser = "Customer"; public const int PaginationUsersPageSize = 5; } }
@charset "UTF-8"; /*! * Bootstrap v4.1.3 (https://getbootstrap.com/) * Copyright 2011-2018 The Bootstrap Authors * Copyright 2011-2018 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ :root { --blue: #007bff; --indigo: #6610f2; --purple: #6f42c1; --pink: #e83e8c; --red: #dc3545; --orange: #fd7e14; --yellow: #ffc107; --green: #28a745; --teal: #20c997; --cyan: #17a2b8; --white: #fff; --gray: #6c757d; --gray-dark: #343a40; --primary: #0074d9; --secondary: #6c757d; --success: #28a745; --info: #17a2b8; --warning: #ffc107; --danger: #d8241b; --light: #f8f9fa; --dark: #343a40; --breakpoint-xs: 0; --breakpoint-sm: 576px; --breakpoint-md: 768px; --breakpoint-lg: 992px; --breakpoint-xl: 1200px; --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; } *, *::before, *::after { box-sizing: border-box; } html { font-family: sans-serif; line-height: 1.15; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; -ms-overflow-style: scrollbar; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } @-ms-viewport { width: device-width; } article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { display: block; } body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; text-align: left; background-color: #fff; } [tabindex="-1"]:focus { outline: 0 !important; } hr { box-sizing: content-box; height: 0; overflow: visible; } h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.5rem; } p { margin-top: 0; margin-bottom: 1rem; } abbr[title], abbr[data-original-title] { text-decoration: underline; text-decoration: underline dotted; cursor: help; border-bottom: 0; } address { margin-bottom: 1rem; font-style: normal; line-height: inherit; } ol, ul, dl { margin-top: 0; margin-bottom: 1rem; } ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; } dt { font-weight: 700; } dd { margin-bottom: 0.5rem; margin-left: 0; } blockquote { margin: 0 0 1rem; } dfn { font-style: italic; } b, strong { font-weight: bolder; } small { font-size: 80%; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } a { color: #0074d9; text-decoration: none; background-color: transparent; -webkit-text-decoration-skip: objects; } a:hover { color: #004b8d; text-decoration: underline; } a:not([href]):not([tabindex]) { color: inherit; text-decoration: none; } a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { color: inherit; text-decoration: none; } a:not([href]):not([tabindex]):focus { outline: 0; } pre, code, kbd, samp { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 1em; } pre { margin-top: 0; margin-bottom: 1rem; overflow: auto; -ms-overflow-style: scrollbar; } figure { margin: 0 0 1rem; } img { vertical-align: middle; border-style: none; } svg { overflow: hidden; vertical-align: middle; } table { border-collapse: collapse; } caption { padding-top: 0.75rem; padding-bottom: 0.75rem; color: #6c757d; text-align: left; caption-side: bottom; } th { text-align: inherit; } label { display: inline-block; margin-bottom: 0.5rem; } button { border-radius: 0; } button:focus { outline: 1px dotted; outline: 5px auto -webkit-focus-ring-color; } input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; } button, input { overflow: visible; } button, select { text-transform: none; } button, html [type=button], [type=reset], [type=submit] { -webkit-appearance: button; } button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner { padding: 0; border-style: none; } input[type=radio], input[type=checkbox] { box-sizing: border-box; padding: 0; } input[type=date], input[type=time], input[type=datetime-local], input[type=month] { -webkit-appearance: listbox; } textarea { overflow: auto; resize: vertical; } fieldset { min-width: 0; padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; max-width: 100%; padding: 0; margin-bottom: 0.5rem; font-size: 1.5rem; line-height: inherit; color: inherit; white-space: normal; } progress { vertical-align: baseline; } [type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button { height: auto; } [type=search] { outline-offset: -2px; -webkit-appearance: none; } [type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration { -webkit-appearance: none; } ::-webkit-file-upload-button { font: inherit; -webkit-appearance: button; } output { display: inline-block; } summary { display: list-item; cursor: pointer; } template { display: none; } [hidden] { display: none !important; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { margin-bottom: 0.5rem; font-family: inherit; font-weight: 500; line-height: 1.2; color: inherit; } h1, .h1 { font-size: 2.5rem; } h2, .h2 { font-size: 2rem; } h3, .h3 { font-size: 1.75rem; } h4, .h4 { font-size: 1.5rem; } h5, .h5 { font-size: 1.25rem; } h6, .h6 { font-size: 1rem; } .lead { font-size: 1.25rem; font-weight: 300; } .display-1 { font-size: 6rem; font-weight: 300; line-height: 1.2; } .display-2 { font-size: 5.5rem; font-weight: 300; line-height: 1.2; } .display-3 { font-size: 4.5rem; font-weight: 300; line-height: 1.2; } .display-4 { font-size: 3.5rem; font-weight: 300; line-height: 1.2; } hr { margin-top: 1rem; margin-bottom: 1rem; border: 0; border-top: 1px solid rgba(0, 0, 0, 0.1); } small, .small { font-size: 80%; font-weight: 400; } mark, .mark { padding: 0.2em; background-color: #fcf8e3; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; } .list-inline-item { display: inline-block; } .list-inline-item:not(:last-child) { margin-right: 0.5rem; } .initialism { font-size: 90%; text-transform: uppercase; } .blockquote { margin-bottom: 1rem; font-size: 1.25rem; } .blockquote-footer { display: block; font-size: 80%; color: #6c757d; } .blockquote-footer::before { content: "— "; } .img-fluid { max-width: 100%; height: auto; } .img-thumbnail { padding: 0.25rem; background-color: #fff; border: 1px solid #dee2e6; border-radius: 0.25rem; max-width: 100%; height: auto; } .figure { display: inline-block; } .figure-img { margin-bottom: 0.5rem; line-height: 1; } .figure-caption { font-size: 90%; color: #6c757d; } code { font-size: 87.5%; color: #e83e8c; word-break: break-word; } a > code { color: inherit; } kbd { padding: 0.2rem 0.4rem; font-size: 87.5%; color: #fff; background-color: #212529; border-radius: 0.2rem; } kbd kbd { padding: 0; font-size: 100%; font-weight: 700; } pre { display: block; font-size: 87.5%; color: #212529; } pre code { font-size: inherit; color: inherit; word-break: normal; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } @media (min-width: 576px) { .container { max-width: 540px; } } @media (min-width: 768px) { .container { max-width: 720px; } } @media (min-width: 992px) { .container { max-width: 960px; } } @media (min-width: 1200px) { .container { max-width: 1140px; } } .container-fluid { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } .row { display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; } .no-gutters { margin-right: 0; margin-left: 0; } .no-gutters > .col, .no-gutters > [class*=col-] { padding-right: 0; padding-left: 0; } .col-xl, .col-xl-auto, .col-xl-12, .col-xl-11, .col-xl-10, .col-xl-9, .col-xl-8, .col-xl-7, .col-xl-6, .col-xl-5, .col-xl-4, .col-xl-3, .col-xl-2, .col-xl-1, .col-lg, .col-lg-auto, .col-lg-12, .col-lg-11, .col-lg-10, .col-lg-9, .col-lg-8, .col-lg-7, .col-lg-6, .col-lg-5, .col-lg-4, .col-lg-3, .col-lg-2, .col-lg-1, .col-md, .col-md-auto, .col-md-12, .col-md-11, .col-md-10, .col-md-9, .col-md-8, .col-md-7, .col-md-6, .col-md-5, .col-md-4, .col-md-3, .col-md-2, .col-md-1, .col-sm, .col-sm-auto, .col-sm-12, .col-sm-11, .col-sm-10, .col-sm-9, .col-sm-8, .col-sm-7, .col-sm-6, .col-sm-5, .col-sm-4, .col-sm-3, .col-sm-2, .col-sm-1, .col, .col-auto, .col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2, .col-1 { position: relative; width: 100%; min-height: 1px; padding-right: 15px; padding-left: 15px; } .col { flex-basis: 0; flex-grow: 1; max-width: 100%; } .col-auto { flex: 0 0 auto; width: auto; max-width: none; } .col-1 { flex: 0 0 8.3333333333%; max-width: 8.3333333333%; } .col-2 { flex: 0 0 16.6666666667%; max-width: 16.6666666667%; } .col-3 { flex: 0 0 25%; max-width: 25%; } .col-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; } .col-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; } .col-6 { flex: 0 0 50%; max-width: 50%; } .col-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; } .col-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; } .col-9 { flex: 0 0 75%; max-width: 75%; } .col-10 { flex: 0 0 83.3333333333%; max-width: 83.3333333333%; } .col-11 { flex: 0 0 91.6666666667%; max-width: 91.6666666667%; } .col-12 { flex: 0 0 100%; max-width: 100%; } .order-first { order: -1; } .order-last { order: 13; } .order-0 { order: 0; } .order-1 { order: 1; } .order-2 { order: 2; } .order-3 { order: 3; } .order-4 { order: 4; } .order-5 { order: 5; } .order-6 { order: 6; } .order-7 { order: 7; } .order-8 { order: 8; } .order-9 { order: 9; } .order-10 { order: 10; } .order-11 { order: 11; } .order-12 { order: 12; } .offset-1 { margin-left: 8.3333333333%; } .offset-2 { margin-left: 16.6666666667%; } .offset-3 { margin-left: 25%; } .offset-4 { margin-left: 33.3333333333%; } .offset-5 { margin-left: 41.6666666667%; } .offset-6 { margin-left: 50%; } .offset-7 { margin-left: 58.3333333333%; } .offset-8 { margin-left: 66.6666666667%; } .offset-9 { margin-left: 75%; } .offset-10 { margin-left: 83.3333333333%; } .offset-11 { margin-left: 91.6666666667%; } @media (min-width: 576px) { .col-sm { flex-basis: 0; flex-grow: 1; max-width: 100%; } .col-sm-auto { flex: 0 0 auto; width: auto; max-width: none; } .col-sm-1 { flex: 0 0 8.3333333333%; max-width: 8.3333333333%; } .col-sm-2 { flex: 0 0 16.6666666667%; max-width: 16.6666666667%; } .col-sm-3 { flex: 0 0 25%; max-width: 25%; } .col-sm-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; } .col-sm-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; } .col-sm-6 { flex: 0 0 50%; max-width: 50%; } .col-sm-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; } .col-sm-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; } .col-sm-9 { flex: 0 0 75%; max-width: 75%; } .col-sm-10 { flex: 0 0 83.3333333333%; max-width: 83.3333333333%; } .col-sm-11 { flex: 0 0 91.6666666667%; max-width: 91.6666666667%; } .col-sm-12 { flex: 0 0 100%; max-width: 100%; } .order-sm-first { order: -1; } .order-sm-last { order: 13; } .order-sm-0 { order: 0; } .order-sm-1 { order: 1; } .order-sm-2 { order: 2; } .order-sm-3 { order: 3; } .order-sm-4 { order: 4; } .order-sm-5 { order: 5; } .order-sm-6 { order: 6; } .order-sm-7 { order: 7; } .order-sm-8 { order: 8; } .order-sm-9 { order: 9; } .order-sm-10 { order: 10; } .order-sm-11 { order: 11; } .order-sm-12 { order: 12; } .offset-sm-0 { margin-left: 0; } .offset-sm-1 { margin-left: 8.3333333333%; } .offset-sm-2 { margin-left: 16.6666666667%; } .offset-sm-3 { margin-left: 25%; } .offset-sm-4 { margin-left: 33.3333333333%; } .offset-sm-5 { margin-left: 41.6666666667%; } .offset-sm-6 { margin-left: 50%; } .offset-sm-7 { margin-left: 58.3333333333%; } .offset-sm-8 { margin-left: 66.6666666667%; } .offset-sm-9 { margin-left: 75%; } .offset-sm-10 { margin-left: 83.3333333333%; } .offset-sm-11 { margin-left: 91.6666666667%; } } @media (min-width: 768px) { .col-md { flex-basis: 0; flex-grow: 1; max-width: 100%; } .col-md-auto { flex: 0 0 auto; width: auto; max-width: none; } .col-md-1 { flex: 0 0 8.3333333333%; max-width: 8.3333333333%; } .col-md-2 { flex: 0 0 16.6666666667%; max-width: 16.6666666667%; } .col-md-3 { flex: 0 0 25%; max-width: 25%; } .col-md-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; } .col-md-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; } .col-md-6 { flex: 0 0 50%; max-width: 50%; } .col-md-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; } .col-md-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; } .col-md-9 { flex: 0 0 75%; max-width: 75%; } .col-md-10 { flex: 0 0 83.3333333333%; max-width: 83.3333333333%; } .col-md-11 { flex: 0 0 91.6666666667%; max-width: 91.6666666667%; } .col-md-12 { flex: 0 0 100%; max-width: 100%; } .order-md-first { order: -1; } .order-md-last { order: 13; } .order-md-0 { order: 0; } .order-md-1 { order: 1; } .order-md-2 { order: 2; } .order-md-3 { order: 3; } .order-md-4 { order: 4; } .order-md-5 { order: 5; } .order-md-6 { order: 6; } .order-md-7 { order: 7; } .order-md-8 { order: 8; } .order-md-9 { order: 9; } .order-md-10 { order: 10; } .order-md-11 { order: 11; } .order-md-12 { order: 12; } .offset-md-0 { margin-left: 0; } .offset-md-1 { margin-left: 8.3333333333%; } .offset-md-2 { margin-left: 16.6666666667%; } .offset-md-3 { margin-left: 25%; } .offset-md-4 { margin-left: 33.3333333333%; } .offset-md-5 { margin-left: 41.6666666667%; } .offset-md-6 { margin-left: 50%; } .offset-md-7 { margin-left: 58.3333333333%; } .offset-md-8 { margin-left: 66.6666666667%; } .offset-md-9 { margin-left: 75%; } .offset-md-10 { margin-left: 83.3333333333%; } .offset-md-11 { margin-left: 91.6666666667%; } } @media (min-width: 992px) { .col-lg { flex-basis: 0; flex-grow: 1; max-width: 100%; } .col-lg-auto { flex: 0 0 auto; width: auto; max-width: none; } .col-lg-1 { flex: 0 0 8.3333333333%; max-width: 8.3333333333%; } .col-lg-2 { flex: 0 0 16.6666666667%; max-width: 16.6666666667%; } .col-lg-3 { flex: 0 0 25%; max-width: 25%; } .col-lg-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; } .col-lg-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; } .col-lg-6 { flex: 0 0 50%; max-width: 50%; } .col-lg-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; } .col-lg-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; } .col-lg-9 { flex: 0 0 75%; max-width: 75%; } .col-lg-10 { flex: 0 0 83.3333333333%; max-width: 83.3333333333%; } .col-lg-11 { flex: 0 0 91.6666666667%; max-width: 91.6666666667%; } .col-lg-12 { flex: 0 0 100%; max-width: 100%; } .order-lg-first { order: -1; } .order-lg-last { order: 13; } .order-lg-0 { order: 0; } .order-lg-1 { order: 1; } .order-lg-2 { order: 2; } .order-lg-3 { order: 3; } .order-lg-4 { order: 4; } .order-lg-5 { order: 5; } .order-lg-6 { order: 6; } .order-lg-7 { order: 7; } .order-lg-8 { order: 8; } .order-lg-9 { order: 9; } .order-lg-10 { order: 10; } .order-lg-11 { order: 11; } .order-lg-12 { order: 12; } .offset-lg-0 { margin-left: 0; } .offset-lg-1 { margin-left: 8.3333333333%; } .offset-lg-2 { margin-left: 16.6666666667%; } .offset-lg-3 { margin-left: 25%; } .offset-lg-4 { margin-left: 33.3333333333%; } .offset-lg-5 { margin-left: 41.6666666667%; } .offset-lg-6 { margin-left: 50%; } .offset-lg-7 { margin-left: 58.3333333333%; } .offset-lg-8 { margin-left: 66.6666666667%; } .offset-lg-9 { margin-left: 75%; } .offset-lg-10 { margin-left: 83.3333333333%; } .offset-lg-11 { margin-left: 91.6666666667%; } } @media (min-width: 1200px) { .col-xl { flex-basis: 0; flex-grow: 1; max-width: 100%; } .col-xl-auto { flex: 0 0 auto; width: auto; max-width: none; } .col-xl-1 { flex: 0 0 8.3333333333%; max-width: 8.3333333333%; } .col-xl-2 { flex: 0 0 16.6666666667%; max-width: 16.6666666667%; } .col-xl-3 { flex: 0 0 25%; max-width: 25%; } .col-xl-4 { flex: 0 0 33.3333333333%; max-width: 33.3333333333%; } .col-xl-5 { flex: 0 0 41.6666666667%; max-width: 41.6666666667%; } .col-xl-6 { flex: 0 0 50%; max-width: 50%; } .col-xl-7 { flex: 0 0 58.3333333333%; max-width: 58.3333333333%; } .col-xl-8 { flex: 0 0 66.6666666667%; max-width: 66.6666666667%; } .col-xl-9 { flex: 0 0 75%; max-width: 75%; } .col-xl-10 { flex: 0 0 83.3333333333%; max-width: 83.3333333333%; } .col-xl-11 { flex: 0 0 91.6666666667%; max-width: 91.6666666667%; } .col-xl-12 { flex: 0 0 100%; max-width: 100%; } .order-xl-first { order: -1; } .order-xl-last { order: 13; } .order-xl-0 { order: 0; } .order-xl-1 { order: 1; } .order-xl-2 { order: 2; } .order-xl-3 { order: 3; } .order-xl-4 { order: 4; } .order-xl-5 { order: 5; } .order-xl-6 { order: 6; } .order-xl-7 { order: 7; } .order-xl-8 { order: 8; } .order-xl-9 { order: 9; } .order-xl-10 { order: 10; } .order-xl-11 { order: 11; } .order-xl-12 { order: 12; } .offset-xl-0 { margin-left: 0; } .offset-xl-1 { margin-left: 8.3333333333%; } .offset-xl-2 { margin-left: 16.6666666667%; } .offset-xl-3 { margin-left: 25%; } .offset-xl-4 { margin-left: 33.3333333333%; } .offset-xl-5 { margin-left: 41.6666666667%; } .offset-xl-6 { margin-left: 50%; } .offset-xl-7 { margin-left: 58.3333333333%; } .offset-xl-8 { margin-left: 66.6666666667%; } .offset-xl-9 { margin-left: 75%; } .offset-xl-10 { margin-left: 83.3333333333%; } .offset-xl-11 { margin-left: 91.6666666667%; } } .table { width: 100%; margin-bottom: 1rem; background-color: transparent; } .table th, .table td { padding: 0.75rem; vertical-align: top; border-top: 1px solid #dee2e6; } .table thead th { vertical-align: bottom; border-bottom: 2px solid #dee2e6; } .table tbody + tbody { border-top: 2px solid #dee2e6; } .table .table { background-color: #fff; } .table-sm th, .table-sm td { padding: 0.3rem; } .table-bordered { border: 1px solid #dee2e6; } .table-bordered th, .table-bordered td { border: 1px solid #dee2e6; } .table-bordered thead th, .table-bordered thead td { border-bottom-width: 2px; } .table-borderless th, .table-borderless td, .table-borderless thead th, .table-borderless tbody + tbody { border: 0; } .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.05); } .table-hover tbody tr:hover { background-color: rgba(0, 0, 0, 0.075); } .table-primary, .table-primary > th, .table-primary > td { background-color: #b8d8f4; } .table-hover .table-primary:hover { background-color: #a2ccf1; } .table-hover .table-primary:hover > td, .table-hover .table-primary:hover > th { background-color: #a2ccf1; } .table-secondary, .table-secondary > th, .table-secondary > td { background-color: #d6d8db; } .table-hover .table-secondary:hover { background-color: #c8cbcf; } .table-hover .table-secondary:hover > td, .table-hover .table-secondary:hover > th { background-color: #c8cbcf; } .table-success, .table-success > th, .table-success > td { background-color: #c3e6cb; } .table-hover .table-success:hover { background-color: #b1dfbb; } .table-hover .table-success:hover > td, .table-hover .table-success:hover > th { background-color: #b1dfbb; } .table-info, .table-info > th, .table-info > td { background-color: #bee5eb; } .table-hover .table-info:hover { background-color: #abdde5; } .table-hover .table-info:hover > td, .table-hover .table-info:hover > th { background-color: #abdde5; } .table-warning, .table-warning > th, .table-warning > td { background-color: #ffeeba; } .table-hover .table-warning:hover { background-color: #ffe8a1; } .table-hover .table-warning:hover > td, .table-hover .table-warning:hover > th { background-color: #ffe8a1; } .table-danger, .table-danger > th, .table-danger > td { background-color: #f4c2bf; } .table-hover .table-danger:hover { background-color: #f0ada9; } .table-hover .table-danger:hover > td, .table-hover .table-danger:hover > th { background-color: #f0ada9; } .table-light, .table-light > th, .table-light > td { background-color: #fdfdfe; } .table-hover .table-light:hover { background-color: #ececf6; } .table-hover .table-light:hover > td, .table-hover .table-light:hover > th { background-color: #ececf6; } .table-dark, .table-dark > th, .table-dark > td { background-color: #c6c8ca; } .table-hover .table-dark:hover { background-color: #b9bbbe; } .table-hover .table-dark:hover > td, .table-hover .table-dark:hover > th { background-color: #b9bbbe; } .table-active, .table-active > th, .table-active > td { background-color: rgba(0, 0, 0, 0.075); } .table-hover .table-active:hover { background-color: rgba(0, 0, 0, 0.075); } .table-hover .table-active:hover > td, .table-hover .table-active:hover > th { background-color: rgba(0, 0, 0, 0.075); } .table .thead-dark th { color: #fff; background-color: #212529; border-color: #32383e; } .table .thead-light th { color: #495057; background-color: #e9ecef; border-color: #dee2e6; } .table-dark { color: #fff; background-color: #212529; } .table-dark th, .table-dark td, .table-dark thead th { border-color: #32383e; } .table-dark.table-bordered { border: 0; } .table-dark.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(255, 255, 255, 0.05); } .table-dark.table-hover tbody tr:hover { background-color: rgba(255, 255, 255, 0.075); } @media (max-width: 575.98px) { .table-responsive-sm { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-sm > .table-bordered { border: 0; } } @media (max-width: 767.98px) { .table-responsive-md { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-md > .table-bordered { border: 0; } } @media (max-width: 991.98px) { .table-responsive-lg { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-lg > .table-bordered { border: 0; } } @media (max-width: 1199.98px) { .table-responsive-xl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive-xl > .table-bordered { border: 0; } } .table-responsive { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; } .table-responsive > .table-bordered { border: 0; } .form-control { display: block; width: 100%; height: calc(2.25rem + 2px); padding: 0.375rem 0.75rem; font-size: 1rem; line-height: 1.5; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; border-radius: 0.25rem; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } @media screen and (prefers-reduced-motion: reduce) { .form-control { transition: none; } } .form-control::-ms-expand { background-color: transparent; border: 0; } .form-control:focus { color: #495057; background-color: #fff; border-color: #5ab2ff; outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .form-control::placeholder { color: #6c757d; opacity: 1; } .form-control:disabled, .form-control[readonly] { background-color: #e9ecef; opacity: 1; } select.form-control:focus::-ms-value { color: #495057; background-color: #fff; } .form-control-file, .form-control-range { display: block; width: 100%; } .col-form-label { padding-top: calc(0.375rem + 1px); padding-bottom: calc(0.375rem + 1px); margin-bottom: 0; font-size: inherit; line-height: 1.5; } .col-form-label-lg { padding-top: calc(0.5rem + 1px); padding-bottom: calc(0.5rem + 1px); font-size: 1.25rem; line-height: 1.5; } .col-form-label-sm { padding-top: calc(0.25rem + 1px); padding-bottom: calc(0.25rem + 1px); font-size: 0.875rem; line-height: 1.5; } .form-control-plaintext { display: block; width: 100%; padding-top: 0.375rem; padding-bottom: 0.375rem; margin-bottom: 0; line-height: 1.5; color: #212529; background-color: transparent; border: solid transparent; border-width: 1px 0; } .form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg { padding-right: 0; padding-left: 0; } .form-control-sm { height: calc(1.8125rem + 2px); padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.5; border-radius: 0.2rem; } .form-control-lg { height: calc(2.875rem + 2px); padding: 0.5rem 1rem; font-size: 1.25rem; line-height: 1.5; border-radius: 0.3rem; } select.form-control[size], select.form-control[multiple] { height: auto; } textarea.form-control { height: auto; } .form-group { margin-bottom: 1rem; } .form-text { display: block; margin-top: 0.25rem; } .form-row { display: flex; flex-wrap: wrap; margin-right: -5px; margin-left: -5px; } .form-row > .col, .form-row > [class*=col-] { padding-right: 5px; padding-left: 5px; } .form-check { position: relative; display: block; padding-left: 1.25rem; } .form-check-input { position: absolute; margin-top: 0.3rem; margin-left: -1.25rem; } .form-check-input:disabled ~ .form-check-label { color: #6c757d; } .form-check-label { margin-bottom: 0; } .form-check-inline { display: inline-flex; align-items: center; padding-left: 0; margin-right: 0.75rem; } .form-check-inline .form-check-input { position: static; margin-top: 0; margin-right: 0.3125rem; margin-left: 0; } .valid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 80%; color: #28a745; } .valid-tooltip { position: absolute; top: 100%; z-index: 5; display: none; max-width: 100%; padding: 0.25rem 0.5rem; margin-top: 0.1rem; font-size: 0.875rem; line-height: 1.5; color: #fff; background-color: rgba(40, 167, 69, 0.9); border-radius: 0.25rem; } .was-validated .form-control:valid, .form-control.is-valid, .was-validated .custom-select:valid, .custom-select.is-valid { border-color: #28a745; } .was-validated .form-control:valid:focus, .form-control.is-valid:focus, .was-validated .custom-select:valid:focus, .custom-select.is-valid:focus { border-color: #28a745; box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); } .was-validated .form-control:valid ~ .valid-feedback, .was-validated .form-control:valid ~ .valid-tooltip, .form-control.is-valid ~ .valid-feedback, .form-control.is-valid ~ .valid-tooltip, .was-validated .custom-select:valid ~ .valid-feedback, .was-validated .custom-select:valid ~ .valid-tooltip, .custom-select.is-valid ~ .valid-feedback, .custom-select.is-valid ~ .valid-tooltip { display: block; } .was-validated .form-control-file:valid ~ .valid-feedback, .was-validated .form-control-file:valid ~ .valid-tooltip, .form-control-file.is-valid ~ .valid-feedback, .form-control-file.is-valid ~ .valid-tooltip { display: block; } .was-validated .form-check-input:valid ~ .form-check-label, .form-check-input.is-valid ~ .form-check-label { color: #28a745; } .was-validated .form-check-input:valid ~ .valid-feedback, .was-validated .form-check-input:valid ~ .valid-tooltip, .form-check-input.is-valid ~ .valid-feedback, .form-check-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-control-input:valid ~ .custom-control-label, .custom-control-input.is-valid ~ .custom-control-label { color: #28a745; } .was-validated .custom-control-input:valid ~ .custom-control-label::before, .custom-control-input.is-valid ~ .custom-control-label::before { background-color: #71dd8a; } .was-validated .custom-control-input:valid ~ .valid-feedback, .was-validated .custom-control-input:valid ~ .valid-tooltip, .custom-control-input.is-valid ~ .valid-feedback, .custom-control-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-control-input:valid:checked ~ .custom-control-label::before, .custom-control-input.is-valid:checked ~ .custom-control-label::before { background-color: #34ce57; } .was-validated .custom-control-input:valid:focus ~ .custom-control-label::before, .custom-control-input.is-valid:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(40, 167, 69, 0.25); } .was-validated .custom-file-input:valid ~ .custom-file-label, .custom-file-input.is-valid ~ .custom-file-label { border-color: #28a745; } .was-validated .custom-file-input:valid ~ .custom-file-label::after, .custom-file-input.is-valid ~ .custom-file-label::after { border-color: inherit; } .was-validated .custom-file-input:valid ~ .valid-feedback, .was-validated .custom-file-input:valid ~ .valid-tooltip, .custom-file-input.is-valid ~ .valid-feedback, .custom-file-input.is-valid ~ .valid-tooltip { display: block; } .was-validated .custom-file-input:valid:focus ~ .custom-file-label, .custom-file-input.is-valid:focus ~ .custom-file-label { box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); } .invalid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 80%; color: #d8241b; } .invalid-tooltip { position: absolute; top: 100%; z-index: 5; display: none; max-width: 100%; padding: 0.25rem 0.5rem; margin-top: 0.1rem; font-size: 0.875rem; line-height: 1.5; color: #fff; background-color: rgba(216, 36, 27, 0.9); border-radius: 0.25rem; } .was-validated .form-control:invalid, .form-control.is-invalid, .was-validated .custom-select:invalid, .custom-select.is-invalid { border-color: #d8241b; } .was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, .was-validated .custom-select:invalid:focus, .custom-select.is-invalid:focus { border-color: #d8241b; box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.25); } .was-validated .form-control:invalid ~ .invalid-feedback, .was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback, .form-control.is-invalid ~ .invalid-tooltip, .was-validated .custom-select:invalid ~ .invalid-feedback, .was-validated .custom-select:invalid ~ .invalid-tooltip, .custom-select.is-invalid ~ .invalid-feedback, .custom-select.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .form-control-file:invalid ~ .invalid-feedback, .was-validated .form-control-file:invalid ~ .invalid-tooltip, .form-control-file.is-invalid ~ .invalid-feedback, .form-control-file.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .form-check-input:invalid ~ .form-check-label, .form-check-input.is-invalid ~ .form-check-label { color: #d8241b; } .was-validated .form-check-input:invalid ~ .invalid-feedback, .was-validated .form-check-input:invalid ~ .invalid-tooltip, .form-check-input.is-invalid ~ .invalid-feedback, .form-check-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-control-input:invalid ~ .custom-control-label, .custom-control-input.is-invalid ~ .custom-control-label { color: #d8241b; } .was-validated .custom-control-input:invalid ~ .custom-control-label::before, .custom-control-input.is-invalid ~ .custom-control-label::before { background-color: #f08883; } .was-validated .custom-control-input:invalid ~ .invalid-feedback, .was-validated .custom-control-input:invalid ~ .invalid-tooltip, .custom-control-input.is-invalid ~ .invalid-feedback, .custom-control-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before, .custom-control-input.is-invalid:checked ~ .custom-control-label::before { background-color: #e7473f; } .was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before, .custom-control-input.is-invalid:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(216, 36, 27, 0.25); } .was-validated .custom-file-input:invalid ~ .custom-file-label, .custom-file-input.is-invalid ~ .custom-file-label { border-color: #d8241b; } .was-validated .custom-file-input:invalid ~ .custom-file-label::after, .custom-file-input.is-invalid ~ .custom-file-label::after { border-color: inherit; } .was-validated .custom-file-input:invalid ~ .invalid-feedback, .was-validated .custom-file-input:invalid ~ .invalid-tooltip, .custom-file-input.is-invalid ~ .invalid-feedback, .custom-file-input.is-invalid ~ .invalid-tooltip { display: block; } .was-validated .custom-file-input:invalid:focus ~ .custom-file-label, .custom-file-input.is-invalid:focus ~ .custom-file-label { box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.25); } .form-inline { display: flex; flex-flow: row wrap; align-items: center; } .form-inline .form-check { width: 100%; } @media (min-width: 576px) { .form-inline label { display: flex; align-items: center; justify-content: center; margin-bottom: 0; } .form-inline .form-group { display: flex; flex: 0 0 auto; flex-flow: row wrap; align-items: center; margin-bottom: 0; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-plaintext { display: inline-block; } .form-inline .input-group, .form-inline .custom-select { width: auto; } .form-inline .form-check { display: flex; align-items: center; justify-content: center; width: auto; padding-left: 0; } .form-inline .form-check-input { position: relative; margin-top: 0; margin-right: 0.25rem; margin-left: 0; } .form-inline .custom-control { align-items: center; justify-content: center; } .form-inline .custom-control-label { margin-bottom: 0; } } .btn { display: inline-block; font-weight: 400; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; border: 1px solid transparent; padding: 0.375rem 0.75rem; font-size: 1rem; line-height: 1.5; border-radius: 0.25rem; transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } @media screen and (prefers-reduced-motion: reduce) { .btn { transition: none; } } .btn:hover, .btn:focus { text-decoration: none; } .btn:focus, .btn.focus { outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .btn.disabled, .btn:disabled { opacity: 0.65; } .btn:not(:disabled):not(.disabled) { cursor: pointer; } a.btn.disabled, fieldset:disabled a.btn { pointer-events: none; } .btn-primary { color: #fff; background-color: #0074d9; border-color: #0074d9; } .btn-primary:hover { color: #fff; background-color: #0060b3; border-color: #0059a6; } .btn-primary:focus, .btn-primary.focus { box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.5); } .btn-primary.disabled, .btn-primary:disabled { color: #fff; background-color: #0074d9; border-color: #0074d9; } .btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle { color: #fff; background-color: #0059a6; border-color: #005299; } .btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.5); } .btn-secondary { color: #fff; background-color: #6c757d; border-color: #6c757d; } .btn-secondary:hover { color: #fff; background-color: #5a6268; border-color: #545b62; } .btn-secondary:focus, .btn-secondary.focus { box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); } .btn-secondary.disabled, .btn-secondary:disabled { color: #fff; background-color: #6c757d; border-color: #6c757d; } .btn-secondary:not(:disabled):not(.disabled):active, .btn-secondary:not(:disabled):not(.disabled).active, .show > .btn-secondary.dropdown-toggle { color: #fff; background-color: #545b62; border-color: #4e555b; } .btn-secondary:not(:disabled):not(.disabled):active:focus, .btn-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); } .btn-success { color: #fff; background-color: #28a745; border-color: #28a745; } .btn-success:hover { color: #fff; background-color: #218838; border-color: #1e7e34; } .btn-success:focus, .btn-success.focus { box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); } .btn-success.disabled, .btn-success:disabled { color: #fff; background-color: #28a745; border-color: #28a745; } .btn-success:not(:disabled):not(.disabled):active, .btn-success:not(:disabled):not(.disabled).active, .show > .btn-success.dropdown-toggle { color: #fff; background-color: #1e7e34; border-color: #1c7430; } .btn-success:not(:disabled):not(.disabled):active:focus, .btn-success:not(:disabled):not(.disabled).active:focus, .show > .btn-success.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); } .btn-info { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-info:hover { color: #fff; background-color: #138496; border-color: #117a8b; } .btn-info:focus, .btn-info.focus { box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); } .btn-info.disabled, .btn-info:disabled { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-info:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled).active, .show > .btn-info.dropdown-toggle { color: #fff; background-color: #117a8b; border-color: #10707f; } .btn-info:not(:disabled):not(.disabled):active:focus, .btn-info:not(:disabled):not(.disabled).active:focus, .show > .btn-info.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); } .btn-warning { color: #212529; background-color: #ffc107; border-color: #ffc107; } .btn-warning:hover { color: #212529; background-color: #e0a800; border-color: #d39e00; } .btn-warning:focus, .btn-warning.focus { box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); } .btn-warning.disabled, .btn-warning:disabled { color: #212529; background-color: #ffc107; border-color: #ffc107; } .btn-warning:not(:disabled):not(.disabled):active, .btn-warning:not(:disabled):not(.disabled).active, .show > .btn-warning.dropdown-toggle { color: #212529; background-color: #d39e00; border-color: #c69500; } .btn-warning:not(:disabled):not(.disabled):active:focus, .btn-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-warning.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); } .btn-danger { color: #fff; background-color: #d8241b; border-color: #d8241b; } .btn-danger:hover { color: #fff; background-color: #b61e17; border-color: #ab1c15; } .btn-danger:focus, .btn-danger.focus { box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.5); } .btn-danger.disabled, .btn-danger:disabled { color: #fff; background-color: #d8241b; border-color: #d8241b; } .btn-danger:not(:disabled):not(.disabled):active, .btn-danger:not(:disabled):not(.disabled).active, .show > .btn-danger.dropdown-toggle { color: #fff; background-color: #ab1c15; border-color: #9f1b14; } .btn-danger:not(:disabled):not(.disabled):active:focus, .btn-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-danger.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.5); } .btn-light { color: #212529; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-light:hover { color: #212529; background-color: #e2e6ea; border-color: #dae0e5; } .btn-light:focus, .btn-light.focus { box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); } .btn-light.disabled, .btn-light:disabled { color: #212529; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-light:not(:disabled):not(.disabled):active, .btn-light:not(:disabled):not(.disabled).active, .show > .btn-light.dropdown-toggle { color: #212529; background-color: #dae0e5; border-color: #d3d9df; } .btn-light:not(:disabled):not(.disabled):active:focus, .btn-light:not(:disabled):not(.disabled).active:focus, .show > .btn-light.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); } .btn-dark { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-dark:hover { color: #fff; background-color: #23272b; border-color: #1d2124; } .btn-dark:focus, .btn-dark.focus { box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); } .btn-dark.disabled, .btn-dark:disabled { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-dark:not(:disabled):not(.disabled):active, .btn-dark:not(:disabled):not(.disabled).active, .show > .btn-dark.dropdown-toggle { color: #fff; background-color: #1d2124; border-color: #171a1d; } .btn-dark:not(:disabled):not(.disabled):active:focus, .btn-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-dark.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); } .btn-outline-primary { color: #0074d9; background-color: transparent; background-image: none; border-color: #0074d9; } .btn-outline-primary:hover { color: #fff; background-color: #0074d9; border-color: #0074d9; } .btn-outline-primary:focus, .btn-outline-primary.focus { box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.5); } .btn-outline-primary.disabled, .btn-outline-primary:disabled { color: #0074d9; background-color: transparent; } .btn-outline-primary:not(:disabled):not(.disabled):active, .btn-outline-primary:not(:disabled):not(.disabled).active, .show > .btn-outline-primary.dropdown-toggle { color: #fff; background-color: #0074d9; border-color: #0074d9; } .btn-outline-primary:not(:disabled):not(.disabled):active:focus, .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-primary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.5); } .btn-outline-secondary { color: #6c757d; background-color: transparent; background-image: none; border-color: #6c757d; } .btn-outline-secondary:hover { color: #fff; background-color: #6c757d; border-color: #6c757d; } .btn-outline-secondary:focus, .btn-outline-secondary.focus { box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); } .btn-outline-secondary.disabled, .btn-outline-secondary:disabled { color: #6c757d; background-color: transparent; } .btn-outline-secondary:not(:disabled):not(.disabled):active, .btn-outline-secondary:not(:disabled):not(.disabled).active, .show > .btn-outline-secondary.dropdown-toggle { color: #fff; background-color: #6c757d; border-color: #6c757d; } .btn-outline-secondary:not(:disabled):not(.disabled):active:focus, .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-secondary.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.5); } .btn-outline-success { color: #28a745; background-color: transparent; background-image: none; border-color: #28a745; } .btn-outline-success:hover { color: #fff; background-color: #28a745; border-color: #28a745; } .btn-outline-success:focus, .btn-outline-success.focus { box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); } .btn-outline-success.disabled, .btn-outline-success:disabled { color: #28a745; background-color: transparent; } .btn-outline-success:not(:disabled):not(.disabled):active, .btn-outline-success:not(:disabled):not(.disabled).active, .show > .btn-outline-success.dropdown-toggle { color: #fff; background-color: #28a745; border-color: #28a745; } .btn-outline-success:not(:disabled):not(.disabled):active:focus, .btn-outline-success:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-success.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5); } .btn-outline-info { color: #17a2b8; background-color: transparent; background-image: none; border-color: #17a2b8; } .btn-outline-info:hover { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-outline-info:focus, .btn-outline-info.focus { box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); } .btn-outline-info.disabled, .btn-outline-info:disabled { color: #17a2b8; background-color: transparent; } .btn-outline-info:not(:disabled):not(.disabled):active, .btn-outline-info:not(:disabled):not(.disabled).active, .show > .btn-outline-info.dropdown-toggle { color: #fff; background-color: #17a2b8; border-color: #17a2b8; } .btn-outline-info:not(:disabled):not(.disabled):active:focus, .btn-outline-info:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-info.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.5); } .btn-outline-warning { color: #ffc107; background-color: transparent; background-image: none; border-color: #ffc107; } .btn-outline-warning:hover { color: #212529; background-color: #ffc107; border-color: #ffc107; } .btn-outline-warning:focus, .btn-outline-warning.focus { box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); } .btn-outline-warning.disabled, .btn-outline-warning:disabled { color: #ffc107; background-color: transparent; } .btn-outline-warning:not(:disabled):not(.disabled):active, .btn-outline-warning:not(:disabled):not(.disabled).active, .show > .btn-outline-warning.dropdown-toggle { color: #212529; background-color: #ffc107; border-color: #ffc107; } .btn-outline-warning:not(:disabled):not(.disabled):active:focus, .btn-outline-warning:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-warning.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5); } .btn-outline-danger { color: #d8241b; background-color: transparent; background-image: none; border-color: #d8241b; } .btn-outline-danger:hover { color: #fff; background-color: #d8241b; border-color: #d8241b; } .btn-outline-danger:focus, .btn-outline-danger.focus { box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.5); } .btn-outline-danger.disabled, .btn-outline-danger:disabled { color: #d8241b; background-color: transparent; } .btn-outline-danger:not(:disabled):not(.disabled):active, .btn-outline-danger:not(:disabled):not(.disabled).active, .show > .btn-outline-danger.dropdown-toggle { color: #fff; background-color: #d8241b; border-color: #d8241b; } .btn-outline-danger:not(:disabled):not(.disabled):active:focus, .btn-outline-danger:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-danger.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(216, 36, 27, 0.5); } .btn-outline-light { color: #f8f9fa; background-color: transparent; background-image: none; border-color: #f8f9fa; } .btn-outline-light:hover { color: #212529; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-outline-light:focus, .btn-outline-light.focus { box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); } .btn-outline-light.disabled, .btn-outline-light:disabled { color: #f8f9fa; background-color: transparent; } .btn-outline-light:not(:disabled):not(.disabled):active, .btn-outline-light:not(:disabled):not(.disabled).active, .show > .btn-outline-light.dropdown-toggle { color: #212529; background-color: #f8f9fa; border-color: #f8f9fa; } .btn-outline-light:not(:disabled):not(.disabled):active:focus, .btn-outline-light:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-light.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(248, 249, 250, 0.5); } .btn-outline-dark { color: #343a40; background-color: transparent; background-image: none; border-color: #343a40; } .btn-outline-dark:hover { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-outline-dark:focus, .btn-outline-dark.focus { box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); } .btn-outline-dark.disabled, .btn-outline-dark:disabled { color: #343a40; background-color: transparent; } .btn-outline-dark:not(:disabled):not(.disabled):active, .btn-outline-dark:not(:disabled):not(.disabled).active, .show > .btn-outline-dark.dropdown-toggle { color: #fff; background-color: #343a40; border-color: #343a40; } .btn-outline-dark:not(:disabled):not(.disabled):active:focus, .btn-outline-dark:not(:disabled):not(.disabled).active:focus, .show > .btn-outline-dark.dropdown-toggle:focus { box-shadow: 0 0 0 0.2rem rgba(52, 58, 64, 0.5); } .btn-link { font-weight: 400; color: #0074d9; background-color: transparent; } .btn-link:hover { color: #004b8d; text-decoration: underline; background-color: transparent; border-color: transparent; } .btn-link:focus, .btn-link.focus { text-decoration: underline; border-color: transparent; box-shadow: none; } .btn-link:disabled, .btn-link.disabled { color: #6c757d; pointer-events: none; } .btn-lg, .btn-group-lg > .btn { padding: 0.5rem 1rem; font-size: 1.25rem; line-height: 1.5; border-radius: 0.3rem; } .btn-sm, .btn-group-sm > .btn { padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.5; border-radius: 0.2rem; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 0.5rem; } input[type=submit].btn-block, input[type=reset].btn-block, input[type=button].btn-block { width: 100%; } .fade { transition: opacity 0.15s linear; } @media screen and (prefers-reduced-motion: reduce) { .fade { transition: none; } } .fade:not(.show) { opacity: 0; } .collapse:not(.show) { display: none; } .collapsing { position: relative; height: 0; overflow: hidden; transition: height 0.35s ease; } @media screen and (prefers-reduced-motion: reduce) { .collapsing { transition: none; } } .dropup, .dropright, .dropdown, .dropleft { position: relative; } .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ""; border-top: 0.3em solid; border-right: 0.3em solid transparent; border-bottom: 0; border-left: 0.3em solid transparent; } .dropdown-toggle:empty::after { margin-left: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 10rem; padding: 0.5rem 0; margin: 0.125rem 0 0; font-size: 1rem; color: #212529; text-align: left; list-style: none; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 0.25rem; } .dropdown-menu-right { right: 0; left: auto; } .dropup .dropdown-menu { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 0.125rem; } .dropup .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ""; border-top: 0; border-right: 0.3em solid transparent; border-bottom: 0.3em solid; border-left: 0.3em solid transparent; } .dropup .dropdown-toggle:empty::after { margin-left: 0; } .dropright .dropdown-menu { top: 0; right: auto; left: 100%; margin-top: 0; margin-left: 0.125rem; } .dropright .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ""; border-top: 0.3em solid transparent; border-right: 0; border-bottom: 0.3em solid transparent; border-left: 0.3em solid; } .dropright .dropdown-toggle:empty::after { margin-left: 0; } .dropright .dropdown-toggle::after { vertical-align: 0; } .dropleft .dropdown-menu { top: 0; right: 100%; left: auto; margin-top: 0; margin-right: 0.125rem; } .dropleft .dropdown-toggle::after { display: inline-block; width: 0; height: 0; margin-left: 0.255em; vertical-align: 0.255em; content: ""; } .dropleft .dropdown-toggle::after { display: none; } .dropleft .dropdown-toggle::before { display: inline-block; width: 0; height: 0; margin-right: 0.255em; vertical-align: 0.255em; content: ""; border-top: 0.3em solid transparent; border-right: 0.3em solid; border-bottom: 0.3em solid transparent; } .dropleft .dropdown-toggle:empty::after { margin-left: 0; } .dropleft .dropdown-toggle::before { vertical-align: 0; } .dropdown-menu[x-placement^=top], .dropdown-menu[x-placement^=right], .dropdown-menu[x-placement^=bottom], .dropdown-menu[x-placement^=left] { right: auto; bottom: auto; } .dropdown-divider { height: 0; margin: 0.5rem 0; overflow: hidden; border-top: 1px solid #e9ecef; } .dropdown-item { display: block; width: 100%; padding: 0.25rem 1.5rem; clear: both; font-weight: 400; color: #212529; text-align: inherit; white-space: nowrap; background-color: transparent; border: 0; } .dropdown-item:hover, .dropdown-item:focus { color: #16181b; text-decoration: none; background-color: #f8f9fa; } .dropdown-item.active, .dropdown-item:active { color: #fff; text-decoration: none; background-color: #0074d9; } .dropdown-item.disabled, .dropdown-item:disabled { color: #6c757d; background-color: transparent; } .dropdown-menu.show { display: block; } .dropdown-header { display: block; padding: 0.5rem 1.5rem; margin-bottom: 0; font-size: 0.875rem; color: #6c757d; white-space: nowrap; } .dropdown-item-text { display: block; padding: 0.25rem 1.5rem; color: #212529; } .btn-group, .btn-group-vertical { position: relative; display: inline-flex; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; flex: 0 1 auto; } .btn-group > .btn:hover, .btn-group-vertical > .btn:hover { z-index: 1; } .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn.active { z-index: 1; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group, .btn-group-vertical .btn + .btn, .btn-group-vertical .btn + .btn-group, .btn-group-vertical .btn-group + .btn, .btn-group-vertical .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-start; } .btn-toolbar .input-group { width: auto; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:not(:last-child):not(.dropdown-toggle), .btn-group > .btn-group:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; } .btn-group > .btn:not(:first-child), .btn-group > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; } .dropdown-toggle-split { padding-right: 0.5625rem; padding-left: 0.5625rem; } .dropdown-toggle-split::after, .dropup .dropdown-toggle-split::after, .dropright .dropdown-toggle-split::after { margin-left: 0; } .dropleft .dropdown-toggle-split::before { margin-right: 0; } .btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split { padding-right: 0.375rem; padding-left: 0.375rem; } .btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split { padding-right: 0.75rem; padding-left: 0.75rem; } .btn-group-vertical { flex-direction: column; align-items: flex-start; justify-content: center; } .btn-group-vertical .btn, .btn-group-vertical .btn-group { width: 100%; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:last-child):not(.dropdown-toggle), .btn-group-vertical > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:not(:first-child), .btn-group-vertical > .btn-group:not(:first-child) > .btn { border-top-left-radius: 0; border-top-right-radius: 0; } .btn-group-toggle > .btn, .btn-group-toggle > .btn-group > .btn { margin-bottom: 0; } .btn-group-toggle > .btn input[type=radio], .btn-group-toggle > .btn input[type=checkbox], .btn-group-toggle > .btn-group > .btn input[type=radio], .btn-group-toggle > .btn-group > .btn input[type=checkbox] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; } .input-group > .form-control, .input-group > .custom-select, .input-group > .custom-file { position: relative; flex: 1 1 auto; width: 1%; margin-bottom: 0; } .input-group > .form-control + .form-control, .input-group > .form-control + .custom-select, .input-group > .form-control + .custom-file, .input-group > .custom-select + .form-control, .input-group > .custom-select + .custom-select, .input-group > .custom-select + .custom-file, .input-group > .custom-file + .form-control, .input-group > .custom-file + .custom-select, .input-group > .custom-file + .custom-file { margin-left: -1px; } .input-group > .form-control:focus, .input-group > .custom-select:focus, .input-group > .custom-file .custom-file-input:focus ~ .custom-file-label { z-index: 3; } .input-group > .custom-file .custom-file-input:focus { z-index: 4; } .input-group > .form-control:not(:last-child), .input-group > .custom-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .form-control:not(:first-child), .input-group > .custom-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group > .custom-file { display: flex; align-items: center; } .input-group > .custom-file:not(:last-child) .custom-file-label, .input-group > .custom-file:not(:last-child) .custom-file-label::after { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .custom-file:not(:first-child) .custom-file-label { border-top-left-radius: 0; border-bottom-left-radius: 0; } .input-group-prepend, .input-group-append { display: flex; } .input-group-prepend .btn, .input-group-append .btn { position: relative; z-index: 2; } .input-group-prepend .btn + .btn, .input-group-prepend .btn + .input-group-text, .input-group-prepend .input-group-text + .input-group-text, .input-group-prepend .input-group-text + .btn, .input-group-append .btn + .btn, .input-group-append .btn + .input-group-text, .input-group-append .input-group-text + .input-group-text, .input-group-append .input-group-text + .btn { margin-left: -1px; } .input-group-prepend { margin-right: -1px; } .input-group-append { margin-left: -1px; } .input-group-text { display: flex; align-items: center; padding: 0.375rem 0.75rem; margin-bottom: 0; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #495057; text-align: center; white-space: nowrap; background-color: #e9ecef; border: 1px solid #ced4da; border-radius: 0.25rem; } .input-group-text input[type=radio], .input-group-text input[type=checkbox] { margin-top: 0; } .input-group-lg > .form-control, .input-group-lg > .input-group-prepend > .input-group-text, .input-group-lg > .input-group-append > .input-group-text, .input-group-lg > .input-group-prepend > .btn, .input-group-lg > .input-group-append > .btn { height: calc(2.875rem + 2px); padding: 0.5rem 1rem; font-size: 1.25rem; line-height: 1.5; border-radius: 0.3rem; } .input-group-sm > .form-control, .input-group-sm > .input-group-prepend > .input-group-text, .input-group-sm > .input-group-append > .input-group-text, .input-group-sm > .input-group-prepend > .btn, .input-group-sm > .input-group-append > .btn { height: calc(1.8125rem + 2px); padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.5; border-radius: 0.2rem; } .input-group > .input-group-prepend > .btn, .input-group > .input-group-prepend > .input-group-text, .input-group > .input-group-append:not(:last-child) > .btn, .input-group > .input-group-append:not(:last-child) > .input-group-text, .input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; } .input-group > .input-group-append > .btn, .input-group > .input-group-append > .input-group-text, .input-group > .input-group-prepend:not(:first-child) > .btn, .input-group > .input-group-prepend:not(:first-child) > .input-group-text, .input-group > .input-group-prepend:first-child > .btn:not(:first-child), .input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; } .custom-control { position: relative; display: block; min-height: 1.5rem; padding-left: 1.5rem; } .custom-control-inline { display: inline-flex; margin-right: 1rem; } .custom-control-input { position: absolute; z-index: -1; opacity: 0; } .custom-control-input:checked ~ .custom-control-label::before { color: #fff; background-color: #0074d9; } .custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .custom-control-input:active ~ .custom-control-label::before { color: #fff; background-color: #8dcaff; } .custom-control-input:disabled ~ .custom-control-label { color: #6c757d; } .custom-control-input:disabled ~ .custom-control-label::before { background-color: #e9ecef; } .custom-control-label { position: relative; margin-bottom: 0; } .custom-control-label::before { position: absolute; top: 0.25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem; pointer-events: none; content: ""; user-select: none; background-color: #dee2e6; } .custom-control-label::after { position: absolute; top: 0.25rem; left: -1.5rem; display: block; width: 1rem; height: 1rem; content: ""; background-repeat: no-repeat; background-position: center center; background-size: 50% 50%; } .custom-checkbox .custom-control-label::before { border-radius: 0.25rem; } .custom-checkbox .custom-control-input:checked ~ .custom-control-label::before { background-color: #0074d9; } .custom-checkbox .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"); } .custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before { background-color: #0074d9; } .custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E"); } .custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before { background-color: rgba(0, 116, 217, 0.5); } .custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before { background-color: rgba(0, 116, 217, 0.5); } .custom-radio .custom-control-label::before { border-radius: 50%; } .custom-radio .custom-control-input:checked ~ .custom-control-label::before { background-color: #0074d9; } .custom-radio .custom-control-input:checked ~ .custom-control-label::after { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); } .custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before { background-color: rgba(0, 116, 217, 0.5); } .custom-select { display: inline-block; width: 100%; height: calc(2.25rem + 2px); padding: 0.375rem 1.75rem 0.375rem 0.75rem; line-height: 1.5; color: #495057; vertical-align: middle; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center; background-size: 8px 10px; border: 1px solid #ced4da; border-radius: 0.25rem; appearance: none; } .custom-select:focus { border-color: #5ab2ff; outline: 0; box-shadow: 0 0 0 0.2rem rgba(90, 178, 255, 0.5); } .custom-select:focus::-ms-value { color: #495057; background-color: #fff; } .custom-select[multiple], .custom-select[size]:not([size="1"]) { height: auto; padding-right: 0.75rem; background-image: none; } .custom-select:disabled { color: #6c757d; background-color: #e9ecef; } .custom-select::-ms-expand { opacity: 0; } .custom-select-sm { height: calc(1.8125rem + 2px); padding-top: 0.375rem; padding-bottom: 0.375rem; font-size: 75%; } .custom-select-lg { height: calc(2.875rem + 2px); padding-top: 0.375rem; padding-bottom: 0.375rem; font-size: 125%; } .custom-file { position: relative; display: inline-block; width: 100%; height: calc(2.25rem + 2px); margin-bottom: 0; } .custom-file-input { position: relative; z-index: 2; width: 100%; height: calc(2.25rem + 2px); margin: 0; opacity: 0; } .custom-file-input:focus ~ .custom-file-label { border-color: #5ab2ff; box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .custom-file-input:focus ~ .custom-file-label::after { border-color: #5ab2ff; } .custom-file-input:disabled ~ .custom-file-label { background-color: #e9ecef; } .custom-file-input:lang(en) ~ .custom-file-label::after { content: "Browse"; } .custom-file-label { position: absolute; top: 0; right: 0; left: 0; z-index: 1; height: calc(2.25rem + 2px); padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; background-color: #fff; border: 1px solid #ced4da; border-radius: 0.25rem; } .custom-file-label::after { position: absolute; top: 0; right: 0; bottom: 0; z-index: 3; display: block; height: 2.25rem; padding: 0.375rem 0.75rem; line-height: 1.5; color: #495057; content: "Browse"; background-color: #e9ecef; border-left: 1px solid #ced4da; border-radius: 0 0.25rem 0.25rem 0; } .custom-range { width: 100%; padding-left: 0; background-color: transparent; appearance: none; } .custom-range:focus { outline: none; } .custom-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .custom-range:focus::-moz-range-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .custom-range:focus::-ms-thumb { box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .custom-range::-moz-focus-outer { border: 0; } .custom-range::-webkit-slider-thumb { width: 1rem; height: 1rem; margin-top: -0.25rem; background-color: #0074d9; border: 0; border-radius: 1rem; transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; appearance: none; } @media screen and (prefers-reduced-motion: reduce) { .custom-range::-webkit-slider-thumb { transition: none; } } .custom-range::-webkit-slider-thumb:active { background-color: #8dcaff; } .custom-range::-webkit-slider-runnable-track { width: 100%; height: 0.5rem; color: transparent; cursor: pointer; background-color: #dee2e6; border-color: transparent; border-radius: 1rem; } .custom-range::-moz-range-thumb { width: 1rem; height: 1rem; background-color: #0074d9; border: 0; border-radius: 1rem; transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; appearance: none; } @media screen and (prefers-reduced-motion: reduce) { .custom-range::-moz-range-thumb { transition: none; } } .custom-range::-moz-range-thumb:active { background-color: #8dcaff; } .custom-range::-moz-range-track { width: 100%; height: 0.5rem; color: transparent; cursor: pointer; background-color: #dee2e6; border-color: transparent; border-radius: 1rem; } .custom-range::-ms-thumb { width: 1rem; height: 1rem; margin-top: 0; margin-right: 0.2rem; margin-left: 0.2rem; background-color: #0074d9; border: 0; border-radius: 1rem; transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; appearance: none; } @media screen and (prefers-reduced-motion: reduce) { .custom-range::-ms-thumb { transition: none; } } .custom-range::-ms-thumb:active { background-color: #8dcaff; } .custom-range::-ms-track { width: 100%; height: 0.5rem; color: transparent; cursor: pointer; background-color: transparent; border-color: transparent; border-width: 0.5rem; } .custom-range::-ms-fill-lower { background-color: #dee2e6; border-radius: 1rem; } .custom-range::-ms-fill-upper { margin-right: 15px; background-color: #dee2e6; border-radius: 1rem; } .custom-control-label::before, .custom-file-label, .custom-select { transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } @media screen and (prefers-reduced-motion: reduce) { .custom-control-label::before, .custom-file-label, .custom-select { transition: none; } } .nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; } .nav-link { display: block; padding: 0.5rem 1rem; } .nav-link:hover, .nav-link:focus { text-decoration: none; } .nav-link.disabled { color: #6c757d; } .nav-tabs { border-bottom: 1px solid #dee2e6; } .nav-tabs .nav-item { margin-bottom: -1px; } .nav-tabs .nav-link { border: 1px solid transparent; border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; } .nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus { border-color: #e9ecef #e9ecef #dee2e6; } .nav-tabs .nav-link.disabled { color: #6c757d; background-color: transparent; border-color: transparent; } .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: #495057; background-color: #fff; border-color: #dee2e6 #dee2e6 #fff; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; } .nav-pills .nav-link { border-radius: 0.25rem; } .nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff; background-color: #0074d9; } .nav-fill .nav-item { flex: 1 1 auto; text-align: center; } .nav-justified .nav-item { flex-basis: 0; flex-grow: 1; text-align: center; } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .navbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; } .navbar > .container, .navbar > .container-fluid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; } .navbar-brand { display: inline-block; padding-top: 0.3125rem; padding-bottom: 0.3125rem; margin-right: 1rem; font-size: 1.25rem; line-height: inherit; white-space: nowrap; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-nav { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; list-style: none; } .navbar-nav .nav-link { padding-right: 0; padding-left: 0; } .navbar-nav .dropdown-menu { position: static; float: none; } .navbar-text { display: inline-block; padding-top: 0.5rem; padding-bottom: 0.5rem; } .navbar-collapse { flex-basis: 100%; flex-grow: 1; align-items: center; } .navbar-toggler { padding: 0.25rem 0.75rem; font-size: 1.25rem; line-height: 1; background-color: transparent; border: 1px solid transparent; border-radius: 0.25rem; } .navbar-toggler:hover, .navbar-toggler:focus { text-decoration: none; } .navbar-toggler:not(:disabled):not(.disabled) { cursor: pointer; } .navbar-toggler-icon { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: middle; content: ""; background: no-repeat center center; background-size: 100% 100%; } @media (max-width: 575.98px) { .navbar-expand-sm > .container, .navbar-expand-sm > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 576px) { .navbar-expand-sm { flex-flow: row nowrap; justify-content: flex-start; } .navbar-expand-sm .navbar-nav { flex-direction: row; } .navbar-expand-sm .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-sm .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-sm > .container, .navbar-expand-sm > .container-fluid { flex-wrap: nowrap; } .navbar-expand-sm .navbar-collapse { display: flex !important; flex-basis: auto; } .navbar-expand-sm .navbar-toggler { display: none; } } @media (max-width: 767.98px) { .navbar-expand-md > .container, .navbar-expand-md > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 768px) { .navbar-expand-md { flex-flow: row nowrap; justify-content: flex-start; } .navbar-expand-md .navbar-nav { flex-direction: row; } .navbar-expand-md .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-md .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-md > .container, .navbar-expand-md > .container-fluid { flex-wrap: nowrap; } .navbar-expand-md .navbar-collapse { display: flex !important; flex-basis: auto; } .navbar-expand-md .navbar-toggler { display: none; } } @media (max-width: 991.98px) { .navbar-expand-lg > .container, .navbar-expand-lg > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 992px) { .navbar-expand-lg { flex-flow: row nowrap; justify-content: flex-start; } .navbar-expand-lg .navbar-nav { flex-direction: row; } .navbar-expand-lg .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-lg .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-lg > .container, .navbar-expand-lg > .container-fluid { flex-wrap: nowrap; } .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; } .navbar-expand-lg .navbar-toggler { display: none; } } @media (max-width: 1199.98px) { .navbar-expand-xl > .container, .navbar-expand-xl > .container-fluid { padding-right: 0; padding-left: 0; } } @media (min-width: 1200px) { .navbar-expand-xl { flex-flow: row nowrap; justify-content: flex-start; } .navbar-expand-xl .navbar-nav { flex-direction: row; } .navbar-expand-xl .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand-xl .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand-xl > .container, .navbar-expand-xl > .container-fluid { flex-wrap: nowrap; } .navbar-expand-xl .navbar-collapse { display: flex !important; flex-basis: auto; } .navbar-expand-xl .navbar-toggler { display: none; } } .navbar-expand { flex-flow: row nowrap; justify-content: flex-start; } .navbar-expand > .container, .navbar-expand > .container-fluid { padding-right: 0; padding-left: 0; } .navbar-expand .navbar-nav { flex-direction: row; } .navbar-expand .navbar-nav .dropdown-menu { position: absolute; } .navbar-expand .navbar-nav .nav-link { padding-right: 0.5rem; padding-left: 0.5rem; } .navbar-expand > .container, .navbar-expand > .container-fluid { flex-wrap: nowrap; } .navbar-expand .navbar-collapse { display: flex !important; flex-basis: auto; } .navbar-expand .navbar-toggler { display: none; } .navbar-light .navbar-brand { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-brand:hover, .navbar-light .navbar-brand:focus { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-nav .nav-link { color: rgba(0, 0, 0, 0.5); } .navbar-light .navbar-nav .nav-link:hover, .navbar-light .navbar-nav .nav-link:focus { color: rgba(0, 0, 0, 0.7); } .navbar-light .navbar-nav .nav-link.disabled { color: rgba(0, 0, 0, 0.3); } .navbar-light .navbar-nav .show > .nav-link, .navbar-light .navbar-nav .active > .nav-link, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .nav-link.active { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-toggler { color: rgba(0, 0, 0, 0.5); border-color: rgba(0, 0, 0, 0.1); } .navbar-light .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); } .navbar-light .navbar-text { color: rgba(0, 0, 0, 0.5); } .navbar-light .navbar-text a { color: rgba(0, 0, 0, 0.9); } .navbar-light .navbar-text a:hover, .navbar-light .navbar-text a:focus { color: rgba(0, 0, 0, 0.9); } .navbar-dark .navbar-brand { color: #fff; } .navbar-dark .navbar-brand:hover, .navbar-dark .navbar-brand:focus { color: #fff; } .navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, 0.5); } .navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link:focus { color: rgba(255, 255, 255, 0.75); } .navbar-dark .navbar-nav .nav-link.disabled { color: rgba(255, 255, 255, 0.25); } .navbar-dark .navbar-nav .show > .nav-link, .navbar-dark .navbar-nav .active > .nav-link, .navbar-dark .navbar-nav .nav-link.show, .navbar-dark .navbar-nav .nav-link.active { color: #fff; } .navbar-dark .navbar-toggler { color: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.1); } .navbar-dark .navbar-toggler-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); } .navbar-dark .navbar-text { color: rgba(255, 255, 255, 0.5); } .navbar-dark .navbar-text a { color: #fff; } .navbar-dark .navbar-text a:hover, .navbar-dark .navbar-text a:focus { color: #fff; } .card { position: relative; display: flex; flex-direction: column; min-width: 0; word-wrap: break-word; background-color: #fff; background-clip: border-box; border: 1px solid rgba(0, 0, 0, 0.125); border-radius: 0.25rem; } .card > hr { margin-right: 0; margin-left: 0; } .card > .list-group:first-child .list-group-item:first-child { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; } .card > .list-group:last-child .list-group-item:last-child { border-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem; } .card-body { flex: 1 1 auto; padding: 1.25rem; } .card-title { margin-bottom: 0.75rem; } .card-subtitle { margin-top: -0.375rem; margin-bottom: 0; } .card-text:last-child { margin-bottom: 0; } .card-link:hover { text-decoration: none; } .card-link + .card-link { margin-left: 1.25rem; } .card-header { padding: 0.75rem 1.25rem; margin-bottom: 0; background-color: rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.125); } .card-header:first-child { border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; } .card-header + .list-group .list-group-item:first-child { border-top: 0; } .card-footer { padding: 0.75rem 1.25rem; background-color: rgba(0, 0, 0, 0.03); border-top: 1px solid rgba(0, 0, 0, 0.125); } .card-footer:last-child { border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); } .card-header-tabs { margin-right: -0.625rem; margin-bottom: -0.75rem; margin-left: -0.625rem; border-bottom: 0; } .card-header-pills { margin-right: -0.625rem; margin-left: -0.625rem; } .card-img-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; padding: 1.25rem; } .card-img { width: 100%; border-radius: calc(0.25rem - 1px); } .card-img-top { width: 100%; border-top-left-radius: calc(0.25rem - 1px); border-top-right-radius: calc(0.25rem - 1px); } .card-img-bottom { width: 100%; border-bottom-right-radius: calc(0.25rem - 1px); border-bottom-left-radius: calc(0.25rem - 1px); } .card-deck { display: flex; flex-direction: column; } .card-deck .card { margin-bottom: 15px; } @media (min-width: 576px) { .card-deck { flex-flow: row wrap; margin-right: -15px; margin-left: -15px; } .card-deck .card { display: flex; flex: 1 0 0%; flex-direction: column; margin-right: 15px; margin-bottom: 0; margin-left: 15px; } } .card-group { display: flex; flex-direction: column; } .card-group > .card { margin-bottom: 15px; } @media (min-width: 576px) { .card-group { flex-flow: row wrap; } .card-group > .card { flex: 1 0 0%; margin-bottom: 0; } .card-group > .card + .card { margin-left: 0; border-left: 0; } .card-group > .card:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; } .card-group > .card:first-child .card-img-top, .card-group > .card:first-child .card-header { border-top-right-radius: 0; } .card-group > .card:first-child .card-img-bottom, .card-group > .card:first-child .card-footer { border-bottom-right-radius: 0; } .card-group > .card:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; } .card-group > .card:last-child .card-img-top, .card-group > .card:last-child .card-header { border-top-left-radius: 0; } .card-group > .card:last-child .card-img-bottom, .card-group > .card:last-child .card-footer { border-bottom-left-radius: 0; } .card-group > .card:only-child { border-radius: 0.25rem; } .card-group > .card:only-child .card-img-top, .card-group > .card:only-child .card-header { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; } .card-group > .card:only-child .card-img-bottom, .card-group > .card:only-child .card-footer { border-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem; } .card-group > .card:not(:first-child):not(:last-child):not(:only-child) { border-radius: 0; } .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-header, .card-group > .card:not(:first-child):not(:last-child):not(:only-child) .card-footer { border-radius: 0; } } .card-columns .card { margin-bottom: 0.75rem; } @media (min-width: 576px) { .card-columns { column-count: 3; column-gap: 1.25rem; orphans: 1; widows: 1; } .card-columns .card { display: inline-block; width: 100%; } } .accordion .card:not(:first-of-type):not(:last-of-type) { border-bottom: 0; border-radius: 0; } .accordion .card:not(:first-of-type) .card-header:first-child { border-radius: 0; } .accordion .card:first-of-type { border-bottom: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .accordion .card:last-of-type { border-top-left-radius: 0; border-top-right-radius: 0; } .breadcrumb { display: flex; flex-wrap: wrap; padding: 0.75rem 1rem; margin-bottom: 1rem; list-style: none; background-color: #e9ecef; border-radius: 0.25rem; } .breadcrumb-item + .breadcrumb-item { padding-left: 0.5rem; } .breadcrumb-item + .breadcrumb-item::before { display: inline-block; padding-right: 0.5rem; color: #6c757d; content: "/"; } .breadcrumb-item + .breadcrumb-item:hover::before { text-decoration: underline; } .breadcrumb-item + .breadcrumb-item:hover::before { text-decoration: none; } .breadcrumb-item.active { color: #6c757d; } .pagination { display: flex; padding-left: 0; list-style: none; border-radius: 0.25rem; } .page-link { position: relative; display: block; padding: 0.5rem 0.75rem; margin-left: -1px; line-height: 1.25; color: #0074d9; background-color: #fff; border: 1px solid #dee2e6; } .page-link:hover { z-index: 2; color: #004b8d; text-decoration: none; background-color: #e9ecef; border-color: #dee2e6; } .page-link:focus { z-index: 2; outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 116, 217, 0.25); } .page-link:not(:disabled):not(.disabled) { cursor: pointer; } .page-item:first-child .page-link { margin-left: 0; border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; } .page-item:last-child .page-link { border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; } .page-item.active .page-link { z-index: 1; color: #fff; background-color: #0074d9; border-color: #0074d9; } .page-item.disabled .page-link { color: #6c757d; pointer-events: none; cursor: auto; background-color: #fff; border-color: #dee2e6; } .pagination-lg .page-link { padding: 0.75rem 1.5rem; font-size: 1.25rem; line-height: 1.5; } .pagination-lg .page-item:first-child .page-link { border-top-left-radius: 0.3rem; border-bottom-left-radius: 0.3rem; } .pagination-lg .page-item:last-child .page-link { border-top-right-radius: 0.3rem; border-bottom-right-radius: 0.3rem; } .pagination-sm .page-link { padding: 0.25rem 0.5rem; font-size: 0.875rem; line-height: 1.5; } .pagination-sm .page-item:first-child .page-link { border-top-left-radius: 0.2rem; border-bottom-left-radius: 0.2rem; } .pagination-sm .page-item:last-child .page-link { border-top-right-radius: 0.2rem; border-bottom-right-radius: 0.2rem; } .badge { display: inline-block; padding: 0.25em 0.4em; font-size: 75%; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25rem; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .badge-pill { padding-right: 0.6em; padding-left: 0.6em; border-radius: 10rem; } .badge-primary { color: #fff; background-color: #0074d9; } .badge-primary[href]:hover, .badge-primary[href]:focus { color: #fff; text-decoration: none; background-color: #0059a6; } .badge-secondary { color: #fff; background-color: #6c757d; } .badge-secondary[href]:hover, .badge-secondary[href]:focus { color: #fff; text-decoration: none; background-color: #545b62; } .badge-success { color: #fff; background-color: #28a745; } .badge-success[href]:hover, .badge-success[href]:focus { color: #fff; text-decoration: none; background-color: #1e7e34; } .badge-info { color: #fff; background-color: #17a2b8; } .badge-info[href]:hover, .badge-info[href]:focus { color: #fff; text-decoration: none; background-color: #117a8b; } .badge-warning { color: #212529; background-color: #ffc107; } .badge-warning[href]:hover, .badge-warning[href]:focus { color: #212529; text-decoration: none; background-color: #d39e00; } .badge-danger { color: #fff; background-color: #d8241b; } .badge-danger[href]:hover, .badge-danger[href]:focus { color: #fff; text-decoration: none; background-color: #ab1c15; } .badge-light { color: #212529; background-color: #f8f9fa; } .badge-light[href]:hover, .badge-light[href]:focus { color: #212529; text-decoration: none; background-color: #dae0e5; } .badge-dark { color: #fff; background-color: #343a40; } .badge-dark[href]:hover, .badge-dark[href]:focus { color: #fff; text-decoration: none; background-color: #1d2124; } .jumbotron { padding: 2rem 1rem; margin-bottom: 2rem; background-color: #e9ecef; border-radius: 0.3rem; } @media (min-width: 576px) { .jumbotron { padding: 4rem 2rem; } } .jumbotron-fluid { padding-right: 0; padding-left: 0; border-radius: 0; } .alert { position: relative; padding: 0.75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.25rem; } .alert-heading { color: inherit; } .alert-link { font-weight: 700; } .alert-dismissible { padding-right: 4rem; } .alert-dismissible .close { position: absolute; top: 0; right: 0; padding: 0.75rem 1.25rem; color: inherit; } .alert-primary { color: #003c71; background-color: #cce3f7; border-color: #b8d8f4; } .alert-primary hr { border-top-color: #a2ccf1; } .alert-primary .alert-link { color: #00213e; } .alert-secondary { color: #383d41; background-color: #e2e3e5; border-color: #d6d8db; } .alert-secondary hr { border-top-color: #c8cbcf; } .alert-secondary .alert-link { color: #202326; } .alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; } .alert-success hr { border-top-color: #b1dfbb; } .alert-success .alert-link { color: #0b2e13; } .alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; } .alert-info hr { border-top-color: #abdde5; } .alert-info .alert-link { color: #062c33; } .alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; } .alert-warning hr { border-top-color: #ffe8a1; } .alert-warning .alert-link { color: #533f03; } .alert-danger { color: #70130e; background-color: #f7d3d1; border-color: #f4c2bf; } .alert-danger hr { border-top-color: #f0ada9; } .alert-danger .alert-link { color: #430b08; } .alert-light { color: #818182; background-color: #fefefe; border-color: #fdfdfe; } .alert-light hr { border-top-color: #ececf6; } .alert-light .alert-link { color: #686868; } .alert-dark { color: #1b1e21; background-color: #d6d8d9; border-color: #c6c8ca; } .alert-dark hr { border-top-color: #b9bbbe; } .alert-dark .alert-link { color: #040505; } @keyframes progress-bar-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } } .progress { display: flex; height: 1rem; overflow: hidden; font-size: 0.75rem; background-color: #e9ecef; border-radius: 0.25rem; } .progress-bar { display: flex; flex-direction: column; justify-content: center; color: #fff; text-align: center; white-space: nowrap; background-color: #0074d9; transition: width 0.6s ease; } @media screen and (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } } .progress-bar-striped { background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 1rem 1rem; } .progress-bar-animated { animation: progress-bar-stripes 1s linear infinite; } .media { display: flex; align-items: flex-start; } .media-body { flex: 1; } .list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; } .list-group-item-action { width: 100%; color: #495057; text-align: inherit; } .list-group-item-action:hover, .list-group-item-action:focus { color: #495057; text-decoration: none; background-color: #f8f9fa; } .list-group-item-action:active { color: #212529; background-color: #e9ecef; } .list-group-item { position: relative; display: block; padding: 0.75rem 1.25rem; margin-bottom: -1px; background-color: #fff; border: 1px solid rgba(0, 0, 0, 0.125); } .list-group-item:first-child { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 0.25rem; border-bottom-left-radius: 0.25rem; } .list-group-item:hover, .list-group-item:focus { z-index: 1; text-decoration: none; } .list-group-item.disabled, .list-group-item:disabled { color: #6c757d; background-color: #fff; } .list-group-item.active { z-index: 2; color: #fff; background-color: #0074d9; border-color: #0074d9; } .list-group-flush .list-group-item { border-right: 0; border-left: 0; border-radius: 0; } .list-group-flush:first-child .list-group-item:first-child { border-top: 0; } .list-group-flush:last-child .list-group-item:last-child { border-bottom: 0; } .list-group-item-primary { color: #003c71; background-color: #b8d8f4; } .list-group-item-primary.list-group-item-action:hover, .list-group-item-primary.list-group-item-action:focus { color: #003c71; background-color: #a2ccf1; } .list-group-item-primary.list-group-item-action.active { color: #fff; background-color: #003c71; border-color: #003c71; } .list-group-item-secondary { color: #383d41; background-color: #d6d8db; } .list-group-item-secondary.list-group-item-action:hover, .list-group-item-secondary.list-group-item-action:focus { color: #383d41; background-color: #c8cbcf; } .list-group-item-secondary.list-group-item-action.active { color: #fff; background-color: #383d41; border-color: #383d41; } .list-group-item-success { color: #155724; background-color: #c3e6cb; } .list-group-item-success.list-group-item-action:hover, .list-group-item-success.list-group-item-action:focus { color: #155724; background-color: #b1dfbb; } .list-group-item-success.list-group-item-action.active { color: #fff; background-color: #155724; border-color: #155724; } .list-group-item-info { color: #0c5460; background-color: #bee5eb; } .list-group-item-info.list-group-item-action:hover, .list-group-item-info.list-group-item-action:focus { color: #0c5460; background-color: #abdde5; } .list-group-item-info.list-group-item-action.active { color: #fff; background-color: #0c5460; border-color: #0c5460; } .list-group-item-warning { color: #856404; background-color: #ffeeba; } .list-group-item-warning.list-group-item-action:hover, .list-group-item-warning.list-group-item-action:focus { color: #856404; background-color: #ffe8a1; } .list-group-item-warning.list-group-item-action.active { color: #fff; background-color: #856404; border-color: #856404; } .list-group-item-danger { color: #70130e; background-color: #f4c2bf; } .list-group-item-danger.list-group-item-action:hover, .list-group-item-danger.list-group-item-action:focus { color: #70130e; background-color: #f0ada9; } .list-group-item-danger.list-group-item-action.active { color: #fff; background-color: #70130e; border-color: #70130e; } .list-group-item-light { color: #818182; background-color: #fdfdfe; } .list-group-item-light.list-group-item-action:hover, .list-group-item-light.list-group-item-action:focus { color: #818182; background-color: #ececf6; } .list-group-item-light.list-group-item-action.active { color: #fff; background-color: #818182; border-color: #818182; } .list-group-item-dark { color: #1b1e21; background-color: #c6c8ca; } .list-group-item-dark.list-group-item-action:hover, .list-group-item-dark.list-group-item-action:focus { color: #1b1e21; background-color: #b9bbbe; } .list-group-item-dark.list-group-item-action.active { color: #fff; background-color: #1b1e21; border-color: #1b1e21; } .close { float: right; font-size: 1.5rem; font-weight: 700; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: 0.5; } .close:not(:disabled):not(.disabled) { cursor: pointer; } .close:not(:disabled):not(.disabled):hover, .close:not(:disabled):not(.disabled):focus { color: #000; text-decoration: none; opacity: 0.75; } button.close { padding: 0; background-color: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; display: none; overflow: hidden; outline: 0; } .modal-dialog { position: relative; width: auto; margin: 0.5rem; pointer-events: none; } .modal.fade .modal-dialog { transition: transform 0.3s ease-out; transform: translate(0, -25%); } @media screen and (prefers-reduced-motion: reduce) { .modal.fade .modal-dialog { transition: none; } } .modal.show .modal-dialog { transform: translate(0, 0); } .modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - (0.5rem * 2)); } .modal-dialog-centered::before { display: block; height: calc(100vh - (0.5rem * 2)); content: ""; } .modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 0.3rem; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; } .modal-backdrop.show { opacity: 0.5; } .modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #e9ecef; border-top-left-radius: 0.3rem; border-top-right-radius: 0.3rem; } .modal-header .close { padding: 1rem; margin: -1rem -1rem -1rem auto; } .modal-title { margin-bottom: 0; line-height: 1.5; } .modal-body { position: relative; flex: 1 1 auto; padding: 1rem; } .modal-footer { display: flex; align-items: center; justify-content: flex-end; padding: 1rem; border-top: 1px solid #e9ecef; } .modal-footer > :not(:first-child) { margin-left: 0.25rem; } .modal-footer > :not(:last-child) { margin-right: 0.25rem; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 576px) { .modal-dialog { max-width: 500px; margin: 1.75rem auto; } .modal-dialog-centered { min-height: calc(100% - (1.75rem * 2)); } .modal-dialog-centered::before { height: calc(100vh - (1.75rem * 2)); } .modal-sm { max-width: 300px; } } @media (min-width: 992px) { .modal-lg { max-width: 800px; } } .tooltip { position: absolute; z-index: 1070; display: block; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-style: normal; font-weight: 400; line-height: 1.5; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; white-space: normal; line-break: auto; font-size: 0.875rem; word-wrap: break-word; opacity: 0; } .tooltip.show { opacity: 0.9; } .tooltip .arrow { position: absolute; display: block; width: 0.8rem; height: 0.4rem; } .tooltip .arrow::before { position: absolute; content: ""; border-color: transparent; border-style: solid; } .bs-tooltip-top, .bs-tooltip-auto[x-placement^=top] { padding: 0.4rem 0; } .bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^=top] .arrow { bottom: 0; } .bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^=top] .arrow::before { top: 0; border-width: 0.4rem 0.4rem 0; border-top-color: #000; } .bs-tooltip-right, .bs-tooltip-auto[x-placement^=right] { padding: 0 0.4rem; } .bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^=right] .arrow { left: 0; width: 0.4rem; height: 0.8rem; } .bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^=right] .arrow::before { right: 0; border-width: 0.4rem 0.4rem 0.4rem 0; border-right-color: #000; } .bs-tooltip-bottom, .bs-tooltip-auto[x-placement^=bottom] { padding: 0.4rem 0; } .bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^=bottom] .arrow { top: 0; } .bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^=bottom] .arrow::before { bottom: 0; border-width: 0 0.4rem 0.4rem; border-bottom-color: #000; } .bs-tooltip-left, .bs-tooltip-auto[x-placement^=left] { padding: 0 0.4rem; } .bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^=left] .arrow { right: 0; width: 0.4rem; height: 0.8rem; } .bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^=left] .arrow::before { left: 0; border-width: 0.4rem 0 0.4rem 0.4rem; border-left-color: #000; } .tooltip-inner { max-width: 200px; padding: 0.25rem 0.5rem; color: #fff; text-align: center; background-color: #000; border-radius: 0.25rem; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: block; max-width: 276px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-style: normal; font-weight: 400; line-height: 1.5; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; letter-spacing: normal; word-break: normal; word-spacing: normal; white-space: normal; line-break: auto; font-size: 0.875rem; word-wrap: break-word; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 0.3rem; } .popover .arrow { position: absolute; display: block; width: 1rem; height: 0.5rem; margin: 0 0.3rem; } .popover .arrow::before, .popover .arrow::after { position: absolute; display: block; content: ""; border-color: transparent; border-style: solid; } .bs-popover-top, .bs-popover-auto[x-placement^=top] { margin-bottom: 0.5rem; } .bs-popover-top .arrow, .bs-popover-auto[x-placement^=top] .arrow { bottom: calc((0.5rem + 1px) * -1); } .bs-popover-top .arrow::before, .bs-popover-auto[x-placement^=top] .arrow::before, .bs-popover-top .arrow::after, .bs-popover-auto[x-placement^=top] .arrow::after { border-width: 0.5rem 0.5rem 0; } .bs-popover-top .arrow::before, .bs-popover-auto[x-placement^=top] .arrow::before { bottom: 0; border-top-color: rgba(0, 0, 0, 0.25); } .bs-popover-top .arrow::after, .bs-popover-auto[x-placement^=top] .arrow::after { bottom: 1px; border-top-color: #fff; } .bs-popover-right, .bs-popover-auto[x-placement^=right] { margin-left: 0.5rem; } .bs-popover-right .arrow, .bs-popover-auto[x-placement^=right] .arrow { left: calc((0.5rem + 1px) * -1); width: 0.5rem; height: 1rem; margin: 0.3rem 0; } .bs-popover-right .arrow::before, .bs-popover-auto[x-placement^=right] .arrow::before, .bs-popover-right .arrow::after, .bs-popover-auto[x-placement^=right] .arrow::after { border-width: 0.5rem 0.5rem 0.5rem 0; } .bs-popover-right .arrow::before, .bs-popover-auto[x-placement^=right] .arrow::before { left: 0; border-right-color: rgba(0, 0, 0, 0.25); } .bs-popover-right .arrow::after, .bs-popover-auto[x-placement^=right] .arrow::after { left: 1px; border-right-color: #fff; } .bs-popover-bottom, .bs-popover-auto[x-placement^=bottom] { margin-top: 0.5rem; } .bs-popover-bottom .arrow, .bs-popover-auto[x-placement^=bottom] .arrow { top: calc((0.5rem + 1px) * -1); } .bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^=bottom] .arrow::before, .bs-popover-bottom .arrow::after, .bs-popover-auto[x-placement^=bottom] .arrow::after { border-width: 0 0.5rem 0.5rem 0.5rem; } .bs-popover-bottom .arrow::before, .bs-popover-auto[x-placement^=bottom] .arrow::before { top: 0; border-bottom-color: rgba(0, 0, 0, 0.25); } .bs-popover-bottom .arrow::after, .bs-popover-auto[x-placement^=bottom] .arrow::after { top: 1px; border-bottom-color: #fff; } .bs-popover-bottom .popover-header::before, .bs-popover-auto[x-placement^=bottom] .popover-header::before { position: absolute; top: 0; left: 50%; display: block; width: 1rem; margin-left: -0.5rem; content: ""; border-bottom: 1px solid #f7f7f7; } .bs-popover-left, .bs-popover-auto[x-placement^=left] { margin-right: 0.5rem; } .bs-popover-left .arrow, .bs-popover-auto[x-placement^=left] .arrow { right: calc((0.5rem + 1px) * -1); width: 0.5rem; height: 1rem; margin: 0.3rem 0; } .bs-popover-left .arrow::before, .bs-popover-auto[x-placement^=left] .arrow::before, .bs-popover-left .arrow::after, .bs-popover-auto[x-placement^=left] .arrow::after { border-width: 0.5rem 0 0.5rem 0.5rem; } .bs-popover-left .arrow::before, .bs-popover-auto[x-placement^=left] .arrow::before { right: 0; border-left-color: rgba(0, 0, 0, 0.25); } .bs-popover-left .arrow::after, .bs-popover-auto[x-placement^=left] .arrow::after { right: 1px; border-left-color: #fff; } .popover-header { padding: 0.5rem 0.75rem; margin-bottom: 0; font-size: 1rem; color: inherit; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-top-left-radius: calc(0.3rem - 1px); border-top-right-radius: calc(0.3rem - 1px); } .popover-header:empty { display: none; } .popover-body { padding: 0.5rem 0.75rem; color: #212529; } .carousel { position: relative; } .carousel-inner { position: relative; width: 100%; overflow: hidden; } .carousel-item { position: relative; display: none; align-items: center; width: 100%; backface-visibility: hidden; perspective: 1000px; } .carousel-item.active, .carousel-item-next, .carousel-item-prev { display: block; transition: transform 0.6s ease; } @media screen and (prefers-reduced-motion: reduce) { .carousel-item.active, .carousel-item-next, .carousel-item-prev { transition: none; } } .carousel-item-next, .carousel-item-prev { position: absolute; top: 0; } .carousel-item-next.carousel-item-left, .carousel-item-prev.carousel-item-right { transform: translateX(0); } @supports (transform-style: preserve-3d) { .carousel-item-next.carousel-item-left, .carousel-item-prev.carousel-item-right { transform: translate3d(0, 0, 0); } } .carousel-item-next, .active.carousel-item-right { transform: translateX(100%); } @supports (transform-style: preserve-3d) { .carousel-item-next, .active.carousel-item-right { transform: translate3d(100%, 0, 0); } } .carousel-item-prev, .active.carousel-item-left { transform: translateX(-100%); } @supports (transform-style: preserve-3d) { .carousel-item-prev, .active.carousel-item-left { transform: translate3d(-100%, 0, 0); } } .carousel-fade .carousel-item { opacity: 0; transition-duration: 0.6s; transition-property: opacity; } .carousel-fade .carousel-item.active, .carousel-fade .carousel-item-next.carousel-item-left, .carousel-fade .carousel-item-prev.carousel-item-right { opacity: 1; } .carousel-fade .active.carousel-item-left, .carousel-fade .active.carousel-item-right { opacity: 0; } .carousel-fade .carousel-item-next, .carousel-fade .carousel-item-prev, .carousel-fade .carousel-item.active, .carousel-fade .active.carousel-item-left, .carousel-fade .active.carousel-item-prev { transform: translateX(0); } @supports (transform-style: preserve-3d) { .carousel-fade .carousel-item-next, .carousel-fade .carousel-item-prev, .carousel-fade .carousel-item.active, .carousel-fade .active.carousel-item-left, .carousel-fade .active.carousel-item-prev { transform: translate3d(0, 0, 0); } } .carousel-control-prev, .carousel-control-next { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; width: 15%; color: #fff; text-align: center; opacity: 0.5; } .carousel-control-prev:hover, .carousel-control-prev:focus, .carousel-control-next:hover, .carousel-control-next:focus { color: #fff; text-decoration: none; outline: 0; opacity: 0.9; } .carousel-control-prev { left: 0; } .carousel-control-next { right: 0; } .carousel-control-prev-icon, .carousel-control-next-icon { display: inline-block; width: 20px; height: 20px; background: transparent no-repeat center center; background-size: 100% 100%; } .carousel-control-prev-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"); } .carousel-control-next-icon { background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"); } .carousel-indicators { position: absolute; right: 0; bottom: 10px; left: 0; z-index: 15; display: flex; justify-content: center; padding-left: 0; margin-right: 15%; margin-left: 15%; list-style: none; } .carousel-indicators li { position: relative; flex: 0 1 auto; width: 30px; height: 3px; margin-right: 3px; margin-left: 3px; text-indent: -999px; cursor: pointer; background-color: rgba(255, 255, 255, 0.5); } .carousel-indicators li::before { position: absolute; top: -10px; left: 0; display: inline-block; width: 100%; height: 10px; content: ""; } .carousel-indicators li::after { position: absolute; bottom: -10px; left: 0; display: inline-block; width: 100%; height: 10px; content: ""; } .carousel-indicators .active { background-color: #fff; } .carousel-caption { position: absolute; right: 15%; bottom: 20px; left: 15%; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; } .align-baseline { vertical-align: baseline !important; } .align-top { vertical-align: top !important; } .align-middle { vertical-align: middle !important; } .align-bottom { vertical-align: bottom !important; } .align-text-bottom { vertical-align: text-bottom !important; } .align-text-top { vertical-align: text-top !important; } .bg-primary { background-color: #0074d9 !important; } a.bg-primary:hover, a.bg-primary:focus, button.bg-primary:hover, button.bg-primary:focus { background-color: #0059a6 !important; } .bg-secondary { background-color: #6c757d !important; } a.bg-secondary:hover, a.bg-secondary:focus, button.bg-secondary:hover, button.bg-secondary:focus { background-color: #545b62 !important; } .bg-success { background-color: #28a745 !important; } a.bg-success:hover, a.bg-success:focus, button.bg-success:hover, button.bg-success:focus { background-color: #1e7e34 !important; } .bg-info { background-color: #17a2b8 !important; } a.bg-info:hover, a.bg-info:focus, button.bg-info:hover, button.bg-info:focus { background-color: #117a8b !important; } .bg-warning { background-color: #ffc107 !important; } a.bg-warning:hover, a.bg-warning:focus, button.bg-warning:hover, button.bg-warning:focus { background-color: #d39e00 !important; } .bg-danger { background-color: #d8241b !important; } a.bg-danger:hover, a.bg-danger:focus, button.bg-danger:hover, button.bg-danger:focus { background-color: #ab1c15 !important; } .bg-light { background-color: #f8f9fa !important; } a.bg-light:hover, a.bg-light:focus, button.bg-light:hover, button.bg-light:focus { background-color: #dae0e5 !important; } .bg-dark { background-color: #343a40 !important; } a.bg-dark:hover, a.bg-dark:focus, button.bg-dark:hover, button.bg-dark:focus { background-color: #1d2124 !important; } .bg-white { background-color: #fff !important; } .bg-transparent { background-color: transparent !important; } .border { border: 1px solid #dee2e6 !important; } .border-top { border-top: 1px solid #dee2e6 !important; } .border-right { border-right: 1px solid #dee2e6 !important; } .border-bottom { border-bottom: 1px solid #dee2e6 !important; } .border-left { border-left: 1px solid #dee2e6 !important; } .border-0 { border: 0 !important; } .border-top-0 { border-top: 0 !important; } .border-right-0 { border-right: 0 !important; } .border-bottom-0 { border-bottom: 0 !important; } .border-left-0 { border-left: 0 !important; } .border-primary { border-color: #0074d9 !important; } .border-secondary { border-color: #6c757d !important; } .border-success { border-color: #28a745 !important; } .border-info { border-color: #17a2b8 !important; } .border-warning { border-color: #ffc107 !important; } .border-danger { border-color: #d8241b !important; } .border-light { border-color: #f8f9fa !important; } .border-dark { border-color: #343a40 !important; } .border-white { border-color: #fff !important; } .rounded { border-radius: 0.25rem !important; } .rounded-top { border-top-left-radius: 0.25rem !important; border-top-right-radius: 0.25rem !important; } .rounded-right { border-top-right-radius: 0.25rem !important; border-bottom-right-radius: 0.25rem !important; } .rounded-bottom { border-bottom-right-radius: 0.25rem !important; border-bottom-left-radius: 0.25rem !important; } .rounded-left { border-top-left-radius: 0.25rem !important; border-bottom-left-radius: 0.25rem !important; } .rounded-circle { border-radius: 50% !important; } .rounded-0 { border-radius: 0 !important; } .clearfix::after { display: block; clear: both; content: ""; } .d-none { display: none !important; } .d-inline { display: inline !important; } .d-inline-block { display: inline-block !important; } .d-block { display: block !important; } .d-table { display: table !important; } .d-table-row { display: table-row !important; } .d-table-cell { display: table-cell !important; } .d-flex { display: flex !important; } .d-inline-flex { display: inline-flex !important; } @media (min-width: 576px) { .d-sm-none { display: none !important; } .d-sm-inline { display: inline !important; } .d-sm-inline-block { display: inline-block !important; } .d-sm-block { display: block !important; } .d-sm-table { display: table !important; } .d-sm-table-row { display: table-row !important; } .d-sm-table-cell { display: table-cell !important; } .d-sm-flex { display: flex !important; } .d-sm-inline-flex { display: inline-flex !important; } } @media (min-width: 768px) { .d-md-none { display: none !important; } .d-md-inline { display: inline !important; } .d-md-inline-block { display: inline-block !important; } .d-md-block { display: block !important; } .d-md-table { display: table !important; } .d-md-table-row { display: table-row !important; } .d-md-table-cell { display: table-cell !important; } .d-md-flex { display: flex !important; } .d-md-inline-flex { display: inline-flex !important; } } @media (min-width: 992px) { .d-lg-none { display: none !important; } .d-lg-inline { display: inline !important; } .d-lg-inline-block { display: inline-block !important; } .d-lg-block { display: block !important; } .d-lg-table { display: table !important; } .d-lg-table-row { display: table-row !important; } .d-lg-table-cell { display: table-cell !important; } .d-lg-flex { display: flex !important; } .d-lg-inline-flex { display: inline-flex !important; } } @media (min-width: 1200px) { .d-xl-none { display: none !important; } .d-xl-inline { display: inline !important; } .d-xl-inline-block { display: inline-block !important; } .d-xl-block { display: block !important; } .d-xl-table { display: table !important; } .d-xl-table-row { display: table-row !important; } .d-xl-table-cell { display: table-cell !important; } .d-xl-flex { display: flex !important; } .d-xl-inline-flex { display: inline-flex !important; } } @media print { .d-print-none { display: none !important; } .d-print-inline { display: inline !important; } .d-print-inline-block { display: inline-block !important; } .d-print-block { display: block !important; } .d-print-table { display: table !important; } .d-print-table-row { display: table-row !important; } .d-print-table-cell { display: table-cell !important; } .d-print-flex { display: flex !important; } .d-print-inline-flex { display: inline-flex !important; } } .embed-responsive { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; } .embed-responsive::before { display: block; content: ""; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; } .embed-responsive-21by9::before { padding-top: 42.8571428571%; } .embed-responsive-16by9::before { padding-top: 56.25%; } .embed-responsive-4by3::before { padding-top: 75%; } .embed-responsive-1by1::before { padding-top: 100%; } .flex-row { flex-direction: row !important; } .flex-column { flex-direction: column !important; } .flex-row-reverse { flex-direction: row-reverse !important; } .flex-column-reverse { flex-direction: column-reverse !important; } .flex-wrap { flex-wrap: wrap !important; } .flex-nowrap { flex-wrap: nowrap !important; } .flex-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex-fill { flex: 1 1 auto !important; } .flex-grow-0 { flex-grow: 0 !important; } .flex-grow-1 { flex-grow: 1 !important; } .flex-shrink-0 { flex-shrink: 0 !important; } .flex-shrink-1 { flex-shrink: 1 !important; } .justify-content-start { justify-content: flex-start !important; } .justify-content-end { justify-content: flex-end !important; } .justify-content-center { justify-content: center !important; } .justify-content-between { justify-content: space-between !important; } .justify-content-around { justify-content: space-around !important; } .align-items-start { align-items: flex-start !important; } .align-items-end { align-items: flex-end !important; } .align-items-center { align-items: center !important; } .align-items-baseline { align-items: baseline !important; } .align-items-stretch { align-items: stretch !important; } .align-content-start { align-content: flex-start !important; } .align-content-end { align-content: flex-end !important; } .align-content-center { align-content: center !important; } .align-content-between { align-content: space-between !important; } .align-content-around { align-content: space-around !important; } .align-content-stretch { align-content: stretch !important; } .align-self-auto { align-self: auto !important; } .align-self-start { align-self: flex-start !important; } .align-self-end { align-self: flex-end !important; } .align-self-center { align-self: center !important; } .align-self-baseline { align-self: baseline !important; } .align-self-stretch { align-self: stretch !important; } @media (min-width: 576px) { .flex-sm-row { flex-direction: row !important; } .flex-sm-column { flex-direction: column !important; } .flex-sm-row-reverse { flex-direction: row-reverse !important; } .flex-sm-column-reverse { flex-direction: column-reverse !important; } .flex-sm-wrap { flex-wrap: wrap !important; } .flex-sm-nowrap { flex-wrap: nowrap !important; } .flex-sm-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex-sm-fill { flex: 1 1 auto !important; } .flex-sm-grow-0 { flex-grow: 0 !important; } .flex-sm-grow-1 { flex-grow: 1 !important; } .flex-sm-shrink-0 { flex-shrink: 0 !important; } .flex-sm-shrink-1 { flex-shrink: 1 !important; } .justify-content-sm-start { justify-content: flex-start !important; } .justify-content-sm-end { justify-content: flex-end !important; } .justify-content-sm-center { justify-content: center !important; } .justify-content-sm-between { justify-content: space-between !important; } .justify-content-sm-around { justify-content: space-around !important; } .align-items-sm-start { align-items: flex-start !important; } .align-items-sm-end { align-items: flex-end !important; } .align-items-sm-center { align-items: center !important; } .align-items-sm-baseline { align-items: baseline !important; } .align-items-sm-stretch { align-items: stretch !important; } .align-content-sm-start { align-content: flex-start !important; } .align-content-sm-end { align-content: flex-end !important; } .align-content-sm-center { align-content: center !important; } .align-content-sm-between { align-content: space-between !important; } .align-content-sm-around { align-content: space-around !important; } .align-content-sm-stretch { align-content: stretch !important; } .align-self-sm-auto { align-self: auto !important; } .align-self-sm-start { align-self: flex-start !important; } .align-self-sm-end { align-self: flex-end !important; } .align-self-sm-center { align-self: center !important; } .align-self-sm-baseline { align-self: baseline !important; } .align-self-sm-stretch { align-self: stretch !important; } } @media (min-width: 768px) { .flex-md-row { flex-direction: row !important; } .flex-md-column { flex-direction: column !important; } .flex-md-row-reverse { flex-direction: row-reverse !important; } .flex-md-column-reverse { flex-direction: column-reverse !important; } .flex-md-wrap { flex-wrap: wrap !important; } .flex-md-nowrap { flex-wrap: nowrap !important; } .flex-md-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex-md-fill { flex: 1 1 auto !important; } .flex-md-grow-0 { flex-grow: 0 !important; } .flex-md-grow-1 { flex-grow: 1 !important; } .flex-md-shrink-0 { flex-shrink: 0 !important; } .flex-md-shrink-1 { flex-shrink: 1 !important; } .justify-content-md-start { justify-content: flex-start !important; } .justify-content-md-end { justify-content: flex-end !important; } .justify-content-md-center { justify-content: center !important; } .justify-content-md-between { justify-content: space-between !important; } .justify-content-md-around { justify-content: space-around !important; } .align-items-md-start { align-items: flex-start !important; } .align-items-md-end { align-items: flex-end !important; } .align-items-md-center { align-items: center !important; } .align-items-md-baseline { align-items: baseline !important; } .align-items-md-stretch { align-items: stretch !important; } .align-content-md-start { align-content: flex-start !important; } .align-content-md-end { align-content: flex-end !important; } .align-content-md-center { align-content: center !important; } .align-content-md-between { align-content: space-between !important; } .align-content-md-around { align-content: space-around !important; } .align-content-md-stretch { align-content: stretch !important; } .align-self-md-auto { align-self: auto !important; } .align-self-md-start { align-self: flex-start !important; } .align-self-md-end { align-self: flex-end !important; } .align-self-md-center { align-self: center !important; } .align-self-md-baseline { align-self: baseline !important; } .align-self-md-stretch { align-self: stretch !important; } } @media (min-width: 992px) { .flex-lg-row { flex-direction: row !important; } .flex-lg-column { flex-direction: column !important; } .flex-lg-row-reverse { flex-direction: row-reverse !important; } .flex-lg-column-reverse { flex-direction: column-reverse !important; } .flex-lg-wrap { flex-wrap: wrap !important; } .flex-lg-nowrap { flex-wrap: nowrap !important; } .flex-lg-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex-lg-fill { flex: 1 1 auto !important; } .flex-lg-grow-0 { flex-grow: 0 !important; } .flex-lg-grow-1 { flex-grow: 1 !important; } .flex-lg-shrink-0 { flex-shrink: 0 !important; } .flex-lg-shrink-1 { flex-shrink: 1 !important; } .justify-content-lg-start { justify-content: flex-start !important; } .justify-content-lg-end { justify-content: flex-end !important; } .justify-content-lg-center { justify-content: center !important; } .justify-content-lg-between { justify-content: space-between !important; } .justify-content-lg-around { justify-content: space-around !important; } .align-items-lg-start { align-items: flex-start !important; } .align-items-lg-end { align-items: flex-end !important; } .align-items-lg-center { align-items: center !important; } .align-items-lg-baseline { align-items: baseline !important; } .align-items-lg-stretch { align-items: stretch !important; } .align-content-lg-start { align-content: flex-start !important; } .align-content-lg-end { align-content: flex-end !important; } .align-content-lg-center { align-content: center !important; } .align-content-lg-between { align-content: space-between !important; } .align-content-lg-around { align-content: space-around !important; } .align-content-lg-stretch { align-content: stretch !important; } .align-self-lg-auto { align-self: auto !important; } .align-self-lg-start { align-self: flex-start !important; } .align-self-lg-end { align-self: flex-end !important; } .align-self-lg-center { align-self: center !important; } .align-self-lg-baseline { align-self: baseline !important; } .align-self-lg-stretch { align-self: stretch !important; } } @media (min-width: 1200px) { .flex-xl-row { flex-direction: row !important; } .flex-xl-column { flex-direction: column !important; } .flex-xl-row-reverse { flex-direction: row-reverse !important; } .flex-xl-column-reverse { flex-direction: column-reverse !important; } .flex-xl-wrap { flex-wrap: wrap !important; } .flex-xl-nowrap { flex-wrap: nowrap !important; } .flex-xl-wrap-reverse { flex-wrap: wrap-reverse !important; } .flex-xl-fill { flex: 1 1 auto !important; } .flex-xl-grow-0 { flex-grow: 0 !important; } .flex-xl-grow-1 { flex-grow: 1 !important; } .flex-xl-shrink-0 { flex-shrink: 0 !important; } .flex-xl-shrink-1 { flex-shrink: 1 !important; } .justify-content-xl-start { justify-content: flex-start !important; } .justify-content-xl-end { justify-content: flex-end !important; } .justify-content-xl-center { justify-content: center !important; } .justify-content-xl-between { justify-content: space-between !important; } .justify-content-xl-around { justify-content: space-around !important; } .align-items-xl-start { align-items: flex-start !important; } .align-items-xl-end { align-items: flex-end !important; } .align-items-xl-center { align-items: center !important; } .align-items-xl-baseline { align-items: baseline !important; } .align-items-xl-stretch { align-items: stretch !important; } .align-content-xl-start { align-content: flex-start !important; } .align-content-xl-end { align-content: flex-end !important; } .align-content-xl-center { align-content: center !important; } .align-content-xl-between { align-content: space-between !important; } .align-content-xl-around { align-content: space-around !important; } .align-content-xl-stretch { align-content: stretch !important; } .align-self-xl-auto { align-self: auto !important; } .align-self-xl-start { align-self: flex-start !important; } .align-self-xl-end { align-self: flex-end !important; } .align-self-xl-center { align-self: center !important; } .align-self-xl-baseline { align-self: baseline !important; } .align-self-xl-stretch { align-self: stretch !important; } } .float-left { float: left !important; } .float-right { float: right !important; } .float-none { float: none !important; } @media (min-width: 576px) { .float-sm-left { float: left !important; } .float-sm-right { float: right !important; } .float-sm-none { float: none !important; } } @media (min-width: 768px) { .float-md-left { float: left !important; } .float-md-right { float: right !important; } .float-md-none { float: none !important; } } @media (min-width: 992px) { .float-lg-left { float: left !important; } .float-lg-right { float: right !important; } .float-lg-none { float: none !important; } } @media (min-width: 1200px) { .float-xl-left { float: left !important; } .float-xl-right { float: right !important; } .float-xl-none { float: none !important; } } .position-static { position: static !important; } .position-relative { position: relative !important; } .position-absolute { position: absolute !important; } .position-fixed { position: fixed !important; } .position-sticky { position: sticky !important; } .fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } .fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1030; } @supports (position: sticky) { .sticky-top { position: sticky; top: 0; z-index: 1020; } } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; } .shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; } .shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; } .shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; } .shadow-none { box-shadow: none !important; } .w-25 { width: 25% !important; } .w-50 { width: 50% !important; } .w-75 { width: 75% !important; } .w-100 { width: 100% !important; } .w-auto { width: auto !important; } .h-25 { height: 25% !important; } .h-50 { height: 50% !important; } .h-75 { height: 75% !important; } .h-100 { height: 100% !important; } .h-auto { height: auto !important; } .mw-100 { max-width: 100% !important; } .mh-100 { max-height: 100% !important; } .m-0 { margin: 0 !important; } .mt-0, .my-0 { margin-top: 0 !important; } .mr-0, .mx-0 { margin-right: 0 !important; } .mb-0, .my-0 { margin-bottom: 0 !important; } .ml-0, .mx-0 { margin-left: 0 !important; } .m-1 { margin: 0.25rem !important; } .mt-1, .my-1 { margin-top: 0.25rem !important; } .mr-1, .mx-1 { margin-right: 0.25rem !important; } .mb-1, .my-1 { margin-bottom: 0.25rem !important; } .ml-1, .mx-1 { margin-left: 0.25rem !important; } .m-2 { margin: 0.5rem !important; } .mt-2, .my-2 { margin-top: 0.5rem !important; } .mr-2, .mx-2 { margin-right: 0.5rem !important; } .mb-2, .my-2 { margin-bottom: 0.5rem !important; } .ml-2, .mx-2 { margin-left: 0.5rem !important; } .m-3 { margin: 1rem !important; } .mt-3, .my-3 { margin-top: 1rem !important; } .mr-3, .mx-3 { margin-right: 1rem !important; } .mb-3, .my-3 { margin-bottom: 1rem !important; } .ml-3, .mx-3 { margin-left: 1rem !important; } .m-4 { margin: 1.5rem !important; } .mt-4, .my-4 { margin-top: 1.5rem !important; } .mr-4, .mx-4 { margin-right: 1.5rem !important; } .mb-4, .my-4 { margin-bottom: 1.5rem !important; } .ml-4, .mx-4 { margin-left: 1.5rem !important; } .m-5 { margin: 3rem !important; } .mt-5, .my-5 { margin-top: 3rem !important; } .mr-5, .mx-5 { margin-right: 3rem !important; } .mb-5, .my-5 { margin-bottom: 3rem !important; } .ml-5, .mx-5 { margin-left: 3rem !important; } .p-0 { padding: 0 !important; } .pt-0, .py-0 { padding-top: 0 !important; } .pr-0, .px-0 { padding-right: 0 !important; } .pb-0, .py-0 { padding-bottom: 0 !important; } .pl-0, .px-0 { padding-left: 0 !important; } .p-1 { padding: 0.25rem !important; } .pt-1, .py-1 { padding-top: 0.25rem !important; } .pr-1, .px-1 { padding-right: 0.25rem !important; } .pb-1, .py-1 { padding-bottom: 0.25rem !important; } .pl-1, .px-1 { padding-left: 0.25rem !important; } .p-2 { padding: 0.5rem !important; } .pt-2, .py-2 { padding-top: 0.5rem !important; } .pr-2, .px-2 { padding-right: 0.5rem !important; } .pb-2, .py-2 { padding-bottom: 0.5rem !important; } .pl-2, .px-2 { padding-left: 0.5rem !important; } .p-3 { padding: 1rem !important; } .pt-3, .py-3 { padding-top: 1rem !important; } .pr-3, .px-3 { padding-right: 1rem !important; } .pb-3, .py-3 { padding-bottom: 1rem !important; } .pl-3, .px-3 { padding-left: 1rem !important; } .p-4 { padding: 1.5rem !important; } .pt-4, .py-4 { padding-top: 1.5rem !important; } .pr-4, .px-4 { padding-right: 1.5rem !important; } .pb-4, .py-4 { padding-bottom: 1.5rem !important; } .pl-4, .px-4 { padding-left: 1.5rem !important; } .p-5 { padding: 3rem !important; } .pt-5, .py-5 { padding-top: 3rem !important; } .pr-5, .px-5 { padding-right: 3rem !important; } .pb-5, .py-5 { padding-bottom: 3rem !important; } .pl-5, .px-5 { padding-left: 3rem !important; } .m-auto { margin: auto !important; } .mt-auto, .my-auto { margin-top: auto !important; } .mr-auto, .mx-auto { margin-right: auto !important; } .mb-auto, .my-auto { margin-bottom: auto !important; } .ml-auto, .mx-auto { margin-left: auto !important; } @media (min-width: 576px) { .m-sm-0 { margin: 0 !important; } .mt-sm-0, .my-sm-0 { margin-top: 0 !important; } .mr-sm-0, .mx-sm-0 { margin-right: 0 !important; } .mb-sm-0, .my-sm-0 { margin-bottom: 0 !important; } .ml-sm-0, .mx-sm-0 { margin-left: 0 !important; } .m-sm-1 { margin: 0.25rem !important; } .mt-sm-1, .my-sm-1 { margin-top: 0.25rem !important; } .mr-sm-1, .mx-sm-1 { margin-right: 0.25rem !important; } .mb-sm-1, .my-sm-1 { margin-bottom: 0.25rem !important; } .ml-sm-1, .mx-sm-1 { margin-left: 0.25rem !important; } .m-sm-2 { margin: 0.5rem !important; } .mt-sm-2, .my-sm-2 { margin-top: 0.5rem !important; } .mr-sm-2, .mx-sm-2 { margin-right: 0.5rem !important; } .mb-sm-2, .my-sm-2 { margin-bottom: 0.5rem !important; } .ml-sm-2, .mx-sm-2 { margin-left: 0.5rem !important; } .m-sm-3 { margin: 1rem !important; } .mt-sm-3, .my-sm-3 { margin-top: 1rem !important; } .mr-sm-3, .mx-sm-3 { margin-right: 1rem !important; } .mb-sm-3, .my-sm-3 { margin-bottom: 1rem !important; } .ml-sm-3, .mx-sm-3 { margin-left: 1rem !important; } .m-sm-4 { margin: 1.5rem !important; } .mt-sm-4, .my-sm-4 { margin-top: 1.5rem !important; } .mr-sm-4, .mx-sm-4 { margin-right: 1.5rem !important; } .mb-sm-4, .my-sm-4 { margin-bottom: 1.5rem !important; } .ml-sm-4, .mx-sm-4 { margin-left: 1.5rem !important; } .m-sm-5 { margin: 3rem !important; } .mt-sm-5, .my-sm-5 { margin-top: 3rem !important; } .mr-sm-5, .mx-sm-5 { margin-right: 3rem !important; } .mb-sm-5, .my-sm-5 { margin-bottom: 3rem !important; } .ml-sm-5, .mx-sm-5 { margin-left: 3rem !important; } .p-sm-0 { padding: 0 !important; } .pt-sm-0, .py-sm-0 { padding-top: 0 !important; } .pr-sm-0, .px-sm-0 { padding-right: 0 !important; } .pb-sm-0, .py-sm-0 { padding-bottom: 0 !important; } .pl-sm-0, .px-sm-0 { padding-left: 0 !important; } .p-sm-1 { padding: 0.25rem !important; } .pt-sm-1, .py-sm-1 { padding-top: 0.25rem !important; } .pr-sm-1, .px-sm-1 { padding-right: 0.25rem !important; } .pb-sm-1, .py-sm-1 { padding-bottom: 0.25rem !important; } .pl-sm-1, .px-sm-1 { padding-left: 0.25rem !important; } .p-sm-2 { padding: 0.5rem !important; } .pt-sm-2, .py-sm-2 { padding-top: 0.5rem !important; } .pr-sm-2, .px-sm-2 { padding-right: 0.5rem !important; } .pb-sm-2, .py-sm-2 { padding-bottom: 0.5rem !important; } .pl-sm-2, .px-sm-2 { padding-left: 0.5rem !important; } .p-sm-3 { padding: 1rem !important; } .pt-sm-3, .py-sm-3 { padding-top: 1rem !important; } .pr-sm-3, .px-sm-3 { padding-right: 1rem !important; } .pb-sm-3, .py-sm-3 { padding-bottom: 1rem !important; } .pl-sm-3, .px-sm-3 { padding-left: 1rem !important; } .p-sm-4 { padding: 1.5rem !important; } .pt-sm-4, .py-sm-4 { padding-top: 1.5rem !important; } .pr-sm-4, .px-sm-4 { padding-right: 1.5rem !important; } .pb-sm-4, .py-sm-4 { padding-bottom: 1.5rem !important; } .pl-sm-4, .px-sm-4 { padding-left: 1.5rem !important; } .p-sm-5 { padding: 3rem !important; } .pt-sm-5, .py-sm-5 { padding-top: 3rem !important; } .pr-sm-5, .px-sm-5 { padding-right: 3rem !important; } .pb-sm-5, .py-sm-5 { padding-bottom: 3rem !important; } .pl-sm-5, .px-sm-5 { padding-left: 3rem !important; } .m-sm-auto { margin: auto !important; } .mt-sm-auto, .my-sm-auto { margin-top: auto !important; } .mr-sm-auto, .mx-sm-auto { margin-right: auto !important; } .mb-sm-auto, .my-sm-auto { margin-bottom: auto !important; } .ml-sm-auto, .mx-sm-auto { margin-left: auto !important; } } @media (min-width: 768px) { .m-md-0 { margin: 0 !important; } .mt-md-0, .my-md-0 { margin-top: 0 !important; } .mr-md-0, .mx-md-0 { margin-right: 0 !important; } .mb-md-0, .my-md-0 { margin-bottom: 0 !important; } .ml-md-0, .mx-md-0 { margin-left: 0 !important; } .m-md-1 { margin: 0.25rem !important; } .mt-md-1, .my-md-1 { margin-top: 0.25rem !important; } .mr-md-1, .mx-md-1 { margin-right: 0.25rem !important; } .mb-md-1, .my-md-1 { margin-bottom: 0.25rem !important; } .ml-md-1, .mx-md-1 { margin-left: 0.25rem !important; } .m-md-2 { margin: 0.5rem !important; } .mt-md-2, .my-md-2 { margin-top: 0.5rem !important; } .mr-md-2, .mx-md-2 { margin-right: 0.5rem !important; } .mb-md-2, .my-md-2 { margin-bottom: 0.5rem !important; } .ml-md-2, .mx-md-2 { margin-left: 0.5rem !important; } .m-md-3 { margin: 1rem !important; } .mt-md-3, .my-md-3 { margin-top: 1rem !important; } .mr-md-3, .mx-md-3 { margin-right: 1rem !important; } .mb-md-3, .my-md-3 { margin-bottom: 1rem !important; } .ml-md-3, .mx-md-3 { margin-left: 1rem !important; } .m-md-4 { margin: 1.5rem !important; } .mt-md-4, .my-md-4 { margin-top: 1.5rem !important; } .mr-md-4, .mx-md-4 { margin-right: 1.5rem !important; } .mb-md-4, .my-md-4 { margin-bottom: 1.5rem !important; } .ml-md-4, .mx-md-4 { margin-left: 1.5rem !important; } .m-md-5 { margin: 3rem !important; } .mt-md-5, .my-md-5 { margin-top: 3rem !important; } .mr-md-5, .mx-md-5 { margin-right: 3rem !important; } .mb-md-5, .my-md-5 { margin-bottom: 3rem !important; } .ml-md-5, .mx-md-5 { margin-left: 3rem !important; } .p-md-0 { padding: 0 !important; } .pt-md-0, .py-md-0 { padding-top: 0 !important; } .pr-md-0, .px-md-0 { padding-right: 0 !important; } .pb-md-0, .py-md-0 { padding-bottom: 0 !important; } .pl-md-0, .px-md-0 { padding-left: 0 !important; } .p-md-1 { padding: 0.25rem !important; } .pt-md-1, .py-md-1 { padding-top: 0.25rem !important; } .pr-md-1, .px-md-1 { padding-right: 0.25rem !important; } .pb-md-1, .py-md-1 { padding-bottom: 0.25rem !important; } .pl-md-1, .px-md-1 { padding-left: 0.25rem !important; } .p-md-2 { padding: 0.5rem !important; } .pt-md-2, .py-md-2 { padding-top: 0.5rem !important; } .pr-md-2, .px-md-2 { padding-right: 0.5rem !important; } .pb-md-2, .py-md-2 { padding-bottom: 0.5rem !important; } .pl-md-2, .px-md-2 { padding-left: 0.5rem !important; } .p-md-3 { padding: 1rem !important; } .pt-md-3, .py-md-3 { padding-top: 1rem !important; } .pr-md-3, .px-md-3 { padding-right: 1rem !important; } .pb-md-3, .py-md-3 { padding-bottom: 1rem !important; } .pl-md-3, .px-md-3 { padding-left: 1rem !important; } .p-md-4 { padding: 1.5rem !important; } .pt-md-4, .py-md-4 { padding-top: 1.5rem !important; } .pr-md-4, .px-md-4 { padding-right: 1.5rem !important; } .pb-md-4, .py-md-4 { padding-bottom: 1.5rem !important; } .pl-md-4, .px-md-4 { padding-left: 1.5rem !important; } .p-md-5 { padding: 3rem !important; } .pt-md-5, .py-md-5 { padding-top: 3rem !important; } .pr-md-5, .px-md-5 { padding-right: 3rem !important; } .pb-md-5, .py-md-5 { padding-bottom: 3rem !important; } .pl-md-5, .px-md-5 { padding-left: 3rem !important; } .m-md-auto { margin: auto !important; } .mt-md-auto, .my-md-auto { margin-top: auto !important; } .mr-md-auto, .mx-md-auto { margin-right: auto !important; } .mb-md-auto, .my-md-auto { margin-bottom: auto !important; } .ml-md-auto, .mx-md-auto { margin-left: auto !important; } } @media (min-width: 992px) { .m-lg-0 { margin: 0 !important; } .mt-lg-0, .my-lg-0 { margin-top: 0 !important; } .mr-lg-0, .mx-lg-0 { margin-right: 0 !important; } .mb-lg-0, .my-lg-0 { margin-bottom: 0 !important; } .ml-lg-0, .mx-lg-0 { margin-left: 0 !important; } .m-lg-1 { margin: 0.25rem !important; } .mt-lg-1, .my-lg-1 { margin-top: 0.25rem !important; } .mr-lg-1, .mx-lg-1 { margin-right: 0.25rem !important; } .mb-lg-1, .my-lg-1 { margin-bottom: 0.25rem !important; } .ml-lg-1, .mx-lg-1 { margin-left: 0.25rem !important; } .m-lg-2 { margin: 0.5rem !important; } .mt-lg-2, .my-lg-2 { margin-top: 0.5rem !important; } .mr-lg-2, .mx-lg-2 { margin-right: 0.5rem !important; } .mb-lg-2, .my-lg-2 { margin-bottom: 0.5rem !important; } .ml-lg-2, .mx-lg-2 { margin-left: 0.5rem !important; } .m-lg-3 { margin: 1rem !important; } .mt-lg-3, .my-lg-3 { margin-top: 1rem !important; } .mr-lg-3, .mx-lg-3 { margin-right: 1rem !important; } .mb-lg-3, .my-lg-3 { margin-bottom: 1rem !important; } .ml-lg-3, .mx-lg-3 { margin-left: 1rem !important; } .m-lg-4 { margin: 1.5rem !important; } .mt-lg-4, .my-lg-4 { margin-top: 1.5rem !important; } .mr-lg-4, .mx-lg-4 { margin-right: 1.5rem !important; } .mb-lg-4, .my-lg-4 { margin-bottom: 1.5rem !important; } .ml-lg-4, .mx-lg-4 { margin-left: 1.5rem !important; } .m-lg-5 { margin: 3rem !important; } .mt-lg-5, .my-lg-5 { margin-top: 3rem !important; } .mr-lg-5, .mx-lg-5 { margin-right: 3rem !important; } .mb-lg-5, .my-lg-5 { margin-bottom: 3rem !important; } .ml-lg-5, .mx-lg-5 { margin-left: 3rem !important; } .p-lg-0 { padding: 0 !important; } .pt-lg-0, .py-lg-0 { padding-top: 0 !important; } .pr-lg-0, .px-lg-0 { padding-right: 0 !important; } .pb-lg-0, .py-lg-0 { padding-bottom: 0 !important; } .pl-lg-0, .px-lg-0 { padding-left: 0 !important; } .p-lg-1 { padding: 0.25rem !important; } .pt-lg-1, .py-lg-1 { padding-top: 0.25rem !important; } .pr-lg-1, .px-lg-1 { padding-right: 0.25rem !important; } .pb-lg-1, .py-lg-1 { padding-bottom: 0.25rem !important; } .pl-lg-1, .px-lg-1 { padding-left: 0.25rem !important; } .p-lg-2 { padding: 0.5rem !important; } .pt-lg-2, .py-lg-2 { padding-top: 0.5rem !important; } .pr-lg-2, .px-lg-2 { padding-right: 0.5rem !important; } .pb-lg-2, .py-lg-2 { padding-bottom: 0.5rem !important; } .pl-lg-2, .px-lg-2 { padding-left: 0.5rem !important; } .p-lg-3 { padding: 1rem !important; } .pt-lg-3, .py-lg-3 { padding-top: 1rem !important; } .pr-lg-3, .px-lg-3 { padding-right: 1rem !important; } .pb-lg-3, .py-lg-3 { padding-bottom: 1rem !important; } .pl-lg-3, .px-lg-3 { padding-left: 1rem !important; } .p-lg-4 { padding: 1.5rem !important; } .pt-lg-4, .py-lg-4 { padding-top: 1.5rem !important; } .pr-lg-4, .px-lg-4 { padding-right: 1.5rem !important; } .pb-lg-4, .py-lg-4 { padding-bottom: 1.5rem !important; } .pl-lg-4, .px-lg-4 { padding-left: 1.5rem !important; } .p-lg-5 { padding: 3rem !important; } .pt-lg-5, .py-lg-5 { padding-top: 3rem !important; } .pr-lg-5, .px-lg-5 { padding-right: 3rem !important; } .pb-lg-5, .py-lg-5 { padding-bottom: 3rem !important; } .pl-lg-5, .px-lg-5 { padding-left: 3rem !important; } .m-lg-auto { margin: auto !important; } .mt-lg-auto, .my-lg-auto { margin-top: auto !important; } .mr-lg-auto, .mx-lg-auto { margin-right: auto !important; } .mb-lg-auto, .my-lg-auto { margin-bottom: auto !important; } .ml-lg-auto, .mx-lg-auto { margin-left: auto !important; } } @media (min-width: 1200px) { .m-xl-0 { margin: 0 !important; } .mt-xl-0, .my-xl-0 { margin-top: 0 !important; } .mr-xl-0, .mx-xl-0 { margin-right: 0 !important; } .mb-xl-0, .my-xl-0 { margin-bottom: 0 !important; } .ml-xl-0, .mx-xl-0 { margin-left: 0 !important; } .m-xl-1 { margin: 0.25rem !important; } .mt-xl-1, .my-xl-1 { margin-top: 0.25rem !important; } .mr-xl-1, .mx-xl-1 { margin-right: 0.25rem !important; } .mb-xl-1, .my-xl-1 { margin-bottom: 0.25rem !important; } .ml-xl-1, .mx-xl-1 { margin-left: 0.25rem !important; } .m-xl-2 { margin: 0.5rem !important; } .mt-xl-2, .my-xl-2 { margin-top: 0.5rem !important; } .mr-xl-2, .mx-xl-2 { margin-right: 0.5rem !important; } .mb-xl-2, .my-xl-2 { margin-bottom: 0.5rem !important; } .ml-xl-2, .mx-xl-2 { margin-left: 0.5rem !important; } .m-xl-3 { margin: 1rem !important; } .mt-xl-3, .my-xl-3 { margin-top: 1rem !important; } .mr-xl-3, .mx-xl-3 { margin-right: 1rem !important; } .mb-xl-3, .my-xl-3 { margin-bottom: 1rem !important; } .ml-xl-3, .mx-xl-3 { margin-left: 1rem !important; } .m-xl-4 { margin: 1.5rem !important; } .mt-xl-4, .my-xl-4 { margin-top: 1.5rem !important; } .mr-xl-4, .mx-xl-4 { margin-right: 1.5rem !important; } .mb-xl-4, .my-xl-4 { margin-bottom: 1.5rem !important; } .ml-xl-4, .mx-xl-4 { margin-left: 1.5rem !important; } .m-xl-5 { margin: 3rem !important; } .mt-xl-5, .my-xl-5 { margin-top: 3rem !important; } .mr-xl-5, .mx-xl-5 { margin-right: 3rem !important; } .mb-xl-5, .my-xl-5 { margin-bottom: 3rem !important; } .ml-xl-5, .mx-xl-5 { margin-left: 3rem !important; } .p-xl-0 { padding: 0 !important; } .pt-xl-0, .py-xl-0 { padding-top: 0 !important; } .pr-xl-0, .px-xl-0 { padding-right: 0 !important; } .pb-xl-0, .py-xl-0 { padding-bottom: 0 !important; } .pl-xl-0, .px-xl-0 { padding-left: 0 !important; } .p-xl-1 { padding: 0.25rem !important; } .pt-xl-1, .py-xl-1 { padding-top: 0.25rem !important; } .pr-xl-1, .px-xl-1 { padding-right: 0.25rem !important; } .pb-xl-1, .py-xl-1 { padding-bottom: 0.25rem !important; } .pl-xl-1, .px-xl-1 { padding-left: 0.25rem !important; } .p-xl-2 { padding: 0.5rem !important; } .pt-xl-2, .py-xl-2 { padding-top: 0.5rem !important; } .pr-xl-2, .px-xl-2 { padding-right: 0.5rem !important; } .pb-xl-2, .py-xl-2 { padding-bottom: 0.5rem !important; } .pl-xl-2, .px-xl-2 { padding-left: 0.5rem !important; } .p-xl-3 { padding: 1rem !important; } .pt-xl-3, .py-xl-3 { padding-top: 1rem !important; } .pr-xl-3, .px-xl-3 { padding-right: 1rem !important; } .pb-xl-3, .py-xl-3 { padding-bottom: 1rem !important; } .pl-xl-3, .px-xl-3 { padding-left: 1rem !important; } .p-xl-4 { padding: 1.5rem !important; } .pt-xl-4, .py-xl-4 { padding-top: 1.5rem !important; } .pr-xl-4, .px-xl-4 { padding-right: 1.5rem !important; } .pb-xl-4, .py-xl-4 { padding-bottom: 1.5rem !important; } .pl-xl-4, .px-xl-4 { padding-left: 1.5rem !important; } .p-xl-5 { padding: 3rem !important; } .pt-xl-5, .py-xl-5 { padding-top: 3rem !important; } .pr-xl-5, .px-xl-5 { padding-right: 3rem !important; } .pb-xl-5, .py-xl-5 { padding-bottom: 3rem !important; } .pl-xl-5, .px-xl-5 { padding-left: 3rem !important; } .m-xl-auto { margin: auto !important; } .mt-xl-auto, .my-xl-auto { margin-top: auto !important; } .mr-xl-auto, .mx-xl-auto { margin-right: auto !important; } .mb-xl-auto, .my-xl-auto { margin-bottom: auto !important; } .ml-xl-auto, .mx-xl-auto { margin-left: auto !important; } } .text-monospace { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; } .text-justify { text-align: justify !important; } .text-nowrap { white-space: nowrap !important; } .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .text-left { text-align: left !important; } .text-right { text-align: right !important; } .text-center { text-align: center !important; } @media (min-width: 576px) { .text-sm-left { text-align: left !important; } .text-sm-right { text-align: right !important; } .text-sm-center { text-align: center !important; } } @media (min-width: 768px) { .text-md-left { text-align: left !important; } .text-md-right { text-align: right !important; } .text-md-center { text-align: center !important; } } @media (min-width: 992px) { .text-lg-left { text-align: left !important; } .text-lg-right { text-align: right !important; } .text-lg-center { text-align: center !important; } } @media (min-width: 1200px) { .text-xl-left { text-align: left !important; } .text-xl-right { text-align: right !important; } .text-xl-center { text-align: center !important; } } .text-lowercase { text-transform: lowercase !important; } .text-uppercase { text-transform: uppercase !important; } .text-capitalize { text-transform: capitalize !important; } .font-weight-light { font-weight: 300 !important; } .font-weight-normal { font-weight: 400 !important; } .font-weight-bold { font-weight: 700 !important; } .font-italic { font-style: italic !important; } .text-white { color: #fff !important; } .text-primary { color: #0074d9 !important; } a.text-primary:hover, a.text-primary:focus { color: #0059a6 !important; } .text-secondary { color: #6c757d !important; } a.text-secondary:hover, a.text-secondary:focus { color: #545b62 !important; } .text-success { color: #28a745 !important; } a.text-success:hover, a.text-success:focus { color: #1e7e34 !important; } .text-info { color: #17a2b8 !important; } a.text-info:hover, a.text-info:focus { color: #117a8b !important; } .text-warning { color: #ffc107 !important; } a.text-warning:hover, a.text-warning:focus { color: #d39e00 !important; } .text-danger { color: #d8241b !important; } a.text-danger:hover, a.text-danger:focus { color: #ab1c15 !important; } .text-light { color: #f8f9fa !important; } a.text-light:hover, a.text-light:focus { color: #dae0e5 !important; } .text-dark { color: #343a40 !important; } a.text-dark:hover, a.text-dark:focus { color: #1d2124 !important; } .text-body { color: #212529 !important; } .text-muted { color: #6c757d !important; } .text-black-50 { color: rgba(0, 0, 0, 0.5) !important; } .text-white-50 { color: rgba(255, 255, 255, 0.5) !important; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .visible { visibility: visible !important; } .invisible { visibility: hidden !important; } @media print { *, *::before, *::after { text-shadow: none !important; box-shadow: none !important; } a:not(.btn) { text-decoration: underline; } abbr[title]::after { content: " (" attr(title) ")"; } pre { white-space: pre-wrap !important; } pre, blockquote { border: 1px solid #adb5bd; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } @page { size: a3; } body { min-width: 992px !important; } .container { min-width: 992px !important; } .navbar { display: none; } .badge { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #dee2e6 !important; } .table-dark { color: inherit; } .table-dark th, .table-dark td, .table-dark thead th, .table-dark tbody + tbody { border-color: #dee2e6; } .table .thead-dark th { color: inherit; border-color: #dee2e6; } } body { background-color: #cacaca; padding: 0; margin: 0; } .navbar { padding-top: 20px; padding-bottom: 20px; transition: all 0.4s ease; } @media (max-width: 800px) { .navbar { background-color: #1a1818; } } .navbar .navbar-nav a { transition: 0.3s ease; text-decoration: none; text-align: center; font-weight: bold; } .navbar .navbar-nav { text-align: center; font-weight: bold; } .navbar .navbar-brand span { color: #ff0000; font-weight: bold; } .zana { background-color: #1a1818; padding: 10px; box-shadow: 0px 10px 25px -11px #000000bf; opacity: 1; border-bottom: 2px solid #ff0000; transition: all 0.4s ease; } .main { background-image: url("1.jpg"); background-position: center; background-repeat: no-repeat; background-size: cover; width: 100%; height: 100vh; overflow: hidden; } @media (min-width: 1401px) { .main { height: 680PX; } } .main .section { font-weight: 800; } .main .section .hero { padding-top: 250px; padding-left: 40px; } @media (max-width: 480px) { .main .section .hero { padding-top: 50%; padding-left: 20px; } } .main .section .hero h1 { font-weight: bold; margin-top: -16px; font-family: "Roboto", sans-serif; font-size: 55px; } @media (max-width: 480px) { .main .section .hero h1 { font-size: 38px; } } @media (min-width: 2081px) { .main .section .hero h1 { font-size: 85px; } } .main .section .hero h1 span { text-decoration: underline; } .container3 { padding-top: 50px; } .container3 h1 { color: #ff0000; font-family: "Roboto", sans-serif; font-weight: bold; padding-left: 15px; text-decoration: underline; } @media (max-width: 480px) { .container3 h1 { font-size: 38px; text-align: center; } } .container3 .row { padding-top: 10px; } .container3 .row img { box-shadow: 0px 2px 17px 2px #000000bf; width: 300px; height: 300px; border: 2px solid #ff0000; } .container3 .row p { font-weight: bold; text-align: left; } @media (max-width: 480px) { .container3 .row p { padding: 5px; } } .container4 { text-align: center; padding-top: 20px; padding-bottom: 10px; margin-top: 50px; } .container4 h1 { font-weight: bold; font-family: "Roboto", sans-serif; text-align: center; } .container4 hr { border: 2px solid #ff0000; width: 150px; } .container4 .fas { color: #ff0000; } .container5 { padding-top: 20px; padding-bottom: 10px; margin-top: 50px; background-color: #ff0000; color: #fff; } @media (max-width: 480px) { .container5 { text-align: center; } } .container5 h1 { padding-left: 50px; font-family: "Roboto", sans-serif; font-weight: bold; } @media (max-width: 480px) { .container5 h1 { padding-left: 0; } } .container5 ul { list-style: none; } .container5 ul li a { color: #fff; text-decoration: none; } .container6 h1 { color: #000; font-family: "Roboto", sans-serif; font-weight: bold; text-align: center; } .container6 hr { width: 200px; border: 2px solid #ff0000; text-align: center; } .container6 img { width: 100%; margin-left: 10px; margin-bottom: 10px; } /*# sourceMappingURL=style.cs.map */
using System; using System.Collections.Generic; using UnityEngine; class StandbyProcess : UniProcessModalEvent { public override ModalProcessType processType { get { return ModalProcessType.Process_Standby; } } public StandbyProcess() : base() { } //投币数显示 public static string[] CoinsNum = {"0","0"}; //初始化函数 public override void Initialization() { base.Initialization(); //#if _IgnoreVerify //#else //进入待机画面做一次完全安全验证 //如果验证失败了游戏就会被挂起 GameRoot.CompleteVerify_Current_Environment(); ////申请一次验证KEY //VerifyEnvironmentKey_LogoVideo = GameRoot.AllocVerifyEnvironmentKey(Guid.NewGuid().ToString()); //#endif//_IgnoreVerify //为了防止加载场景和IO卡线程冲突,这里暂时锁定,不释放资源 UniGameResources.LockUnloadUnusedAssets(); //加载游戏场景 //如果是调试模式就不需要加载场景了 if (ConsoleCenter.CurrentSceneWorkMode != SceneWorkMode.SCENEWORKMODE_Debug) { Application.LoadLevel(SystemCommand.FirstSceneName); } //加载完成后进行其他初始化 //投币代理 InputDevice.delegateInsertNewCoins = playerInsertCoins; } public static void playerInsertCoins(int coin, IParkourPlayer_Xiong.PlayerIndex index) { ConsoleCenter.OnPlayerInsertCoins(coin, index); UpdateCoinsUI(index); //if (GameRoot.gameProcessControl.currentProcess.processType == ModalProcessType.Process_GameOver) //{ // if (ConsoleCenter.IsCanStartGame()) // { // //加载完成后进行其他初始化 // ((RaceSceneControl)GameRoot.CurrentSceneControl).GameStart(); // ConsoleCenter.PlayerStartGamePayCoins(); // UpdateCoinsUI(); // } //} } ////刷新币数 public static void UpdateCoinsUI(IParkourPlayer_Xiong.PlayerIndex index) { //for (int i = 0; i < ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins.Length; i++) //{ //((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].gameObject.SetActive(false); //((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].gameObject.SetActive(false); int coins = ConsoleCenter.GetPlayerCoins(index); if (coins > 99) { coins = 99; } CoinsNum[(int)index] = coins.ToString(); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_GameCoins[(int)index].Text = CoinsNum[(int)index]; //如果已经进入游戏了,就什么都可以不用显示了 if (((RaceSceneControl)GameRoot.CurrentSceneControl).IsEnterStart(index)) { ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].gameObject.SetActive(false); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].gameObject.SetActive(false); } //如果不够开始游戏就提示投币 else if (!ConsoleCenter.IsCanStartGame(index)) { ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].gameObject.SetActive(false); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].gameObject.SetActive(true); if (((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].playStatus != GuiPlaneAnimationPlayer.PlayStatus.Status_Play) { ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].Stop(); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].Play(); } } else { ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowInsertCoins[(int)index].gameObject.SetActive(false); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].gameObject.SetActive(true); if (((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].playStatus != GuiPlaneAnimationPlayer.PlayStatus.Status_Play) { ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].Stop(); ((RaceSceneControl)GameRoot.CurrentSceneControl).m_ShowEnterJionGame[(int)index].Play(); } } } public override void OnUpdate() { base.OnUpdate(); //if (UniGameOptionsDefine.chargeMode == UniInsertCoinsOptionsFile.GameChargeMode.Mode_Free) //{ // if (GameRoot.gameProcessControl.currentProcess.processType == ModalProcessType.Process_GameOver) // { // if (InputDevice.ButtonLeft) // { // Debug.Log("开始游戏"); // if (ConsoleCenter.IsCanStartGame()) // { // Debug.Log("可以开始游戏"); // //加载完成后进行其他初始化 // ((RaceSceneControl)GameRoot.CurrentSceneControl).GameStart(); // ConsoleCenter.PlayerStartGamePayCoins(); // UpdateCoinsUI(); // } // } // } //} } //#if _IgnoreVerify //#else // //释放函数 // public override void Dispose() // { // GameRoot.RelaseVerifyEnvironmentKey(VerifyEnvironmentKey_LogoVideo); // } //#endif //_IgnoreVerify }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using DFrame; namespace DPYM { /// <summary> /// 警察类:相当于老板、老板娘、师傅 /// </summary> public class Police : GameElement { } }
using UnityEngine; using System.Collections; public class Twinkle : MonoBehaviour { public float twinkleDuration = 3.0f; public float twinkleSpeed = 30.0f; float twinkleTime = 0.0f; float time = 0.0f; // Use this for initialization void OnEnable() { twinkleTime = 0.0f; time = 0.0f; } // Update is called once per frame void Update () { if (Mathf.Sin(twinkleTime) > 0) { renderer.enabled = true; } else { renderer.enabled = false; } twinkleTime += Time.deltaTime * twinkleSpeed; time += Time.deltaTime; if (time >= twinkleDuration) { renderer.enabled = true; enabled = false; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening;//DOTweenを使用するため public class ItemFactory : MonoBehaviour { [SerializeField] GameObject[] ItemObject;//発射するオブジェクト [SerializeField] float span;//アイテムがたまるまでの間隔 [SerializeField] float delta;//溜めている時間 // Start is called before the first frame update void Start() { delta = 0; Move(); } // Update is called once per frame void Update() { if (!GManager.instance.IsBattle) { return; } delta += Time.deltaTime; if (span < delta) { delta = 0; MakeItem();//アイテムを1つ出す } } void MakeItem() { int SummonNum; SummonNum = Random.Range(0, 100); SummonNum %= ItemObject.Length; GameObject ItemObj = Instantiate(ItemObject[SummonNum]) as GameObject;//弾の生成 ItemObj.transform.position = new Vector3(this.transform.position.x, this.transform.position.y + 0.5f, this.transform.position.z);//自分の場所に出す } void Move() {//特定の地点を周回する int SelectMove; SelectMove = Random.Range(0, 100); SelectMove %= 2; switch (SelectMove) { case 0://広い範囲で周回する DOTween.Sequence().Append(transform.DOLocalMove(new Vector3(-7, 4.57f, 0), 1.0f)) .Append(transform.DOLocalMove(new Vector3(0, 4.57f, 0), 1.0f)) .Append(transform.DOLocalMove(new Vector3(7, 4.57f, 0), 1.0f)) .OnComplete(Move); break; case 1://狭い範囲で周回する DOTween.Sequence().Append(transform.DOLocalMove(new Vector3(-3, 4.57f, 0), 1.0f)) .Append(transform.DOLocalMove(new Vector3(0, 4.57f, 0), 1.0f)) .Append(transform.DOLocalMove(new Vector3(3, 4.57f, 0), 1.0f)) .OnComplete(Move); break; default: break; } } }
using System; using WorkScheduleManagement.Data.Entities.Users; namespace WorkScheduleManagement.Data.Entities.Requests { public abstract class Request : IEntity { public Guid Id { get; set; } public ApplicationUser Creator { get; set; } public RequestTypes RequestTypes { get; set; } public RequestStatuses RequestStatus { get; set; } public ApplicationUser Approver { get; set; } public DateTime CreatedAt { get; set; } public DateTime SentAt { get; set; } public string Comment { get; set; } } }
using System; using System.Collections.Generic; using UnityEngine; public class WorkerPathPreview : MonoBehaviour { [SerializeField] private LineRenderer lr = null; [SerializeField] private PathfindingAgent moveHelper = null; [SerializeField] private float zValue = -1; private void Update() { if(!Pause.isPaused()) { if(this.moveHelper != null && this.moveHelper.hasPath()) { this.lr.enabled = true; NavPath path = this.moveHelper.path; List<Vector3> points = new List<Vector3>(); points.Add(this.transform.position - Vector3.forward); for(int i = path.targetIndex; i < path.pointCount; i++) { points.Add((Vector3)path.getPoint(i).worldPos + Vector3.forward * this.zValue); } this.lr.positionCount = points.Count; Vector3[] a = points.ToArray(); Array.Reverse(a); this.lr.SetPositions(a); } else { this.lr.enabled = false; } } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using Skat; using System; namespace SkatUnitTest { [TestClass] public class UnitTest1 { [TestMethod] public void Under200000() //Test: Hvis prisen er under 200.000 { //Arrange int pris = 134000; int expected = 113900; //Act int actual = Skat.Afgift.BilAfgift(pris); //Assert Assert.AreEqual(actual, expected); } [TestMethod] public void Over200000() //Test: hvis prisen er over 200.000 { //Arrange int pris = 250000; int expected = 245000; //Act int actual = Skat.Afgift.BilAfgift(pris); //Assert Assert.AreEqual(actual, expected); } [TestMethod] public void Under0() //Test af exception { //Arrange int pris = -5; //Act try { Afgift.BilAfgift(pris); } //Assert catch (ArgumentException) { } } [TestMethod] public void ElBilUnder200000() //Test: hvis en elbil koster under 200000 { //Arrange int pris = 150000; int expected = 25500; //Act int actual = Skat.Afgift.ElBilAfgift(pris); //Assert Assert.AreEqual(actual, expected); } [TestMethod] public void ElBilOver200000() { //Arrange int pris = 250000; int expected = 49000; //Act int actual = Skat.Afgift.ElBilAfgift(pris); //Assert Assert.AreEqual(actual, expected); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using System.IO.Compression; using log4net; namespace PaletteInstaller.utils { class ZipTool { private static readonly ILog log = LogManager.GetLogger("ZipTool"); public bool CreateZipFileFromDirectory(string dirSource, string zipFileDest, bool addBaseDir) { bool result = true; try { ZipFile.CreateFromDirectory(dirSource, zipFileDest, CompressionLevel.Optimal, addBaseDir); }catch(Exception ex) { log.Error("Zip Tool Error: " + ex.Message); result = false; } return result; } public bool UnZipFile(string fileSource, string dirDest) { bool result = true; try { ZipFile.ExtractToDirectory(fileSource, dirDest); } catch (Exception ex) { log.Error("UnZip Tool Error: " + ex.Message); result = false; } return result; } } }
using System.Drawing; using System.Windows.Forms; using System; using Project.Windows; using System.Runtime.InteropServices; namespace Project.Drawing { /// <summary> /// スクリーンショット撮影クラス /// </summary> public class PrintScreen : CaptureAPI { /// <summary> /// プライマリスクリーンの画像を取得する /// </summary> /// <returns>プライマリスクリーンの画像</returns> public static Bitmap CaptureScreen() { //プライマリモニタのデバイスコンテキストを取得 IntPtr disDC = NativeMethod.GetDC(IntPtr.Zero); //Bitmapの作成 var bmp = new Bitmap( Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); //Graphicsの作成 using (var g = Graphics.FromImage(bmp)) { //Graphicsのデバイスコンテキストを取得 IntPtr hDC = g.GetHdc(); //Bitmapに画像をコピーする NativeMethod.BitBlt(hDC, 0, 0, bmp.Width, bmp.Height, disDC, 0, 0, NativeMethod.SRCCOPY); //解放 g.ReleaseHdc(hDC); } NativeMethod.ReleaseDC(IntPtr.Zero, disDC); //32bit return bmp; } /// <summary> /// アクティブなウィンドウの画像を取得する /// </summary> /// <returns>アクティブなウィンドウの画像</returns> public static Bitmap CaptureActiveWindow() { //アクティブなウィンドウのデバイスコンテキストを取得 IntPtr hWnd = WindowAPIWrapper.GetForegroundWindowHandle(); IntPtr hWinDC = NativeMethod.GetWindowDC(hWnd); //ウィンドウの大きさを取得 var winRect = new Rect(); NativeMethod.GetWindowRect(hWnd, ref winRect); //Bitmapの作成 var bmp = new Bitmap(winRect.Right - winRect.Left, winRect.Bottom - winRect.Top); //Graphicsの作成 using (var g = Graphics.FromImage(bmp)) { //Graphicsのデバイスコンテキストを取得 IntPtr hDC = g.GetHdc(); //Bitmapに画像をコピーする NativeMethod.BitBlt(hDC, 0, 0, bmp.Width, bmp.Height, hWinDC, 0, 0, NativeMethod.SRCCOPY); //解放 g.ReleaseHdc(hDC); } NativeMethod.ReleaseDC(hWnd, hWinDC); return bmp; } /// <summary> /// Windows10のドロップシャドウ対策入りのキャプチャ /// </summary> /// <returns></returns> public static Bitmap CaptureActiveWindow10() { //アクティブなウィンドウのデバイスコンテキストを取得 IntPtr hWnd = WindowAPIWrapper.GetForegroundWindowHandle(); IntPtr hWinDC = NativeMethod.GetWindowDC(hWnd); //ウィンドウの大きさを取得 var winRect = new Rect(); Rect bounds; NativeMethod.DwmGetWindowAttribute(hWnd, DWMWINDOWATTRIBUTE.DWMWA_EXTENDED_FRAME_BOUNDS, out bounds, Marshal.SizeOf(typeof(Rect))); NativeMethod.GetWindowRect(hWnd, ref winRect); //Bitmapの作成 var offsetX = bounds.Left - winRect.Left; var offsetY = bounds.Top - winRect.Top; var bmp = new Bitmap(bounds.Right - bounds.Left, bounds.Bottom - bounds.Top); //Graphicsの作成 using (var g = Graphics.FromImage(bmp)) { //Graphicsのデバイスコンテキストを取得 IntPtr hDC = g.GetHdc(); //Bitmapに画像をコピーする Int32 bmpWidth = bmp.Width; Int32 bmpHeight = bmp.Height; Console.WriteLine(winRect); NativeMethod.BitBlt(hDC, 0, 0, bmpWidth, bmpHeight, hWinDC, offsetX, offsetY, NativeMethod.SRCCOPY); //解放 g.ReleaseHdc(hDC); } NativeMethod.ReleaseDC(hWnd, hWinDC); return bmp; } } /// <summary> /// /// </summary> internal class WindowAPIWrapper : WindowAPI { /// <summary> /// /// </summary> /// <returns></returns> public static IntPtr GetForegroundWindowHandle() { return NativeMethod.GetForegroundWindow(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace jaytwo.Common.Extensions { public static class LinqExtensions { public static IEnumerable<T> DistinctBy<T, TKey>(this IEnumerable<T> enumerable, Func<T, TKey> selector) { return enumerable.GroupBy(selector).Select(x => x.First()); } private static Random randomizer = new Random(); public static IEnumerable<T> OrderByRandom<T>(this IEnumerable<T> enumerable) { return enumerable.OrderBy(x => randomizer.Next()); } public static T FirstRandom<T>(this IEnumerable<T> enumerable) { var enumerableAsList = (enumerable as IList<T>); if (enumerableAsList != null && enumerableAsList.Count > 0) { var index = randomizer.Next(enumerableAsList.Count); return enumerableAsList[index]; } else { return enumerable.OrderByRandom().First(); } } public static T FirstRandomOrDefault<T>(this IEnumerable<T> enumerable) { var enumerableAsList = (enumerable as IList<T>); if (enumerableAsList != null && enumerableAsList.Count > 0) { var index = randomizer.Next(enumerableAsList.Count); return enumerableAsList[index]; } else { return enumerable.OrderByRandom().FirstOrDefault(); } } } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using InstituteOfFineArts.Areas.Identity.Data; using InstituteOfFineArts.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; namespace InstituteOfFineArts.Controllers { [Authorize(Roles = "Administrator")] public class AdministratorsController : Controller { private readonly InstituteOfFineArtsContext _context; private readonly UserManager<CustomUser> _userManager; private readonly SignInManager<CustomUser> _signInManager; private readonly ILogger<AdministratorsController> _logger; public AdministratorsController(ILogger<AdministratorsController> logger, UserManager<CustomUser> userManager, InstituteOfFineArtsContext context, SignInManager<CustomUser> signInManager) { _logger = logger; _userManager = userManager; _context = context; _signInManager = signInManager; } // Define input model public InputModel Input { get; set; } public InputModel2 Input2 { get; set; } public class InputModel2 { [Required] [DataType(DataType.Password)] [Display(Name = "Current password")] public string OldPassword { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New password")] public string NewPassword { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm new password")] [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] public string ConfirmPassword { get; set; } } public class InputModel { [Required] [RegularExpression("^[A-Za-z0-9]+$", ErrorMessage = "Input invalid")] [Display(Name = "User Name")] public string UserName { get; set; } [Required] [Display(Name = "Full Name")] public string FullName { get; set; } [Required] [Display(Name = "Address")] public string Address { get; set; } [Required] [Phone] [Display(Name = "Phone Number")] public string Phone { get; set; } [Required] [DataType(DataType.Date)] [Display(Name = "Date Of Birth")] public DateTime DateOfBirth { get; set; } [Required] public Gender Gender { get; set; } [Required] [EmailAddress] [Display(Name = "Email")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } public string RoleName { get; set; } } // Get list user of each role public async Task<IActionResult> Index() { var Administrators = await _userManager.GetUsersInRoleAsync("Administrator"); ViewData["Administrators"] = Administrators.Where(a=>a.Status == AccountStatus.Activate).Count(); var managers = await _userManager.GetUsersInRoleAsync("Manager"); ViewData["Managers"] = managers.Where(a => a.Status == AccountStatus.Activate).Count(); var staffs = await _userManager.GetUsersInRoleAsync("Staff"); ViewData["Staffs"] = staffs.Where(a => a.Status == AccountStatus.Activate).Count(); var students = await _userManager.GetUsersInRoleAsync("Student"); ViewData["Students"] = students.Where(a => a.Status == AccountStatus.Activate).Count(); return View(); } public async Task<IActionResult> AccountList() { // get admin list var adminList = await _userManager.GetUsersInRoleAsync("Administrator"); ViewData["AdminList"] = adminList.Where(a => a.Status == AccountStatus.Activate).ToList(); // get manager list var managerList = await _userManager.GetUsersInRoleAsync("Manager"); ViewData["ManagerList"] = managerList.Where(a => a.Status == AccountStatus.Activate).ToList(); // get staff list var staffList = await _userManager.GetUsersInRoleAsync("Staff"); ViewData["StaffList"] = staffList.Where(a => a.Status == AccountStatus.Activate).ToList(); // get student list var studentList = await _userManager.GetUsersInRoleAsync("Student"); ViewData["StudentList"] = studentList.Where(a => a.Status == AccountStatus.Activate).ToList(); return View(); } // Get data to the create form public IActionResult Create() { ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); return View(); } // Do create task [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Create(InputModel input) { if (ModelState.IsValid) { if (input.DateOfBirth >= DateTime.Now.Date) { ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); TempData["Faile"] = "Invalid Date of Birth!"; return View(); } var accountNameExist = _context.Users.Where(a => a.UserName == input.UserName).Count(); if (accountNameExist > 0) { ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); TempData["Faile"] = "Account name already taken!"; return View(); } var accountEmailExist = _context.Users.Where(a => a.Email == input.Email).Count(); if (accountEmailExist > 0) { ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); TempData["Faile"] = "Email already taken!"; return View(); } var accountPhoneExist = _context.Users.Where(a => a.PhoneNumber == input.Phone).Count(); if (accountPhoneExist > 0) { ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); TempData["Faile"] = "Phone number already taken!"; return View(); } var user = new CustomUser { FullName = input.FullName, UserName = input.UserName, Email = input.Email, Gender = input.Gender, Address = input.Address, PhoneNumber = input.Phone, DateOfBirth = input.DateOfBirth, CreatedAt = DateTime.Now, UpdatedAt = DateTime.Now, Status = AccountStatus.Activate }; var createUserResult = await _userManager.CreateAsync(user, input.Password); var createUserRoleResult = await _userManager.AddToRoleAsync(user, input.RoleName); if (createUserResult.Succeeded && createUserRoleResult.Succeeded) { TempData["Success"] = "Created success."; return RedirectToAction(nameof(AccountList)); } } ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", "Student"); return View(); } // Get detail data by id public async Task<IActionResult> Details(string id) { if (id == null) { return NotFound(); } var accountDetail = await _context.Users.FindAsync(id); if (accountDetail == null) { return NotFound(); } if (accountDetail.Status == AccountStatus.Inactivate) { return NotFound(); } var accountRole = await _userManager.GetRolesAsync(accountDetail); ViewData["AccountRole"] = accountRole; return View(accountDetail); } // Get data to the edit form public async Task<IActionResult> Edit(string id) { if (id == null) { return NotFound(); } var user = await _context.Users.FindAsync(id); if (user == null) { return NotFound(); } if (user.Status == AccountStatus.Inactivate) { return NotFound(); } var currentRole = await _userManager.GetRolesAsync(user); ViewData["RoleList"] = new SelectList(_context.Roles, "Name", "Name", currentRole[0]); return View(user); } // Do edit task [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Edit(string id, CustomUser user, string role) { if (id != user.Id) { return NotFound(); } if (ModelState.IsValid) { try { var customUser = await _userManager.FindByIdAsync(id); if (customUser.Status == AccountStatus.Inactivate) { return NotFound(); } customUser.FullName = user.FullName; customUser.Address = user.Address; customUser.PhoneNumber = user.PhoneNumber; customUser.DateOfBirth = user.DateOfBirth; customUser.Gender = user.Gender; customUser.Email = user.Email; var userRole = await _userManager.GetRolesAsync(customUser); await _userManager.RemoveFromRoleAsync(customUser, userRole[0]); await _userManager.AddToRoleAsync(customUser, role); await _userManager.UpdateAsync(customUser); } catch (DbUpdateConcurrencyException) { if (!UserExist(user.Id)) { return NotFound(); } else { throw; } } TempData["Success"] = "Edited success!"; return RedirectToAction(nameof(AccountList)); } return View(user); } public async Task<IActionResult> MyAccount() { var user = await GetCurrentUserAsync(); ViewData["Role"] = _context.Roles.Find(_context.UserRoles.Where(c => c.UserId == user.Id).Single().RoleId); return View(user); } public IActionResult ChangePassword() { return View(); } [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> ChangePassword(InputModel2 input2) { if (ModelState.IsValid) { var user = await GetCurrentUserAsync(); var changePasswordResult = await _userManager.ChangePasswordAsync(user, input2.OldPassword, input2.NewPassword); if (!changePasswordResult.Succeeded) { TempData["Faile"] = "Current password is not correct!"; return View(); } await _signInManager.RefreshSignInAsync(user); TempData["Success"] = "Password has changed!"; return RedirectToAction(nameof(MyAccount)); } return View(); } public async Task<IActionResult> Delete(string id) { if (id == null) { return NotFound(); } var accountDetail = await _context.Users.FindAsync(id); if (accountDetail.Status == AccountStatus.Inactivate) { return NotFound(); } var accountRole = await _userManager.GetRolesAsync(accountDetail); ViewData["AccountRole"] = accountRole; if (accountDetail == null) { return NotFound(); } return View(accountDetail); } [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] public async Task<IActionResult> DeleteConfirmed(string id) { var user = await _context.Users.FindAsync(id); user.Status = AccountStatus.Inactivate; _context.Users.Update(user); await _context.SaveChangesAsync(); TempData["Success"] = "Deleted success!"; return RedirectToAction(nameof(AccountList)); } private Task<CustomUser> GetCurrentUserAsync() => _userManager.GetUserAsync(HttpContext.User); private bool UserExist(string id) { return _context.Users.Any(e => e.Id == id); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace CarValueApi.Model { public class Root { /// <summary> /// Make input of the car /// </summary> public string make { get; set; } /// <summary> /// Model input of the car /// </summary> public string model { get; set; } /// <summary> /// Year input of the car /// </summary> public int year { get; set; } /// <summary> /// Year of purchase input of the car /// </summary> public int yearOfPurchase { get; set; } /// <summary> /// Price input of the car /// </summary> public int price { get; set; } /// <summary> /// Color input of the car /// </summary> public string color { get; set; } /// <summary> /// Milage input of the car /// </summary> public int milage { get; set; } /// <summary> /// Plate number input of the car /// </summary> public string plateNumber { get; set; } internal decimal DetermineMarketValue() { decimal CarYearValue; if (year < 2000) { //myCarValue = Convert.ToInt32(PriceBought * 0.42); CarYearValue = -Convert.ToInt32(price * 0.20); } else if (year >= 2000 || year <= 2001) { CarYearValue = -Convert.ToInt32(price * 0.18); } else if (year >= 2002 || year <= 2003) { CarYearValue = -Convert.ToInt32(price * 0.16); } else if (year >= 2004 || year <= 2005) { CarYearValue = -Convert.ToInt32(price * 0.14); } else if (year >= 2006 || year <= 2007) { CarYearValue = -Convert.ToInt32(price * 0.12); } else if (year >= 2008 || year <= 2009) { CarYearValue = -Convert.ToInt32(price * 0.10); } else if (year >= 2010 || year <= 2011) { CarYearValue = -Convert.ToInt32(price * 0.08); } else if (year >= 2012 || year <= 2012) { CarYearValue = price - Convert.ToInt32(price * 0.06); } else if (year >= 2013 || year <= 2014) { CarYearValue = -Convert.ToInt32(price * 0.04); } else if (year >= 2015 || year <= 2016) { CarYearValue = -Convert.ToInt32(price * 0.02); } else if (year >= 2017 || year <= 2018) { CarYearValue = -Convert.ToInt32(price * 0.02); } else if (year >= 2019 || year <= 2020) { CarYearValue = -Convert.ToInt32(price * 0.01); } else if (year == 2021) { CarYearValue = -Convert.ToInt32(price * 0.01); } else { CarYearValue = price; } return CarYearValue; } internal decimal YearsUsed() { int CarValueAfterNumberOfYears; int numberOfYearsUsed; numberOfYearsUsed = yearOfPurchase - year; if (numberOfYearsUsed == 0) { CarValueAfterNumberOfYears = 0; } else if (numberOfYearsUsed == 1 || numberOfYearsUsed == 2) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.01); } else if (numberOfYearsUsed == 3 || numberOfYearsUsed == 4) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.02); } else if (numberOfYearsUsed == 5 || numberOfYearsUsed == 6) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.04); } else if (numberOfYearsUsed == 7 || numberOfYearsUsed == 8) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.06); } else if (numberOfYearsUsed == 9 || numberOfYearsUsed == 10) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.08); } else if (numberOfYearsUsed == 11 || numberOfYearsUsed == 12) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.10); } else if (numberOfYearsUsed == 13 || numberOfYearsUsed == 14) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.12); } else if (numberOfYearsUsed == 15 || numberOfYearsUsed == 16) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.14); } else if (numberOfYearsUsed == 17 || numberOfYearsUsed == 18) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.14); } else if (numberOfYearsUsed == 19 || numberOfYearsUsed == 20) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.16); } else if (numberOfYearsUsed == 21) { CarValueAfterNumberOfYears = -Convert.ToInt32(price * 0.16); } else { CarValueAfterNumberOfYears = 0; } return CarValueAfterNumberOfYears; } internal int Milage() { int carMilageValue; if (milage <= 20000) { carMilageValue = 0; } else if (milage >= 20000 && milage < 40000) { carMilageValue = -Convert.ToInt32(price * 0.05); } else if (milage >= 40000 && milage < 80000) { carMilageValue = -Convert.ToInt32(price * 0.10); } else if (milage >= 80000 && milage < 120000) { carMilageValue = -Convert.ToInt32(price * 0.15); } else if (milage >= 120000) { carMilageValue = -Convert.ToInt32(price * 0.20); } else { carMilageValue = 0; } return carMilageValue; } internal decimal CurrentCarValue() { decimal purr = Convert.ToDecimal(YearsUsed() + DetermineMarketValue() + Milage()); decimal currentPrices = price + purr; return currentPrices; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace com.Sconit.PrintModel { public class SpecialBarCode { public string Code { get; set; } public string Desc1 { get; set; } public string Desc2 { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lesson6 { interface NewInterface { double Add(); } interface NewInterface2 { double Add(); } class SomeClass : NewInterface, NewInterface2 { double NewInterface.Add() { return 2; } double NewInterface2.Add() { return 2; } } }
using FamilyAccounting.DAL.Connection; using FamilyAccounting.DAL.Entities; using FamilyAccounting.DAL.Interfaces; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Threading.Tasks; namespace FamilyAccounting.DAL.Repositories { public class AuditRepository : IAuditRepository { private readonly string connectionString; public AuditRepository(DbConfig dbConfig) { connectionString = dbConfig.ConnectionString; } public IEnumerable<AuditAction> GetActions() { string sqlProcedure = "PR_Audit_Actions_Read"; List<AuditAction> table = new List<AuditAction>(); using (SqlConnection con = new SqlConnection(connectionString)) { con.Open(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { int sourceId = reader.IsDBNull("id_wallet_source") ? 0 : reader.GetInt32("id_wallet_source"); int targetId = reader.IsDBNull("id_wallet_target") ? 0 : reader.GetInt32("id_wallet_target"); int categoryId = reader.IsDBNull("id_category") ? 0 : reader.GetInt32("id_category"); string description = reader.IsDBNull("description") ? "" : reader.GetString("description"); Transaction transaction = new Transaction { Id = reader.GetInt32("id"), SourceWalletId = sourceId, TargetWalletId = targetId, CategoryId = categoryId, Amount = reader.GetDecimal("amount"), TimeStamp = reader.GetDateTime("timestamp"), State = reader.GetBoolean("success"), Description = description }; AuditAction audit = new AuditAction { Transaction = transaction, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } reader.Close(); } return table; } public IEnumerable<AuditWallet> GetWallets() { string sqlProcedure = "PR_Audit_Wallets_Read"; List<AuditWallet> table = new List<AuditWallet>(); using (SqlConnection con = new SqlConnection(connectionString)) { con.Open(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { Wallet wallet = new Wallet { Id = reader.GetInt32("id"), PersonId = reader.GetInt32("id_person"), Description = reader.GetString("description"), IsActive = reader.GetBoolean("inactive") }; AuditWallet audit = new AuditWallet { Wallet = wallet, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } reader.Close(); } return table; } public IEnumerable<AuditPerson> GetPersons() { string sqlProcedure = "PR_Audit_Persons_Read"; List<AuditPerson> table = new List<AuditPerson>(); using (SqlConnection con = new SqlConnection(connectionString)) { con.Open(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { Person person = new Person { Id = reader.GetInt32("id"), FirstName = reader.GetString("name"), LastName = reader.GetString("surname"), Email = reader.GetString("email"), Phone = reader.GetString("phone"), IsActive = !reader.GetBoolean("inactive") }; AuditPerson audit = new AuditPerson { Person = person, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } reader.Close(); } return table; } public async Task<IEnumerable<AuditAction>> GetActionsAsync() { string sqlProcedure = "PR_Audit_Actions_Read"; List<AuditAction> table = new List<AuditAction>(); using (SqlConnection con = new SqlConnection(connectionString)) { await con.OpenAsync(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = await cmd.ExecuteReaderAsync(); if (reader.HasRows) { while (await reader.ReadAsync()) { int sourceId = reader.IsDBNull("id_wallet_source") ? 0 : reader.GetInt32("id_wallet_source"); int targetId = reader.IsDBNull("id_wallet_target") ? 0 : reader.GetInt32("id_wallet_target"); int categoryId = reader.IsDBNull("id_category") ? 0 : reader.GetInt32("id_category"); string description = reader.IsDBNull("description") ? "" : reader.GetString("description"); Transaction transaction = new Transaction { Id = reader.GetInt32("id"), SourceWalletId = sourceId, TargetWalletId = targetId, CategoryId = categoryId, Amount = reader.GetDecimal("amount"), TimeStamp = reader.GetDateTime("timestamp"), State = reader.GetBoolean("success"), Description = description }; AuditAction audit = new AuditAction { Transaction = transaction, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } await reader.CloseAsync(); } return table; } public async Task<IEnumerable<AuditWallet>> GetWalletsAsync() { string sqlProcedure = "PR_Audit_Wallets_Read"; List<AuditWallet> table = new List<AuditWallet>(); using (SqlConnection con = new SqlConnection(connectionString)) { await con.OpenAsync(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = await cmd.ExecuteReaderAsync(); if (reader.HasRows) { while (await reader.ReadAsync()) { Wallet wallet = new Wallet { Id = reader.GetInt32("id"), PersonId = reader.GetInt32("id_person"), Description = reader.GetString("description"), IsActive = reader.GetBoolean("inactive") }; AuditWallet audit = new AuditWallet { Wallet = wallet, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } await reader.CloseAsync(); } return table; } public async Task<IEnumerable<AuditPerson>> GetPersonsAsync() { string sqlProcedure = "PR_Audit_Persons_Read"; List<AuditPerson> table = new List<AuditPerson>(); using (SqlConnection con = new SqlConnection(connectionString)) { await con.OpenAsync(); SqlCommand cmd = new SqlCommand(sqlProcedure, con) { CommandType = CommandType.StoredProcedure }; SqlDataReader reader = await cmd.ExecuteReaderAsync(); if (reader.HasRows) { while (await reader.ReadAsync()) { Person person = new Person { Id = reader.GetInt32("id"), FirstName = reader.GetString("name"), LastName = reader.GetString("surname"), Email = reader.GetString("email"), Phone = reader.GetString("phone"), IsActive = !reader.GetBoolean("inactive") }; AuditPerson audit = new AuditPerson { Person = person, Type = reader.GetString("crud_type"), Time = reader.GetDateTime("crud_time") }; table.Add(audit); } } await reader.CloseAsync(); } return table; } } }
using BattleEngine.Actors.Damages; namespace BattleEngine.Actors.Bullets { public class BattleBullet : BattleObject { public virtual void update(int tick, int deltaTick) { } public virtual BattleDamage generateDamage() { return null; } public virtual bool needRemove { get { return false; } } public virtual bool needGenerateDamage { get { return false; } } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; [RequireComponent(typeof(MovingComponent))] [RequireComponent(typeof(RotatorComponent))] [RequireComponent(typeof(ChargerComponent))] public class PropulsorComponent : MonoBehaviour, IDebugDrawable { [SerializeField] private bool CanAlwaysPropulse = false; [SerializeField] private float MinPropulsionSpeed = 5f; [SerializeField] private float MaxPropulsionSpeed = 20f; [SerializeField] private float MaxPressedPropulsionTime = 2f; [SerializeField] private float _NeutralPropulsionRatio = 0.5f; [SerializeField] private float _GoodPropulsionRatio = 0.3f; [SerializeField] private float SlowTime = 0.5f; [SerializeField] private float SlowTimeSpeed = 2f; [SerializeField] private bool UseCameraShake = true; [SerializeField] private float CameraShakeTime = 2f; [SerializeField] private float PropulsingCameraShakeAmount = 2f; [SerializeField] private float MinCameraShakeAmount = 2f; [SerializeField] private float MaxCameraShakeAmount = 5f; [SerializeField] private GameObject ReactorParticle = null; [SerializeField] private GameObject ChargeParticle = null; [SerializeField] private ParticleSystem PropulsionParticle = null; [SerializeField] private float WaitTimeToReactivateRotator = 1f; [SerializeField] private AudioSource PropulsionChargeSound = null; [SerializeField] private AudioSource PropulsionImpulseSound = null; [SerializeField] private AudioSource PropulsionCancelSound = null; public float NeutralPropulsionThreshold { get { return _NeutralPropulsionRatio; } } public float GoodPropulsionThreshold { get { return NeutralPropulsionThreshold + _GoodPropulsionRatio; } } public float BadPropulsionThreshold { get { return 1f; } } public class OnCanPropulseEvent : UnityEvent { } public OnCanPropulseEvent OnCanPropulseStartEvent { get; } = new OnCanPropulseEvent(); public OnCanPropulseEvent OnCanPropulseEndEvent { get; } = new OnCanPropulseEvent(); public class OnPropulseEvent : UnityEvent { } public OnPropulseEvent OnPropulseStartEvent { get; } = new OnPropulseEvent(); public OnPropulseEvent OnPropulseEndEvent { get; } = new OnPropulseEvent(); public OnPropulseEvent OnPropulseCancelEvent { get; } = new OnPropulseEvent(); private List<GameObject> NearComets = new List<GameObject>(); private EnergySupplierComponent CurrentEnergySupplier = null; private float CurrentPressedPropulsionTime = -1f; private MovingComponent MovingComp = null; private RotatorComponent RotatorComp = null; private ChargerComponent ChargerComp = null; private ShipOrbitalComponent ShipOrbitalComp = null; private ShakeComponent CameraShakeComp = null; private float CurrentWaitTimeBeforeReactivatingRotator = -1f; public bool CanPropulse { get { return CanAlwaysPropulse || ChargerComp.CurrentNumRecharge > 0 || NearComets.Count > 0 || (ShipOrbitalComp && ShipOrbitalComp.OrbitalState == ShipOrbitalComponent.EOrbitalState.InInnerRadius); } } public bool IsPropulsing { get { return CurrentPressedPropulsionTime >= 0f; } } public bool IsValidPropulsion { get { return IsPropulsing && CurrentPropulsionRatio > NeutralPropulsionThreshold; } } public float CurrentPropulsionRatio { get { return IsPropulsing ? CurrentPressedPropulsionTime / MaxPressedPropulsionTime : 0f; } } EnergySupplierComponent GetLinkedEnergySupplier() { NearComets.RemoveAll(x => x == null); if (ShipOrbitalComp && ShipOrbitalComp.Planet && ShipOrbitalComp.OrbitalState == ShipOrbitalComponent.EOrbitalState.InInnerRadius) { return ShipOrbitalComp.Planet.GetComponent<EnergySupplierComponent>(); } else if ( NearComets.Count > 0 ) { return NearComets[0].GetComponent<EnergySupplierComponent>(); } return null; } void UpdateEnergySupplier() { EnergySupplierComponent NewSupplier = GetLinkedEnergySupplier(); if (CurrentEnergySupplier != NewSupplier) { CurrentEnergySupplier = NewSupplier; if (ChargerComp.IsRecharging) { ChargerComp.UpdateAvailability(CurrentEnergySupplier ? CurrentEnergySupplier.AvailableEnergy : 0); } else if (CurrentEnergySupplier) { ChargerComp.StartRecharge(CurrentEnergySupplier.AvailableEnergy); } } } void ResetPropulse() { if (CameraShakeComp) { CameraShakeComp.StopContinuousShakeCamera(); } CurrentPressedPropulsionTime = -1f; Time.timeScale = 1f; // Reset slow-mo on soundtrack UpdateAudioAccordingToTimeScale(Time.timeScale); if (ChargeParticle) { ChargeParticle.SetActive(false); } if (PropulsionChargeSound) { PropulsionChargeSound.Stop(); } ChargerComp.StopRecharge(); CurrentEnergySupplier = null; } void CancelPropulse( bool PlaySound = true ) { ResetPropulse(); OnPropulseCancelEvent.Invoke(); if (PlaySound && PropulsionCancelSound) { PropulsionCancelSound.Play(); } if (ReactorParticle) { ReactorParticle.SetActive(false); } } private void UpdateAudioAccordingToTimeScale(float timeScale) { if (!GameManager.Instance) return; GameManager.Instance.UpdateAudioAccordingToTimeScale(timeScale); } void StartPropulse() { if (CanPropulse) { CurrentPressedPropulsionTime = 0f; OnPropulseStartEvent.Invoke(); if (UseCameraShake && CameraShakeComp) { CameraShakeComp.ContinuousShakeCamera(PropulsingCameraShakeAmount); } if (ChargeParticle) { ChargeParticle.SetActive(true); } if (ReactorParticle) { ReactorParticle.SetActive(true); } if (PropulsionChargeSound) { PropulsionChargeSound.Play(); } UpdateEnergySupplier(); } } void UpdatePropulse() { if (IsPropulsing) { CurrentPressedPropulsionTime += Time.unscaledDeltaTime; float newTimeScale = Time.timeScale - SlowTimeSpeed * Time.unscaledDeltaTime; if (newTimeScale > SlowTime) { Time.timeScale = newTimeScale; } else { Time.timeScale = SlowTime; } // Add a slow-mo effect on in-game audio UpdateAudioAccordingToTimeScale(Time.timeScale); if (CurrentPressedPropulsionTime > MaxPressedPropulsionTime) { OnCanPropulseEndEvent.Invoke(); CancelPropulse(); if (ShipUnit.Instance) { ShipUnit.Instance.Explode(); } else { Debug.LogWarning("No Ship Instance found, will not be able to die"); } } UpdateEnergySupplier(); } } void EndPropulse() { if (IsValidPropulsion) { OnPropulseEndEvent.Invoke(); if (PropulsionParticle) { PropulsionParticle.Play(); if (WaitTimeToReactivateRotator > 0) { CurrentWaitTimeBeforeReactivatingRotator = WaitTimeToReactivateRotator; RotatorComp.enabled = false; } } if (PropulsionImpulseSound) { PropulsionImpulseSound.Play(); } NearComets.RemoveAll(x => x == null); if (NearComets.Count > 0) { GameObject NearestComet = NearComets[0]; NearComets.RemoveAt(0); Destroy(NearestComet); } else { ChargerComp.UseCharge(); } float CameraShakeAmount = MinCameraShakeAmount + (MaxCameraShakeAmount - MinCameraShakeAmount) * CurrentPropulsionRatio; MovingComp.CurrentSpeed = MinPropulsionSpeed + (MaxPropulsionSpeed - MinPropulsionSpeed) * CurrentPropulsionRatio; if (RotatorComp.MeshRotated) { transform.rotation = RotatorComp.MeshRotated.rotation; RotatorComp.MeshRotated.localRotation = Quaternion.identity; } if (UseCameraShake && CameraShakeComp) { CameraShakeComp.ShakeCamera(CameraShakeTime, CameraShakeAmount); } } else if (IsPropulsing) { CancelPropulse(); } ResetPropulse(); } private void OnPause(bool IsPaused) { if (IsPropulsing) { CancelPropulse(); } else { ResetPropulse(); } } private void Awake() { MovingComp = GetComponent<MovingComponent>(); RotatorComp = GetComponent<RotatorComponent>(); ChargerComp = GetComponent<ChargerComponent>(); ShipOrbitalComp = GetComponentInChildren<ShipOrbitalComponent>(); if (ChargeParticle) { ChargeParticle.SetActive(false); } if (ReactorParticle) { ReactorParticle.SetActive(false); } } private void Start() { CameraShakeComp = FindObjectOfType<ShakeComponent>(); if (GameManager.Instance) { GameManager.Instance.OnPauseUnpauseEvent.AddListener(OnPause); } DebugDrawHelper.RegisterDrawable(gameObject, this); } private void OnDestroy() { DebugDrawHelper.UnregisterDrawable(gameObject, this); if (GameManager.Instance) { GameManager.Instance.OnPauseUnpauseEvent.RemoveListener(OnPause); } OnCanPropulseEndEvent.Invoke(); CancelPropulse(false); } private void Update() { if (GameManager.Instance && GameManager.Instance.IsInPause) { return; } if (CurrentWaitTimeBeforeReactivatingRotator > 0f) { CurrentWaitTimeBeforeReactivatingRotator -= Time.deltaTime; if (CurrentWaitTimeBeforeReactivatingRotator < 0f) { RotatorComp.enabled = true; if (ReactorParticle) { ReactorParticle.SetActive(false); } } } if ( IsPropulsing && !CanPropulse ) { CancelPropulse(); } if ( Input.GetKeyDown( KeyCode.Space ) ) { StartPropulse(); } if ( Input.GetKey( KeyCode.Space ) ) { UpdatePropulse(); } if ( Input.GetKeyUp( KeyCode.Space ) ) { EndPropulse(); } } GameObject GetCometFromCollider(Collider other) { if (other.CompareTag("Comet")) { return other.gameObject; } else if (other.CompareTag("DynamicObjectTrigger")) { CometComponent ChildComp = other.gameObject.GetComponentInChildren<CometComponent>(); if (ChildComp) { return ChildComp.gameObject; } } return null; } private void OnTriggerEnter(Collider other) { GameObject Comet = GetCometFromCollider(other); if (Comet) { NearComets.Add(Comet); if (NearComets.Count == 1) { OnCanPropulseStartEvent.Invoke(); } } } private void OnTriggerExit(Collider other) { GameObject Comet = GetCometFromCollider(other); if (Comet) { NearComets.Remove(Comet); if (NearComets.Count == 0) { OnCanPropulseEndEvent.Invoke(); } } } public void DebugDraw(ref Rect BasePos, float TextYIncrement, GUIStyle Style) { #if UNITY_EDITOR string PropulsingValue = "[NONE]"; if (CurrentPropulsionRatio < NeutralPropulsionThreshold) { PropulsingValue = "[NEUTRAL]"; } else if (CurrentPropulsionRatio < GoodPropulsionThreshold) { PropulsingValue = "[GOOD]"; } else { PropulsingValue = "[BAD]"; } GUI.Label(BasePos, "- " + (IsPropulsing ? "Propulsing " + (100f * CurrentPropulsionRatio).ToString("F2") + " " + PropulsingValue : "Not propulsing..."), Style); BasePos.y += TextYIncrement; GUI.Label(BasePos, "- Time scale " + Time.timeScale, Style); BasePos.y += TextYIncrement; GUI.Label(BasePos, "- " + NearComets.Count + " comets around", Style); BasePos.y += TextYIncrement; if (CurrentEnergySupplier) { GUI.Label(BasePos, "- Energy supplier " + CurrentEnergySupplier.name, Style); BasePos.y += TextYIncrement; } else { GUI.Label(BasePos, "- No energy supplier around", Style); BasePos.y += TextYIncrement; } if (CurrentWaitTimeBeforeReactivatingRotator > 0f) { GUI.Label(BasePos, "- Wait time before rotation " + CurrentWaitTimeBeforeReactivatingRotator + "s", Style); BasePos.y += TextYIncrement; } #endif } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SamuraiWalkBack : MonoBehaviour { /* public SamuraiBehaviour samurai; //public Transform target; public float speed; float distance; */ public SamuraiBehaviour samurai; public AstarSamurai samuraiAStar; public Vector3 moveVector; public Transform targetPlayer; public Rigidbody2D rb; public float speed = 100; float distance; // Start is called before the first frame update void Start() { speed = 100; samurai = GetComponentInChildren<SamuraiBehaviour>(); samuraiAStar = GetComponent<AstarSamurai>(); rb = GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update() { targetPlayer = GameObject.FindGameObjectWithTag("Player2").transform; distance = (targetPlayer.position - transform.position).magnitude; moveVector = -(targetPlayer.position - transform.position).normalized; Debug.Log("---------------------DISTANCIA" + distance); Vector3 direction = (transform.position - targetPlayer.transform.position).normalized; rb.AddForce(direction * speed); Invoke("ReactivateAstar", 2); } public void ReactivateAstar() { //samuraiAStar.attacking = true; samurai.Astar.enabled = true; samurai.WalkBack.enabled = false; } }
#if UNITY_2019_1_OR_NEWER using UnityEditor; using UnityEngine.UIElements; using UnityAtoms.Editor; using UnityAtoms.MonoHooks; namespace UnityAtoms.MonoHooks.Editor { /// <summary> /// Event property drawer of type `ColliderGameObject`. Inherits from `AtomEventEditor&lt;ColliderGameObject, ColliderGameObjectEvent&gt;`. Only availble in `UNITY_2019_1_OR_NEWER`. /// </summary> [CustomEditor(typeof(ColliderGameObjectEvent))] public sealed class ColliderGameObjectEventEditor : AtomEventEditor<ColliderGameObject, ColliderGameObjectEvent> { } } #endif
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Linq; using System.Windows.Forms; using System.Reflection; using DevExpress.XtraEditors; using DevExpress.XtraVerticalGrid; using DevExpress.XtraVerticalGrid.Events; using IRAP.Global; using IRAP.Entity.MDM; using IRAP.WCF.Client.Method; namespace IRAP_FVS_LSSIVO.UserControls { public partial class ucOperatorSkillsMatrix : ucCustomFVSKanban { private string className = MethodBase.GetCurrentMethod().DeclaringType.FullName; private int communityID = 0; private int t102LeafID = 0; private int t134LeafID = 0; private string shotTime = ""; private long sysLogID = 0; //private List<SkillMatrix> operators = new List<SkillMatrix>(); private List<OperatorSkillMatrix> operators = new List<OperatorSkillMatrix>(); public ucOperatorSkillsMatrix() { InitializeComponent(); } private void GetOperatorSkillMatrix( int communityID, int t102LeafID, int t134LeafID, string shotTime, long sysLogID) { string strProcedureName = string.Format( "{0}.{1}", className, MethodBase.GetCurrentMethod().Name); WriteLog.Instance.WriteBeginSplitter(strProcedureName); try { operators.Clear(); int errCode = 0; string errText = ""; //List<OperatorSkillMatrix> datas = new List<OperatorSkillMatrix>(); IRAPMDMClient.Instance.ufn_GetSkillMatrix_Operators( communityID, t102LeafID, t134LeafID, shotTime, sysLogID, ref operators, out errCode, out errText); WriteLog.Instance.Write( string.Format("({0}){1}", errCode, errText), strProcedureName); if (errCode == 0) { //for (int i = 0; i < datas.Count; i += 2) //{ // SkillMatrix op = new SkillMatrix() // { // T216Name1 = datas[i].T216Name, // UserName1 = datas[i].UserName, // QualificationLevel1 = datas[i].QualificationLevel, // }; // if (i + 1 < datas.Count) // { // op.T216Name2 = datas[i + 1].T216Name; // op.UserName2 = datas[i + 1].UserName; // op.QualificationLevel2 = datas[i + 1].QualificationLevel; // } // operators.Add(op); //} //grdOperatorSkillMatrixs.DataSource = operators; vgrdOperatorSkills.DataSource = operators; } FillGridDataWidth(); } finally { WriteLog.Instance.WriteEndSplitter(strProcedureName); } } public void SetSearchCondition( int communityID, int t102LeafID, int t134LeafID, string shotTime, long sysLogID) { this.communityID = communityID; this.t102LeafID = t102LeafID; this.t134LeafID = t134LeafID; this.shotTime = shotTime; this.sysLogID = sysLogID; GetOperatorSkillMatrix( communityID, t102LeafID, t134LeafID, shotTime, sysLogID); } private void FillGridDataWidth() { if (operators.Count > 0) { int recordWidth = (vgrdOperatorSkills.Width - vgrdOperatorSkills.RowHeaderWidth) / operators.Count; if (recordWidth > vgrdOperatorSkills.RecordMinWidth) { vgrdOperatorSkills.RecordWidth = recordWidth; vgrdOperatorSkills.ScrollVisibility = ScrollVisibility.Vertical; } else { vgrdOperatorSkills.ScrollVisibility = ScrollVisibility.Auto; } } } private void vgrdOperatorSkills_CustomDrawRowValueCell(object sender, CustomDrawRowValueCellEventArgs e) { if (e.Row == rowUserName) { if (e.RecordIndex >= 0 && e.RecordIndex < operators.Count) { switch (operators[e.RecordIndex].QualificationLevel) { case 2: e.Appearance.BackColor = Color.FromArgb(255, 192, 128); e.Appearance.ForeColor = Color.Black; break; case 3: e.Appearance.BackColor = Color.Red; e.Appearance.ForeColor = Color.White; break; default: break; } } } } } internal class SkillMatrix { public string T216Name1 { get; set; } public string UserName1 { get; set; } public int QualificationLevel1 { get; set; } public string T216Name2 { get; set; } public string UserName2 { get; set; } public int QualificationLevel2 { get; set; } } }
public class Player { public string Name { get; } public int Id { get; } public Category[] Scoreboard { get; } = { new Category("Ones"), new Category("Twos"), new Category("Threes"), new Category("Fours"), new Category("Fives"), new Category("Sixes"), new Category("OnePair"), new Category("TwoPair"), new Category("Three of a kind"), new Category("Four o a kind"), new Category("Small straight"), new Category("Large straight"), new Category("Full house"), new Category("Chance"), new Category("Yatzy") }; public Player(string name) { Name = name; } public bool HasFullScoreboard() { foreach (Category score in Scoreboard) { if (!score.IsScored) return false; } return true; } public int GetTotalScore() { int total = 0; foreach (Category score in Scoreboard) { total += score.Val; } return total; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class UnlockableDoor : Unlockable { public float doorOpening = 0.25f; public float doorOpeningTime = 1.0f; // how long (in seconds) will it take to open the door? public float doorOpenDuration = 5.0f; // how long (in seconds) will the door be open for? private Vector3 originalPosL, originalPosR; // initial position of left and right door private Transform transformL, transformR; private Transform playerTransform; // time before door locks private float timeToLock = 0.0f; // Start is called before the first frame update protected virtual void Start() { foreach (Transform t in GetComponentsInChildren<Transform>()) { if (t.gameObject.name == "LDoor") { originalPosL = t.localPosition; transformL = t; } else if (t.gameObject.name == "RDoor") { originalPosR = t.localPosition; transformR = t; } } //Logger.Log("LDoor original: " + originalPosL); //Logger.Log("RDoor original: " + originalPosR); playerTransform = GameObject.Find("Player").transform; } protected virtual bool CanUnlock() { return Input.GetKeyDown(KeyCode.Space) && !isUnlocked && DistanceCheck(); } // Update is called once per frame protected override void Update() { if (timeToLock <= 0.0f || !CanUnlock()) { if (isUnlocked) { //Logger.Log("Locking!"); timeToLock = doorOpeningTime; } Lock(); } if (CanUnlock() && !isUnlocked) { //Logger.Log("Unlocking!"); timeToLock = doorOpenDuration + doorOpeningTime; //Logger.Log("ttl: " + timeToLock); Unlock(); } else if(!CanUnlock() && isUnlocked) { Lock(); } else if(isUnlocked) { timeToLock -= Time.deltaTime; Unlock(); } else if(!isUnlocked) { timeToLock -= Time.deltaTime; Lock(); } } public override void Unlock() { float t = doorOpeningTime - (timeToLock - doorOpenDuration); //Logger.Log("t=" + t); t /= doorOpeningTime; //Logger.Log("Step is " + t.ToString()); isUnlocked = true; transformL.localPosition = Vector3.Lerp(transformL.localPosition, new Vector3(originalPosL.x - doorOpening, originalPosL.y, originalPosL.z), t); transformR.localPosition = Vector3.Lerp(transformR.localPosition, new Vector3(originalPosR.x + doorOpening, originalPosR.y, originalPosR.z), t); } public override void Lock() { float t = doorOpeningTime - timeToLock; //Logger.Log("t=" + t); t /= doorOpeningTime; //Logger.Log("Step is " + t.ToString()); isUnlocked = false; transformL.localPosition = Vector3.Lerp(transformL.localPosition, originalPosL, t); transformR.localPosition = Vector3.Lerp(transformR.localPosition, originalPosR, t); } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace _005_ExtendingModelClass.Models { [MetadataTypeAttribute(typeof(GeneroMetadata))] partial class Genero { public sealed class GeneroMetadata { public int Codigo { get; set; } [Required(ErrorMessage = "O nome é obrigatório")] public String Nome { get; set; } [Required(ErrorMessage = "O sexo é obrigatório")] public char Sexo { get; set; } private GeneroMetadata() { } } } }
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Kadastr.Data.DB { class Entity { public static IQueryable<TEntity> Select<TEntity>() where TEntity : class { AppDBContent context = new AppDBContent(); // Здесь мы можем указывать различные настройки контекста, // например выводить в отладчик сгенерированный SQL-код context.Database.Log = (s => System.Diagnostics.Debug.WriteLine(s)); // Загрузка данных с помощью универсального метода Set return context.Set<TEntity>(); } public static void Update<TEntity>(TEntity entity) where TEntity : class { AppDBContent context = new AppDBContent(); // Настройки контекста context.Database.Log = (s => System.Diagnostics.Debug.WriteLine(s)); context.Entry<TEntity>(entity).State = EntityState.Modified; context.SaveChanges(); } /// <summary> /// Запись одного поля в базу данных /// </summary> public static void Insert<TEntity>(TEntity entity) where TEntity : class { // Настройки контекста AppDBContent context = new AppDBContent(); context.Database.Log = (s => System.Diagnostics.Debug.WriteLine(s)); context.Entry(entity).State = EntityState.Added; context.SaveChanges(); } /// <summary> /// Запись нескольких полей в БД /// </summary> public static void Inserts<TEntity>(IEnumerable<TEntity> entities) where TEntity : class { // Настройки контекста AppDBContent context = new AppDBContent(); // Отключаем отслеживание и проверку изменений для оптимизации вставки множества полей context.Configuration.AutoDetectChangesEnabled = false; context.Configuration.ValidateOnSaveEnabled = false; context.Database.Log = (s => System.Diagnostics.Debug.WriteLine(s)); foreach (TEntity entity in entities) context.Entry(entity).State = EntityState.Added; context.SaveChanges(); context.Configuration.AutoDetectChangesEnabled = true; context.Configuration.ValidateOnSaveEnabled = true; } public static void Delete<TEntity>(TEntity entity) where TEntity : class { // Настройки контекста AppDBContent context = new AppDBContent(); context.Database.Log = (s => System.Diagnostics.Debug.WriteLine(s)); context.Entry<TEntity>(entity).State = EntityState.Deleted; context.SaveChanges(); } } }
using ConsolePiano.InstrumentalNote; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsolePiano { public interface IPianoKey { MusicalTone Tone { get; set; } string Alias { get; set; } void Play(DefaultInstrumentNote instrumentNote); } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SimpleMove : MonoBehaviour { private void Start() { } // Update is called once per frame void Update() { var pos = transform.position; if (Input.GetKey(KeyCode.W)) pos.y = pos.y + 1f * Time.deltaTime; else if (Input.GetKey(KeyCode.S)) pos.y = pos.y + -1f * Time.deltaTime; else if (Input.GetKey(KeyCode.D)) pos.x = pos.x + 1f * Time.deltaTime; else if (Input.GetKey(KeyCode.A)) pos.x = pos.x - 1f * Time.deltaTime; transform.position = pos; } }
namespace Customer { public enum CustomerType { //One-time , Regular, Golden, Diamond Onetime, Regular, Golden, Diamond } }
using MD.PersianDateTime; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace iGarson_App.Models { [Serializable] public class Orders { public int id { get; set; } public string pay { get; set; } public string person { get; set; } public int table { get; set; } public string status { get; set; } public string fullCost { get; set; } public string explain { get; set; } public string created_at { get; set; } public PersianDateTime persianDate { get; set; } public List<OrderList> list { get; set; } public int maxTime { get; set; } public string Info { get; set; } } }
using Plugin.GoogleAnalytics.Abstractions; using Plugin.GoogleAnalytics.Abstractions.Model; namespace Plugin.GoogleAnalytics { public sealed partial class PlatformInfoProvider : IPlatformInfoProvider { public PlatformInfoProvider() { var device = new DeviceInfo(); ScreenResolution = device.Display; UserLanguage = device.LanguageCode; UserAgent = device.UserAgent; ViewPortResolution = device.ViewPortResolution; Version = device.VersionNumber; GetAnonymousClientId(device); } } }
using DChild.Gameplay.Environment; using DChild.Gameplay.Player; using DChild; using UnityEngine; using DChild.Gameplay; public class RopeSegment : MonoBehaviour, IInteractable { public Vector3 position => transform.position; private Rigidbody2D m_rigidbody; public new Rigidbody2D rigidbody { get { return m_rigidbody; } } public IInteractable Interact(Player player) { player.transform.SetParent(transform); var body = player.GetComponent<IsolatedPhysics2D>(); body.Disable(); return this; } private void Start() { m_rigidbody = GetComponent<Rigidbody2D>(); } }
using System; using System.Globalization; namespace HastaOtomasyonLib { public abstract class Insan { #region Fields private string _ad, _soyad, _telefon; #endregion #region Properties public string Ad { get { return _ad; } set { _ad = AdSoyadHazirla(value); } } public string Soyad { get { return _soyad; } set { _soyad = AdSoyadHazirla(value); } } public string TCKN { get; set; } public Insan() { string tckn = string.Empty; do { string guid = Guid.NewGuid().ToString().Replace("-", ""); foreach (char item in guid) { if (tckn.Length == 11) break; if (char.IsDigit(item)) tckn += item; } } while (tckn.Length != 11); TCKN = tckn; } public string Telefon { get { return _telefon; } set { if (value.Length != 10) throw new Exception("Telefon numarasını hatalı girdiniz"); foreach (char item in value) { if (!char.IsDigit(item)) throw new Exception("Telefon içerisinde sadece rakam bulunmalıdır"); } _telefon = value; } } public abstract DateTime DogumTarihi { get; set; } public int Yas { get { return YasHesapla(); } } public Cinsiyetler Cinsiyet { get; set; } private string AdSoyadHazirla(string kelime) { foreach (char harf in kelime) { if (!(char.IsLetter(harf) || char.IsWhiteSpace(harf))) throw new Exception("Ad veya Soyad içerisinde geçersiz karakter kullandınız."); } if (kelime.Trim().Length < 2) throw new Exception("Ad ve Soyad en az 2 karakter olmalı"); return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(kelime); } #endregion #region Methods private int YasHesapla() { return DateTime.Now.Year - DogumTarihi.Year; } #endregion public override string ToString() { return $"{Ad} {Soyad}"; } } public enum Cinsiyetler { Kadın, Erkek } }
namespace Sila.Services.MongoDb { using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using MongoDB.Driver; using MongoDB.Driver.Linq; using Sila.Models.Database; using Sila.Options; /// <summary> /// The service for interacting with MongoDb. /// </summary> public class MongoDbService : IMongoDbService { private readonly IMongoDatabase _database; /// <summary> /// The service for interacting with MongoDb. /// </summary> /// <param name="mongoDbOptions">The MongoDb options to use.</param> public MongoDbService(MongoDbOptions mongoDbOptions) { if (mongoDbOptions == null) throw new ArgumentNullException(nameof(mongoDbOptions)); MongoClient mongoClient = new MongoClient(mongoDbOptions.ConnectionString); _database = mongoClient.GetDatabase(mongoDbOptions.Database); } /// <summary> /// Get a collection. /// </summary> /// <param name="collection">The name of the collection.</param> /// <typeparam name="T">The type of documents stored in the collection.</typeparam> /// <returns>A queryable collection.</returns> public IMongoQueryable<T> GetCollection<T>(String collection) where T : IDatabaseObject { return _database.GetCollection<T>(collection).AsQueryable(); } /// <summary> /// Insert a document into a collection. /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="document">The document to insert.</param> /// <typeparam name="T">The type of the document.</typeparam> /// <returns>A task representing the operation.</returns> public Task InsertDocumentAsync<T>(String collection, T document) where T : IDatabaseObject { return _database.GetCollection<T>(collection).InsertOneAsync(document); } /// <summary> /// Insert documents into a collection. /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="documents">The documents to insert.</param> /// <typeparam name="T">The type of the documents.</typeparam> /// <returns>A task representing the operation.</returns> public Task InsertDocumentsAsync<T>(String collection, IEnumerable<T> documents) where T : IDatabaseObject { if (documents == null) throw new ArgumentNullException(nameof(documents)); return _database.GetCollection<T>(collection).InsertManyAsync(documents); } /// <summary> /// Add an item to a set on a given path. /// Dot notation path example: prop1.0.nestedProp /// { /// prop1: [ /// { /// nestedProp: [ /// ... /// ] /// }, /// ... /// ] /// } /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">The filter for the root item to update.</param> /// <param name="dotNotationPath">The dot notation path. See example in summary.</param> /// <param name="item">The item to add to the set.</param> /// <typeparam name="TDocument">The type of the root item.</typeparam> /// <typeparam name="TItem">The type of the item to add to the set.</typeparam> /// <returns>A task representing the operation.</returns> public Task AddItemToSet<TDocument, TItem>(String collection, Expression<Func<TDocument, Boolean>> filter, String dotNotationPath, TItem item) where TDocument : IDatabaseObject { UpdateDefinition<TDocument> updateDefinition = Builders<TDocument>.Update.AddToSet(dotNotationPath, item); return _database.GetCollection<TDocument>(collection).UpdateOneAsync(filter, updateDefinition); } /// <summary> /// Add a property to an object. /// Example 1: dotNotationPath = null, propertyName = "newProp", item = "newValue" /// { /// "oldProp": ..., /// "OtherOldProp": { ... }, /// "newProp": "newValue" /// } /// Example 2: dotNotationPath = "OtherOldProp", propertyName = "newProp", item = "newValue" /// { /// "oldProp": ..., /// "OtherOldProp": /// { /// "newProp": "newValue", /// ... /// } /// } /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">The filter for the root item to update.</param> /// <param name="dotNotationPath">The dot notation path. Null indicates to add it to the root item. See example in summary.</param> /// <param name="propertyName">The name of the property to add.</param> /// <param name="item">The item to add as the value of the property.</param> /// <typeparam name="TDocument">The type of the root item.</typeparam> /// <typeparam name="TItem">The type of the item to add as a property.</typeparam> /// <returns>A task representing the operation.</returns> public Task AddPropertyToObject<TDocument, TItem>(String collection, Expression<Func<TDocument, Boolean>> filter, String? dotNotationPath, String propertyName, TItem item) where TDocument : IDatabaseObject { // Check if we need to add a '.' in the middle for nested objects. String fullDotNotationPath = dotNotationPath != null ? $"{dotNotationPath}.{propertyName}" : propertyName; UpdateDefinition<TDocument> updateDefinition = Builders<TDocument>.Update.Set(fullDotNotationPath, item); return _database.GetCollection<TDocument>(collection).UpdateOneAsync(filter, updateDefinition); } /// <summary> /// Add a property to objects matching the filter. /// Example 1: dotNotationPath = null, propertyName = "newProp", item = "newValue" /// { /// "oldProp": ..., /// "OtherOldProp": { ... }, /// "newProp": "newValue" /// } /// Example 2: dotNotationPath = "OtherOldProp", propertyName = "newProp", item = "newValue" /// { /// "oldProp": ..., /// "OtherOldProp": /// { /// "newProp": "newValue", /// ... /// } /// } /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">The filter for the root items to update.</param> /// <param name="dotNotationPath">The dot notation path. Null indicates to add it to the root items. See example in summary.</param> /// <param name="propertyName">The name of the property to add.</param> /// <param name="item">The item to add as the value of the property.</param> /// <typeparam name="TDocument">The type of the root items.</typeparam> /// <typeparam name="TItem">The type of the item to add as a property.</typeparam> /// <returns>A task representing the operation.</returns> public Task AddPropertyToObjects<TDocument, TItem>(String collection, Expression<Func<TDocument, Boolean>> filter, String? dotNotationPath, String propertyName, TItem item) where TDocument : IDatabaseObject { // Check if we need to add a '.' in the middle for nested objects. String fullDotNotationPath = dotNotationPath != null ? $"{dotNotationPath}.{propertyName}" : propertyName; UpdateDefinition<TDocument> updateDefinition = Builders<TDocument>.Update.Set(fullDotNotationPath, item); return _database.GetCollection<TDocument>(collection).UpdateManyAsync(filter, updateDefinition); } /// <summary> /// Add properties to an object. See 'AddPropertyToObject' for an example as this behaves the same way. /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">The filter for the root item to update.</param> /// <param name="updateDefinitions">The list of update definitions.</param> /// <typeparam name="TDocument">The type of the root item.</typeparam> /// <returns>A task representing the operation.</returns> public Task AddPropertiesToObject<TDocument>(String collection, Expression<Func<TDocument, Boolean>> filter, IEnumerable<StackableUpdateDefinition> updateDefinitions) where TDocument : IDatabaseObject { // Ensure the update definitions contains items if (updateDefinitions == null || !updateDefinitions.Any()) { return Task.CompletedTask; } UpdateDefinition<TDocument>? stackedUpdateDefinitions = null; foreach (StackableUpdateDefinition updateDefinition in updateDefinitions) { // Check if we need to add a '.' in the middle for nested objects. String fullDotNotationPath = updateDefinition.DotNotationPath != null ? $"{updateDefinition.DotNotationPath}.{updateDefinition.PropertyName}" : updateDefinition.PropertyName; // Create or add to the current update definition chain stackedUpdateDefinitions = stackedUpdateDefinitions?.Set(fullDotNotationPath, updateDefinition.Item) ?? Builders<TDocument>.Update.Set(fullDotNotationPath, updateDefinition.Item); } return _database.GetCollection<TDocument>(collection).UpdateOneAsync(filter, stackedUpdateDefinitions); } /// <summary> /// Remove a property from an object. /// Example 1: dotNotationPath = null, propertyName = "newProp" /// { /// "oldProp": ..., /// "OtherOldProp": { ... }, /// /// "newProp": "newValue" // This property would be removed /// } /// Example 2: dotNotationPath = "OtherOldProp", propertyName = "newProp" /// { /// "oldProp": ..., /// "OtherOldProp": /// { /// "newProp": "newValue", // This property would be removed /// ... /// } /// } /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">The filter for the root item to update.</param> /// <param name="dotNotationPath">The dot notation path. Null indicates to remove it to the root item. See example in summary.</param> /// <param name="propertyName">The name of the property to remove.</param> /// <typeparam name="TDocument">The type of the root item.</typeparam> /// <returns>A task representing the operation.</returns> public Task RemovePropertyFromObject<TDocument>(String collection, Expression<Func<TDocument, Boolean>> filter, String? dotNotationPath, String propertyName) where TDocument : IDatabaseObject { // Check if we need to add a '.' in the middle for nested objects. String fullDotNotationPath = dotNotationPath != null ? $"{dotNotationPath}.{propertyName}" : propertyName; UpdateDefinition<TDocument> updateDefinition = Builders<TDocument>.Update.Unset(fullDotNotationPath); return _database.GetCollection<TDocument>(collection).UpdateOneAsync(filter, updateDefinition); } /// <summary> /// Remove a document from a collection. /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">A filter for the document to remove.</param> /// <typeparam name="T">The type of the document to remove.</typeparam> /// <returns>A task representing the operation.</returns> public Task RemoveDocumentAsync<T>(String collection, Expression<Func<T, Boolean>> filter) where T : IDatabaseObject { return _database.GetCollection<T>(collection).DeleteOneAsync(filter); } /// <summary> /// Remove documents from a collection. /// </summary> /// <param name="collection">The name of the collection.</param> /// <param name="filter">A filter for the documents to remove from the collection.</param> /// <typeparam name="T">The type of documents to remove from the collection.</typeparam> /// <returns>A task representing the operation.</returns> public Task RemoveDocumentsAsync<T>(String collection, Expression<Func<T, Boolean>> filter) where T : IDatabaseObject { return _database.GetCollection<T>(collection).DeleteManyAsync(filter); } /// <summary> /// Find the first index of an element matching a predicate in the provided mongo queryable. /// </summary> /// <param name="mongoQueryable">The mongo queryable.</param> /// <param name="predicate">The predicate.</param> /// <typeparam name="T">The type of document.</typeparam> /// <returns>The index of the element of null otherwise.</returns> public async Task<Int32?> GetIndex<T>(IMongoQueryable<T> mongoQueryable, Func<T, Boolean> predicate) where T : IDatabaseObject { // Ensure the arguments are not null if (mongoQueryable == null) throw new ArgumentNullException(nameof(mongoQueryable)); // Get the cursor IAsyncCursor<T> cursor = await mongoQueryable.ToCursorAsync().ConfigureAwait(false); // Move the first batch onto the cursor Boolean documentsAvailable = await cursor.MoveNextAsync().ConfigureAwait(false); Int32 index = 0; while (documentsAvailable) { foreach (T item in cursor.Current) { if (predicate(item)) return index; index++; } documentsAvailable = await cursor.MoveNextAsync().ConfigureAwait(false); } return null; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MMDB.Extensions { public static class StringExtensions { public static String Substring(this String str, String start, String end) { int from = str.IndexOf(start, StringComparison.Ordinal) + start.Length; int to = str.LastIndexOf(end, StringComparison.Ordinal); return str.Substring(from, to - from); } } }
using UnityAtoms.Mobile; namespace UnityAtoms.Mobile { /// <summary> /// Action of type `TouchUserInputPair`. Inherits from `AtomAction&lt;TouchUserInputPair&gt;`. /// </summary> [EditorIcon("atom-icon-purple")] public abstract class TouchUserInputPairAction : AtomAction<TouchUserInputPair> { } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using VRTK; //Script used to fix a bug where you could grab a fractured chunk while it was still in a static Fractured Object. public class StaticGrabCorrector : MonoBehaviour { FracturedChunk cScript; bool DEBUG = false; VRTK_InteractableObject vio; void Start () { vio = gameObject.GetComponent<VRTK_InteractableObject> (); cScript = gameObject.GetComponent<FracturedChunk>(); vio.isGrabbable = false; } // Update is called once per frame void Update () { if (cScript.IsDetachedChunk) { if(DEBUG) Debug.Log ("Chunk is Detached"); vio.isGrabbable = true; } } }
using System; namespace Belatrix.JobLogger.Exceptions { public class JobLoggerManagerException : Exception { public JobLoggerManagerException() { } public JobLoggerManagerException(string message) : base(message) { } public JobLoggerManagerException(string message, Exception inner) : base(message, inner) { } } }
using QRCoder; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.IO; namespace Anywhere2Go.Library { public class QRCodeGenerate { public string GenQRCode(string data) { try { QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(data, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeImage = qrCode.GetGraphic(20); MemoryStream ms = new MemoryStream(); qrCodeImage.Save(ms,ImageFormat.Png); byte[] b = ms.ToArray(); var qrCodeImg = "data:image/png;base64," + Convert.ToBase64String(b); return qrCodeImg; } catch (Exception) { throw; } } } public static class QRHelper { public static string GenerateQrCode(string data) { try { QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(data, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeImage = qrCode.GetGraphic(20); MemoryStream ms = new MemoryStream(); qrCodeImage.Save(ms, ImageFormat.Png); byte[] b = ms.ToArray(); var qrCodeImg = "data:image/png;base64," + Convert.ToBase64String(b); return qrCodeImg; } catch (Exception) { throw; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Threading; namespace Win32.Devices { public enum DeviceType { Port, Interface } public class DeviceInfo { public DeviceType DeviceType; public Guid ClassGuid; public string Name; public DeviceInfo(DeviceType deviceType, Guid classGuid, string name) { DeviceType = deviceType; ClassGuid = classGuid; Name = name; } } /// <summary> /// This class provides device add/remove event notification based on the device class GUID /// </summary> public class DeviceListener : NativeWindow, IDisposable { [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr RegisterDeviceNotification(IntPtr recipient, IntPtr notificationFilter, int flags); [DllImport("user32.dll")] private static extern bool UnregisterDeviceNotification(IntPtr handle); [DllImport("kernel32.dll")] static extern uint GetLastError(); [StructLayout(LayoutKind.Sequential)] public struct DEV_BROADCAST_HDR { public int dbch_size; public int dbch_devicetype; public int dbch_reserved; } [StructLayout(LayoutKind.Sequential)] public struct DEV_BROADCAST_DEVICEINTERFACE { public int dbcc_size; public int dbcc_devicetype; public int dbcc_reserved; public Guid dbcc_classguid; // Name is variable length //internal short Name; } const int WM_DEVICECHANGE = 0x0219; const int WM_DESTROY = 0x0002; const int DBT_DEVICEARRIVAL = 0x8000; const int DBT_DEVICEREMOVECOMPLETE = 0x8004; const int DBT_DEVTYPE_PORT = 0x0003; const int DBT_DEVTYP_DEVICEINTERFACE = 0x0005; const int DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000; const int DEVICE_NOTIFY_ALL_INTERFACE_CLASSES = 0x00000004; const int HWND_MESSAGE = -3; public event Action<DeviceInfo> DeviceArrived = delegate { }; public event Action<DeviceInfo> DeviceRemoveCompleted = delegate { }; private ApplicationContext context = new ApplicationContext(); private Nullable<DeviceType> deviceType = null; /// <summary> /// Creates a DeviceListener that listens for devices that implement /// the specified interface class. Note that this is different than /// the "device class guid" shown in Device Manager, which is /// technically the "device setup class". The guid that must be /// specified here is an identifier for the "device interface class". /// </summary> /// <param name="classGuid"></param> public DeviceListener(Guid classGuid) { deviceType = DeviceType.Interface; Initialize(classGuid); } /// <summary> /// Creates a DeviceListener that listens for devices of the specified /// type. /// </summary> /// <param name="deviceType"></param> public DeviceListener(DeviceType deviceType) { this.deviceType = deviceType; Initialize(new Guid()); } /// <summary> /// Creates a DeviceListener that listens for all ports and device /// interfaces /// </summary> public DeviceListener() { Initialize(new Guid()); } private void Initialize(Guid guid) { // This is a little complicated by the fact that the window must // be created on the same thread that does the processing, but we // want to be able to forward exceptions during initialization to // the caller on the calling thread. // // This works by signaling an event when initialization is // complete and setting an exception reference if one occurred. var initialized = new System.Threading.AutoResetEvent(false); var notificationHandle = new IntPtr(0); Exception exception = null; var notificationThread = new Thread(new ThreadStart(() => { try { CreateHandle(new CreateParams()); // Register for additional device notifications // (WM_DEVICECHANGE messages) beyond what a window // receives by default. notificationHandle = RegisterForDeviceNotifications(guid); } catch (Exception e) { exception = e; } finally { initialized.Set(); } try { // Run the message loop. All the WM_DEVICECHANGE // processing will happen from this context. Application.Run(context); } finally { // Need to always unregister the device notification // handle and the window handle created during the call // to CreateHandle if (notificationHandle != IntPtr.Zero) UnregisterDeviceNotification(notificationHandle); ReleaseHandle(); } })); // Start the thread and wait for the initialization to occur // before returning. notificationThread.Start(); initialized.WaitOne(); // If an exception occured while initizing the windo or // notification registration, re-throw it now. if (exception != null) throw exception; } private IntPtr RegisterForDeviceNotifications(Guid guid) { var filter = new DEV_BROADCAST_DEVICEINTERFACE(); filter.dbcc_size = Marshal.SizeOf(filter) + 4; filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; filter.dbcc_reserved = 0; filter.dbcc_classguid = guid; var flags = guid == new Guid() ? DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES : DEVICE_NOTIFY_WINDOW_HANDLE; var ptr = Marshal.AllocHGlobal(Marshal.SizeOf(filter) + 4); Marshal.StructureToPtr(filter, ptr, false); var handle = RegisterDeviceNotification(this.Handle, ptr, guid == new Guid() ? DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES : DEVICE_NOTIFY_WINDOW_HANDLE); Marshal.FreeHGlobal(ptr); if (handle == IntPtr.Zero) { throw new Exception("RegisterDeviceNotification failed: " + GetLastError()); } return handle; } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { context.ExitThread(); } } protected override void WndProc(ref Message m) { if (m.Msg == WM_DEVICECHANGE) { if (m.WParam.ToInt64() == DBT_DEVICEARRIVAL) { var header = (DEV_BROADCAST_HDR)Marshal.PtrToStructure( m.LParam, typeof(DEV_BROADCAST_HDR)); if (header.dbch_devicetype == DBT_DEVTYPE_PORT) { if (deviceType == DeviceType.Port || deviceType == null) { var name = Marshal.PtrToStringAuto(new IntPtr( m.LParam.ToInt64() + Marshal.SizeOf(typeof(DEV_BROADCAST_HDR)))); DeviceArrived(new DeviceInfo( DeviceType.Port, new Guid(), name)); } } else if (header.dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { if (deviceType == DeviceType.Interface || deviceType == null) { var di = (DEV_BROADCAST_DEVICEINTERFACE)Marshal.PtrToStructure( m.LParam, typeof(DEV_BROADCAST_DEVICEINTERFACE)); var name = Marshal.PtrToStringAuto(new IntPtr( m.LParam.ToInt64() + Marshal.SizeOf(typeof(DEV_BROADCAST_DEVICEINTERFACE)))); DeviceArrived(new DeviceInfo( DeviceType.Interface, di.dbcc_classguid, name)); } } } else if (m.WParam.ToInt64() == DBT_DEVICEREMOVECOMPLETE) { var header = (DEV_BROADCAST_HDR)Marshal.PtrToStructure( m.LParam, typeof(DEV_BROADCAST_HDR)); if (header.dbch_devicetype == DBT_DEVTYPE_PORT) { if (deviceType == DeviceType.Port || deviceType == null) { var name = Marshal.PtrToStringAuto(new IntPtr( m.LParam.ToInt64() + Marshal.SizeOf(typeof(DEV_BROADCAST_HDR)))); DeviceRemoveCompleted(new DeviceInfo( DeviceType.Port, new Guid(), name)); } } else if (header.dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { if (deviceType == DeviceType.Interface || deviceType == null) { var di = (DEV_BROADCAST_DEVICEINTERFACE)Marshal.PtrToStructure( m.LParam, typeof(DEV_BROADCAST_DEVICEINTERFACE)); var name = Marshal.PtrToStringAuto(new IntPtr( m.LParam.ToInt64() + Marshal.SizeOf(typeof(DEV_BROADCAST_DEVICEINTERFACE)))); DeviceRemoveCompleted(new DeviceInfo( DeviceType.Interface, di.dbcc_classguid, name)); } } } } base.WndProc(ref m); } } }
using System.Collections.Generic; namespace Atc.XUnit { /// <summary> /// TestResult. /// </summary> public class TestResult { /// <summary> /// Initializes a new instance of the <see cref="TestResult"/> class. /// </summary> /// <param name="text">The text.</param> public TestResult(string text) { this.IsError = false; this.IndentLevel = 0; this.Text = text; } /// <summary> /// Initializes a new instance of the <see cref="TestResult"/> class. /// </summary> /// <param name="indentLevel">The indent level.</param> /// <param name="text">The text.</param> public TestResult(int indentLevel, string text) { if (indentLevel < 0) { indentLevel = 1; } this.IsError = true; this.IndentLevel = indentLevel; this.Text = text; } /// <summary> /// Initializes a new instance of the <see cref="TestResult"/> class. /// </summary> /// <param name="isError">if set to <c>true</c> [is error].</param> /// <param name="indentLevel">The indent level.</param> /// <param name="text">The text.</param> public TestResult(bool isError, int indentLevel, string text) { if (indentLevel < 0) { indentLevel = 1; } this.IsError = isError; this.IndentLevel = indentLevel; this.Text = text; } /// <summary> /// Initializes a new instance of the <see cref="TestResult"/> class. /// </summary> /// <param name="indentLevel">The indent level.</param> /// <param name="text">The text.</param> /// <param name="subLines">The sub lines.</param> public TestResult(int indentLevel, string text, List<string> subLines) { if (indentLevel < 0) { indentLevel = 1; } this.IsError = true; this.IndentLevel = indentLevel; this.Text = text; this.SubLines = subLines; } /// <summary> /// Gets a value indicating whether this instance is error. /// </summary> /// <value> /// <c>true</c> if this instance is error; otherwise, <c>false</c>. /// </value> public bool IsError { get; } /// <summary> /// Gets the indent level. /// </summary> /// <value> /// The indent level. /// </value> public int IndentLevel { get; } /// <summary> /// Gets the text. /// </summary> /// <value> /// The text. /// </value> public string Text { get; } /// <summary> /// Gets the sub lines. /// </summary> /// <value> /// The sub lines. /// </value> public List<string>? SubLines { get; } /// <summary> /// Converts to string. /// </summary> /// <returns> /// A string that represents this instance. /// </returns> public override string ToString() { return $"{nameof(this.IsError)}: {this.IsError}, {nameof(this.IndentLevel)}: {this.IndentLevel}, {nameof(this.Text)}: {this.Text}, {nameof(this.SubLines)}: {this.SubLines?.Count}"; } } }
using System; using System.ComponentModel; using System.Data; using System.Linq; using System.Windows.Forms; using DelftTools.Controls; using DelftTools.Controls.Swf.Editors; using DelftTools.Controls.Swf.Table; using DelftTools.Tests.Controls.Swf.Table.TestClasses; using DelftTools.TestUtils; using DelftTools.Utils; using NUnit.Framework; using SortOrder = DelftTools.Controls.SortOrder; namespace DelftTools.Tests.Controls.Swf.Table { [TestFixture] public class TableViewPasteControllerTest { [Test] public void PasteFailsOnSortedColumn() { TableView tableView = GetTableViewWithTwoStringColumnsAndOneRow(); //hook up a copy paste controller var tableViewCopyPasteController = new TableViewPasteController(tableView); //sort on the second column tableView.Columns[1].SortOrder = SortOrder.Ascending; //setup eventhandler for failed paste checking error message int callCount = 0; tableViewCopyPasteController.PasteFailed += (s, e) => { Assert.AreEqual("Cannot paste into sorted column", e.Value); callCount++; }; //action! paste in the first column..second column is hit so should fail tableView.SelectCells(0, 0, 0, 0); tableViewCopyPasteController.PasteLines(new[] { "kaas\tmelk" }); //we should have failed Assert.AreEqual(1,callCount); } [Test] public void PasteFailsInFilterGrid() { TableView tableView = GetTableViewWithTwoStringColumnsAndOneRow(); //hook up a copy paste controller var tableViewCopyPasteController = new TableViewPasteController(tableView); //filter first column tableView.Columns[0].FilterString = "[Name] Like 'Jaap%'"; //setup eventhandler for failed paste checking error message int callCount = 0; tableViewCopyPasteController.PasteFailed += (s, e) => { Assert.AreEqual("Cannot paste into filtered tableview.", e.Value); callCount++; }; //action! paste in the first column.. tableView.SelectCells(0, 0, 0, 0); tableViewCopyPasteController.PasteLines(new[] { "kaas" }); //we should have failed Assert.AreEqual(1, callCount); } [Test] public void PasteDoesNotAddNewRowsToSortedTableView() { TableView tableView = GetTableViewWithTwoStringColumnsAndOneRow(); //hook up a copy paste controller var tableViewCopyPasteController = new TableViewPasteController(tableView); //select the first cell of the second column tableView.SelectCells(0, 1, 0, 1); //sort fist column tableView.Columns[0].SortOrder = SortOrder.Ascending; //action paste a possible 3 lines tableViewCopyPasteController.PasteLines(new[] {"kaas\tmelk","noot\tmies","appel\tflap"}); //assert rowcount is still one..no new rows are added on a sorted grid Assert.AreEqual(1,tableView.RowCount); //make sure we did something Assert.AreEqual("kaas",tableView.GetCellValue(0,1)); } [Test] public void PasteFillsSelection() { var list = new BindingList<Person>() { new Person {Name = "jan", Age = 25}, new Person {Name = "fon", Age = 33}, new Person {Name = "peer", Age = 25}, new Person {Name = "fo", Age = 33} }; var tableView = new TableView {Data = list}; //select all cells in first column tableView.SelectCells(0, 0, 3, 0); //hook up a copy paste controller var tableViewCopyPasteController = new TableViewPasteController(tableView); //this should set the first column to kees,anton,kees,anton tableViewCopyPasteController.PasteLines(new[] {"kees", "anton"}); //asert the names are now like this Assert.AreEqual(new[] {"kees", "anton", "kees", "anton"}, list.Select(p => p.Name).ToArray()); } [Test] public void PasteFailsIntoNonSquareSelection() { var list = new BindingList<Person>() { new Person {Name = "jan", Age = 25}, new Person {Name = "fon", Age = 33}, new Person {Name = "peer", Age = 25}, new Person {Name = "fo", Age = 33} }; var tableView = new TableView { Data = list }; //make a diagonal selection tableView.SelectedCells.Add(new TableViewCell(0,0)); tableView.SelectedCells.Add(new TableViewCell(1, 1)); var tableViewCopyPasteController = new TableViewPasteController(tableView); int callCount = 0; tableViewCopyPasteController.PasteFailed += (s, e) => { callCount++; Assert.AreEqual( "Cannot paste into non rectangular selection", e.Value); }; //this should a paste failed event tableViewCopyPasteController.PasteLines(new[] { "kees", "anton" }); Assert.AreEqual(1,callCount); } [Test] public void CopyPasteEnumInBindingList() { var list = new BindingList<ClassWithEnum> { new ClassWithEnum{Type = FruitType.Banaan}, new ClassWithEnum{Type = FruitType.Peer} }; var tableView = new TableView { Data = list }; var editor = DefaultTypeEditorFactory.CreateComboBoxTypeEditor(); editor.Items = Enum.GetValues(typeof (FruitType)); tableView.Columns[0].Editor = editor; var tableViewCopyPasteController = new TableViewPasteController(tableView); //select 2nd row tableView.SelectCells(1,0,1,0); //paste twee bananen en een peer ;) tableViewCopyPasteController.PasteLines(new[]{"Banaan","Banaan","Peer" }); //we should have 3 bananas and a pear Assert.AreEqual("Banaan","Banaan","Banaan","Peer",list.Select(c=>c.Type).ToArray()); //WindowsFormsTestHelper.ShowModal(tableView); } [Test] public void PasteTakesInvisibleColumnsIntoAccount() { //if a possible paste is too big it is important to not exceed the visiblecolcount - 1 var list = new BindingList<Person>() { new Person {Name = "jan", Age = 25}, new Person {Name = "fon", Age = 33}, new Person {Name = "peer", Age = 25}, new Person {Name = "fo", Age = 33} }; var tableView = new TableView {Data = list}; //hide the age column tableView.Columns[1].Visible = false; //select top left tableView.SelectCells(0, 0, 0, 0); var tableViewCopyPasteController = new TableViewPasteController(tableView); //paste some non sense tableViewCopyPasteController.PasteLines(new[] {"kees\tkan\twel"}); //first person should be kees now Assert.AreEqual("kees", list[0].Name); } [Test] [NUnit.Framework.Category("CrashesOnWindows7")] public void PasteIntoGridBoundToDataTable() { var tableWithTwoStrings = new DataTable(); tableWithTwoStrings.Columns.Add("A", typeof(string)); tableWithTwoStrings.Columns.Add("B", typeof(string)); tableWithTwoStrings.Rows.Add("a", "b"); var tableView = new TableView { Data = tableWithTwoStrings }; Clipboard.SetText(string.Format("{0}\t{1}" + Environment.NewLine + "{0}\t{1}", "oe", "oe1")); tableView.PasteClipboardContents(); //WindowsFormsTestHelper.ShowModal(tableView); //should overwrite existing row and add another one Assert.AreEqual(2, tableWithTwoStrings.Rows.Count); Assert.AreEqual("oe", tableWithTwoStrings.Rows[0][0]); Assert.AreEqual("oe1", tableWithTwoStrings.Rows[0][1]); Assert.AreEqual("oe", tableWithTwoStrings.Rows[1][0]); Assert.AreEqual("oe1", tableWithTwoStrings.Rows[1][1]); } [Test] public void PastingIntoReadOnlyCellsDoesNotChangeTheValues() { var tableWithTwoStrings = new DataTable(); tableWithTwoStrings.Columns.Add("A", typeof(string)); tableWithTwoStrings.Columns.Add("B", typeof(string)); tableWithTwoStrings.Rows.Add("a", "b"); var tableView = new TableView { Data = tableWithTwoStrings }; //values in the first column are read only tableView.ReadOnlyCellFilter = delegate (TableViewCell cell) { return cell.ColumnIndex== 0; }; //select top row tableView.SelectCells(0, 0, 0, 1); var tableViewCopyPasteController = new TableViewPasteController(tableView); //paste some non sense. tableViewCopyPasteController.PasteLines(new[] { "c\td" }); //only column b should have changed Assert.AreEqual("a", tableWithTwoStrings.Rows[0][0]); Assert.AreEqual("d", tableWithTwoStrings.Rows[0][1]); } [Test] public void PasteIntoARowSelection() { var tableWithTwoStrings = new DataTable(); tableWithTwoStrings.Columns.Add("A", typeof(string)); tableWithTwoStrings.Columns.Add("B", typeof(string)); tableWithTwoStrings.Rows.Add("a", "b"); var tableView = new TableView { Data = tableWithTwoStrings }; var tableViewCopyPasteController = new TableViewPasteController(tableView); //select top row tableView.SelectCells(0, 0, 0, 1); //paste some non sense. tableViewCopyPasteController.PasteLines(new[] { "c" }); //first line should now be [c c] Assert.AreEqual("c", tableWithTwoStrings.Rows[0][0]); Assert.AreEqual("c", tableWithTwoStrings.Rows[0][1]); } private static TableView GetTableViewWithTwoStringColumnsAndOneRow() { var tableView = new TableView(); var tableWithTwoStrings = new DataTable(); tableWithTwoStrings.Columns.Add("Name", typeof(string)); tableWithTwoStrings.Columns.Add("B", typeof(string)); tableWithTwoStrings.Rows.Add("a", "b"); tableView.Data = tableWithTwoStrings; return tableView; } [Test] public void UseValidatorToIgnorePaste() { var tableView = new TableView(); var tableWithTwoStrings = new DataTable(); tableWithTwoStrings.Columns.Add("Name", typeof(string)); tableWithTwoStrings.Columns.Add("B", typeof(string)); tableWithTwoStrings.Rows.Add("a", "b"); tableView.Data = tableWithTwoStrings; tableView.InputValidator += TableViewEditorValidator; var tableViewCopyPasteController = new TableViewPasteController(tableView); Assert.AreEqual("b", tableWithTwoStrings.Rows[0][1]); //select top right cell tableView.SelectCells(0, 1, 0, 1); // paste "c" and check result tableViewCopyPasteController.PasteLines(new[] { "c" }); Assert.AreEqual("c", tableWithTwoStrings.Rows[0][1]); // check paste of d fails tableViewCopyPasteController.PasteLines(new[] { "d" }); Assert.AreEqual("c", tableWithTwoStrings.Rows[0][1]); } [Test] public void UseValidatorToIgnoreRow() { var tableView = new TableView(); var dataTable = new DataTable(); dataTable.Columns.Add("Alpha", typeof(string)); dataTable.Columns.Add("Numeric", typeof(int)); dataTable.Rows.Add("a", 1); tableView.Data = dataTable; tableView.PasteBehaviour = TableViewPasteBehaviourOptions.SkipRowWhenValueIsInvalid; tableView.InputValidator = (c, v) => { if (c.ColumnIndex == 0 && (v.ToString() == "b")) return new Utils.Tuple<string, bool>("b not allowed", false); return new Utils.Tuple<string, bool>("", true); }; var tableViewCopyPasteController = new TableViewPasteController(tableView); Assert.AreEqual(1, dataTable.Rows[0][1]); //select top left cell tableView.SelectCells(1, 0, 0, 0); // paste "c" and check result tableViewCopyPasteController.PasteLines(new[] { "b\t2", "c\t3" }); Assert.AreEqual(2, dataTable.Rows.Count); Assert.AreEqual("c", dataTable.Rows[1][0]); } private static Utils.Tuple<string, bool> TableViewEditorValidator(TableViewCell tableViewCell, object value) { // do not accept "d" return ((string)value).Contains("d") ? new Utils.Tuple<string, bool>("", false) : new Utils.Tuple<string, bool>("", true); } } }
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Nac.Common; using System.Collections.Specialized; using Nac.Wpf.Common; using System.Windows.Threading; using System.Windows; using System.Diagnostics; using Nac.Wpf.UI; public interface INacWpfContext : INacContext {} public static class NacWpfGlobal { public static NacWpfContext G { get { return NacGlobal.G as NacWpfContext; } set { NacGlobal.G = value; } } } namespace Nac.Wpf.UI { using System.Text.RegularExpressions; using static NacWpfGlobal; public class NacWpfContext : NacWpfObjectWithChildren, INacWpfContext, ICollection<NacWpfEngine>/*, INotifyCollectionChanged*/ { private DispatcherTimer RefreshTimer { get; set; } private Dictionary<string, NacWpfEngine> _engines = new Dictionary<string, NacWpfEngine>(); private NacWpfContext() { RefreshTimer = new DispatcherTimer(); RefreshTimer.Interval = new TimeSpan(0, 0, 0, 1, 0); RefreshTimer.Tick += RefreshTimer_Tick; ; RefreshTimer.Start(); } private static NacWpfContext Instance { get { return G as NacWpfContext; } } public static void Create() { G = new NacWpfContext(); } public static void Destroy() { Instance.Dispose(); } long l1 = 0, l2 = 0; Stopwatch sw = new Stopwatch(); private void RefreshTimer_Tick(object sender, EventArgs e) { try { Refreshing = true; var w = Application.Current.MainWindow; Predicate<object> IsRefreshable = obj => null != obj.GetType().GetMethod("NacWpfRefresh"); sw.Restart(); var refreshables = NacWpfUtils.Controls(w, IsRefreshable); sw.Stop(); l1 = Math.Max(sw.ElapsedMilliseconds, l1); sw.Restart(); foreach (var r in refreshables) { var mi = r.GetType().GetMethod("NacWpfRefresh"); try { mi.Invoke(r, null); } catch (Exception x) when (Log(x, mi, r)) { } } sw.Stop(); l2 = Math.Max(sw.ElapsedMilliseconds, l2); } finally { Refreshing = false; } } public void AddEngine(NacWpfEngine engine) { _engines.Add(engine.Host, engine); engine.NewEngineMessageEvent += Engine_NewEngineMessageEvent; OnNotifyChildrenCollectionChanged(NotifyCollectionChangedAction.Add, new[] { engine }); } public void RemoveEngine(NacWpfEngine engine) { engine.NewEngineMessageEvent -= Engine_NewEngineMessageEvent; _engines.Remove(engine.Host); OnNotifyChildrenCollectionChanged(NotifyCollectionChangedAction.Remove, new[] { engine }); } public event NewEngineMessageHandler NewEngineMessageEvent; private void Engine_NewEngineMessageEvent(string[] messages) { NewEngineMessageEvent?.Invoke(messages); } #region ICollection<NacWpfEngine> public new int Count { get { throw new NotImplementedException(); } } public new bool IsReadOnly { get { throw new NotImplementedException(); } } public void Add(NacWpfEngine item) { throw new NotImplementedException(); } public new void Clear() { throw new NotImplementedException(); } public bool Contains(NacWpfEngine item) { throw new NotImplementedException(); } public void CopyTo(NacWpfEngine[] array, int arrayIndex) { throw new NotImplementedException(); } public bool Remove(NacWpfEngine item) { throw new NotImplementedException(); } public new IEnumerator<NacWpfEngine> GetEnumerator() { throw new NotImplementedException(); } IEnumerator IEnumerable.GetEnumerator() { return _engines.Values.GetEnumerator(); } #endregion #region INacWpfContext public NacWpfEngine GetEngine(string path) { Uri u = new Uri(path); return _engines[u.Host]; } public bool Log(params object[] args) { return true; } //public void Dispose() { // //throw new NotImplementedException(); //} //public dynamic Engine { // get { // throw new NotImplementedException(); // } //} //public dynamic Field { // get { // throw new NotImplementedException(); // } //} bool _refreshing; public bool Refreshing { get { return _refreshing; } private set { _refreshing = value; } } #endregion //#region INotifyCollectionChanged //public event NotifyCollectionChangedEventHandler CollectionChanged; //#endregion } }
using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace WebApp.Extensions { public static class CorsServiceExtensions { public static IServiceCollection ConfigureCors(this IServiceCollection services) { services.AddCors(o => o.AddPolicy("WebAppPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowCredentials() .AllowAnyHeader(); })); return services; } } }
using Moudou.CodeGenerator.AbstractionClasses; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SampleTemplateProject.Framework { public class DBInitValue : IInitValue { public void SetValue(string SourceText) { } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(AudioSource))] public class musicBG : MonoBehaviour { [SerializeField] private AudioClip backgroundMusic; private AudioSource bgMusic; [SerializeField] private GameObject musicPanel; bool panelActivation = false; public void openPanel() { musicPanel.SetActive(true); panelActivation = true; } public void closePanel() { musicPanel.SetActive(false); panelActivation = false; } public void doPanel() { if (panelActivation) { closePanel(); Debug.Log("close "); } else { openPanel(); Debug.Log("open "); } } public void PlayPauseMusic() { // Check if the music is currently playing. if (bgMusic.isPlaying) bgMusic.Pause(); // Pause if it is else bgMusic.Play(); // Play if it isn't } public void PlayStop() { if (bgMusic.isPlaying) bgMusic.Stop(); else bgMusic.Play(); } public void PlayMusic() { bgMusic.Play(); } public void StopMusic() { bgMusic.Stop(); } public void PauseMusic() { bgMusic.Pause(); } void Start() { bgMusic = GetComponent<AudioSource>(); bgMusic.clip = backgroundMusic; bgMusic.volume = 0.010f; PlayMusic(); } void Update() { } }
using System; using System.Collections.Generic; using System.Text; namespace ReflectionSpike { public enum VariableType { String, Integer } public enum ElapsedTimeIn { Milliseconds, Ticks } }
using System; class InvalidNumber { static void Main() { int a = int.Parse(Console.ReadLine()); if ((a >= 100 && a <= 200) || a == 0) { return; } else { Console.WriteLine("invalid"); } } }
using HabMap.ProjectConfigurations.Models; using Prism.Mvvm; using Prism.Regions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace HabMap.ProjectConfigurations.ViewModels { public class NodeServerDataDetailViewModel : BindableBase, INavigationAware { #region Private members /// <summary> /// The selected NS Data /// </summary> private INodeServerModel _selectedNSData; private IRegionManager _regionManager; private IProjectConfigurationModel _projectConfig; #endregion public NodeServerDataDetailViewModel(IRegionManager regionManager, IProjectConfigurationModel projectConfig) { _projectConfig = projectConfig; _regionManager = regionManager; } #region Public Fields /// <summary> /// The selected NS Data /// </summary> public INodeServerModel SelectedNSData { get { return _selectedNSData; } set { SetProperty(ref _selectedNSData, value); } } #endregion #region INavigationAware Methods public bool IsNavigationTarget(NavigationContext navigationContext) { return true; } public void OnNavigatedFrom(NavigationContext navigationContext) { _regionManager.Regions["CIButtonRegion"].RemoveAll(); } public void OnNavigatedTo(NavigationContext navigationContext) { INodeServerModel selectedNSData = navigationContext.Parameters["NodeServer"] as INodeServerModel; if (selectedNSData != null) { try { SelectedNSData = _projectConfig.NodeServerList.First(x => x.GUID == selectedNSData.GUID); for(int i = SelectedNSData.CI.Length - 1; i >= 0; i--) { var parameters = new NavigationParameters(); parameters.Add("NSData", SelectedNSData); parameters.Add("CIIndex", i); _regionManager.RequestNavigate("CIButtonRegion", "NodeServerCIButtonView", parameters); } } catch(Exception e) { MessageBox.Show(e.Message); } } } #endregion } }
using System; using System.Collections.Generic; using System.Text; namespace DesignPatterns.Command.Example2 { public interface IAppCommand { void Execute(string text); void Undo(); } }
using MongoDB.Entities; using NUnit.Framework; using ProductService.Persistance.Entities; using System; using System.Collections.Generic; using System.Text; using MongoDB.Driver; namespace ProductService.Application.Tests.Unit { public abstract class BaseProductTest { const string databaseName = "ProductService-Application-Unit-Tests"; [OneTimeSetUp] public void Setup() => new DB(databaseName); [TearDown] public void TearDown() => DB.Delete<Product>(x => true); [OneTimeTearDown] public void OneTimeCleanup() => new MongoClient().DropDatabase(databaseName); } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using WebDeanery.DataLayer; namespace WebDeanery.Models { public class FacultetModel { public Int32 FacultetId { get; set; } public String FacultetName { get; set; } public String ShortName { get; set; } public List<MasnagitutyunModel> Masnagitutyun { get; set; } } }
using System; using System.Threading; using System.Threading.Tasks; using CronScheduler.Extensions.Scheduler; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace CronScheduler.UnitTest; public class TestJobExceptionOptions : SchedulerOptions { public bool RaiseException { get; set; } } public class TestJobException : IScheduledJob { private readonly ILogger<TestJobException> _logger; private readonly TestJobExceptionOptions _options; public TestJobException( ILogger<TestJobException> logger, IOptionsMonitor<TestJobExceptionOptions> optionsMonitor) { _logger = logger; _options = optionsMonitor.Get(Name); } public string Name { get; } = nameof(TestJobException); public Task ExecuteAsync(CancellationToken cancellationToken) { if (_options.RaiseException) { var message = nameof(Exception); _logger.LogError(message); throw new Exception(message); } _logger.LogInformation("Running {name}", nameof(TestJobException)); return Task.CompletedTask; } }
using Abp.MultiTenancy; namespace Abp.Zero.NHibernate.EntityMappings { public class TenantMap : TenantMapBase<AbpTenant> { } }
using System; namespace DesignPatterns.State.SystemPermissionExample { public abstract class PermissionState { protected string name; public static PermissionState REQUESTED = new PermissionRequested(); public static PermissionState UNIX_REQUESTED = new UnixPermissionRequested(); public static PermissionState CLAIMED = new PermissionClaimed(); public static PermissionState UNIX_CLAIMED = new UnixPermissionClaimed(); public static PermissionState GRANTED = new PermissionGranted(); public static PermissionState DENIED = new PermissionDenied(); public virtual void ClaimedBy(SystemAdmin admin, SystemPermission permission) { } public virtual void DeniedBy(SystemAdmin admin, SystemPermission permission) { } public virtual void GrantedBy(SystemAdmin admin, SystemPermission permission) { } public override string ToString() { return name; } } }
using UnityEngine; using System.Collections; public class InfomationScroll : MonoBehaviour { public float scrollSpeed = 1.0f; public float waitTime = 1.0f; public float finishPosX = -15f; public float resetPosX = 4f; bool isMoveText = false; int frame = 0; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (frame >= 60 * waitTime) { isMoveText = true; } if (isMoveText == true) { transform.position -= new Vector3 (0.01f * scrollSpeed, 0f, 0f); if (transform.position.x <= finishPosX) { transform.localPosition = new Vector3 (resetPosX, 0f, 0f); isMoveText = false; frame = 0; } } frame++; } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Docller.Core.Common; using Docller.Core.Services; namespace Docller.Common { public class DownloadResult : FileResult { private readonly IDownloadProvider _downloadProvider; public DownloadResult(IDownloadProvider downloadProvider) : base(downloadProvider.ContentType) { _downloadProvider = downloadProvider; this.FileDownloadName = downloadProvider.FileName; } protected override void WriteFile(HttpResponseBase response) { response.SetCookie(new HttpCookie(Constants.FileDownloadCookie, "true") { Path = "/" }); response.Buffer = false; _downloadProvider.DownloadToStream(response.OutputStream, new ClientConnection(response)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace Model.IntelligenceDiningTable.ResponseResult { /// <summary> /// 元素含量 /// </summary> public class E_Nutrition { /// <summary> /// 元素名称 /// </summary> public string item { get; set;} /// <summary> /// 元素含量 /// </summary> public string value { get; set; } /// <summary> /// 单位名称 /// </summary> public string unit { get; set; } [JsonIgnore] /// <summary> /// 元素ID /// </summary> public int id { get; set; } } }
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; namespace Cyber_FerCesar_Sistema { public partial class Frm_GestaoFornecedor : Form { public Frm_GestaoFornecedor() { InitializeComponent(); } private void Frm_GestaoFornecedor_Load(object sender, EventArgs e) { string sql = String.Format(@" SELECT N_IDFORNECEDOR as 'Id', T_NOMEFORNECEDOR as 'Nome', T_TELEFONE as 'Teçefone', T_NIF as 'NIF' FROM tb_fornecedores "); Dgv_fornecedor.DataSource = Banco.dql(sql); Dgv_fornecedor.Columns[0].Width = 20; Dgv_fornecedor.Columns[1].Width = 200; Dgv_fornecedor.Columns[2].Width = 100; Dgv_fornecedor.Columns[3].Width = 100; } private void Dgv_fornecedor_SelectionChanged(object sender, EventArgs e) { DataGridView dgv = (DataGridView)sender; if (dgv.SelectedRows.Count > 0) { DataTable dt = new DataTable(); string id = dgv.SelectedRows[0].Cells[0].Value.ToString(); string query = String.Format(@" SELECT * FROM tb_fornecedores WHERE N_IDFORNECEDOR = {0} ",id); dt = Banco.dql(query); Txt_id.Text = dt.Rows[0].Field<Int64>("N_IDFORNECEDOR").ToString(); Txt_nome.Text = dt.Rows[0].Field<string>("T_NOMEFORNECEDOR"); Txt_telefone.Text = dt.Rows[0].Field<string>("T_TELEFONE"); Txt_nif.Text = dt.Rows[0].Field<string>("T_NIF"); } } private void Btn_novo_Click(object sender, EventArgs e) { Frm_CadFornecedor frm_CadFornecedor = new Frm_CadFornecedor(); frm_CadFornecedor.Show(); this.Close(); } private void Btn_salvar_Click(object sender, EventArgs e) { string query = String.Format(@" UPDATE tb_fornecedores SET T_NOMEFORNECEDOR = '{0}', T_TELEFONE = '{1}', T_NIF = '{2}' WHERE N_IDFORNECEDOR = {3} ",Txt_nome.Text,Txt_telefone.Text,Txt_nif.Text,Txt_id.Text); Banco.dml(query); MessageBox.Show("Dados do fornecedor actualizado!"); string sql = String.Format(@" SELECT N_IDFORNECEDOR as 'Id', T_NOMEFORNECEDOR as 'Nome', T_TELEFONE as 'Teçefone', T_NIF as 'NIF' FROM tb_fornecedores "); Dgv_fornecedor.DataSource = Banco.dql(sql); } private void Btn_excluir_Click(object sender, EventArgs e) { string sql = String.Format(@" DELETE FROM tb_fornecedores WHERE N_IDFORNECEDOR = {0} ",Txt_id.Text); Banco.dml(sql); MessageBox.Show("Registo apagado!"); Dgv_fornecedor.Rows.Remove(Dgv_fornecedor.CurrentRow); } private void Btn_fechar_Click(object sender, EventArgs e) { this.Close(); } } }
using System; using System.Globalization; using Atc.CodeAnalysis.CSharp.SyntaxFactories; using Microsoft.CodeAnalysis.CSharp; using Xunit; namespace Atc.CodeAnalysis.CSharp.Tests.SyntaxFactories { public class SyntaxLiteralExpressionFactoryTests { [Theory] [InlineData("1.01")] [InlineData("1000.42")] [InlineData("0")] [InlineData("42")] [InlineData("-42")] [InlineData("12,345")] public void ShouldParseNumber(string value) { // Act var result = SyntaxLiteralExpressionFactory.Create(value, SyntaxKind.NumericLiteralExpression); // Assert Assert.Equal(SyntaxKind.NumericLiteralExpression, result.Kind()); Assert.Equal(value.Replace(",", ".", StringComparison.Ordinal), result.ToString()); } [Theory] [InlineData("1.0a")] [InlineData("ABC")] [InlineData("")] public void ShouldFailOnInvalidNumber(string value) { Assert.Throws<ArgumentOutOfRangeException>(() => SyntaxLiteralExpressionFactory.Create(value, SyntaxKind.NumericLiteralExpression)); } [Theory] [InlineData("1.0a")] [InlineData("ABC")] [InlineData("")] public void ShouldParseInvalidNumberAsString(string value) { // Act var result = SyntaxLiteralExpressionFactory.Create(value); // Assert Assert.Equal(SyntaxKind.StringLiteralExpression, result.Kind()); Assert.Equal($"\"{value}\"", result.ToString()); } [Theory] [InlineData(0)] [InlineData(42)] [InlineData(-10)] public void ShouldParseInteger(int value) { // Act var result = SyntaxLiteralExpressionFactory.Create(value); // Assert Assert.Equal(SyntaxKind.NumericLiteralExpression, result.Kind()); Assert.Equal(value.ToString(CultureInfo.InvariantCulture), result.ToString()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace Barker.Models { public class User { [JsonPropertyName("UserID")] public int UserID { get; set; } [JsonPropertyName("Email")] public string Email { get; set; } [JsonPropertyName("Username")] public string Username { get; set; } [JsonPropertyName("Password")] public string Password { get; set; } [JsonPropertyName("Name")] public string Name { get; set; } [JsonPropertyName("Lastname")] public string Lastname { get; set; } [JsonPropertyName("Birthday")] public DateTime Birthday { get; set; } [JsonPropertyName("LastLogon")] public DateTime LastLogon { get; set; } [JsonPropertyName("AccountCreationDate")] public DateTime AccountCreationDate { get; set; } } }
using MyHeroKill.Managers; using MyHeroKill.Model.Wepons; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MyHeroKill.Model.Roles { public abstract class BaseRole : IRole { #region 属性 public int IndexOfRoles { get; set; } public string Name { get; set; } public string ImgUrl { get; set; } public List<Card> CardsInHand { get; set; } public int SkinId { get; set; } /// <summary> /// 角色状态,是机器人、人类待机、人类正常、人类掉线 /// </summary> public Enums.ERoleStatus RoleStatus { get; set; } public Enums.ERoleCampType CampType { get; set; } public int BaseDamage { get; set; } public int BaseLife { get; set; } public int BaseAttackDistance { get; set; } public int BaseAttackCount { get; set; } public List<Skills.ISkill> BaseSkills { get; set; } public List<Wepons.IWeapon> BaseWeapons { get; set; } public List<Skills.ISkill> AdditionalSkills { get; set; } public List<Wepons.IWeapon> AdditionalWeapons { get; set; } public int MaxLife { get; set; } public int CurrentDamage { get; set; } public int CurrentLife { get; set; } public int CurrentAttackDistance { get; set; } public int CurrentAttackCount { get; set; } /// <summary> /// 基础防御距离 /// </summary> public int BaseDefenseDistance { get; set; } /// <summary> /// 当前防御距离 /// </summary> public int CurrentDefenceDistance { get; set; } /// <summary> /// 当前的HandCardManager /// </summary> public Managers.HandCardManager CurrentHandCardManager { get; set; } #endregion public BaseRole() { this.IndexOfRoles = 1; this.CampType = Enums.ERoleCampType.Any; this.RoleStatus = Enums.ERoleStatus.AI; this.Name = "英雄"; this.SkinId = 0; this.BaseDamage = 1; this.BaseLife = 3; this.BaseAttackDistance = 1; this.BaseAttackCount = 1; this.BaseDefenseDistance = 0; this.CardsInHand = new List<Card>(); this.BaseSkills = new List<Skills.ISkill>(); this.BaseWeapons = new List<Wepons.IWeapon>(); this.AdditionalSkills = new List<Skills.ISkill>(); this.AdditionalWeapons = new List<Wepons.IWeapon>(); this.CurrentDamage = this.BaseDamage; this.CurrentLife = this.BaseLife; this.MaxLife = this.CurrentLife; this.CurrentDefenceDistance = this.BaseDefenseDistance; this.CurrentAttackDistance = this.BaseAttackDistance; this.CurrentAttackCount = this.BaseAttackCount; this.CurrentHandCardManager = new Managers.HandCardManager(); this.SumRoleProperties(); } public virtual void OnLifeChange(int deltaLife) { this.CurrentLife += deltaLife; if (this.CurrentLife > this.MaxLife) { this.CurrentLife = this.MaxLife; } if (this.CurrentLife <= 0) { //血量小于1,求药 Console.WriteLine("要死了。。。"); } } public virtual void OnRoleDying() { } public virtual void OnRolePlaying() { } public virtual void OnRoleIdle() { } public virtual bool OnReplySha(Managers.HandCardManager handCardManager, DefenseCardModel defenseCardContainer) { return true; } /// <summary> /// 血量变化事件 /// </summary> /// <param name="deltaLife"></param> /// <param name="handCardManager"></param> public virtual void OnLifeChange(int deltaLife, Managers.HandCardManager handCardManager) { this.CurrentLife += deltaLife; this.CurrentLife = this.CurrentLife > this.MaxLife ? this.MaxLife : this.CurrentLife; //血量小于1则求药 if (this.CurrentLife < 1) { this.TriggerOnRoleAskYaoEvents(); } } public delegate void RoleEvents(); public event RoleEvents OnRoleAskShaEvents; public event RoleEvents OnRoleAskShanEvents; public event RoleEvents OnRoleAskWuxiekejiEvents; public event RoleEvents OnRoleAskYaoEvents; public event RoleEvents OnRoleAskJuedouEvents; public delegate bool RoleEventsDefense(HandCardManager handCardManager, DefenseCardModel defenseModel); public event RoleEventsDefense OnReplyShaEvents; public virtual void TriggerOnRoleAskShaEvents() { this.OnRoleAskShaEvents(); } public virtual void TriggerOnRoleAskShanEvents() { this.OnRoleAskShanEvents(); } public virtual void TriggerOnRoleAskWuxiekejiEvents() { this.OnRoleAskWuxiekejiEvents(); } public virtual void TriggerOnRoleAskYaoEvents() { this.OnRoleAskYaoEvents(); } public virtual void TriggerOnRoleAskJuedouEvents() { this.OnRoleAskJuedouEvents(); } public virtual void TriggerOnReplyShaEvents(DefenseCardModel defense) { this.OnReplyShaEvents(this.CurrentHandCardManager, defense); } /// <summary> /// 计算角色的综合属性 /// </summary> protected virtual void SumRoleProperties() { //处理附加武器和附加技能增加的攻击距离。最大攻击距离=最大基础距离+最大附加距离的最大值 int maxDistance = this.BaseAttackDistance; //分析角色所自带的武器、技能加成 foreach (var item in this.BaseSkills) { this.CurrentLife += item.AddLife; this.CurrentDamage += item.AddDamage; this.BaseAttackDistance += item.AddAttackDistance; this.CurrentAttackDistance += item.AddAttackDistance; this.CurrentAttackCount += item.AddAttackCount; this.CurrentDefenceDistance += item.AddDefenceDistance; //事件 this.OnRoleAskShaEvents += item.OnAskSha; this.OnRoleAskShanEvents += item.OnAskShan; this.OnRoleAskWuxiekejiEvents += item.OnAskWuxiekeji; this.OnRoleAskYaoEvents += item.OnAskYao; //this.OnReplyShaEvents += item.OnReplySha; } foreach (var item in this.AdditionalSkills) { this.CurrentLife += item.AddLife; this.CurrentDamage += item.AddDamage; this.CurrentAttackDistance += item.AddAttackDistance; this.CurrentAttackCount += item.AddAttackCount; this.CurrentDefenceDistance += item.AddDefenceDistance; maxDistance = maxDistance > item.AddAttackDistance ? maxDistance : item.AddAttackDistance; //事件 this.OnRoleAskShaEvents += item.OnAskSha; this.OnRoleAskShanEvents += item.OnAskShan; this.OnRoleAskWuxiekejiEvents += item.OnAskWuxiekeji; this.OnRoleAskYaoEvents += item.OnAskYao; //this.OnReplyShaEvents += item.OnReplySha; } foreach (var item in this.BaseWeapons) { this.CurrentLife += item.AddLife; this.CurrentDamage += item.AddDamage; this.BaseAttackDistance += item.AddAttackDistance; this.CurrentAttackDistance = Math.Max(this.CurrentAttackDistance, item.AddAttackDistance); this.CurrentDefenceDistance += item.AddDefenceDistance; this.CurrentAttackCount += item.AddAttackCount; //事件 this.OnRoleAskShaEvents += item.OnAskSha; this.OnRoleAskShanEvents += item.OnAskShan; this.OnRoleAskWuxiekejiEvents += item.OnAskWuxiekeji; //this.OnReplyShaEvents += item.OnReplySha; } foreach (var item in this.AdditionalWeapons) { this.CurrentLife += item.AddLife; this.CurrentDamage += item.AddDamage; this.CurrentDefenceDistance += item.AddDefenceDistance; this.CurrentAttackDistance = Math.Max(this.CurrentAttackDistance, item.AddAttackDistance); maxDistance = maxDistance > item.AddAttackDistance ? maxDistance : item.AddAttackDistance; this.CurrentAttackCount += item.AddAttackCount; //事件 this.OnRoleAskShaEvents += item.OnAskSha; this.OnRoleAskShanEvents += item.OnAskShan; this.OnRoleAskWuxiekejiEvents += item.OnAskWuxiekeji; // this.OnReplyShaEvents += item.OnReplySha; } this.CurrentAttackDistance = Math.Max(this.BaseAttackDistance, maxDistance); } protected void AddWeapon(IWeapon wp) { Console.WriteLine("。。。加装备-" + wp.Name); this.CurrentLife += wp.AddLife; this.CurrentDamage += wp.AddDamage; this.CurrentDefenceDistance += wp.AddDefenceDistance; if (wp.PositionOfWeaponList == 3) { //检查是否有进攻马,最后减去默认的距离1 var jingongma = this.AdditionalWeapons.FirstOrDefault(p => p.PositionOfWeaponList == 1); this.CurrentAttackDistance = this.BaseAttackDistance + (jingongma == null ? 0 : 1) + wp.AddAttackDistance - 1; } this.CurrentAttackCount += wp.AddAttackCount; this.AdditionalWeapons.Add(wp); //事件 this.OnRoleAskShaEvents += wp.OnAskSha; this.OnRoleAskShanEvents += wp.OnAskShan; this.OnRoleAskWuxiekejiEvents += wp.OnAskWuxiekeji; //this.OnReplyShaEvents += wp.OnReplySha; } public virtual void EquipWeapon(IWeapon wp) { var existsWeapon = this.AdditionalWeapons.FirstOrDefault(p => p.PositionOfWeaponList == wp.PositionOfWeaponList); if (existsWeapon != null) { this.UnEquipWeapon(existsWeapon); } this.AddWeapon(wp); } public virtual void UnEquipWeapon(IWeapon wp) { Console.WriteLine("。。。卸掉装备-" + wp.Name); //去除该武器所加的所有属性 this.CurrentLife -= wp.AddLife; this.CurrentDamage -= wp.AddDamage; this.CurrentDefenceDistance -= wp.AddDefenceDistance; this.CurrentAttackDistance = Math.Max(this.CurrentAttackDistance - wp.AddAttackDistance, 1); //如果是进攻武器,则直接重新计算距离 if (wp.PositionOfWeaponList == 3) { //检查是否有进攻马,最后减去默认的距离1 var jingongma = this.AdditionalWeapons.FirstOrDefault(p => p.PositionOfWeaponList == 1); this.CurrentAttackDistance = this.BaseAttackDistance + (jingongma == null ? 0 : 1); } this.CurrentAttackCount -= wp.AddAttackCount; //事件 this.OnRoleAskShaEvents -= wp.OnAskSha; this.OnRoleAskShanEvents -= wp.OnAskShan; this.OnRoleAskWuxiekejiEvents -= wp.OnAskWuxiekeji; //this.OnReplyShaEvents -= wp.OnReplySha; this.AdditionalWeapons.Remove(wp); } public override string ToString() { string bwp = "基础武器:" + string.Join("、", this.BaseWeapons.Select(p => p.Name)); string awp = "装备武器:" + string.Join("、", this.AdditionalWeapons.Select(p => p.Name)); string bsk = "基础技能:" + string.Join("、", this.BaseSkills.Select(p => p.Name)); string ask = "附加技能:" + string.Join("、", this.AdditionalSkills.Select(p => p.Name)); string msg = String.Format("角色名称:{0}\r\n基础血量:{1}\r\n攻击范围:{2}\r\n防御距离:{8}\r\n单回合可攻击次数:{3}\r\n{4}\r\n{5}\r\n{6}\r\n{7}\r\n", this.Name, this.BaseLife, this.CurrentAttackDistance, this.CurrentAttackCount, bwp, awp, bsk, ask, this.CurrentDefenceDistance); return msg; } public bool OnReplySha(HandCardManager handCardManager, int fromUserIndex, AttackCardModel attackCardModel, DefenseCardModel defenseCardModel) { IRole role = this.CurrentHandCardManager.CurrentHostManager.GetRole(fromUserIndex); if (defenseCardModel.IsDefensed) { //被抵挡,什么都不做 } else { //出了闪? if (defenseCardModel.DefenseCardContainers != null && defenseCardModel.DefenseCardContainers.Count > 0) { //TODO:检查杀被闪掉之后是否强制命中,如博浪锤,盘龙棍 } else { //掉血 role.CurrentHandCardManager.TiggerChangeLife(fromUserIndex, -1); } } return true; } } }
using EddiDataDefinitions; using System; using Utilities; namespace EddiEvents { [PublicAPI] public class EmbarkEvent : Event { public const string NAME = "Embark"; public const string DESCRIPTION = "Triggered when you transition from on foot to a ship or SRV"; public const string SAMPLE = "{ \"timestamp\":\"2021-05-03T22:22:12Z\", \"event\":\"Embark\", \"SRV\":false, \"Taxi\":false, \"Multicrew\":false, \"ID\":6, \"StarSystem\":\"Sumod\", \"SystemAddress\":3961847269739, \"Body\":\"Sharp Dock\", \"BodyID\":56, \"OnStation\":true, \"OnPlanet\":false, \"StationName\":\"Sharp Dock\", \"StationType\":\"Coriolis\", \"MarketID\":3223952128 }"; [PublicAPI("The name of the star system in which the commander is embarking")] public string systemname { get; } [PublicAPI("The name of the body from which the commander is embarking (if any)")] public string bodyname { get; private set; } [PublicAPI("The name of the station from which the commander is embarking (if any)")] public string station { get; private set; } [PublicAPI("The type of station from which the commander is embarking (if any)")] public string stationtype => (stationModel ?? StationModel.None).localizedName; [PublicAPI("True if embarking to another player's ship")] public bool tomulticrew { get; } [PublicAPI("True if embarking to your own ship")] public bool toship => toLocalId != null && !tosrv && !totransport && !tomulticrew; [PublicAPI("True if embarking to an SRV")] public bool tosrv { get; } [PublicAPI("True if embarking to a transport ship (e.g. taxi or dropship)")] public bool totransport { get; } [PublicAPI("True if embarking from a station")] public bool? onstation { get; } [PublicAPI("True if embarking from a planet")] public bool? onplanet { get; } // Not intended to be user facing public int? toLocalId { get; } public ulong systemAddress { get;} public int? bodyId { get; } public long? marketId { get; } public StationModel stationModel { get; } public EmbarkEvent(DateTime timestamp, bool toSRV, bool toTransport, bool toMultiCrew, int? toLocalId, string system, ulong systemAddress, string body, int? bodyId, bool? onStation, bool? onPlanet, string station, long? marketId, StationModel stationModel) : base(timestamp, NAME) { this.tosrv = toSRV; this.totransport = toTransport; this.tomulticrew = toMultiCrew; this.toLocalId = toLocalId; this.systemname = system; this.systemAddress = systemAddress; this.bodyname = body; this.bodyId = bodyId; this.onstation = onStation; this.onplanet = onPlanet; this.station = station; this.marketId = marketId; this.stationModel = stationModel; } } }
using System.Threading.Tasks; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; namespace TelegramFootballBot.Core.Models.Commands { public abstract class Command { public abstract string Name { get; } public abstract Task ExecuteAsync(Message message); public bool StartsWith(Message message) { return message.Type == MessageType.Text && message.Text.StartsWith(Name); } public static bool IsBotOwner(Message message) { return message.Chat.Id == AppSettings.BotOwnerChatId; } } }
using Entoarox.Framework.UI; namespace Entoarox.Framework.Indev //.UI { internal class RecipeComponent : BaseInteractiveMenuComponent { /********* ** Public methods *********/ public RecipeComponent(int item, bool craftable = true) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _4.WeAllLoveBits { class LoveTheBits { static void Main() { ushort userInput = ushort.Parse(Console.ReadLine()); int p = 0; int pReversed = 0; int pInversed = 0; int[] pNew = new int[userInput]; for (int index = 0; index < userInput; index++) { p = int.Parse(Console.ReadLine()); int nextNum = p; while (nextNum > 0) { pReversed <<= 1; if ((nextNum & 1) == 1) { pReversed |= 1; } nextNum >>= 1; } pInversed = p; int position = 0; int n = p; while (n >= 1) { int mask = 1 << position; int nAndMask = pInversed & mask; pInversed = pInversed ^ mask; position++; n >>= 1; } pNew[index] = (p ^ pInversed) & pReversed; } foreach (var num in pNew) { Console.WriteLine(num); } } } }
//Name: ScreenFade.cs //Project: Spectral: The Silicon Domain //Author(s) Conor Hughes - conormpkhughes@yahoo.com //Description: This script creates a fade-to-black transition used by several other scripts. using UnityEngine; using UnityEngine.UI; using System.Collections; public class ScreenFade : MonoBehaviour { public bool fadeToColor = true; //determines if iamge fades in/out public float lastInterval, //time of last frame timeNow, //time of current frame customDeltaTime; //custom deltatime independent of timescale private GameObject fadeObject; //the ui element that fades private RawImage rImg; //the rawimage component of the fade object private RectTransform rTrans; //the recttransform component of the fade object private GameObject canvas; //the main canvas private GameObject pausePanel; //the pause panel gameobject private GameObject mouseCursor; //the mouse cursor gameobject private float fadeRate = 3f; //the rate at which the image fades private Transform healthBarObject, //healthbar transform inventoryObject, //inventory transform timeButtonObject; //time button transform // Use this for initialization void Start () { //find main hud elements if(transform.parent.Find("HUD_Healthbar"))healthBarObject = transform.parent.Find("HUD_Healthbar"); if(transform.parent.Find("HUD_Inventory"))inventoryObject = transform.parent.Find("HUD_Inventory"); if(transform.parent.Find("Time Button"))timeButtonObject = transform.parent.Find("Time Button"); if (GameObject.Find ("Mouse Cursor"))mouseCursor = GameObject.Find ("Mouse Cursor"); pausePanel = GameObject.Find ("Pause Manager").GetComponent<PauseManager>().pauseScreen; canvas = gameObject.transform.parent.gameObject; //find and enable fader fadeObject = transform.Find("Fade").gameObject; fadeObject.SetActive(true); //Get Components and size of fader rImg = transform.Find("Fade").GetComponent<RawImage>(); rTrans = transform.Find("Fade").GetComponent<RectTransform>(); rTrans.sizeDelta = new Vector2(Screen.width, Screen.height); //fade out fadeToColor = false; } //Shows/hides the fader public void ToggleCanFade(){ fadeToColor = !fadeToColor; } // Update is called once per frame void Update () { if (!mouseCursor)mouseCursor = GameObject.Find ("Mouse Cursor"); timeNow = Time.realtimeSinceStartup; customDeltaTime = timeNow - lastInterval; lastInterval = timeNow; if(fadeToColor){ if(timeButtonObject) timeButtonObject.gameObject.SetActive(false); rImg.color = Color.Lerp(rImg.color, new Color(rImg.color.r, rImg.color.g, rImg.color.g, 1), Time.deltaTime * fadeRate); } else{ if(rImg.color.a > 0.6f)if(timeButtonObject)timeButtonObject.gameObject.SetActive(true); rImg.color = Color.Lerp(rImg.color, new Color(rImg.color.r, rImg.color.g, rImg.color.g, 0), Time.deltaTime * fadeRate); } lastInterval = timeNow; } //has the fader disappear public void FadeOut(){ fadeToColor = false; } //has the fader appear public void FadeIn(){ fadeToColor = true; Time.timeScale = 1; } //Move the fader to the bottom of the hierarchy so no other UI elements appear in front of it. public void ResetParent(){ transform.SetParent (null); pausePanel.GetComponent<RectTransform>().SetParent (null); pausePanel.GetComponent<RectTransform>().SetParent (canvas.transform); mouseCursor.transform.SetParent (null); mouseCursor.transform.SetParent (canvas.transform); transform.SetParent (canvas.transform); } }
namespace Core { /// <summary> /// Base result class for responses /// </summary> public class BaseActionResult : BaseResult { } }
using System.Collections.Generic; using SkillPrestige.Logging; using SkillPrestige.Professions; using SkillPrestige.Professions.Registration; namespace SkillPrestige.Mods.MyLuckSkill { // ReSharper disable once UnusedMember.Global - referenced and created through reflection. public sealed class LuckRegistration : ProfessionRegistration { public override void RegisterProfessions() { Logger.LogInformation("Registering Luck Professions..."); Lucky = new TierOneProfession { Id = 30, DisplayName = "Lucky", EffectText = new[] {"Better daily luck."} }; Quester = new TierOneProfession { Id = 31, DisplayName = "Quester", EffectText = new[] {"Quests are more likely to appear each day."}, }; SpecialCharm = new TierTwoProfession { Id = 32, DisplayName = "Special Charm", EffectText = new[] {"Great daily luck most of the time."}, SpecialHandling = new SpecialCharmSpecialHandling(), TierOneProfession = Lucky }; LuckA2 = new TierTwoProfession { Id = 33, DisplayName = "Luck A2", EffectText = new[] {"Does...nothing, yet."}, TierOneProfession = Lucky }; NightOwl = new TierTwoProfession { Id = 34, DisplayName = "Night Owl", EffectText = new[] {"Nightly events occur twice as often."}, TierOneProfession = Quester }; LuckB2 = new TierTwoProfession { Id = 35, DisplayName = "Luck B2", EffectText = new[] {"Does...nothing, yet."}, TierOneProfession = Quester }; Quester.TierTwoProfessions = new List<TierTwoProfession> { NightOwl, LuckB2 }; Lucky.TierTwoProfessions = new List<TierTwoProfession> { SpecialCharm, LuckA2 }; Logger.LogInformation("Luck Professions Registered."); } } }
using System; using System.Text; using System.Collections.Generic; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using Newtonsoft.Json; using System.IO; using Hl7.Fhir.Support; using Hl7.Fhir.Serializers; using System.Text.RegularExpressions; using System.Xml; namespace Hl7.Fhir.Tests { [TestClass] public class BundleTests { [TestMethod] public void TestSerializeBundleXml() { Bundle b = createTestBundle(); StringWriter w = new StringWriter(); XmlWriter xw = XmlWriter.Create(w); b.Save(xw); xw.Flush(); xw.Close(); Assert.AreEqual(testBundleAsXml, w.ToString()); } [TestMethod] public void TestSerializeBundleJson() { Bundle b = createTestBundle(); StringWriter w = new StringWriter(); JsonWriter jw = new JsonTextWriter(w); b.Save(jw); jw.Flush(); jw.Close(); Assert.AreEqual(testBundleAsJson, w.ToString()); } [TestMethod] public void TestHandleCrap() { var errors = new ErrorList(); Bundle.LoadFromJson("Crap!", errors); Assert.IsTrue(errors.Count > 0); errors.Clear(); Bundle.LoadFromJson("{ \" Crap!", errors); Assert.IsTrue(errors.Count > 0); errors.Clear(); Bundle.LoadFromXml("Crap", errors); Assert.IsTrue(errors.Count > 0); errors.Clear(); Bundle.LoadFromXml("<Crap><cra", errors); Assert.IsTrue(errors.Count > 0); } [TestMethod] public void TestParseBundleXml() { ErrorList errors = new ErrorList(); Bundle result = Bundle.Load(XmlReader.Create(new StringReader(testBundleAsXml)), errors); Assert.AreEqual(0, errors.Count, errors.Count > 0 ? errors.ToString() : null); // And serialize again, to see the roundtrip. StringWriter w = new StringWriter(); XmlWriter xw = XmlWriter.Create(w); result.Save(xw); xw.Flush(); xw.Close(); Assert.AreEqual(testBundleAsXml, w.ToString()); } [TestMethod] public void TestParseBundleJson() { ErrorList errors = new ErrorList(); Bundle result = Bundle.Load(new JsonTextReader(new StringReader(testBundleAsJson)), errors); Assert.AreEqual(0, errors.Count, errors.Count > 0 ? errors.ToString() : null); // And serialize again, to see the roundtrip. StringWriter w = new StringWriter(); JsonWriter jw = new JsonTextWriter(w); result.Save(jw); jw.Flush(); jw.Close(); Assert.AreEqual(testBundleAsJson, w.ToString()); } private string testBundleAsXml = @"<?xml version=""1.0"" encoding=""utf-16""?><feed xmlns=""http://www.w3.org/2005/Atom""><title type=""text"">Updates to resource 233</title>" + @"<id>urn:uuid:0d0dcca9-23b9-4149-8619-65002224c3</id><updated>2012-11-02T14:17:21Z</updated><link rel=""self"" " + @"href=""http://test.com/fhir/patient/@233/history$format=json"" /><link rel=""last"" href=""http://test.com/fhir/patient/@233"" />"+ @"<author><name>Ewout Kramer</name></author>" + @"<entry><title type=""text"">Resource 233 Version 1</title><link rel=""self"" href=""http://test.com/fhir/patient/@233/history/@1"" />"+ @"<id>http://test.com/fhir/patient/@233</id><updated>2012-11-01T13:04:14Z</updated><published>2012-11-02T14:17:21Z</published><author>"+ @"<name>110.143.187.242</name></author><category term=""Patient"" scheme=""http://hl7.org/fhir/resource-types"" /><content type=""text/xml"">"+ @"<Patient xmlns=""http://hl7.org/fhir""><text><status value=""generated"" /><div xmlns=""http://www.w3.org/1999/xhtml"">summary here</div>"+ @"</text></Patient></content><summary type=""xhtml""><div xmlns=""http://www.w3.org/1999/xhtml"">summary here</div></summary></entry>"+ @"<deleted-entry ref=""http://test.com/fhir/patient/@233"" when=""2012-11-01T13:15:30Z"" xmlns=""http://purl.org/atompub/tombstones/1.0"">"+ @"<link rel=""self"" href=""http://test.com/fhir/patient/@233/history/@2"" xmlns=""http://www.w3.org/2005/Atom"" /></deleted-entry><entry>"+ @"<title type=""text"">Resource 99 Version 1</title><link rel=""self"" href=""http://test.com/fhir/binary/@99/history/@1"" />"+ @"<id>http://test.com/fhir/binary/@99</id><updated>2012-10-31T13:04:14Z</updated><published>2012-11-02T14:17:21Z</published>"+ @"<category term=""Binary"" scheme=""http://hl7.org/fhir/resource-types"" /><content type=""text/xml"">"+ @"<Binary contentType=""application/x-test"" xmlns=""http://hl7.org/fhir"">AAECAw==</Binary></content><summary type=""xhtml""><div xmlns=""http://www.w3.org/1999/xhtml"">" + @"Binary content</div></summary></entry></feed>"; private string testBundleAsJson = @"{""title"":""Updates to resource 233"",""updated"":""2012-11-02T14:17:21+00:00"",""id"":""urn:uuid:0d0dcca9-23b9-4149-8619-65002224c3"","+ @"""link"":[{""rel"":""self"",""href"":""http://test.com/fhir/patient/@233/history$format=json""},{""rel"":""last"",""href"":"+ @"""http://test.com/fhir/patient/@233""}],"+ @"""author"":[{""name"":""Ewout Kramer""}]," + @"""entry"":[{""title"":""Resource 233 Version 1"",""link"":[{""rel"":""self"",""href"":"+ @"""http://test.com/fhir/patient/@233/history/@1""}],""id"":""http://test.com/fhir/patient/@233"",""updated"":""2012-11-01T13:04:14+00:00"","+ @"""published"":""2012-11-02T14:17:21+00:00"",""author"":[{""name"":""110.143.187.242""}],""summary"":"+ @"""<div xmlns=\""http://www.w3.org/1999/xhtml\"">summary here</div>"",""category"":[{""term"":""Patient"",""scheme"":"+ @"""http://hl7.org/fhir/resource-types""}],""content"":{""Patient"":{""text"":{""status"":{""value"":""generated""},""div"":"+ @"""<div xmlns=\""http://www.w3.org/1999/xhtml\"">summary here</div>""}}}},{""deleted"":""2012-11-01T13:15:30+00:00"",""id"":"+ @"""http://test.com/fhir/patient/@233"",""link"":[{""rel"":""self"",""href"":""http://test.com/fhir/patient/@233/history/@2""}]},"+ @"{""title"":""Resource 99 Version 1"",""link"":[{""rel"":""self"",""href"":""http://test.com/fhir/binary/@99/history/@1""}],""id"":"+ @"""http://test.com/fhir/binary/@99"",""updated"":""2012-10-31T13:04:14+00:00"",""published"":""2012-11-02T14:17:21+00:00"","+ @"""summary"":""<div xmlns='http://www.w3.org/1999/xhtml'>Binary content</div>"",""category"":[{""term"":"+ @"""Binary"",""scheme"":""http://hl7.org/fhir/resource-types""}],""content"":{""Binary"":{""contentType"":""application/x-test"",""content"":"+ @"""AAECAw==""}}}]}"; private static Bundle createTestBundle() { Bundle b = new Bundle(); b.Title = "Updates to resource 233"; b.Id = new Uri("urn:uuid:0d0dcca9-23b9-4149-8619-65002224c3"); b.LastUpdated = new DateTimeOffset(2012, 11, 2, 14, 17, 21, TimeSpan.Zero); b.Links.SelfLink = new Uri("http://test.com/fhir/patient/@233/history$format=json"); b.Links.LastLink = new Uri("http://test.com/fhir/patient/@233"); b.AuthorName = "Ewout Kramer"; ResourceEntry e1 = new ResourceEntry(); e1.Id = new Uri("http://test.com/fhir/patient/@233"); e1.Title = "Resource 233 Version 1"; e1.SelfLink = new Uri("http://test.com/fhir/patient/@233/history/@1"); e1.LastUpdated = new DateTimeOffset(2012, 11, 01, 13, 04, 14, TimeSpan.Zero); e1.Published = new DateTimeOffset(2012, 11, 2, 14, 17, 21, TimeSpan.Zero); e1.EntryAuthorName = "110.143.187.242"; e1.Content = new Model.Patient() { Text = new Model.Narrative() { Status = Model.Narrative.NarrativeStatus.Generated, Div = "<div xmlns=\"http://www.w3.org/1999/xhtml\">summary here</div>" } }; DeletedEntry e2 = new DeletedEntry(); e2.Id = new Uri("http://test.com/fhir/patient/@233"); e2.SelfLink = new Uri("http://test.com/fhir/patient/@233/history/@2"); e2.When = new DateTimeOffset(2012, 11, 01, 13, 15, 30, TimeSpan.Zero); BinaryEntry e3 = new BinaryEntry(); e3.Id = new Uri("http://test.com/fhir/binary/@99"); e3.Title = "Resource 99 Version 1"; e3.SelfLink = new Uri("http://test.com/fhir/binary/@99/history/@1"); e3.LastUpdated = new DateTimeOffset(2012, 10, 31, 13, 04, 14, TimeSpan.Zero); e3.Published = new DateTimeOffset(2012, 11, 2, 14, 17, 21, TimeSpan.Zero); e3.MediaType = "application/x-test"; e3.Content = new byte[] { 0x00, 0x01, 0x02, 0x03 }; b.Entries.Add(e1); b.Entries.Add(e2); b.Entries.Add(e3); return b; } } }
using SocialWorld.Business.Interfaces; using SocialWorld.Business.StringInfo; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SocialWorld.WebApi { public static class JwtIdentityInitializer { public static async Task Seed(IAppUserService appUserService, IAppUserRoleService appUserRoleService, IAppRoleService appRoleService) { var adminRole = await appRoleService.FindByNameAsync(RoleInfo.Admin); if (adminRole == null) { await appRoleService.AddAsync(new Entities.Concrete.AppRole { Name = RoleInfo.Admin }); } var memberRole = await appRoleService.FindByNameAsync(RoleInfo.Member); if (memberRole == null) { await appRoleService.AddAsync(new Entities.Concrete.AppRole { Name = RoleInfo.Member }); } var adminUser = await appUserService.FindByEmail("test@test.com"); if (adminUser == null) { string password = BCrypt.Net.BCrypt.HashPassword("1"); await appUserService.AddAsync(new Entities.Concrete.AppUser { Name="Admin Test", Password = password, Email = "test@test.com", }); var role = await appRoleService.FindByNameAsync(RoleInfo.Admin); var admin = await appUserService.FindByEmail("test@test.com"); await appUserRoleService.AddAsync(new Entities.Concrete.AppUserRole { AppUserId = admin.Id, AppRoleId = role.Id }); } } } }
using System; using System.Collections.Generic; namespace IrsMonkeyApi.Models.DB { public partial class StateCode { public string StateCode1 { get; set; } public int StateCodeId { get; set; } } }
using System; using System.Collections.Generic; using Crossroads.Utilities.Services.Interfaces; using MinistryPlatform.Translation.Models.DTO; using MinistryPlatform.Translation.Repositories.Interfaces; using Moq; using NUnit.Framework; using SignInCheckIn.Models.DTO; using SignInCheckIn.Services; using SignInCheckIn.Services.Interfaces; namespace SignInCheckIn.Tests.Services { public class ChildCheckinServiceTest { private Mock<IChildCheckinRepository> _childCheckinRepository; private Mock<IContactRepository> _contactRepository; private Mock<IEventService> _eventService; private Mock<IApplicationConfiguration> _applicationConfiguration; private Mock<IRoomRepository> _roomRepository; private Mock<IEventRepository> _eventRepository; private ChildCheckinService _fixture; [SetUp] public void SetUp() { AutoMapperConfig.RegisterMappings(); _childCheckinRepository = new Mock<IChildCheckinRepository>(); _contactRepository = new Mock<IContactRepository>(); _eventService = new Mock<IEventService>(); _roomRepository = new Mock<IRoomRepository>(); _applicationConfiguration = new Mock<IApplicationConfiguration>(); _eventRepository = new Mock<IEventRepository>(); _fixture = new ChildCheckinService(_childCheckinRepository.Object, _contactRepository.Object, _roomRepository.Object, _applicationConfiguration.Object, _eventService.Object, _eventRepository.Object); } [Test] public void ShouldGetChildrenForCurrentEventAndRoomNoEventIdNonAc() { var siteId = 1; var roomId = 321; const string kioskId = "504c73c1-d664-4ccd-964e-e008e7ce2635"; var eventDto = new EventDto { EarlyCheckinPeriod = 30, EventEndDate = DateTime.Now.AddDays(1), EventId = 1234567, EventStartDate = DateTime.Now, EventTitle = "test event", EventType = "type test", LateCheckinPeriod = 30, }; //var subEventDto = new MpEventDto //{ // EventId = 2345678, // ParentEventId = 1234567 //}; List<MpEventDto> subEvents = new List<MpEventDto> { //subEventDto }; var mpParticipantsDto = new List<MpParticipantDto> { new MpParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime() } }; var mpEventRoomDto = new MpEventRoomDto { EventId = 1234567, RoomId = roomId }; _eventService.Setup(m => m.GetCurrentEventForSite(It.IsAny<int>(), It.IsAny<string>())).Returns(eventDto); _eventRepository.Setup(m => m.GetSubeventsForEvents(It.IsAny<List<int>>(), null)).Returns(subEvents); _roomRepository.Setup(m => m.GetEventRoomForEventMaps(It.IsAny<List<int>>(), roomId)).Returns(mpEventRoomDto); _childCheckinRepository.Setup(m => m.GetChildrenByEventAndRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(mpParticipantsDto); var result = _fixture.GetChildrenForCurrentEventAndRoom(roomId, siteId, null, kioskId); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpParticipantsDto[0].ParticipantId, result.Participants[0].ParticipantId); Assert.AreEqual(mpParticipantsDto[0].ContactId, result.Participants[0].ContactId); Assert.AreEqual(result.CurrentEvent.EventId, eventDto.EventId); } [Test] public void ShouldGetChildrenForCurrentEventAndRoomEventIdNonAc() { var siteId = 1; var roomId = 321; const string kioskId = "504c73c1-d664-4ccd-964e-e008e7ce2635"; var eventDto = new EventDto { EarlyCheckinPeriod = 30, EventEndDate = DateTime.Now.AddDays(1), EventId = 1234567, EventStartDate = DateTime.Now, EventTitle = "test event", EventType = "type test", LateCheckinPeriod = 30, }; var mpParticipantsDto = new List<MpParticipantDto> { new MpParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime() } }; //var subEventDto = new MpEventDto //{ // EventId = 2345678, // ParentEventId = 1234567 //}; List<MpEventDto> subEvents = new List<MpEventDto> { //subEventDto }; var mpEventRoomDto = new MpEventRoomDto { EventId = 1234567, RoomId = roomId }; _eventService.Setup(m => m.GetEvent(It.IsAny<int>())).Returns(eventDto); _eventRepository.Setup(m => m.GetSubeventsForEvents(It.IsAny<List<int>>(), null)).Returns(subEvents); _roomRepository.Setup(m => m.GetEventRoomForEventMaps(It.IsAny<List<int>>(), roomId)).Returns(mpEventRoomDto); _childCheckinRepository.Setup(m => m.GetChildrenByEventAndRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(mpParticipantsDto); var result = _fixture.GetChildrenForCurrentEventAndRoom(roomId, siteId, eventDto.EventId, kioskId); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpParticipantsDto[0].ParticipantId, result.Participants[0].ParticipantId); Assert.AreEqual(mpParticipantsDto[0].ContactId, result.Participants[0].ContactId); Assert.AreEqual(result.CurrentEvent.EventId, eventDto.EventId); } [Test] public void ShouldGetChildrenForCurrentEventAndRoomEventIdWithAcSubevent() { var siteId = 1; var roomId = 321; const string kioskId = "504c73c1-d664-4ccd-964e-e008e7ce2635"; var eventDto = new EventDto { EarlyCheckinPeriod = 30, EventEndDate = DateTime.Now.AddDays(1), EventId = 1234567, EventStartDate = DateTime.Now, EventTitle = "test event", EventType = "type test", LateCheckinPeriod = 30, }; var mpParticipantsDto = new List<MpParticipantDto> { new MpParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime() } }; var subEventDto = new MpEventDto { EventId = 2345678, ParentEventId = 1234567 }; List<MpEventDto> subEvents = new List<MpEventDto> { subEventDto }; var mpEventRoomDto = new MpEventRoomDto { EventId = 1234567, RoomId = roomId }; _eventService.Setup(m => m.GetEvent(It.IsAny<int>())).Returns(eventDto); _eventRepository.Setup(m => m.GetSubeventsForEvents(It.IsAny<List<int>>(), null)).Returns(subEvents); _roomRepository.Setup(m => m.GetEventRoomForEventMaps(It.IsAny<List<int>>(), roomId)).Returns(mpEventRoomDto); _childCheckinRepository.Setup(m => m.GetChildrenByEventAndRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(mpParticipantsDto); var result = _fixture.GetChildrenForCurrentEventAndRoom(roomId, siteId, eventDto.EventId, kioskId); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpParticipantsDto[0].ParticipantId, result.Participants[0].ParticipantId); Assert.AreEqual(mpParticipantsDto[0].ContactId, result.Participants[0].ContactId); Assert.AreEqual(result.CurrentEvent.EventId, eventDto.EventId); } [Test] public void ShouldGetChildrenForCurrentEventAndRoomEventIdWithAcSubEvent() { var siteId = 1; var roomId = 321; const string kioskId = "504c73c1-d664-4ccd-964e-e008e7ce2635"; var eventDto = new EventDto { EarlyCheckinPeriod = 30, EventEndDate = DateTime.Now.AddDays(1), EventId = 1234567, EventStartDate = DateTime.Now, EventTitle = "test event", EventType = "type test", LateCheckinPeriod = 30, }; var mpParticipantsDto = new List<MpParticipantDto> { new MpParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime() } }; var subEventDto = new MpEventDto { EventId = 2345678, ParentEventId = 1234567 }; List<MpEventDto> subEvents = new List<MpEventDto> { subEventDto }; var mpEventRoomDto = new MpEventRoomDto { EventId = 1234567, RoomId = roomId }; _eventService.Setup(m => m.GetEvent(It.IsAny<int>())).Returns(eventDto); _eventRepository.Setup(m => m.GetSubeventsForEvents(It.IsAny<List<int>>(), null)).Returns(subEvents); _roomRepository.Setup(m => m.GetEventRoomForEventMaps(It.IsAny<List<int>>(), roomId)).Returns(mpEventRoomDto); _childCheckinRepository.Setup(m => m.GetChildrenByEventAndRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(mpParticipantsDto); var result = _fixture.GetChildrenForCurrentEventAndRoom(roomId, siteId, eventDto.EventId, kioskId); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpParticipantsDto[0].ParticipantId, result.Participants[0].ParticipantId); Assert.AreEqual(mpParticipantsDto[0].ContactId, result.Participants[0].ContactId); Assert.AreEqual(result.CurrentEvent.EventId, eventDto.EventId); } [Test] public void ShouldGetChildrenForCurrentEventAndAdventureClubRoomEventIdWithAcSubEvent() { var siteId = 1; var roomId = 321; const string kioskId = "504c73c1-d664-4ccd-964e-e008e7ce2635"; var eventDto = new EventDto { EarlyCheckinPeriod = 30, EventEndDate = DateTime.Now.AddDays(1), EventId = 2345678, EventStartDate = DateTime.Now, EventTitle = "test event", EventType = "type test", LateCheckinPeriod = 30, }; var mpParticipantsDto = new List<MpParticipantDto> { new MpParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime() } }; var subEventDto = new MpEventDto { EventId = 2345678, ParentEventId = 1234567 }; List<MpEventDto> subEvents = new List<MpEventDto> { subEventDto }; var mpEventRoomDto = new MpEventRoomDto { EventId = 2345678, RoomId = roomId }; _eventService.Setup(m => m.GetEvent(It.IsAny<int>())).Returns(eventDto); _eventRepository.Setup(m => m.GetSubeventsForEvents(It.IsAny<List<int>>(), null)).Returns(subEvents); _roomRepository.Setup(m => m.GetEventRoomForEventMaps(It.IsAny<List<int>>(), roomId)).Returns(mpEventRoomDto); _childCheckinRepository.Setup(m => m.GetChildrenByEventAndRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(mpParticipantsDto); var result = _fixture.GetChildrenForCurrentEventAndRoom(roomId, siteId, eventDto.EventId, kioskId); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpParticipantsDto[0].ParticipantId, result.Participants[0].ParticipantId); Assert.AreEqual(mpParticipantsDto[0].ContactId, result.Participants[0].ContactId); Assert.AreEqual(result.CurrentEvent.EventId, eventDto.EventId); } [Test] public void TestCheckinChildrenForCurrentEventAndRoom() { var dto = new ParticipantDto { ParticipantId = 12, ContactId = 1443, HouseholdPositionId = 2, FirstName = "First1", LastName = "Last1", DateOfBirth = new DateTime(), ParticipationStatusId = 3 }; _childCheckinRepository.Setup(m => m.CheckinChildrenForCurrentEventAndRoom(It.IsAny<int>(), It.IsAny<int>())); _fixture.CheckinChildrenForCurrentEventAndRoom(dto); _childCheckinRepository.VerifyAll(); } [Test] public void ShouldGetEventParticipantByCallNumber() { var eventId = 888; var subeventId = 999; var callNumber = 44; var roomId = 321; var mpEventParticipantDto = new MpEventParticipantDto { EventParticipantId = 12, FirstName = "First1", LastName = "Last1", CheckinHouseholdId = 432234, DateOfBirth = new DateTime() }; var mpContactDtos = new List<MpContactDto> { new MpContactDto { FirstName = "George" } }; var subevent = new MpEventDto { EventId = 333 }; _applicationConfiguration.Setup(m => m.CheckedInParticipationStatusId).Returns(4); _childCheckinRepository.Setup(m => m.GetEventParticipantByCallNumber(It.IsAny<List<int>>(), It.IsAny<int>())).Returns(mpEventParticipantDto); _contactRepository.Setup(m => m.GetHeadsOfHouseholdByHouseholdId(mpEventParticipantDto.CheckinHouseholdId.Value)).Returns(mpContactDtos); _eventRepository.Setup(mocked => mocked.GetSubeventByParentEventId(It.IsAny<int>(), It.IsAny<int>())).Returns(subevent); var result = _fixture.GetEventParticipantByCallNumber(eventId, callNumber, roomId, true); _childCheckinRepository.VerifyAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(mpEventParticipantDto.EventParticipantId, result.EventParticipantId); Assert.AreEqual(mpEventParticipantDto.FirstName, result.FirstName); } [Test] public void ShouldOverrideChildIntoRoom() { int eventId = 321; int eventParticipantId = 444; int roomId = 111; var eventRoom = new MpEventRoomDto { AllowSignIn = true, EventRoomId = 333, EventId = 222, RoomId = 111, CheckedIn = 2, SignedIn = 5, Capacity = 7 }; _roomRepository.Setup(m => m.GetEventRoom(It.IsAny<int>(), It.IsAny<int>())).Returns(eventRoom); _childCheckinRepository.Setup(m => m.OverrideChildIntoRoom(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>())); _fixture.OverrideChildIntoRoom(eventId, eventParticipantId, roomId); _childCheckinRepository.VerifyAll(); } } }
using NUnit.Framework; using Problems; namespace Tests { public class Tests { [SetUp] public void Setup() { } [Test] public void Test1() { Program p = new Program(); string result = p.Prefix("what ... did you say??"); Assert.AreEqual("22,5:what ... did you say??", result); string result1 = p.Prefix("hello"); Assert.AreEqual("5,1:hello", result1); string result2 = p.Prefix(""); Assert.AreEqual("0,0:", result2); string result3 = p.Prefix("1"); Assert.AreEqual("1,1:1", result3); string result4 = p.Prefix("1 1"); Assert.AreEqual("3,2:1 1", result4); string result5 = p.Prefix("1 1 1"); Assert.AreEqual("5,3:1 1 1", result5); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Szab.Hybrids; using Szab.Scheduling.Representation; using Szab.Extensions; namespace Szab.Scheduling.MSRCPSP { public class MSRCPSPAnnealedEASolver : AnnealedTournamentEvolutionarySolver<ScheduleSpecimen> { public ProjectSpecification ProjectData { get; private set; } protected override IEnumerable<ScheduleSpecimen> CreateInitialPopulation() { List<Task> availableTasks = this.ProjectData.Tasks.ToList(); List<ScheduleSpecimen> initialPopulation = new List<ScheduleSpecimen>(); for (int i = 0; i < this.PopulationSize; i++) { ScheduleSpecimen newSpecimen = new ScheduleSpecimen(this.ProjectData, availableTasks.Count); availableTasks.Shuffle(); availableTasks.CopyTo(newSpecimen.Tasks, 0); initialPopulation.Add(newSpecimen); } return initialPopulation; } public MSRCPSPAnnealedEASolver(ProjectSpecification projectData, int maxGenerations) { this.ProjectData = projectData; this.MaxGenerations = maxGenerations; } } }
 using System; using System.Collections.Generic; using System.Linq; namespace Oop._12_RefactoringBindAll { class Program { static int GetControlDigit0(long number) { int sum = 0; bool isOddPos = true; while (number > 0) { int digit = (int)(number % 10); if (isOddPos) sum += 3 * digit; else sum += digit; number += digit; number /= 10; isOddPos = !isOddPos; } int modulo = sum % 7; return modulo; } private static IEnumerable<int> GetDigitsOf(long number) { IList<int> digits = new List<int>(); while (number > 0) { digits.Add((int)(number % 10)); number /= 10; } return digits; } static int GetControlDigit1(long number) { int sum = 0; bool isOddPos = true; foreach (int digit in GetDigitsOf(number)) { if (isOddPos) sum += 3 * digit; else sum += digit; number += digit; isOddPos = !isOddPos; } int modulo = sum % 7; return modulo; } private static IEnumerable<int> MultiplyingFactors { get { //return new int[] { 3,1, 3,1, 3,1 }; int factor = 3; while (true) { yield return factor; factor = 4 - factor; } } } static int GetControlDigit2(long number) { //int sum = 0; IEnumerator<int> factor = MultiplyingFactors.GetEnumerator(); IList<int> ponderedDigits = new List<int>(); foreach (int digit in GetDigitsOf(number)) { factor.MoveNext(); //sum += digit * factor.Current; ponderedDigits.Add(digit * factor.Current); } int sum = ponderedDigits.Sum(); int modulo = sum % 7; return modulo; } static int GetControlDigit3(long number) { //IEnumerable<int> ponderedDigits = GetDigitsOf(number) // .Zip(MultiplyingFactors, (a, b) => a * b); int sum = GetDigitsOf(number) .Zip(MultiplyingFactors, (a, b) => a * b) .Sum(); int modulo = sum % 7; return modulo; } static int GetControlDigit4(long number) => //GetDigitsOf(number) number .DigitsFromLowest() .Zip(MultiplyingFactors, (a, b) => a * b) .Sum() % 7; //introducing polimorphism static int GetControlDigit5(long number, Func<long,IEnumerable<int>> getDigitsOf) => getDigitsOf(number) .Zip(MultiplyingFactors, (a, b) => a * b) .Sum() % 7; //point for class extraction static int GetControlDigit5(long number, Func<long, IEnumerable<int>> getDigitsOf, int modulo) => getDigitsOf(number) .Zip(MultiplyingFactors, (a, b) => a * b) .Sum() % modulo; } static void MainX() { //final solution int controlDigit = ControlDigitAlgorithms.ForSalesDepartament.GetControlDigit(12345); } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _7DRL_2021.Menus { class StatMenu : Menu { public abstract class Tab { protected StatMenu StatMenu; public TextBuilder Text; public bool Dirty = true; public List<ITextElement> Lines = new List<ITextElement>(); protected virtual bool CanInit => true; public Tab(StatMenu menu) { StatMenu = menu; } public void Update() { if (Dirty && CanInit) { Init(); Dirty = false; } Text?.Update(); } public abstract void Init(); } public class RunTab : Tab { public HighscoreRunFile File; public RunStats Stats => File.Score; public AsyncCheck Loading; protected override bool CanInit => Loading.Done; public RunTab(StatMenu menu, HighscoreRunFile file, AsyncCheck loading) : base(menu) { File = file; Loading = loading; } public override void Init() { Text = new TextBuilder(StatMenu.Width, float.PositiveInfinity); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Level"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.Level.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Score"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.Score.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Cards"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); foreach(var card in Stats.Cards) { right.AppendElement(new TextElementIcon(card, right.DefaultFormat, right.DefaultDialog)); } right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Kills"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.Kills.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Gibs"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.Gibs.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Splats Collected"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.Splats.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Hearts Ripped"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.HeartsRipped.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Hearts Eaten"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.HeartsEaten.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Rats Hunted"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.RatsHunted.ToString()); right.EndLine(); }); AddLine((left) => { left.StartLine(LineAlignment.Left); left.AppendText("Cards Crushed"); left.EndLine(); }, (right) => { right.StartLine(LineAlignment.Right); right.AppendText(Stats.CardsCrushed.ToString()); right.EndLine(); }); Text.EndContainer(); Text.Finish(); } private void AddLine(Action<TextBuilder> leftText, Action<TextBuilder> rightText) { Text.StartTableRow(StatMenu.Width, new ColumnConfigs(new IColumnWidth[] { new ColumnFixedWidth(16, true), new ColumnFractionalWidth(0.5f, false), new ColumnFractionalWidth(0.5f, false), new ColumnFixedWidth(16, true), })); Text.StartTableCell(); Text.EndTableCell(); Text.StartTableCell(); leftText(Text); Text.EndTableCell(); Text.StartTableCell(); rightText(Text); Text.EndTableCell(); Lines.Add(Text.EndTableRow()); } } Scene Scene; LabelledUI UI; public Vector2 Position; List<Tab> Tabs = new List<Tab>(); Tab LeftTab; Tab RightTab; LerpFloat SwitchLerp = new LerpFloat(0); public int Selection; public int TabSelection; public LerpFloat Scroll = new LerpFloat(0); public override FontRenderer FontRenderer => Scene.FontRenderer; protected override IEnumerable<IMenuArea> MenuAreas => Enumerable.Empty<IMenuArea>(); public StatMenu(Scene scene) { Scene = scene; Width = scene.Viewport.Width / 3; Height = scene.Viewport.Height / 2; Position = new Vector2(scene.Viewport.Width / 2, scene.Viewport.Height / 2); UI = new LabelledUI(SpriteLoader.Instance.AddSprite("content/ui_box"), SpriteLoader.Instance.AddSprite("content/ui_box"), null, () => new Point(Width, Height)); foreach(var file in GetRunScores()) { Tabs.Add(new RunTab(this, file, file.ReloadAsync())); } LeftTab = Tabs.First(); var formatName = new TextFormatting() { Bold = true, }; } private IEnumerable<HighscoreRunFile> GetRunScores() { DirectoryInfo dir = new DirectoryInfo("stats/runs"); return dir.GetFiles("*.json").Select(file => new HighscoreRunFile(file.FullName, new RunStats())); } public override void HandleInput(Scene scene) { base.HandleInput(scene); if (InputBlocked) return; Tab tab = GetCurrentTab(); if (scene.InputState.IsKeyPressed(Keys.W, 15, 5)) Selection--; if (scene.InputState.IsKeyPressed(Keys.S, 15, 5)) Selection++; if (scene.InputState.IsKeyPressed(Keys.A, 15, 5)) { TabSelection = Tabs.Count <= 0 ? 0 : (TabSelection + Tabs.Count - 1) % Tabs.Count; LeftTab = Tabs[TabSelection]; RightTab = tab; SwitchLerp.Set(1, 0, LerpHelper.Linear, 10); } if (scene.InputState.IsKeyPressed(Keys.D, 15, 5)) { TabSelection = Tabs.Count <= 0 ? 0 : (TabSelection + Tabs.Count + 1) % Tabs.Count; LeftTab = tab; RightTab = Tabs[TabSelection]; SwitchLerp.Set(0, 1, LerpHelper.Linear, 10); } Selection = tab.Lines.Count <= 0 ? 0 : (Selection + tab.Lines.Count) % tab.Lines.Count; UpdateScroll(tab); } private Tab GetCurrentTab() { if (SwitchLerp.End < 0.5f) return LeftTab; else return RightTab; } public void UpdateScroll(Tab tab) { if (tab.Lines.Empty()) return; var currentTop = tab.Lines[Selection].GetTop(); var currentBottom = tab.Lines[Selection].GetBottom(); if (currentTop < Scroll) { Scroll.Set(currentTop, LerpHelper.Linear, 5); } if (currentBottom > Scroll + Height) { Scroll.Set(currentBottom - Height, LerpHelper.Linear, 5); } } public override void Update(Scene scene) { base.Update(scene); LeftTab?.Update(); RightTab?.Update(); SwitchLerp.Update(); Scroll.Update(); } public override void PreDraw(Scene scene) { base.PreDraw(scene); scene.PushSpriteBatch(blendState: scene.NonPremultiplied, samplerState: SamplerState.PointWrap, projection: Projection); scene.GraphicsDevice.Clear(Color.TransparentBlack); if (LeftTab != null && LeftTab.Text != null) LeftTab.Text.Draw(new Vector2(-Width * SwitchLerp.Value, -Scroll), FontRenderer); if (RightTab != null && RightTab.Text != null) RightTab.Text.Draw(new Vector2(Width * (1 - SwitchLerp.Value), -Scroll), FontRenderer); scene.PopSpriteBatch(); } public override void Draw(Scene scene) { int x = (int)Position.X - Width / 2; int y = (int)Position.Y - Height / 2; float openCoeff = Math.Min(Ticks / 7f, 1f); UI.Draw(FontRenderer, x, y, openCoeff); if (openCoeff >= 1) { scene.SpriteBatch.Draw(RenderTarget, new Rectangle(x, y, RenderTarget.Width, RenderTarget.Height), RenderTarget.Bounds, Color.White); } } } }
using System; using Utilities; namespace EddiEvents { [PublicAPI] public class LowFuelEvent : Event { public const string NAME = "Low fuel"; public const string DESCRIPTION = "Triggered when your fuel level falls below 25% and in 5% increments thereafter"; public const string SAMPLE = null; public LowFuelEvent(DateTime timestamp) : base(timestamp, NAME) { } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class MagicMouseEvents : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler //for setting magic menu details { public Text magicDesc; public Text MPCostText; public Text cooldownText; public BaseHero heroToCastOn; BaseHero heroFromMenu; BaseMagicScript magicScript; GameMenu menu; AudioManager AM; public BaseAttack magicUsed; public Coroutine processMagic = null; public Coroutine chooseHero = null; private void Start() { magicDesc = GameObject.Find("MagicMenuCanvas/MagicMenuPanel/MagicDescriptionPanel/MagicDescriptionText").GetComponent<Text>(); MPCostText = GameObject.Find("MagicMenuCanvas/MagicMenuPanel/MagicDetailsPanel/MPCostText").GetComponent<Text>(); cooldownText = GameObject.Find("MagicMenuCanvas/MagicMenuPanel/MagicDetailsPanel/CooldownText").GetComponent<Text>(); menu = GameObject.Find("GameManager/Menus").GetComponent<GameMenu>(); //the menu script on GameManager AM = GameObject.Find("GameManager").GetComponent<AudioManager>(); heroFromMenu = menu.heroToCheck; //hero that was chosen to enter the magic menu with } public BaseAttack GetMagic(string name) //gets the actual magic spell { foreach (BaseAttack magic in heroFromMenu.MagicAttacks) { if (magic.name == name) { return magic; } } return null; } public string GetMagicName() //gets the spell name based on which panel is clicked { return gameObject.transform.Find("Name").GetComponent<Text>().text; } public void OnPointerEnter(PointerEventData eventData) //sets magic details on magic menu based on which magic panel is being hovered { magicDesc.text = GetMagic(GetMagicName()).description; MPCostText.text = GetMagic(GetMagicName()).MPCost.ToString(); cooldownText.text = GetMagic(GetMagicName()).cooldown.ToString(); } public void OnPointerExit(PointerEventData eventData) //sets magic details on magic menus to blank values when not hovering any magic panels { magicDesc.text = ""; MPCostText.text = "-"; cooldownText.text = "-"; } public void OnPointerClick(PointerEventData eventData) //starts magic processing upon clicking magic spell { if (GetMagic(GetMagicName()).usableInMenu && GetMagic(GetMagicName()).enoughMP) { if (GetMagic(GetMagicName()).useState == BaseAttack.UseStates.HERO) { magicUsed = GetMagic(GetMagicName()); processMagic = StartCoroutine(ProcessMagic()); } } else { menu.PlaySE(AM.cantActionSE); } } static List<RaycastResult> GetEventSystemRaycastResults() //gets all objects clicked { PointerEventData eventData = new PointerEventData(EventSystem.current); eventData.position = Input.mousePosition; List<RaycastResult> raysastResults = new List<RaycastResult>(); EventSystem.current.RaycastAll(eventData, raysastResults); return raysastResults; } public IEnumerator ProcessMagic() { menu.DisplayCanvas(menu.HeroSelectMagicPanel); //yield return ChooseHero(); //choose hero to cast spell on chooseHero = StartCoroutine(ChooseHero()); yield return chooseHero; magicScript = new BaseMagicScript(); magicScript.spell = magicUsed; //sets the spell to be cast in magic script magicScript.heroPerformingAction = heroFromMenu; //sets the casting hero in magic script magicScript.heroReceivingAction = heroToCastOn; //sets the receiving hero in magic script magicScript.ProcessMagicHeroToHero(false); //processes the spell heroFromMenu.curMP -= magicUsed.MPCost; UpdateUI(); //updates interface magicUsed = null; //sets magicUsed to null so it isn't used again next time magicScript = null; //sets magicScript to null so it can't be used again next time heroToCastOn = null; //sets hero to be cast on to null so they arent cast on again next time } public IEnumerator ChooseHero() //chooses hero based on which hero panel is clicked { menu.PlaySE(AM.confirmSE); DrawHeroSelectPanel(); yield return menu.AnimateMagicHeroSelectPanel(); menu.choosingHeroForMagicMenu = true; while (heroToCastOn == null) { if (Input.GetButtonDown("Cancel")) { StopCoroutine(processMagic); StopCoroutine(chooseHero); } GetHeroClicked(); yield return null; } if (heroToCastOn != null) { menu.PlaySE(AM.healSE); } yield return menu.AnimateMagicHeroSelectPanel(); GameObject.Find("GameManager/Menus/MagicMenuCanvas/MagicMenuPanel/HeroSelectMagicPanel/Hero1SelectMagicPanel").GetComponent<MagicMenuMouseEvents>().HideBorder(); GameObject.Find("GameManager/Menus/MagicMenuCanvas/MagicMenuPanel/HeroSelectMagicPanel/Hero2SelectMagicPanel").GetComponent<MagicMenuMouseEvents>().HideBorder(); GameObject.Find("GameManager/Menus/MagicMenuCanvas/MagicMenuPanel/HeroSelectMagicPanel/Hero3SelectMagicPanel").GetComponent<MagicMenuMouseEvents>().HideBorder(); GameObject.Find("GameManager/Menus/MagicMenuCanvas/MagicMenuPanel/HeroSelectMagicPanel/Hero4SelectMagicPanel").GetComponent<MagicMenuMouseEvents>().HideBorder(); GameObject.Find("GameManager/Menus/MagicMenuCanvas/MagicMenuPanel/HeroSelectMagicPanel/Hero5SelectMagicPanel").GetComponent<MagicMenuMouseEvents>().HideBorder(); menu.HideCanvas(menu.HeroSelectMagicPanel); menu.choosingHeroForMagicMenu = false; } void DrawHeroSelectPanel() //shows hero panels to be selected to cast spell on { menu.DisplayCanvas(menu.HeroSelectMagicPanel); int heroCount = GameManager.instance.activeHeroes.Count; DrawHeroSelectPanels(heroCount); for (int i = 0; i < heroCount; i++) //Display hero stats { GameObject.Find("Hero" + (i + 1) + "SelectMagicPanel").transform.Find("NameText").GetComponent<Text>().text = GameManager.instance.activeHeroes[i].name; //Name text menu.DrawHeroFace(GameManager.instance.activeHeroes[i], GameObject.Find("Hero" + (i + 1) + "SelectMagicPanel").transform.Find("FacePanel").GetComponent<Image>()); GameObject.Find("Hero" + (i + 1) + "SelectMagicPanel").transform.Find("LevelText").GetComponent<Text>().text = GameManager.instance.activeHeroes[i].currentLevel.ToString(); //Level text GameObject.Find("Hero" + (i + 1) + "SelectMagicPanel").transform.Find("HPText").GetComponent<Text>().text = (GameManager.instance.activeHeroes[i].curHP + " / " + GameManager.instance.activeHeroes[i].finalMaxHP); //HP text GameObject.Find("Hero" + (i + 1) + "SelectMagicPanel").transform.Find("MPText").GetComponent<Text>().text = (GameManager.instance.activeHeroes[i].curMP + " / " + GameManager.instance.activeHeroes[i].finalMaxMP); //MP text } } void DrawHeroSelectPanels(int count) //draws hero panels based on how many active heroes { if (count == 1) { menu.Hero1SelectMagicPanel.SetActive(true); menu.Hero2SelectMagicPanel.SetActive(false); menu.Hero3SelectMagicPanel.SetActive(false); menu.Hero4SelectMagicPanel.SetActive(false); menu.Hero5SelectMagicPanel.SetActive(false); } else if (count == 2) { menu.Hero1SelectMagicPanel.SetActive(true); menu.Hero2SelectMagicPanel.SetActive(true); menu.Hero3SelectMagicPanel.SetActive(false); menu.Hero4SelectMagicPanel.SetActive(false); menu.Hero5SelectMagicPanel.SetActive(false); } else if (count == 3) { menu.Hero1SelectMagicPanel.SetActive(true); menu.Hero2SelectMagicPanel.SetActive(true); menu.Hero3SelectMagicPanel.SetActive(true); menu.Hero4SelectMagicPanel.SetActive(false); menu.Hero5SelectMagicPanel.SetActive(false); } else if (count == 4) { menu.Hero1SelectMagicPanel.SetActive(true); menu.Hero2SelectMagicPanel.SetActive(true); menu.Hero3SelectMagicPanel.SetActive(true); menu.Hero4SelectMagicPanel.SetActive(true); menu.Hero5SelectMagicPanel.SetActive(false); } else if (count == 5) { menu.Hero1SelectMagicPanel.SetActive(true); menu.Hero2SelectMagicPanel.SetActive(true); menu.Hero3SelectMagicPanel.SetActive(true); menu.Hero4SelectMagicPanel.SetActive(true); menu.Hero5SelectMagicPanel.SetActive(true); } DrawHeroPanelBars(); } void DrawHeroPanelBars() //draws the magic menu HP/MP bars { if (GameManager.instance.activeHeroes.Count == 1) { menu.Hero1MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuHPProgressBar.transform.localScale.y); menu.Hero1MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuMPProgressBar.transform.localScale.y); } else if (GameManager.instance.activeHeroes.Count == 2) { menu.Hero1MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuHPProgressBar.transform.localScale.y); menu.Hero1MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuMPProgressBar.transform.localScale.y); menu.Hero2MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuHPProgressBar.transform.localScale.y); menu.Hero2MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuMPProgressBar.transform.localScale.y); } else if (GameManager.instance.activeHeroes.Count == 3) { menu.Hero1MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuHPProgressBar.transform.localScale.y); menu.Hero1MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuMPProgressBar.transform.localScale.y); menu.Hero2MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuHPProgressBar.transform.localScale.y); menu.Hero2MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuMPProgressBar.transform.localScale.y); menu.Hero3MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuHPProgressBar.transform.localScale.y); menu.Hero3MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuMPProgressBar.transform.localScale.y); } else if (GameManager.instance.activeHeroes.Count == 4) { menu.Hero1MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuHPProgressBar.transform.localScale.y); menu.Hero1MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuMPProgressBar.transform.localScale.y); menu.Hero2MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuHPProgressBar.transform.localScale.y); menu.Hero2MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuMPProgressBar.transform.localScale.y); menu.Hero3MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuHPProgressBar.transform.localScale.y); menu.Hero3MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuMPProgressBar.transform.localScale.y); menu.Hero4MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[3]), 0, 1), menu.Hero4MagicMenuHPProgressBar.transform.localScale.y); menu.Hero4MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[3]), 0, 1), menu.Hero4MagicMenuMPProgressBar.transform.localScale.y); } else if (GameManager.instance.activeHeroes.Count == 5) { menu.Hero1MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuHPProgressBar.transform.localScale.y); menu.Hero1MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[0]), 0, 1), menu.Hero1MagicMenuMPProgressBar.transform.localScale.y); menu.Hero2MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuHPProgressBar.transform.localScale.y); menu.Hero2MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[1]), 0, 1), menu.Hero2MagicMenuMPProgressBar.transform.localScale.y); menu.Hero3MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuHPProgressBar.transform.localScale.y); menu.Hero3MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[2]), 0, 1), menu.Hero3MagicMenuMPProgressBar.transform.localScale.y); menu.Hero4MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[3]), 0, 1), menu.Hero4MagicMenuHPProgressBar.transform.localScale.y); menu.Hero4MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[3]), 0, 1), menu.Hero4MagicMenuMPProgressBar.transform.localScale.y); menu.Hero5MagicMenuHPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesHP(GameManager.instance.activeHeroes[4]), 0, 1), menu.Hero5MagicMenuHPProgressBar.transform.localScale.y); menu.Hero5MagicMenuMPProgressBar.transform.localScale = new Vector2(Mathf.Clamp(GetProgressBarValuesMP(GameManager.instance.activeHeroes[4]), 0, 1), menu.Hero5MagicMenuMPProgressBar.transform.localScale.y); } } void GetHeroClicked() //gets hero based on which hero panel is clicked { //Check if the left Mouse button is clicked if (Input.GetKeyDown(KeyCode.Mouse0)) { List<RaycastResult> results = GetEventSystemRaycastResults(); //For every result returned, output the name of the GameObject on the Canvas hit by the Ray foreach (RaycastResult result in results) { if (result.gameObject.name == "Hero1SelectMagicPanel") { heroToCastOn = GameManager.instance.activeHeroes[0]; } if (result.gameObject.name == "Hero2SelectMagicPanel") { heroToCastOn = GameManager.instance.activeHeroes[1]; } if (result.gameObject.name == "Hero3SelectMagicPanel") { heroToCastOn = GameManager.instance.activeHeroes[2]; } if (result.gameObject.name == "Hero4SelectMagicPanel") { heroToCastOn = GameManager.instance.activeHeroes[3]; } if (result.gameObject.name == "Hero5SelectMagicPanel") { heroToCastOn = GameManager.instance.activeHeroes[4]; } } } } void UpdateUI() //updates interface { menu.DrawMagicMenuStats(); foreach (Transform child in GameObject.Find("WhiteMagicListPanel/WhiteMagicScroller/WhiteMagicListSpacer").transform) { if (heroFromMenu.curMP < GetMagic(child.gameObject.GetComponentInChildren<Text>().text).MPCost) { child.gameObject.GetComponentInChildren<Text>().color = Color.gray; GetMagic(child.gameObject.GetComponentInChildren<Text>().text).enoughMP = false; } } } float GetProgressBarValuesHP(BaseHero hero) { float heroHP = hero.curHP; float heroBaseHP = hero.finalMaxHP; float calc_HP; calc_HP = heroHP / heroBaseHP; return calc_HP; } float GetProgressBarValuesMP(BaseHero hero) { float heroMP = hero.curMP; float heroBaseMP = hero.finalMaxMP; float calc_MP; calc_MP = heroMP / heroBaseMP; return calc_MP; } }
using EmployeeDeactivation.Models; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace EmployeeDeactivation.Interface { public interface IAdminDataOperation { List<Teams> RetrieveSponsorDetails(); Task<bool> AddSponsorData(string teamName, string sponsorFirstName, string sponsorLastName, string sponsorGid, string sponsorEmail, string sponsorDepartment, string reportingManagerEmail); Task<bool> DeleteSponsorData(string gId); List<DeactivatedEmployeeDetails> RetrieveEmployeeDetails(); List<DeactivatedEmployeeDetails> DeactivationEmployeeData(); List<ActivationWorkflowModel> ActivationEmployeeData(); } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace _2018_07_28.Pages { public class IndexModel : PageModel { public static int Count = 0; public int OtherCount = 0; public DateTime CurrentTime { get; set; } public string MyMessage { get; set; } public void OnGet() { // Runs when someone requests my page CurrentTime = DateTime.Now; MyMessage = "This is a message from me to you!"; Count += 1; OtherCount += 1; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class FlowerPower : MonoBehaviour { public float timer = 10.0f; Material[] mat = new Material[4]; Rigidbody fireball; AudioSource effectsrc; AudioClip firesound; // Start is called before the first frame update void Start() { var player = GameObject.FindGameObjectWithTag("Player"); effectsrc = player.GetComponent<AudioSource>(); fireball = Resources.Load<Rigidbody>("Prefabs/fire"); mat[0] = Resources.Load<Material>("Materials/MarioCap2"); mat[1] = Resources.Load<Material>("Materials/MarioBody2"); mat[2] = Resources.Load<Material>("Materials/MarioCap.0"); mat[3] = Resources.Load<Material>("Materials/MarioBody.0"); firesound = Resources.Load<AudioClip>("SoundEffect/fireballsound"); GetComponentInChildren<Renderer>().materials[7].mainTexture = mat[0].mainTexture; GetComponentInChildren<Renderer>().materials[8].mainTexture = mat[1].mainTexture; } // Update is called once per frame void Update() { timer -= Time.deltaTime; if (Input.GetKeyDown(KeyCode.Space)) { SoundManager.instance.Play(effectsrc,firesound); Vector3 shootDir = new Vector3(1.0f,0.0f,0.0f); Rigidbody fireclone = (Rigidbody)Instantiate(fireball, this.transform.position+new Vector3(-1.0f,2.75f,0f), this.transform.rotation); float speed = gameObject.GetComponent<MoveForward>().speed / 0.4f; fireclone.AddForce(shootDir*(2000.0f*speed)); } if (timer <= 0){ Destroy(this); } } private void OnDestroy() { GetComponentInChildren<Renderer>().materials[7].mainTexture = mat[2].mainTexture; GetComponentInChildren<Renderer>().materials[8].mainTexture = mat[3].mainTexture; } }
using OrgMan.Data.Repository.Repositorybase; using OrgMan.DataContracts.Repository.RepositoryBase; using OrgMan.DataModel; namespace OrgMan.Data.Repository { public class LoginRepository : GenericRepository<Login>, IGenericRepository<Login> { public LoginRepository(OrgManEntities context) : base(context) { } } }
using System; using System.Collections.Generic; using Raven.Client; using Raven.Client.Document; using Raven.Client.Embedded; namespace Common { public static class Util { public static IDocumentStore GetStore(Options options) { var uri = new Uri(options.ConnectionString); var store = uri.Scheme == Uri.UriSchemeFile ? (IDocumentStore) new EmbeddableDocumentStore {DataDirectory = uri.LocalPath, DefaultDatabase = options.Database } : new DocumentStore {Url = uri.ToString(), DefaultDatabase = options.Database }; store.Initialize(); store.DatabaseCommands.GlobalAdmin.EnsureDatabaseExists(options.Database); return store; } public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key) { TValue value; dictionary.TryGetValue(key, out value); return value; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace _04.CompareTwoTextFiles { class CompareTwo { static void Main() { string path1 = "../../test.txt"; string path2 = "../../test2.txt"; int diff = 0; int equal = 0; using (StreamReader first = new StreamReader(path1)) { using (StreamReader second = new StreamReader(path2)) { string firstLine = first.ReadLine(); string secondLine = second.ReadLine(); while (firstLine != null && secondLine != null) { if (firstLine != secondLine) { diff++; } else { equal++; } firstLine = first.ReadLine(); secondLine = second.ReadLine(); } } Console.WriteLine("Different lines: {0}", diff); Console.WriteLine("Equal lines {0}", equal); } } } }
using System.Linq; using Cradiator.Config; using Cradiator.Model; using Cradiator.Services; using Cradiator.Views; using FakeItEasy; using Ninject; using NUnit.Framework; using Shouldly; namespace Cradiator.Tests.Model { [Ignore("Integration tests")] [Category("Integration")] [TestFixture] public class BuildStatusFetcher_IntegrationTests { ICradiatorView _view; IConfigSettings _configSettings; IKernel _kernel; IWebClientFactory _factory; [SetUp] public void SetUp() { _view = A.Fake<ICradiatorView>(); _configSettings = A.Fake<IConfigSettings>(); A.CallTo(() => _configSettings.ProjectNameRegEx).Returns(".*"); A.CallTo(() => _configSettings.CategoryRegEx).Returns(".*"); A.CallTo(() => _configSettings.ServerNameRegEx).Returns(".*"); _kernel = new StandardKernel(new CradiatorNinjaModule(_view, _configSettings)); _factory = _kernel.Get<IWebClientFactory>(); _kernel.Get<BuildDataTransformer>(); } [Test] public void a_connectivity_exception_will_be_thrown_if_the_uri_isnt_resolveable() { Assert.Throws<FetchException>(() => { var fetcher = new BuildDataFetcher( new ViewUrl("http://a.b.c.d.e.foo/ccnet/XmlStatusReport.aspx"), _configSettings, _factory); fetcher.Fetch(); }, "Unable to contact http://a.b.c.d.e.foo/ccnet/XmlStatusReport.aspx"); } [Test, Ignore("this test is a little sensitive - and will fail if anything is going wrong at the thoughtworks URL")] public void can_get_projects_from_a_realaddress() { var fetcher = new BuildDataFetcher(new ViewUrl("http://ccnetlive.thoughtworks.com/ccnet/XmlStatusReport.aspx"), _configSettings, _factory); var fetch = fetcher.Fetch().ToList(); fetch.Count.ShouldBeGreaterThan(0); fetch.ShouldContain(@"Project name=""CCNet"""); } } }
using Assets.Gamelogic.Utils; using Assets.Gamelogic.Player; using Improbable; using Improbable.Core; using Improbable.Unity; using Improbable.Unity.CodeGeneration; using Improbable.Unity.Visualizer; using UnityEngine; namespace Assets.Gamelogic.Interactable { //[WorkerType(WorkerPlatform.UnityClient)] public class PhonePickup : MonoBehaviour { public Transform reciever; private PhoneBehaviour recieverBehaviour; private Interaction playerInteration = null; private float waittime = 0.1f; private float timepassed = 0.1f; private void OnEnable() { if (reciever) { recieverBehaviour = reciever.GetComponent<PhoneBehaviour>(); if (recieverBehaviour == null) { Debug.LogError("Reciever Behavior Not Set!"); } } else { Debug.LogError("No Reciever Set!"); } } private void OnTriggerEnter(Collider other) { GameObject go = other.gameObject; //Debug.Log("Entered: " + go.name); //GameObject parent = go.transform.parent.gameObject; if (go.CompareTag("Player")) { //Debug.Log("Is Player"); playerInteration = go.GetComponent<Interaction>(); } } private void OnTriggerExit(Collider other) { GameObject go = other.gameObject; //Debug.Log("Entered: " + go.name); if (playerInteration != null) { //Debug.Log("Bye Bye Player"); //playerInteration = null; } } private void Update() { if (timepassed >= waittime) { if (playerInteration != null && playerInteration.pickup) { //Debug.Log("*** Got Click ***"); if (reciever) { //Debug.Log("Has Reciever"); OnPlayerClick(); timepassed = 0f; } } } else { timepassed += Time.deltaTime; } } private void OnPlayerClick() { if (recieverBehaviour.pickedup) { reciever.parent = transform; reciever.localPosition = Vector3.zero; reciever.localRotation = UnityEngine.Quaternion.identity; recieverBehaviour.pickedup = false; } else { reciever.parent = playerInteration.gameObject.transform; reciever.localPosition = new Vector3(0.5f, 0.8f, 0f); reciever.localEulerAngles = new Vector3(0f, 0f, -90f); recieverBehaviour.pickedup = true; } } } }
using System; using System.Collections.Generic; using System.IO; using System.Security.Cryptography; using System.Text; using System.Linq; namespace Compare { internal class FileComparison : IFileCompare { public CompareValue.Types Similar(CompareValue srcCompareValue, CompareValue tarCompareValue) { CompareValue.Types similarValue = CompareValue.Types.None; if (srcCompareValue.Hash?.ToLower() == tarCompareValue.Hash?.ToLower()) { similarValue |= CompareValue.Types.Hash; } if (srcCompareValue.Directory?.ToLower() == tarCompareValue.Directory?.ToLower()) { similarValue |= CompareValue.Types.Directory; } if (srcCompareValue.Extension?.ToLower() == tarCompareValue.Extension?.ToLower()) { similarValue |= CompareValue.Types.Extension; } if (srcCompareValue.FileName?.ToLower() == tarCompareValue.FileName?.ToLower()) { similarValue |= CompareValue.Types.FileName; } if (OnComparePartialFileName(srcCompareValue.FileName?.ToLower(), tarCompareValue.FileName?.ToLower(), 5)) { similarValue |= CompareValue.Types.FileNamePartial; } return similarValue; } private bool OnComparePartialFileName(string fileName1, string fileName2, int maxDif) { if (!string.IsNullOrWhiteSpace(fileName1) && !string.IsNullOrWhiteSpace(fileName2) && fileName1.Length >= 3 && fileName2.Length >= 3) { string lName = fileName1; string sName = fileName2; if (fileName2.Length > fileName1.Length) { lName = fileName2; sName = fileName1; } var arLong = OnCreateCompareStringArray(lName); var arShot = OnCreateCompareStringArray(sName); var dif = arLong.Except(arShot); if (dif.Count() <= maxDif) return true; // use different starting point for the [sName] sName = sName.Substring(1); arShot = OnCreateCompareStringArray(sName); dif = arLong.Except(arShot); if (dif.Count() <= maxDif) return true; sName = sName.Substring(1); arShot = OnCreateCompareStringArray(sName); dif = arLong.Except(arShot); if (dif.Count() <= maxDif) return true; } return false; } private List<string> OnCreateCompareStringArray(string value) { var retVal = new List<string>(); for (int i = 0; i < value.Length;) { string val; if (value.Length > i + 3) val = value.Substring(i, 3); else val = value.Substring(i); retVal.Add(val); i += 3; if (i >= value.Length) break; } return retVal; } private string OnGetMD5(string path) { if (AccessControl.File(path)) { using (var md5 = MD5.Create()) { using (var stream = File.OpenRead(path)) { var hash = md5.ComputeHash(stream); return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); } } } return null; } private FileInfo OnGetFileInfo(string path) { if (AccessControl.File(path)) { return new System.IO.FileInfo(path); } return null; } public CompareValue CreateCompareValue(string path) { var fileInfo = OnGetFileInfo(path); return new CompareValue { Hash = OnGetMD5(path), FileName = Path.GetFileNameWithoutExtension(path), Directory = Path.GetDirectoryName(path), Extension = Path.GetExtension(path), FileCreated = fileInfo != null ? fileInfo.CreationTime : DateTime.Now, FileModified = fileInfo?.LastWriteTime, FileSize = fileInfo != null ? fileInfo.Length : 0, }; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class AppeaseTimeoutPI : GhostPersonalityInstaller { float timeRemainingForAppeasement = 55; public override bool InstallPersonality(Ghost ghost) { if (ghost.appeaseConditionInstalled == false) { ghost.generalTransitionConditions.Add(new TimeoutTC(ghost, ghost.AppeasedTransitionState, timeRemainingForAppeasement)); ghost.appeaseConditionInstalled = true; return true; } return false; } }
using LibraryCoder.UtilitiesMisc; using System; using System.Diagnostics; using Windows.Foundation.Metadata; using Windows.UI.Core; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; namespace SampleUWP { enum UseBackButton { Off, On }; // Used to turn back button on or off. Enumeration limits this to one way or the other. public partial class MainPage : Page { // Declare pointer to this MainPage so other pages can call methods and variable from this MainPage(). public static MainPage mainPagePointer; // Save currentDeviceFamily value here and use to customize layouts for specific devices if needed. public DeviceFamily currentDeviceFamily; // TODO: do not use following! // Gets system accent color set by user in W10 personalization settings. // public Color usersSystemAccentColor = (Color)Application.Current.Resources["SystemAccentColor"]; // ListView variables below used to save last SplitView menu occurrences. Used on topMenu or botMenu so can deselect them when switching between the menus. private ListView topMenuSavedSelection = null; private ListView botMenuSavedSelection = null; private bool backEvent = false; // True if last navigation request came from buttonBack or global back event. // UWP apps can use built-in global back event to navigate to previous pages. But many of Microsoft's apps have moved the back button down into // the application's top bar just right of the Hamburger Menu Button. Show, none, one, the other, or both, by setting following two variables accordingly. private readonly UseBackButton backOnGlobal = UseBackButton.Off; // Manually set to On to show global back event button on window title bar. private readonly UseBackButton backOnTitleBar = UseBackButton.On; // Manually set to On to show back button right of Hamburger Menu Button. public MainPage() { this.InitializeComponent(); // These are public static variables that allows other pages to call public variables and methods that are part of this MainPage(). mainPagePointer = this; // Set value of pointer declared above currentDeviceFamily = LibUM.GetDeviceFamily(); // Get value of currentDeviceFamily. Debug.WriteLine($"MainPage(): currentDeviceFamily={currentDeviceFamily}"); // TODO: Following Xbox code may not be required now. Verify! /* if (DeviceFamily.Xbox.Equals(currentDeviceFamily)) { // If Xbox, then adjust margins on title bar items to be inside Safe Border Area Margin, "left,top,right,bottom", // or "48,27,48,27" or "48,27". Appearance will vary depending on actual TV used. TblkAppName.Margin = new Thickness(0, 28, 0, 8); ButAbout.Margin = new Thickness(50, 0, 0, 8); ButBack.Margin = new Thickness(50, 0, 0, 8); mainScroller.Margin = new Thickness(28, 0, 28, 8); // Xbox/TV output requires more margin to prevent chopping. } */ // Register a global back event handler. This can be registered on a per-page-bases if only have a subset of pages // that needs to handle back button or if want to do page-specific logic before deciding to navigate back from those pages. SystemNavigationManager.GetForCurrentView().BackRequested += Global_BackRequested; // If on a phone device that has dedicated back button, then hide the software back button. if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) { backOnGlobal = UseBackButton.Off; backOnTitleBar = UseBackButton.Off; } MainScrollerOff(); // Turn mainScroller off so other pages can set it's values as needed. topMenu.ItemsSource = topMenuList; // Populate the top SplitView menu from list topMenuList defined in menuSetup.cs file. botMenu.ItemsSource = botMenuList; // Populate the bot Splitview menu from list botMenuList defined in menuSetup.cs file. topMenu.SelectedIndex = 0; // Set topMenu[0] as current page which triggers Menu_SelectionChanged event and navigates to topMenu[0]. //(Application.Current).DebugSettings.EnableFrameRateCounter = true; // Override debug settings in app.xaml.cs //(Application.Current).DebugSettings.IsTextPerformanceVisualizationEnabled = true; // Override debug settings in app.xaml.cs } /************************************* Public Methods ****************************************************/ /// <summary> /// Each page needs to set it's own scroll and zoom requirements. Only parameters that need to be changed need to be entered. /// </summary> /// <param name="horz"></param> /// <param name="vert"></param> /// <param name="horzVis"></param> /// <param name="vertVis"></param> /// <param name="zoom"></param> /// <param name="maxZoom"></param> /// <param name="minZoom"></param> public void MainScrollerOn(ScrollMode horz = ScrollMode.Auto, ScrollMode vert = ScrollMode.Auto, ScrollBarVisibility horzVis = ScrollBarVisibility.Disabled, ScrollBarVisibility vertVis = ScrollBarVisibility.Visible, ZoomMode zoom = ZoomMode.Disabled, float maxZoom = 2.0f, float minZoom = 0.5f) { mainScroller.HorizontalScrollMode = horz; mainScroller.VerticalScrollMode = vert; mainScroller.HorizontalScrollBarVisibility = horzVis; mainScroller.VerticalScrollBarVisibility = vertVis; mainScroller.ZoomMode = zoom; mainScroller.MaxZoomFactor = maxZoom; mainScroller.MinZoomFactor = minZoom; } /// <summary> /// This is invoked before navigating to a new page and resets mainScroller. Each page can then set values as needed. /// </summary> public void MainScrollerOff() { mainScroller.HorizontalScrollMode = ScrollMode.Disabled; mainScroller.VerticalScrollMode = ScrollMode.Disabled; mainScroller.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; mainScroller.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled; mainScroller.ChangeView(0d, 0d, 1.0f); // Reset zoom factor before navigating to new page. mainScroller.MaxZoomFactor = 2.0f; mainScroller.MinZoomFactor = 0.5f; mainScroller.ZoomMode = ZoomMode.Disabled; } /// <summary> /// Update Title Bar Status text and set matching tooltip since truncation possible if space not available. /// This also allows other pages to access and update the Title Bar Status via pointer to this page. /// </summary> /// <param name="status"></param> public void UpdateTitleBarStatus(string status) { titleBarStatus.Text = status; ToolTipService.SetToolTip(titleBarStatus, status); } /************************************* Private Methods ****************************************************/ /// <summary> /// Invoked when user makes a selection from the topMenu or botMenu splitView menus and will navigate to the selected page. /// Also invoked whenever SelectedIndex is set as in MainPage() and Global_BackRequested() methods. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e) { _ = e; // Discard unused parameter. UpdateTitleBarStatus(string.Empty); // Clear title bar status and tooltip when navigating // Automatically close SplitView menu on selection if DisplayMode is Overlay or CompactOverlay. // This matches behavior that MicroSoft is doing with all their apps. SplitViewDisplayMode currentDisplayMode = menuSetup.DisplayMode; switch (currentDisplayMode) { case SplitViewDisplayMode.Overlay: // Overlay passes over the content menuSetup.IsPaneOpen = false; // Inline pushes content to the right break; case SplitViewDisplayMode.CompactOverlay: menuSetup.IsPaneOpen = false; break; default: // Throw exception so error can be discovered and corrected. throw new NotSupportedException("Invalid switch (currentDisplayMode)."); } // Get the triggered event from ListView of SelectedIndex. Could be from topMenu or botMenu and needs to determined below. if (sender is ListView listView) { if (listView.SelectedItem is MenuItem menuItem) { // Test if selected item is from bottom menu since if is typically shortest and least used. // If it is not from bottom menu, then it should be from top menu. bool isInBotMenu = false; Type currentPage = menuItem.PageNavigate; // get the current page foreach (MenuItem item in botMenuList) { if (currentPage == item.PageNavigate) { isInBotMenu = true; // Selected item is from botMenu break; } } if (isInBotMenu) { botMenuSavedSelection = listView; // Save current selection so it can be deselected later when go back to topMenu if (topMenuSavedSelection != null) topMenuSavedSelection.SelectedIndex = -1; // Deselect highlighted selection on topMenu } else { topMenuSavedSelection = listView; // Save current selection so it can be deselected later when go back to botMenu if (botMenuSavedSelection != null) botMenuSavedSelection.SelectedIndex = -1; // Deselect highlighted selection on botMenu } titleBarText.Text = menuItem.MenuText; // Display the current selected menu item in the title bar if (backEvent) // Skip navigation if global back happened since GoBack already navigated back backEvent = false; // Reset flag else { MainScrollerOff(); // Turn mainScroller off before navigating to next page. mainFrame.Navigate(menuItem.PageNavigate); // Navigate to the page of the item selected from the SplitView menus } if (currentPage == topMenuList[0].PageNavigate) // Check if current page is the Home page, hide back button if so. ToggleBackButton(UseBackButton.Off); else // Show back button if not on Home page, but check if actually can go back first. { if (mainFrame.CanGoBack) ToggleBackButton(UseBackButton.On); else // Collapse the back button if can't go back for whatever reason. ToggleBackButton(UseBackButton.Off); } } } } /// <summary> /// Invoked when user issues a global back on device. /// If the app has no in-app back stack left for the current view/frame the user may be navigated away back /// to the previous app in the system's app back stack or to the start screen. In windowed mode on desktop /// there is no system app back stack and the user will stay in the app even when the in-app back stack is depleted. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Global_BackRequested(object sender, BackRequestedEventArgs e) { // Back Button Navigation: https://msdn.microsoft.com/en-us/library/windows/apps/mt465734.aspx //SystemNavigationManager Class: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.systemnavigationmanager.aspx if (mainFrame.CanGoBack && e.Handled == false) { e.Handled = true; // Mark event as handled so don't get bounced out of this app. MainScrollerOff(); // Turn mainScroller off before navigating to next page. mainFrame.GoBack(); // Navigate to last/back page. Now need to update menu selections to match this page. GoBackPage(); // Update selection on SplitView menu. } else // Hide Back button if can't go back anymore. Not neccessarily on the Home page yet! Error or cache expended? { UpdateTitleBarStatus("Error: CanGoBack is false, unable to navigate back."); ToggleBackButton(UseBackButton.Off); } } /// <summary> /// Invoked when user selects Back button on title bar. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonBack_Click(object sender, RoutedEventArgs e) { _ = sender; // Discard unused parameter. _ = e; // Discard unused parameter. if (mainFrame.CanGoBack) { MainScrollerOff(); // Turn mainScroller off before navigating to next page. mainFrame.GoBack(); // Navigate to last/back page. Now need to update menu selections to match this page. GoBackPage(); // Update selection on SplitView menu. } else // Hide Back button if can't go back anymore. Not neccessarily on the Home page yet! Error or cache expended? { UpdateTitleBarStatus("Error: CanGoBack is false, unable to navigate back."); ToggleBackButton(UseBackButton.Off); } } /// <summary> /// Updates selection on SplitView menu. This is called from ButtonBack_Click() and Global_BackRequested() events above. /// </summary> private void GoBackPage() { backEvent = true; // Need to flag that back button was pressed to prevent navigating to page again. // Magic/key happens with following statement Type navPage = mainFrame.SourcePageType; // Get current page after navigating back. Now need find and update SplitVew menu to matching page. bool matchInTopMenu = false; bool matchInBotMenu = false; for (int i = 0; i < topMenuList.Count; i++) // Search topMenuList for match { if (navPage == topMenuList[i].PageNavigate) // Match found if true { matchInTopMenu = true; topMenu.SelectedIndex = i; // Set topMenu[i] as current page, this triggers Menu_SelectionChanged event above which does all the work. break; } } if (!matchInTopMenu) // No match was found in topMenuList so search botMenuList { for (int i = 0; i < botMenuList.Count; i++) { if (navPage == botMenuList[i].PageNavigate) // Match found if true; { matchInBotMenu = true; botMenu.SelectedIndex = i; // Set botMenu[i] as current page, this triggers Menu_SelectionChanged event above which does all the work. break; } } } if (!matchInTopMenu && !matchInBotMenu) // Just in case if dynamically changing menus and navigate back to a page that is no longer in menu. { UpdateTitleBarStatus("Error: Item not found in menu that matches current page, unable to update menu selection."); backEvent = false; // Reset flag } } /// <summary> /// Toggle back button on or off. /// </summary> /// <param name="state"></param> private void ToggleBackButton(UseBackButton state) { if (state == UseBackButton.Off) // Turn back button off { if (backOnGlobal == UseBackButton.On) SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; if (backOnTitleBar == UseBackButton.On) buttonBack.Visibility = Visibility.Collapsed; } else // Turn back button on if it isn't off { if (backOnGlobal == UseBackButton.On) SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; if (backOnTitleBar == UseBackButton.On) buttonBack.Visibility = Visibility.Visible; } } /// <summary> /// Invoked when user selects ListViewItem Hamburger Menu Button on title bar. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Hamburger_Tapped(object sender, TappedRoutedEventArgs e) { _ = sender; // Discard unused parameter. _ = e; // Discard unused parameter. menuSetup.IsPaneOpen = !menuSetup.IsPaneOpen; // Manually toggle SplitView menu on and off } /// <summary> /// Invoked when user right-clicks on Hamburger Menu Button. Use to experiment since this overrides current menu style. /// May want to disable this action in any release code. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Hamburger_RightTapped(object sender, RightTappedRoutedEventArgs e) { _ = sender; // Discard unused parameter. _ = e; // Discard unused parameter. SplitViewDisplayMode current = menuSetup.DisplayMode; switch (current) { case SplitViewDisplayMode.Overlay: menuSetup.DisplayMode = SplitViewDisplayMode.CompactOverlay; UpdateTitleBarStatus("DisplayMode=CompactOverlay"); // Overlay passes over the content break; case SplitViewDisplayMode.CompactOverlay: menuSetup.DisplayMode = SplitViewDisplayMode.Inline; UpdateTitleBarStatus("DisplayMode=Inline"); // Inline pushes content to the right break; case SplitViewDisplayMode.Inline: menuSetup.DisplayMode = SplitViewDisplayMode.CompactInline; UpdateTitleBarStatus("DisplayMode=CompactInline"); // Inline pushes content to the right break; case SplitViewDisplayMode.CompactInline: menuSetup.DisplayMode = SplitViewDisplayMode.Overlay; UpdateTitleBarStatus("DisplayMode=Overlay"); // Overlay passes over the content break; default: // Throw exception so error can be discovered and corrected. throw new NotSupportedException("Invalid switch (current)."); } } // TODO: Delete following method since not used??? /// <summary> /// Invoked by MainPage() above. If on phone device that has top Status Bar functionality, then hide the phone Status /// Bar to conserve screen space. This will not work without reference to "Windows Mobile Extensions For The UWP". /// </summary> //private async void CollapsePhoneStatusBar() //{ // Windows.UI.ViewManagement.StatusBar statusBar = StatusBar.GetForCurrentView(); // await statusBar.HideAsync(); // //await statusBar.ShowAsync(); // FYI, this would show the phone Status Bar but it resets on app exit so not needed. //} } // End of MainPage() /************************************************************************************************************************************************** The following items are bound IValueconverers that format items for display on the top and bottom SplitView menus. IValueConverter knows which list to use from initialiation code following "this.InitializeComponent()". The following statement starts the process, "topMenu.ItemsSource = topMenuList;" */ // MainPage.xaml calls this via ItemTemplate to alternate the font of left SplitMenu TextBlock depending if it is glyph ot text. public class SymbolTypeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { //Debug.WriteLine("Inside SymbolTypeConverter()"); if (value is MenuItem listItem) { if (listItem.SymbolType == MenuSymbolType.glyph) return (string)Application.Current.Resources["fontSymbol"]; // SymbolType is a glyph, so return symbol font. else return (string)Application.Current.Resources["fontText"]; // Default, SymbolType is text, so return text font. } else return null; } // No need to implement converting back on one-way binding. public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } // MainPage.xaml calls this via ItemTemplate to fill out the text or symbol items in left SplitMenu TextBlock. public class SymbolTextConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { //Debug.WriteLine("Inside SymbolTextConverter()"); if (value is MenuItem listItem) return listItem.SymbolText; // Return SymbolText value from the MenuItem list.t else return null; } // No need to implement converting back on one-way binding. public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } // MainPage.xaml calls this via ItemTemplate to fill out the text in right SplitMenu TextBlock. public class MenuTextConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { //Debug.WriteLine("Inside MenuTextConverter()" if (value is MenuItem listItem) return listItem.MenuText; // Return MenuText value from the MenuItem list. else return null; } // No need to implement converting back on one-way binding. public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Threading.Tasks; using System.Web; using System.Web.Mvc; using PagedList; using WebQLKhoaHoc.Models; namespace WebQLKhoaHoc.Controllers { public class HomeController : Controller { private QLKhoaHocEntities db = new QLKhoaHocEntities(); private QLKHRepository QLKHrepo = new QLKHRepository(); public ActionResult Index() { ViewBag.MaDonViQLThucHien = new SelectList(db.DonViQLs, "MaDonVi", "TenDonVI"); ViewBag.MaDanhMuc = new List<SelectListItem> { new SelectListItem { Text = "Nhà Khoa Học", Value = "0",Selected = true}, new SelectListItem { Text = "Đề Tài Khoa Học", Value ="1"}, new SelectListItem { Text = "Bài Báo Khoa Học", Value ="2"}, new SelectListItem { Text = "Sách Và Giáo Trình", Value ="3"}, }; return View(); } [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Search([Bind(Include = "MaDanhMuc,MaDonViQLThucHien,SearchValue")] HomeSearchViewModel home) { ViewBag.SearchValue = home.SearchValue; int Size_Of_Page = 6; int No_Of_Page = 1; switch (home.MaDanhMuc) { case "1": ViewBag.MaCapDeTai = new SelectList(db.CapDeTais, "MaCapDeTai", "TenCapDeTai"); ViewBag.MaDonViQLThucHien = new SelectList(db.DonViQLs, "MaDonVi", "TenDonVI"); ViewBag.MaLinhVuc = new SelectList(QLKHrepo.GetListMenuLinhVuc(), "Id", "TenLinhVuc"); var detais = db.DeTais.Include(d => d.CapDeTai).Include(d => d.LoaiHinhDeTai).Include(d => d.DonViChuTri).Include(d => d.DonViQL).Include(d => d.LinhVuc).Include(d => d.XepLoai).Include(d => d.TinhTrangDeTai).Include(d => d.PhanLoaiSP).ToList(); if (!String.IsNullOrEmpty(home.MaDonViQLThucHien) && home.MaDonViQLThucHien != "0") { detais = detais.Where(p => p.MaDonViQLThucHien.ToString() == home.MaDonViQLThucHien).ToList(); } if (!String.IsNullOrEmpty(home.SearchValue)) { detais = detais.Where(p => p.TenDeTai.ToLower().Contains(home.SearchValue.ToLower())).ToList(); } int totalPage1 = (int)Math.Ceiling((decimal)detais.Count() / 6); ViewBag.TotalItem = detais.Count(); IPagedList<DeTai> pageOrders1 = new StaticPagedList<DeTai>(detais, No_Of_Page, 1, totalPage1); return View("~/Views/DeTais/Index.cshtml", pageOrders1); case "2": ViewBag.MaLinhVuc = new SelectList(QLKHrepo.GetListMenuLinhVuc(), "Id", "TenLinhVuc"); ViewBag.MaCapTapChi = new SelectList(db.CapTapChis, "MaCapTapChi", "TenCapTapChi"); ViewBag.MaPhanLoaiTapChi = new SelectList(db.PhanLoaiTapChis, "MaLoaiTapChi", "TenLoaiTapChi"); ViewBag.MaLoaiTapChi = new List<SelectListItem> { new SelectListItem { Text = "Trong Nước", Value = "1"}, new SelectListItem { Text = "Ngoài Nước", Value ="0"}, }; var baibaos = db.BaiBaos.Include(b => b.CapTapChi).Include(b => b.PhanLoaiTapChi).ToList(); if (!String.IsNullOrEmpty(home.SearchValue)) { baibaos = baibaos.Where(p => p.TenBaiBao.ToLower().Contains(home.SearchValue.ToLower())).ToList(); } int totalPage2 = (int)Math.Ceiling((decimal)baibaos.Count() / 6); ViewBag.TotalItem = baibaos.Count(); IPagedList<BaiBao> pageOrders2 = new StaticPagedList<BaiBao>(baibaos, No_Of_Page, 1, totalPage2); return View("~/Views/BaiBaos/Index.cshtml", pageOrders2); case "3": ViewBag.MaLinhVuc = new SelectList(QLKHrepo.GetListMenuLinhVuc(), "Id", "TenLinhVuc"); ViewBag.MaNXB = new SelectList(db.NhaXuatBans, "MaNXB", "TenNXB"); ViewBag.MaLoai = new SelectList(db.PhanLoaiSaches, "MaLoai", "TenLoai"); var sachGiaoTrinhs = db.SachGiaoTrinhs.Include(s => s.LinhVuc).Include(s => s.NhaXuatBan).Include(s => s.PhanLoaiSach).ToList(); if (!String.IsNullOrEmpty(home.SearchValue)) { sachGiaoTrinhs = sachGiaoTrinhs.Where(p => p.TenSach.ToLower().Contains(home.SearchValue.ToLower())).ToList(); } int totalPage3 = (int)Math.Ceiling((decimal)sachGiaoTrinhs.Count() / 6); ViewBag.TotalItem = sachGiaoTrinhs.Count(); IPagedList<SachGiaoTrinh> pageOrders3 = new StaticPagedList<SachGiaoTrinh>(sachGiaoTrinhs, No_Of_Page, 1, totalPage3); return View("~/Views/SachGiaoTrinhs/Index.cshtml", pageOrders3); default: ViewBag.MaCNDaoTao = new SelectList(db.ChuyenNganhs.ToList(), "MaChuyenNganh", "TenChuyenNganh"); ViewBag.MaHocHam = new SelectList(db.HocHams.ToList(), "MaHocHam", "TenHocHam"); ViewBag.MaHocVi = new SelectList(db.HocVis.ToList(), "MaHocVi", "TenHocVi"); ViewBag.MaDonViQL = new SelectList(db.DonViQLs.ToList(), "MaDonVi", "TenDonVI"); ViewBag.MaNgachVienChuc = new SelectList(db.NgachVienChucs.ToList(), "MaNgach", "TenNgach"); var nhaKhoaHocs = db.NhaKhoaHocs.Include(n => n.ChuyenNganh).Include(n => n.DonViQL).Include(n => n.HocHam).Include(n => n.HocVi).Include(n => n.NgachVienChuc).ToList(); if (!String.IsNullOrEmpty(home.MaDonViQLThucHien) && home.MaDonViQLThucHien != "0") { nhaKhoaHocs = nhaKhoaHocs.Where(p => p.MaDonViQL.ToString() == home.MaDonViQLThucHien).ToList(); } if (!String.IsNullOrEmpty(home.SearchValue)) { nhaKhoaHocs = nhaKhoaHocs.Where(p => (p.HoNKH + " " + p.TenNKH).ToLower().Contains(home.SearchValue.ToLower())).ToList(); } var lstNKH = new List<NhaKhoaHocViewModel>(); for (int i = 0; i < nhaKhoaHocs.Count; i++) { NhaKhoaHocViewModel nkh = NhaKhoaHocViewModel.Mapping(nhaKhoaHocs[i]); lstNKH.Add(nkh); } int totalPage = (int)Math.Ceiling((decimal)lstNKH.Count() / 6); ViewBag.TotalItem = lstNKH.Count(); IPagedList<NhaKhoaHocViewModel> pageOrders = new StaticPagedList<NhaKhoaHocViewModel>(lstNKH, No_Of_Page, 1, totalPage); return View("~/Views/NhaKhoaHocs/Index.cshtml", pageOrders); } } public ActionResult Admin() { ViewBag.Message = "Your application description page."; return View(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace verifyData { class Program { static void Main(string[] args) { VerifyData vd = new VerifyData(args[0]); vd.Verify(); } } }
using Funding.Common.Constants; using System; using System.ComponentModel.DataAnnotations; namespace Funding.Data.Models { public class Comment { public int Id { get; set; } [Required] [StringLength(ProjectConst.CommentMaxLength, MinimumLength = ProjectConst.CommentMinLength)] public string Content { get; set; } public User User { get; set; } public string UserId { get; set; } public Project Project { get; set; } public int ProjectId { get; set; } public DateTime SentDate { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class RecoverPasswordSolution : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session["RecoverAnswer"] == null) { // Error Message RecoverPassword_Answer.Text = "Please go through proper steps to recover password"; } else { // Check if answer is valid // Else post that it is not valid RecoverPassword_Answer.Text = "Invalid Security Answer. Please try again."; } } }
namespace dotless.Test.Specs.Functions { using NUnit.Framework; public class ContrastFixture : SpecFixtureBase { [Test] public void TestContrast() { AssertExpression("white", "contrast(#000000)"); AssertExpression("black", "contrast(#FFFFFF)"); //AssertExpressionError("Expected Color in function 'TestContrast', found \"foo\"", 6, "contrast(\"foo\")"); } } }
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; namespace Library.API.Configurations { public static class RedisCacheConfig { public static void AddRedisCacheConfiguration(this IServiceCollection services, IConfiguration configuration) { if (services == null) throw new ArgumentNullException(nameof(services)); services.AddStackExchangeRedisCache(options => { // 连接到 Redis 的配置 options.Configuration = configuration["Caching:Host"]; // Redis 实例名称 options.InstanceName = configuration["Caching:Instanc"]; }); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Scores : Singleton<Scores> { [SerializeField] private int _maxScore; [SerializeField] private Text _scoreText; [SerializeField] private FinishGame _finishGame; public int CurrentScore { get; private set; } public int MaxScore { get; private set; } private void Awake() { SetScore(_maxScore); } /// <summary> /// Updates the score if an item has been handed in /// </summary> public void FinishedItem() { CurrentScore++; _scoreText.text = CurrentScore + "/" + MaxScore; if (CurrentScore == MaxScore) { _finishGame.GameFinished(); } } /// <summary> /// Resets the current score and sets a maximum score /// </summary> /// <param name="iMaxScore"></param> public void SetScore(int iMaxScore) { CurrentScore = 0; MaxScore = iMaxScore; } }
using Spotify_2._0.Backend; using Spotify_2._0.Classes; using System; using System.Collections.Generic; using System.Diagnostics; using System.Windows; using System.Windows.Controls; using System.Windows.Input; namespace Spotify_2._0 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private string message = "Search a Spotify username in the upper lefthand box\nLeft click on each of your playlists to see the songs within\nDouble click the song to play the preview of each song"; private Button btn = new(); private BackendTest backend = new(); private readonly Backend.Backend backend2 = new(); public MainWindow() { InitializeComponent(); } /// <summary> /// this is the physical button that sends the username to backend /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void SearchUserBtn_Click(object sender, EventArgs e) { PlayListScrollbar.ScrollToVerticalOffset(0); SongScrollbar.ScrollToVerticalOffset(0); GetBackendInfo(SearchUserText.Text); } /// <summary> /// This is where we search for users based on their username and return data that Spotify's API gives us /// </summary> /// <param name="search">What user you are searching for in the Spotify API</param> public async void GetBackendInfo(string search) { Playlist_Text_Block.Children.Clear(); Song_Text_Block.Children.Clear(); PlayListScrollbar.ScrollToVerticalOffset(0); SongScrollbar.ScrollToVerticalOffset(0); AlbumArtist_name.Text = ""; List<Playlist> playlists = await backend2.GetPlaylists(search); playlists.ForEach(playlist => { btn = new(); btn.Content = $"{playlist.name}"; btn.DataContext += $"{playlist.id}"; btn.Click += new RoutedEventHandler(SongsReturn); Playlist_Text_Block.Children.Add(btn); }); } /// <summary> /// returns the song information and playlist data from the backend /// </summary> /// <param name="sender">WPF handling how buttons send actions</param> /// <param name="e">arguments that some buttons and actions require</param> private async void SongsReturn(object sender, RoutedEventArgs e) { Song_Text_Block.Children.Clear(); AlbumArtist_name.Text = ""; object _ = ((Button)sender).DataContext; List<Song> songs = await backend2.GetSongs(_.ToString()); songs.ForEach(song => { btn = new(); btn.Content = $"{song.name}"; string retStr = ""; song.Artists.ForEach(artist => { retStr += artist.Name + '\n'; }); btn.Tag = song.preview_url; btn.DataContext += $"Artist(s): {retStr}\n"; btn.DataContext += $"Album: {song.album_name}"; btn.MouseDoubleClick += Btn_MouseDoubleClick; btn.Click += new RoutedEventHandler(ArtistAlbumReturn); Song_Text_Block.Children.Add(btn); }); } /// <summary> /// this plays the preview for the songs returned in each playlist /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { mePlayer.Source = new Uri(((Button)sender).Tag.ToString()); mePlayer.Play(); } catch (Exception err) { Trace.WriteLine(err.Message); mePlayer.Play(); } } /// <summary> /// this returns the album and artist that the song clicked is in /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ArtistAlbumReturn(object sender, RoutedEventArgs e) { AlbumArtist_name.Text = ""; object _ = ((Button)sender).DataContext; Trace.WriteLine(_); AlbumArtist_name.Text += _; } /// <summary> /// this was dummy data for testing purposes in sprint 1 /// </summary> public void DummyData() { List<Playlist> playlists = backend.RetrievePlaylists(5); List<Song> songs = backend.RetrievePlaylistSongs(3); playlists.ForEach(playlist => { TextBlock text = new(); text.Text += $"Name : {playlist.name} \nDescription : {playlist.description}\n"; Playlist_Text_Block.Children.Add(text); }); songs.ForEach(song => { TextBlock textBlock = new(); textBlock.Text += $"Name: {song.name}\nDuration: {song.duration}\n"; Song_Text_Block.Children.Add(textBlock); }); } private void Window_Loaded(object sender, RoutedEventArgs e) { MessageBox.Show(message); } private void HelpBtn_Click(object sender, RoutedEventArgs e) { MessageBox.Show(message); } } }