1 public static int InsertSharedStringItem(string text, pkg.SharedStringTablePart shareStringPart) 2 { 3 if (shareStringPart.SharedStringTable == null) 4 { 5 shareStringPart.SharedStringTable = new DOS.SharedStringTable(); 6 } 7 8 int i = 0; 9 10 foreach (DOS.SharedStringItem item in shareStringPart.SharedStringTable.Elements<DOS.SharedStringItem>()) 11 { 12 if (item.InnerText == text) 13 { 14 return i; 15 } 16 i++; 17 } 18 19 shareStringPart.SharedStringTable.AppendChild(new DOS.SharedStringItem(new DOS.Text(text))); 20 shareStringPart.SharedStringTable.Save(); 21 22 return i; 23 }
分享和发布原创的新技术,中国的软件行业落后外国几百条街了,知识共享力争不要落后太多