public void ReadTopicalPassage(Topic topic) { m_Preaching = true; Say("A Word from the Lord concerning {0}:", TopicReader.GetTopicName(topic)); m_Timer = new RecitalTimer(this, BibleReader.GetRandomTopicVerses(topic)); m_Timer.Start(); m_NextPreach = DateTime.Now + PreachDelay; }
public TopicGump(Mobile GM, Bible bible, int topic) : base(20, 20) { m_GM = GM; m_GM.CloseGump(typeof(TopicGump)); m_Bible = bible; m_Topic = topic; m_Book = (int)(m_Bible.Book); m_Chapter = m_Bible.Chapter; AddPage(0); AddBackground(0, 0, 696, 540, 0x13BE); string str1, str2, str; int[,] verses; int verselength, topiclength, ymax; string verse = ""; verses = TopicReader.GetTopicVerses((Topic)m_Topic); topiclength = verses.GetLength(0); if (topiclength < 17) { ymax = topiclength; } else { ymax = 16; } AddLabel(200, 7, 500, BibleReader.ToTitleCase(TopicReader.GetTopicName((Topic)m_Topic))); AddResetButton(15, 510, 400, "Home"); if (m_Topic > 0) { AddBkwdButton(345, 510, m_Topic - 1, "Prev Topic"); } if (m_Topic < 303) { AddFwdButton(645, 510, m_Topic + 1, "Next Topic"); } for (int y = 0; y < ymax; y++) { try { verse = BibleReader.GetVerse(verses[y, 0], verses[y, 1], verses[y, 2]); verselength = verse.Length < 68 ? verse.Length - 8 : 60; str1 = BibleReader.Books[verses[y, 0]] + " " + verses[y, 1].ToString() + " : "; str2 = verse.Substring(7, verselength) + "..."; str = str1 + str2; AddButton(15, 29 + (y * 24), 5541, 5542, y + 500 + (m_Topic * 1000), GumpButtonType.Reply, 0); AddHtml(50, 30 + (y * 24), 635, 20, Color(str, 0x480), false, false); } catch { break; } } }
public void ReadTopicalPassage() { Topic readTopic = BibleTopic; m_Preaching = true; if (m_Random) { Array values = Enum.GetValues(typeof(Topic)); Random random = new Random(); readTopic = (Topic)values.GetValue(random.Next(values.Length)); } Say("How about this topic - {0}:", TopicReader.GetTopicName(readTopic)); m_Timer = new RecitalTimer(this, BibleReader.GetRandomTopicVerses(readTopic)); m_Timer.Start(); m_NextPreach = DateTime.Now + PreachDelay; }
/// <summary> /// Initializes a new instance of the class. /// </summary> public FrmWirenBoardWizard(IAdminContext adminContext, ScadaProject project, RecentSelection recentSelection) : this() { this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext)); this.project = project ?? throw new ArgumentNullException(nameof(project)); ctrlLineSelect = new CtrlLineSelect(adminContext, project, recentSelection); ctrlLog = new CtrlLog(); ctrlDeviceTree = new CtrlDeviceTree(); ctrlEntityID = new CtrlEntityID(adminContext, project, recentSelection); logHelper = new RichTextBoxHelper(ctrlLog.RichTextBox); AddUserControls(); step = Step.SelectLine; topicReader = null; configBuilder = null; }
public static string[] GetRandomTopicVerses(Topic topic) { int y = 0; string[] output; int[] verses = TopicReader.RandomTopicVerse(topic); try { output = new string[(verses[3] - verses[2]) + 1]; for (int x = verses[2]; x <= verses[3]; x++) { output[y++] = GetVerse(verses[0], verses[1], x); } return(output); } catch { output = new string[] { "No verses found with that reference." }; return(output); } }
public override void OnResponse(NetState state, RelayInfo info) { state.Mobile.CloseGump(typeof(TopicGump)); int topic, subtopic; int m_Choice = info.ButtonID; if (m_Choice > 499) { topic = (m_Choice - 500) / 1000; subtopic = (m_Choice % 1000) - 500; m_Bible.SetPassage(TopicReader.GetTopicVerse((Topic)topic, subtopic)); state.Mobile.SendGump(new BibleGump(m_GM, m_Bible)); } else if (m_Choice < 400) { state.Mobile.SendGump(new TopicGump(m_GM, m_Bible, m_Choice)); } else if (m_Choice == 400) { state.Mobile.SendGump(new BibleGump(m_GM, m_Bible)); } }
/// <summary> /// Performs a dialog with user to create webhooks at a user specified endpoint /// </summary> /// <param name="webhookController">Controller to use for creating webhooks</param> private static void CreateNewWebhooks(WebhookController webhookController) { bool confirmed = false; string newUrl = string.Empty; while (!confirmed) { Console.WriteLine("Enter the new URL to set for webhooks."); newUrl = Console.ReadLine(); Console.WriteLine("\"{0}\", confirm?(y/n)", newUrl); confirmed = (Console.ReadLine() == "y"); } var topics = TopicReader.ReadTopics(); List <Webhook> createdWebhooks = new List <Webhook>(); //Create webhooks from selected file's topics foreach (string topic in topics) { try { createdWebhooks.Add(webhookController.CreateWebhook(new Webhook() { address = newUrl, topic = topic })); } catch (Exception ex) { Console.WriteLine("Error creating webhook: {0}", ex.Message); } } foreach (var createdWebhook in createdWebhooks) { Console.WriteLine("Webhook for {0} created with ID {1}", createdWebhook.topic, createdWebhook.id); } }
public BibleGump(Mobile GM, Bible bible) : base(20, 20) { m_GM = GM; m_GM.CloseGump(typeof(BibleGump)); m_Bible = bible; m_Book = (int)(m_Bible.Book); m_Chapter = m_Bible.Chapter; m_Topic = (int)(m_Bible.BibleTopic); int chapnum = BibleReader.GetNumChapters(m_Book); if (m_Chapter > chapnum) { m_Chapter = chapnum; } int versnum = BibleReader.GetNumVerses(m_Book, m_Chapter); m_FirstVerse = m_Bible.FirstVerse; if (m_FirstVerse > versnum) { m_FirstVerse = versnum; } m_LastVerse = m_Bible.LastVerse; if (m_LastVerse < m_FirstVerse) { m_LastVerse = m_FirstVerse; } if (m_LastVerse > versnum) { m_LastVerse = versnum; } string maxchap = chapnum.ToString(); string max = versnum.ToString(); AddPage(0); AddBackground(0, 0, 696, 540, 0x13BE); AddPage(1); AddAlphaRegion(190, 30, 486, 476); string passName = BibleReader.Books[m_Book] + " " + m_Chapter.ToString() + " : " + m_FirstVerse.ToString(); if (m_FirstVerse < m_LastVerse) { passName += " - " + m_LastVerse.ToString(); } AddLabel(200, 7, 500, passName); string passage = ""; for (int x = m_FirstVerse; x <= m_LastVerse; x++) { passage += BibleReader.GetVerse(m_Book, m_Chapter, x); } AddHtml(200, 40, 466, 456, passage, true, true); AddOKButton(200, 510, 0, "Accept Changes"); AddLabel(15, 30, 0x459, "Book of"); AddImageTiled(15, 50, 160, 20, 0xA40); AddTextEntry(15, 50, 160, 20, 0x769, 0, BibleReader.Books[m_Book]); AddLabel(15, 110, 0x459, "Chapter (Max - " + maxchap + ")"); AddImageTiled(15, 130, 60, 20, 0xA40); AddTextEntry(15, 130, 60, 20, 0x769, 1, m_Chapter.ToString()); AddLabel(15, 190, 0x459, "First Verse (Max - " + max + ")"); AddImageTiled(15, 210, 60, 20, 0xA40); AddTextEntry(15, 210, 60, 20, 0x769, 2, m_FirstVerse.ToString()); AddLabel(15, 270, 0x459, "Last Verse (Max - " + max + ")"); AddImageTiled(15, 290, 60, 20, 0xA40); AddTextEntry(15, 290, 60, 20, 0x769, 3, m_LastVerse.ToString()); AddResetButton(15, 350, 1, "Reset Passage"); AddPageBkwdButton(15, 380, 2, "Index"); AddPageBkwdButton(15, 410, 3, "Concordance"); AddPage(2); int entry = 1; int ymax; AddPageBkwdButton(15, 510, 1, "Back"); for (int x = 0; x < 4; x++) { if (x < 3) { ymax = 17; } else { ymax = 15; } for (int y = 0; y < ymax; y++) { AddResetButton(15 + (x * 171), 20 + (y * 25), entry + 1, BibleReader.Books[entry++]); } } int zlimit = 15; entry = 0; for (int x = 0; x < 7; x++) { AddPage(3 + x); AddPageBkwdButton(15, 510, 1, "Back"); if (x > 0) { AddPageBkwdButton(345, 510, 2 + x, "Prev Topics"); } if (x < 6) { AddPageFwdButton(645, 510, 4 + x, "Next Topics"); } if (x == 6) { zlimit = 11; } for (int y = 0; y < 3; y++) { for (int z = 0; z < zlimit; z++) { AddResetButton(15 + (y * 225), 20 + (z * 25), entry + 100, BibleReader.ToTitleCase(TopicReader.GetTopicName((Topic)entry++))); } } } }