public Design(ITitle title, IPlotColor plotColor, IXTick <T> xTick, IYTick <Q> yTick, bool hasGrid) : this(title, plotColor) { HasGrid = hasGrid; PlotColor = plotColor; XTick = xTick; YTick = yTick; }
private void btnGetChapter_Click(object sender, EventArgs e) { try { var titleUrl = new Uri(cbTitleUrl.Text); ITitle title = TitleFactory.CreateTitle(titleUrl); title.Proxy = Option.GetProxy(); btnGetChapter.Enabled = false; var task = title.PopulateChapterAsync(new Core.Progress <int>(progress => txtPercent.Text = progress + "%")); task.ContinueWith(t => { btnGetChapter.Enabled = true; dgvChapter.DataSource = title.Chapters; if (t.Exception != null && t.Exception.InnerException != null) { txtMessage.Text = t.Exception.InnerException.Message; } }, TaskScheduler.FromCurrentSynchronizationContext()); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private IVendor AddVendor2() { ITitle title2 = CreateTitle(new Title() { Name = "XX xxx" }); IContact companyContact2 = CreateContact(new Contact() { Email = "*****@*****.**", Fax = "(444)444-4444", Phone = "(555)555-5555" }); ILocation address2 = CreateLocation(new Location() { City = "xxxxx", PostalCode = "xxxxxx", StateProvince = "XX", Country = "Xxxxxx", Street = "Xxxx Xxxxxx" }); ICompany company2 = CraeteCompany(companyContact2, address2, "xx xxx"); var vendorContact2 = CreateContact(new Contact() { Email = "*****@*****.**", Fax = "(666)666-66661", Phone = "(777)777-7777" }); vendor2 = new Vendor() { Company = (Company)company2, Contact = (Contact)vendorContact2, FirstName = "Tom", LastName = "Jackson", Title = (Title)title2 }; return(CreateVendor(vendor2)); }
public IPacket ReadPacket(IMinecraftDataReader reader) { Action = (TitleAction)reader.ReadVarInt(); switch (Action) { case TitleAction.Title: Title = new TitleTitle(); Title.FromReader(reader); break; case TitleAction.Subtitle: Title = new TitleSubtitle(); Title.FromReader(reader); break; case TitleAction.Times: Title = new TitleTimes(); Title.FromReader(reader); break; case TitleAction.Clear: Title = new TitleClear(); Title.FromReader(reader); break; case TitleAction.Reset: Title = new TitleReset(); Title.FromReader(reader); break; } return(this); }
private IVendor AddVendor1() { ITitle title = CreateTitle(new Title() { Name = "Sale Manager" }); IContact companyContact = CreateContact(new Contact() { Email = "*****@*****.**", Fax = "(111)111-1111", Phone = "(222)222-2222" }); ILocation address = CreateLocation(new Location() { City = "Toronto", PostalCode = "M3C", StateProvince = "ON", Country = "Canada", Street = "Some Street" }); ICompany company = CraeteCompany(companyContact, address, "New Company"); var vendorContact = CreateContact(new Contact() { Email = "*****@*****.**", Fax = "(113)111-1111", Phone = "(225)222-2222" }); vendor1 = new Vendor() { Company = (Company)company, Contact = (Contact)vendorContact, FirstName = "Joe", LastName = "Brawn", Title = (Title)title }; return(dataService.GetRepository <IVendorRepository, IVendor>().Add(vendor1)); }
static void Main(string[] args) { BangOlufsenTV botv = new BangOlufsenTV(); ITitle title = (ITitle)botv; //bir sınıfa birden fazla interface atabildiğimiz için hangisinin özelligini kullanmak istiyorsak onu botv den bu şekilde alırız. }
static void Main(string[] args) { BangOlufsenTV botv = new BangOlufsenTV(); ITitle title = (ITitle)botv; ITi }
public MainViewModel(IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; this.dataContext = serviceProvider.GetService <TestDataContext>(); ITitle mainTitle = serviceProvider.GetService <ITitle>(); Title = mainTitle.Title; }
public Design(ITitle title, IPlotColor plotColor, bool hasGrid, decimal increaseTickRate, string scatterSuffix, string xLabel, string yLabel) : this(title, plotColor) { XLabel = xLabel; YLabel = yLabel; ScatterSuffix = scatterSuffix; IncreaseTickRate = increaseTickRate; HasGrid = hasGrid; }
private void Tbi_GotFocus(object sender, RoutedEventArgs e) { ITitle subViewModel = ((FrameworkElement)sender).DataContext as ITitle; if (subViewModel != null) { viewModel.ChangeTitleViewModel(subViewModel); } }
public Backlog(ITitle title, Tasks task) : base(title) { foreach (var item in task.sampleTask) { foreach (var inItem in item.Value) { this.SprintTotalPoints += inItem.Estimate; } } }
private string GetTitleType(ITitle titleItem) { switch (titleItem.TitleType) { case TitleType.Main: return("main"); case TitleType.SourceInfo: return("collection"); case TitleType.PublishInfo: return("collection"); } return("collection"); }
public Handler() { Players = new List <Player>(); Task.Run(async() => { Console.WriteLine("Loading Handler Essential Data..."); await Item.LoadItems(); await Monster.LoadMonsters(); await Quest.LoadQuests(); await GearSword.LoadSwords(); await GearHelmet.LoadHelmets(); await GearChestplate.LoadChestplates(); await GearGloves.LoadGloves(); await GearBoots.LoadBoots(); await GearLeggings.LoadLeggings(); await ITitle.LoadTitles(); await LoadPlayers(); Console.WriteLine("Handler Data Loaded."); }).GetAwaiter().GetResult(); Player p = Players.Find(x => x.Character.Name == "Flame"); Console.WriteLine("Sorting Players..."); BountyPlayers = new List <Player>(); BountyPlayers = Players.FindAll(x => x.Character.Stats.PvP.reasonlessKillTimer > 0); TopWork = Players.ToArray(); TopQuests = Players.ToArray(); SortPlayers.SortAll(Program.handler); Console.WriteLine("Players Sorted.\nStarting WoT."); Running = true; Task.Run(async() => { await KeepAlive(); }); }
/// <summary> /// Create a Title object base on the URI. /// </summary> /// <param name="uri"></param> /// <returns></returns> public static ITitle CreateTitle(Uri uri) { ITitle title = null; WebsiteHost.IWebsiteHost hostData; if (TitleDistill.TryGetDistilledHost(uri, out hostData)) { title = new TitleDistill(uri, hostData, null); } else { string message = String.Format("'{0}' is currently unsupported.", uri.Host); throw new Exception(message); } return(title); }
private void GetChapters(Uri seriesUri) { try { ITitle title = TitleFactory.CreateTitle(seriesUri); currentTitle = title; title.Proxy = Option.GetProxy(); btnGetChapter.Enabled = false; cbTitleUrl.Enabled = false; /// Remove focus from the title combo to avoid accidentally loading more /// series when scrolling. if (ActiveControl == cbTitleUrl) { ActiveControl = null; } var task = title.PopulateChapterAsync(new DMR11.Core.Progress <double>(progress => Animate(NetworkProgressBar, "ProgressValue", progress, 0, 1000))); task.ContinueWith(t => { cbTitleUrl.Enabled = true; btnGetChapter.Enabled = true; dgvChapter.DataSource = title.Chapters; dgvChapter.Focus(); PrepareSeriesDirectory(); if (t.Exception != null && t.Exception.InnerException != null) { txtMessage.Text = t.Exception.InnerException.Message; } }, TaskScheduler.FromCurrentSynchronizationContext()); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Create Title object base on uri /// </summary> /// <param name="uri"></param> /// <returns></returns> public static ITitle CreateTitle(Uri uri) { ITitle title = null; switch (uri.Host) { case "mangafox.me": title = new TitleMangaFox(uri); break; case "read.mangashare.com": title = new TitleMangaShare(uri); break; case "www.mangatoshokan.com": title = new TitleMangaToshokan(uri); break; case "www.mangahere.co": title = new TitleMangaHere(uri); break; case "www.otakuworks.com": title = new TitleOtakuworks(uri); break; case "www.mangareader.net": title = new TitleMangaReader(uri); break; default: string message = String.Format("This site ({0}) is not supported.", uri.Host); throw new Exception(message); } return(title); }
public static bool GetAlternativeTitle(ref string expr, ICollection <string> lst, ref ITitle title) { Abbreviation d = null; if ( Parsing.Token( ref expr, false, t => (d = Abbrs.Config.Abbrs.FirstOrDefault(a => a.Abbr == t)) != null) == null) { return(false); } title = d; if (!d.Editable) { lst.Add(d.Content); } return(true); }
protected override bool AlternativeTitle(ref string expr, ICollection <string> lst, ref ITitle title) => GetAlternativeTitle(ref expr, lst, ref title);
public Backlog(ITitle title) : base(title) { this.SprintTotalPoints = 0; }
private string GetTitleType(ITitle titleItem) { switch (titleItem.TitleType) { case TitleType.Main: return "main"; case TitleType.SourceInfo: return "collection"; case TitleType.PublishInfo: return "collection"; } return "collection"; }
public async Task Title(string action, [Remainder] string chosenTitle = null) { Player player = await Program.handler.GetPlayer(Context); if (player == null) { return; } if (action.ToLower() == "list") { if (player.Character.Titles == null) { await Context.Channel.SendMessageAsync("*Your title list is empty...*"); return; } if (player.Character.Titles.Count == 0) { await Context.Channel.SendMessageAsync("*Your title list is empty...*"); return; } string toReturn = $"Hello {player.Character.Name}, Here is the list of your Titles:\n"; bool newSection = false; for (int i = 0; i < player.Character.Titles.Count; i++) { if (i > 0) { if (player.Character.Titles[i].titleType != player.Character.Titles[i - 1].titleType) { newSection = true; } else { newSection = false; } } else if (i == 0) { newSection = true; } if (newSection) { if (player.Character.Titles[i].titleType == TitleType.MonsterKills) { toReturn += $"\n Monster Kills Titles:\n"; } else { toReturn += $"\n {Enum.GetName(typeof(TitleType), player.Character.Titles[i].titleType)} Titles:\n"; } } toReturn += $"-> [{player.Character.Titles[i].name}] - {player.Character.Titles[i].reason}\n"; } await Context.User.GetOrCreateDMChannelAsync().Result.SendMessageAsync($"```Ini\n{toReturn}```"); } else if (action.ToLower() == "select" || action.ToLower() == "set") { string title = ""; if (string.IsNullOrEmpty(chosenTitle)) { await Context.Channel.SendMessageAsync("**Title you want to select can not be null.**"); return; } title = chosenTitle; if (player.Character.Titles.Exists(x => x.name.ToLower() == title.ToLower())) { ITitle trueTitle = player.Character.Titles.Find(x => x.name.ToLower() == title.ToLower()); player.Character.ActiveTitle = trueTitle; await Context.Channel.SendMessageAsync($":ballot_box_with_check: **Title -** `{trueTitle.name}` **- selected** :ballot_box_with_check: "); } else { await Context.Channel.SendMessageAsync($":bangbang: **Title -** `{title}` **- was not found in your list. Type \"+title list\" to see what titles you have** :bangbang:"); } } else if (action.ToLower() == "remove") { if (player.Character.ActiveTitle == null) { await Context.Channel.SendMessageAsync(":exclamation: **No active title has been detected** :exclamation:"); } else if (player.Character.ActiveTitle != null) { player.Character.ActiveTitle = null; await Context.Channel.SendMessageAsync(":ballot_box_with_check: **Active title has been removed** :ballot_box_with_check:"); } } else { await Context.Channel.SendMessageAsync($"You are doing something wrong :thinking:\nUsage is: `Select/Remove [title], List`"); } return; }
public Design(ITitle title) { Title = title; }
public IPacket ReadPacket(IMinecraftDataReader reader) { Action = (TitleAction) reader.ReadVarInt(); switch (Action) { case TitleAction.Title: Title = new TitleTitle(); Title.FromReader(reader); break; case TitleAction.Subtitle: Title = new TitleSubtitle(); Title.FromReader(reader); break; case TitleAction.Times: Title = new TitleTimes(); Title.FromReader(reader); break; case TitleAction.Clear: Title = new TitleClear(); Title.FromReader(reader); break; case TitleAction.Reset: Title = new TitleReset(); Title.FromReader(reader); break; } return this; }
public Title(ITitle title) { this.title = title; }
protected virtual bool AlternativeTitle(ref string expr, ICollection<string> lst, ref ITitle title) => false;
private ITitle CreateTitle(ITitle title) { var titleRepo = dataService.GetRepository <ITitlesRepository, ITitle>(); return(titleRepo.Add(title)); }
public HomeController(ITitle title) { this.title = title; }
protected virtual bool AlternativeTitle(ref string expr, ICollection <string> lst, ref ITitle title) => AbbrSerializer.GetAlternativeTitle(ref expr, lst, ref title);
private static bool AlternativeTitle(ref string expr, ICollection <string> lst, ref ITitle title) => AbbrSerializer.GetAlternativeTitle(ref expr, lst, ref title);
/// <summary> /// Draws a title in the object. /// </summary> /// <param name="g">Graphics related to the image on which the title should be drawn.</param> /// <param name="s">Size of the object.</param> /// <param name="t">Object with the title properties.</param> public static void DrawTitle(Graphics g, Size s, ITitle t) { if (t.TitleBarHeight > 0) { // Draw title bar var clTitleBar = Color.FromArgb(t.TitleBarOpacity, t.TitleBarColor); var brTitleBar = new SolidBrush(clTitleBar); var rTitleBar = new Rectangle(0, 0, s.Width, t.TitleBarHeight); if (t.TitleRotation == Rotation.Clockwise90 || t.TitleRotation == Rotation.Clockwise270) { rTitleBar.Width = t.TitleBarHeight; rTitleBar.Height = s.Height; } if (t.TitleAlign == ContentAlignment.TopCenter || t.TitleAlign == ContentAlignment.MiddleCenter || t.TitleAlign == ContentAlignment.BottomCenter) { rTitleBar.X = (s.Width - rTitleBar.Width) / 2; } else if (t.TitleAlign == ContentAlignment.TopRight || t.TitleAlign == ContentAlignment.MiddleRight || t.TitleAlign == ContentAlignment.BottomRight) { rTitleBar.X = s.Width - rTitleBar.Width; } if (t.TitleAlign == ContentAlignment.MiddleLeft || t.TitleAlign == ContentAlignment.MiddleCenter || t.TitleAlign == ContentAlignment.MiddleRight) { rTitleBar.Y = (s.Height - rTitleBar.Height) / 2; } else if (t.TitleAlign == ContentAlignment.BottomLeft || t.TitleAlign == ContentAlignment.BottomCenter || t.TitleAlign == ContentAlignment.BottomRight) { rTitleBar.Y = s.Height - rTitleBar.Height; } g.FillRectangle(brTitleBar, rTitleBar); } if (!string.IsNullOrEmpty(t.Title)) { // Calculate title coordinates var szTitle = g.MeasureString(t.Title, t.TitleFont); // Draw title on temporary picture var bT = new Bitmap((int)szTitle.Width, (int)szTitle.Height); var gT = Graphics.FromImage(bT); gT.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; gT.FillRectangle(Brushes.Transparent, 0, 0, szTitle.Width, szTitle.Height); gT.DrawString(t.Title, t.TitleFont, new SolidBrush(t.TitleColor), 0, 0); // Rotate temporary picture if applicable if (t.TitleRotation == Rotation.Clockwise90) { ((Bitmap)bT).RotateFlip(RotateFlipType.Rotate90FlipNone); } else if (t.TitleRotation == Rotation.Clockwise180) { ((Bitmap)bT).RotateFlip(RotateFlipType.Rotate180FlipNone); } else if (t.TitleRotation == Rotation.Clockwise270) { ((Bitmap)bT).RotateFlip(RotateFlipType.Rotate270FlipNone); } int iTitleY = t.TitleOffset.Y; int iTitleX = t.TitleOffset.X; if (t.TitleAlign == ContentAlignment.TopRight || t.TitleAlign == ContentAlignment.MiddleRight || t.TitleAlign == ContentAlignment.BottomRight) { iTitleX = s.Width - bT.Size.Width + t.TitleOffset.X; } else if (t.TitleAlign == ContentAlignment.TopCenter || t.TitleAlign == ContentAlignment.MiddleCenter || t.TitleAlign == ContentAlignment.BottomCenter) { iTitleX = (s.Width - bT.Size.Width) / 2 + t.TitleOffset.X; } if (t.TitleAlign == ContentAlignment.BottomLeft || t.TitleAlign == ContentAlignment.BottomCenter || t.TitleAlign == ContentAlignment.BottomRight) { iTitleY = s.Height - bT.Size.Height + t.TitleOffset.Y; } else if (t.TitleAlign == ContentAlignment.MiddleLeft || t.TitleAlign == ContentAlignment.MiddleCenter || t.TitleAlign == ContentAlignment.MiddleRight) { iTitleY = (s.Height - bT.Size.Height) / 2 + t.TitleOffset.Y; } g.DrawImage(bT, iTitleX, iTitleY); } }
public void WriteTitle(ITitle title) { PythonProcess.AddInstruction("plt.title(\"" + title.Text + "\",fontsize=" + title.FontSize + ")"); }
public Design(ITitle title, IPlotColor plotColor) : this(title) { PlotColor = plotColor; }