/** Adds all found acronyms (that are not already in the table) to the table; then, sort. **/ private void AddFoundAcronymsToTable() { frm.SetMainText("Adding all found acronyms to the table."); String dudsList = GetDudsList(); int allFoundWords = found.Count; int currentItem = 0; foreach (String word in found) { SetNumber(currentItem++, allFoundWords); String definition = ""; if (!inTable.Contains(word.Trim()) && !dudsList.Contains(word.Trim())) { acronymTable.Rows.Add(); Word.Cell acronymCell = acronymTable.Cell(acronymTable.Rows.Count, 1); acronymCell.Shading.ForegroundPatternColorIndex = Word.WdColorIndex.wdYellow; acronymCell.Range.Text = word; String letter = word.ToLower().Substring(0, 1); if (wordlist[letter].Contains(word.Trim())) { foreach (string s in wordlist[letter].Split('\n')) { String[] split = s.Split(','); if (split[0].Equals(word.Trim())) { definition = split[1].Trim(); } } } Word.Cell defCell = acronymTable.Cell(acronymTable.Rows.Count, 2); defCell.Shading.ForegroundPatternColorIndex = Word.WdColorIndex.wdYellow; defCell.Range.Text = definition; } } acronymTable.SortAscending(); }
private void wypiszWymagania(ref int wiersz, bool PokazTresc) { okno.Log(Statystyki.LogMsgType.Info, "Eksport wymagań"); String wynik = ""; wynik += "<div class=\"img\">"; wynik += dajTytulRozdz("2", ref wiersz); int i = 2; if (PokazTresc) { foreach (Element e in modelProjektu.WymaganiaBiznesoweLista) { Wordy.Table tab = null; if (jezykPolski) { tab = word.wstawTabele("Rozdzial1b", new string[] { "Autor", /* "Pakiet",*/ "Wymaganie", "Status" /*, "Treść", "Status","Właściciel"*/ }); } else { tab = word.wstawTabele("Rozdzial1b", new string[] { "Author", /*"Package",*/ "Requirement", "Status" /*, "Treść", "Status","Właściciel"*/ }); } tab.Columns[1].SetWidth(50f, Wordy.WdRulerStyle.wdAdjustNone); tab.Columns[2].SetWidth(370f, Wordy.WdRulerStyle.wdAdjustNone); tab.Columns[3].SetWidth(80f, Wordy.WdRulerStyle.wdAdjustNone); word.wstawWierszDoTabeli("Rozdzial1b", tab, i++, new string[] { e.Author, /* pakTxt,*/ e.Name, e.Status }); if (e.Notes.Length > 0) { word.wstawParagraf(" ", 5); word.wstawNotatkeEAtoRTF(modelProjektu.Repozytorium, e); } if (e.GetLinkedDocument().Length > 0) { word.wstawParagraf(" ", 5); word.wstawZalacznikRTF(e); } word.wstawParagraf("", 5); } Wordy.Table tabI = null; if (jezykPolski) { tabI = word.wstawTabele("Rozdzial1b", new string[] { "Autor", /* "Pakiet",*/ "Wymaganie", "Status" /*, "Treść", "Status","Właściciel"*/ }); } else { tabI = word.wstawTabele("Rozdzial1b", new string[] { "Author", /*"Package",*/ "Requirement", "Status" /*, "Treść", "Status","Właściciel"*/ }); } i = 2; tabI.Columns[1].SetWidth(50f, Wordy.WdRulerStyle.wdAdjustNone); tabI.Columns[2].SetWidth(370f, Wordy.WdRulerStyle.wdAdjustNone); tabI.Columns[3].SetWidth(80f, Wordy.WdRulerStyle.wdAdjustNone); foreach (Element e in modelProjektu.WymaganiaInfrastrukturaLista) { word.wstawWierszDoTabeli("Rozdzial1b", tabI, i++, new string[] { e.Author, /* pakTxt,*/ e.Name, e.Status }); } // tab.SortAscending(); } else { Wordy.Table tab = null; if (jezykPolski) { tab = word.wstawTabele("Rozdzial1b", new string[] { "Autor", /* "Pakiet",*/ "Wymaganie", "Status" /*, "Treść", "Status","Właściciel"*/ }); } else { tab = word.wstawTabele("Rozdzial1b", new string[] { "Author", /*"Package",*/ "Requirement", "Status" /*, "Treść", "Status","Właściciel"*/ }); } tab.Columns[1].SetWidth(50f, Wordy.WdRulerStyle.wdAdjustNone); // tab.Columns[2].SetWidth(100f, Wordy.WdRulerStyle.wdAdjustNone); tab.Columns[2].SetWidth(370f, Wordy.WdRulerStyle.wdAdjustNone); tab.Columns[3].SetWidth(80f, Wordy.WdRulerStyle.wdAdjustNone); // int ii = 1; foreach (Element e in modelProjektu.WymaganiaBiznesoweLista) { word.wstawWierszDoTabeli("Rozdzial1b", tab, i++, new string[] { e.Author, /* pakTxt,*/ e.Name, e.Status }); } foreach (Element e in modelProjektu.WymaganiaInfrastrukturaLista) { word.wstawWierszDoTabeli("Rozdzial1b", tab, i++, new string[] { e.Author, /* pakTxt,*/ e.Name, e.Status }); } tab.SortAscending(); } okno.Log(Statystyki.LogMsgType.WynikOK, " elementów: \n Biznesowych: " + modelProjektu.WymaganiaBiznesoweLista.Count + "\n Infrastruktura: " + modelProjektu.WymaganiaInfrastrukturaLista.Count + " [ok]\n"); }
/// <summary> /// 升序排序 /// </summary> /// <param name="wordTable"></param> public static void SortAscending(Word.Table wordTable) { wordTable.SortAscending(); //排序 }