private void Skills_Load(object sender, EventArgs e) { // Load Data jhandle = new JSONHandler(); data = jhandle.ReadFromJSON(); // Add First Text Box SkillBoxList.Add(new TextBox()); SkillBoxList[0].Location = new System.Drawing.Point(6, 6); SkillBoxList[0].Size = new System.Drawing.Size(238, 20); SkillBoxList[0].TabIndex = tabTracker; this.Controls.Add(SkillBoxList[SkillBoxList.Count - 1]); tabTracker += 1; // Add First Delete Button DeleteBtnList.Add(new Button()); DeleteBtnList[0].Location = new System.Drawing.Point(248, 6); DeleteBtnList[0].Size = new System.Drawing.Size(20, 20); DeleteBtnList[0].Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); DeleteBtnList[0].Text = "-"; DeleteBtnList[0].UseVisualStyleBackColor = true; DeleteBtnList[0].Click += delegate(object senderLoc, EventArgs eLoc) { DeleteBtn_Click(senderLoc, eLoc, 0); }; //new System.EventHandler(this.DeleteBtn_Click); DeleteBtnList[0].TabIndex = tabTracker; DeleteBtnList[0].Enabled = false; this.Controls.Add(DeleteBtnList[DeleteBtnList.Count - 1]); tabTracker += 1; // Add First Add Button AddButtonList.Add(new Button()); AddButtonList[0].Location = new System.Drawing.Point(272, 6); AddButtonList[0].Size = new System.Drawing.Size(20, 20); AddButtonList[0].Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); AddButtonList[0].Text = "+"; AddButtonList[0].UseVisualStyleBackColor = true; AddButtonList[0].Click += new System.EventHandler(this.AddButton_Click); AddButtonList[0].TabIndex = tabTracker; this.Controls.Add(AddButtonList[AddButtonList.Count - 1]); tabTracker += 1; // Add text to SkillBoxes if (data.Skills.Count != 0) { for (int i = 0; i < data.Skills.Count - 1; i++) { AddRow(); } for (int i = 0; i < data.Skills.Count; i++) { SkillBoxList[i].Text = data.Skills[i]; } // Add Extra Row AddRow(); } }
private void Summary_Load(object sender, EventArgs e) { jhandle = new JSONHandler(); data = jhandle.ReadFromJSON(); /* Load data into TextBoxs */ Loaded = false; SummaryBox.Text = data.Summary; Loaded = true; }
public bool WriteToJSON(ResumeData data, string file) // Write the data to json file { string dataSerialized = JsonConvert.SerializeObject(data); try { File.WriteAllText(file, dataSerialized); return(true); } catch { Console.WriteLine("Something went wrong"); return(false); } }
public ResumeData ReadFromJSON(string file) // Read data from json file and return object { string data; try { data = File.ReadAllText(file); } catch { return(null); } ResumeData dataDeserialized = JsonConvert.DeserializeObject <ResumeData>(data); return(dataDeserialized); }
private void BasicInfo_Load(object sender, EventArgs e) { PhoneTxt1.BringToFront(); PhoneTxt2.BringToFront(); PhoneTxt3.BringToFront(); jhandle = new JSONHandler(); data = jhandle.ReadFromJSON(); /* Load data into TextBoxs */ Loaded = false; NameTxt.Text = data.Name; if (data.Phone != null && data.Phone.Length == 14) { PhoneTxt1.Text = data.Phone.Substring(1, 3); PhoneTxt2.Text = data.Phone.Substring(6, 3); PhoneTxt3.Text = data.Phone.Substring(10, 4); } EmailTxt.Text = data.Email; SiteTxt.Text = data.Site; AddressTxt1.Text = data.Address1; AddressTxt2.Text = data.Address2; CityTxt.Text = data.City; ZipTxt.Text = data.Zip; if (data.State != null) { for (int i = 0; i < 50; i++) { if (data.State == stateList[i]) { StateBox.SelectedIndex = i; } if (i == 50) { Console.WriteLine("Last Line Reached"); } } } Loaded = true; }
private void Jobs_Load(object sender, EventArgs e) { jhandle = new JSONHandler(); data = jhandle.ReadFromJSON(); if (data.Jobs == null) { jobBox.Items.Add("First Job"); data.Jobs = new List <Dictionary <string, string> >(); data.Jobs.Add(newDict); } else { foreach (Dictionary <string, string> dict in data.Jobs) { jobBox.Items.Add(dict["LISTTITLE"]); } LoadTextFromIndex(0); } jobBox.SelectedIndex = 0; allowUpdate = true; }
//static private ResumeData data; public DocumentBuilder()//ResumeData import) { //data = import; String docname = "Test"; PdfWriter writer = null; bool read = false; try // Try writing to file { writer = new PdfWriter(docname + ".pdf"); read = true; } catch // Catch if file is open and display message to user { string message = "Please close the open PDF or save using a different name."; string caption = "Active PDF Open in Another Window"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult msg; msg = MessageBox.Show(message, caption, buttons); Console.WriteLine("Please close the pdf file that is open"); } if (read) { PdfDocument pdf = new PdfDocument(writer); Document doc = new Document(pdf); /* Import Data */ JSONHandler jhandle = new JSONHandler(); ResumeData data = jhandle.ReadFromJSON(); /*--------------------------- Writing to doc ------------------------------------*/ /* Register Fonts */ PdfFontFactory.RegisterDirectory("C:\\Windows\\Fonts"); PdfFont Courier = PdfFontFactory.CreateRegisteredFont("Courier New"); PdfFont Gothic = PdfFontFactory.CreateRegisteredFont("Century Gothic"); /* Create Content */ Paragraph Name = new Paragraph(data.Name) .SetTextAlignment(TextAlignment.CENTER) .SetFont(Courier) .SetFontSize(34); Paragraph Bio = new Paragraph(data.Email + " | " + data.Phone + " | " + data.Address1) .SetTextAlignment(TextAlignment.CENTER) .SetFont(Gothic) .SetFontSize(9); Paragraph Site = new Paragraph() .Add(new Link("Barnes7619.com", PdfAction.CreateURI("https://Barnes7619.com")).SetUnderline()) .SetTextAlignment(TextAlignment.CENTER) .SetFont(Gothic) .SetFontSize(9); Table SummaryHead = CreateSeparator("Summary", Courier); Table EducationHead = CreateSeparator("Education & Training", Courier); Table SoftwareHead = CreateSeparator("Software Experience", Courier); Table ExperienceHead = CreateSeparator("Experience", Courier); Table SkillsHead = CreateSeparator("Skills", Courier); ///* Formatting */ //Name.Alignment = Element.ALIGN_CENTER; //Bio.Alignment = Element.ALIGN_CENTER; //Site.Alignment = Element.ALIGN_CENTER; /* Add Content to Document */ doc.Add(Name); doc.Add(Bio); doc.Add(Site); doc.Add(SummaryHead); doc.Add(EducationHead); doc.Add(SoftwareHead); doc.Add(ExperienceHead); doc.Add(SkillsHead); /* Close Document */ doc.Close(); /* ------------------------- Completed Message --------------------------- */ string message = "Resume Generated!"; string caption = "Finished"; MessageBoxButtons buttons = MessageBoxButtons.OK; DialogResult msg; msg = MessageBox.Show(message, caption, buttons); } }
public ResumeAutomator() { InitializeComponent(); data = new ResumeData(); }