internal override void AddDesignNotesToList(DesignNotesList designNotesList) { string id = GetStateId(); string wording = GetDesignNotes().ToString(); designNotesList.AddDesignNoteContent(id, wording); }
internal static DesignNotesList GetDesignNotesList() { DesignNotesList designNotesList = new DesignNotesList(); foreach (Shadow shadow in PathMaker.LookupAllShadows()) { shadow.AddDesignNotesToList(designNotesList); //shadow.AddPromptsToRecordingList(recordingList, onOrAfterDate); } return(designNotesList); }
internal static void ExportDesignNotes(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl visioControl) { string targetFilename; string currentFileName; if (saveFileDialog == null) { saveFileDialog = new SaveFileDialog(); saveFileDialog.Title = Common.GetResourceString(Strings.SavePromptsTitleRes); saveFileDialog.Filter = Common.GetResourceString(Strings.SavePromptsFilterRes); saveFileDialog.FilterIndex = 1; // Excel will ask about overwriting and I can't find a way to bypass that - so // skip it here and let excel do it on wb.close saveFileDialog.OverwritePrompt = false; } saveFileDialog.InitialDirectory = PathMaker.getCurrentFileDirectory(visioControl); targetFilename = visioControl.Src; currentFileName = System.IO.Path.GetFileName(targetFilename); saveFileDialog.FileName = Common.StripExtensionFileName(currentFileName) + "_DesignNotes.xlsx"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { targetFilename = saveFileDialog.FileName; } else { return; } Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application(); if (excelApp == null) { Common.ErrorMessage("Couldn't start Excel - make sure it's installed"); return; } excelApp.Visible = false; Workbook wb = excelApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet ws = (Worksheet)wb.Worksheets[1]; if (ws == null) { Common.ErrorMessage("Excel worksheet couldn't be created."); return; } DocTitleShadow shadow = PathMaker.LookupDocTitleShadow(); string client = ""; string project = ""; if (shadow != null) { client = shadow.GetClientName(); project = shadow.GetProjectName(); } ws.Cells[1, 1].Value = "Client: " + client; ws.Cells[2, 1].Value = "Project: " + project; ws.Cells[3, 1].Value = "Date: " + DateTime.Now.ToString(Strings.DateColumnFormatString); ws.Cells[1, 1].Font.Bold = true; ws.Cells[2, 1].Font.Bold = true; ws.Cells[3, 1].Font.Bold = true; ws.Columns["A:A"].ColumnWidth = 6; ws.Columns["B:B"].ColumnWidth = 40; ws.Columns["C:C"].ColumnWidth = 100; ws.Columns["D:D"].ColumnWidth = 16; ((Range)ws.Columns["C:C"]).EntireColumn.WrapText = true; ws.Cells[5, 1].Value = "Count"; ws.Cells[5, 2].Value = "State Name"; ws.Cells[5, 3].Value = "Design Notes"; ws.Cells[5, 4].Value = "Last Updated"; ws.Cells[5, 1].Font.Bold = true; ws.Cells[5, 2].Font.Bold = true; ws.Cells[5, 3].Font.Bold = true; ws.Cells[5, 4].Font.Bold = true; ws.Cells[5, 4].HorizontalAlignment = XlHAlign.xlHAlignLeft; ws.Columns["D:D"].HorizontalAlignment = XlHAlign.xlHAlignLeft; DesignNotesList designNotesList = Common.GetDesignNotesList(); char[] delimiterChars = { '@' }; //raw text looks like this... "design notes have been updated again@@02/18/2014" //splitting inot two parts for XLS writing int row = 6; int count = 1; if (designNotesList.GetDesignNotes().Count >= 1) { foreach (DesignNotesList.DesignNoteContent designNote in designNotesList.GetDesignNotes()) { ws.Cells[row, 1] = count; ws.Cells[row, 2] = designNote.StateId; //string wording = Common.StripBracketLabels(designNote.Wording); string[] notes = Common.StripBracketLabels(designNote.Wording).Split(delimiterChars); if (notes[0].Length > 0) { ws.Cells[row, 3] = notes[0]; string lastUpdated = notes[2]; ws.Cells[row, 4] = lastUpdated; ws.Rows[row].VerticalAlignment = XlVAlign.xlVAlignCenter; ws.Cells[row, 1].HorizontalAlignment = XlHAlign.xlHAlignCenter; } row++; count++; } try { wb.SaveAs(targetFilename); } catch { Common.ErrorMessage("Excel worksheet couldn't be created."); } } else { Common.ErrorMessage("Excel worksheet generation skipped - no Design Notes found in VUI file."); } excelApp.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp); excelApp = null; }
internal static DesignNotesList GetDesignNotesList() { DesignNotesList designNotesList = new DesignNotesList(); foreach (Shadow shadow in PathMaker.LookupAllShadows()) { shadow.AddDesignNotesToList(designNotesList); //shadow.AddPromptsToRecordingList(recordingList, onOrAfterDate); } return designNotesList; }
internal virtual void AddDesignNotesToList(DesignNotesList designNotesList) { }
virtual internal void AddDesignNotesToList(DesignNotesList designNotesList) { }