當前位置: 首頁>>代碼示例>>C#>>正文


C# EscherContainerRecord.ToString方法代碼示例

本文整理匯總了C#中NPOI.DDF.EscherContainerRecord.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# EscherContainerRecord.ToString方法的具體用法?C# EscherContainerRecord.ToString怎麽用?C# EscherContainerRecord.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NPOI.DDF.EscherContainerRecord的用法示例。


在下文中一共展示了EscherContainerRecord.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestToString

        public void TestToString()
        {
            EscherContainerRecord r = new EscherContainerRecord();
            r.RecordId=EscherContainerRecord.SP_CONTAINER;
            r.Options=(short)0x000F;
            String nl = Environment.NewLine;
            Assert.AreEqual("EscherContainerRecord (SpContainer):" + nl +
                    "  isContainer: True" + nl +
                    "  version: 0x000F" + nl +
                    "  instance: 0x0000" + nl +
                    "  recordId: 0xF004" + nl +
                    "  numchildren: 0" + nl
                    , r.ToString());

            EscherOptRecord r2 = new EscherOptRecord();
            // don't try to shoot in foot, please -- vlsergey
            // r2.setOptions((short) 0x9876);
            r2.RecordId=EscherOptRecord.RECORD_ID;

            String expected;
            r.AddChildRecord(r2);
            expected = "EscherContainerRecord (SpContainer):" + nl +
                       "  isContainer: True" + nl +
                       "  version: 0x000F" + nl +
                       "  instance: 0x0000" + nl +
                       "  recordId: 0xF004" + nl +
                       "  numchildren: 1" + nl +
                       "  children: " + nl +
                       "    Child 0:" + nl +
                       "    EscherOptRecord:" + nl +
                       "      isContainer: False" + nl +
                       "      version: 0x0003" + nl +
                       "      instance: 0x0000" + nl +
                       "      recordId: 0xF00B" + nl +
                       "      numchildren: 0" + nl +
                       "      properties:" + nl +
                       "    " + nl;
            Assert.AreEqual(expected, r.ToString());

            r.AddChildRecord(r2);
            expected = "EscherContainerRecord (SpContainer):" + nl +
                       "  isContainer: True" + nl +
                       "  version: 0x000F" + nl +
                       "  instance: 0x0000" + nl +
                       "  recordId: 0xF004" + nl +
                       "  numchildren: 2" + nl +
                       "  children: " + nl +
                       "    Child 0:" + nl +
                       "    EscherOptRecord:" + nl +
                       "      isContainer: False" + nl +
                       "      version: 0x0003" + nl +
                       "      instance: 0x0000" + nl +
                       "      recordId: 0xF00B" + nl +
                       "      numchildren: 0" + nl +
                       "      properties:" + nl +
                       "    " + nl +
                       "    Child 1:" + nl +
                       "    EscherOptRecord:" + nl +
                       "      isContainer: False" + nl +
                       "      version: 0x0003" + nl +
                       "      instance: 0x0000" + nl +
                       "      recordId: 0xF00B" + nl +
                       "      numchildren: 0" + nl +
                       "      properties:" + nl +
                       "    " + nl;
            Assert.AreEqual(expected, r.ToString());
        }
開發者ID:Reinakumiko,項目名稱:npoi,代碼行數:67,代碼來源:TestEscherContainerRecord.cs

示例2: TestToString

        public void TestToString()
        {
            EscherContainerRecord r = new EscherContainerRecord();
            r.RecordId=EscherContainerRecord.SP_CONTAINER;
            r.Options=(short)0x000F;
            String nl = Environment.NewLine;
            Assert.AreEqual("EscherContainerRecord (SpContainer):" + nl +
                    "  isContainer: True" + nl +
                    "  options: 0x000F" + nl +
                    "  recordId: 0xF004" + nl +
                    "  numchildren: 0" + nl
                    , r.ToString());

            EscherOptRecord r2 = new EscherOptRecord();
            r2.Options = unchecked((short)0x9876) ;
            r2.RecordId=EscherOptRecord.RECORD_ID;

            String expected;
            r.AddChildRecord(r2);
            expected = "EscherContainerRecord (SpContainer):" + nl +
                       "  isContainer: True" + nl +
                       "  options: 0x000F" + nl +
                       "  recordId: 0xF004" + nl +
                       "  numchildren: 1" + nl +
                       "  children: " + nl +
                       "   Child 0:" + nl +
                       "EscherOptRecord:" + nl +
                       "  isContainer: False" + nl +
                       "  options: 0x0003" + nl +
                       "  recordId: 0xF00B" + nl +
                       "  numchildren: 0" + nl +
                       "  properties:" + nl;
            Assert.AreEqual(expected, r.ToString());

            r.AddChildRecord(r2);
            expected = "EscherContainerRecord (SpContainer):" + nl +
                       "  isContainer: True" + nl +
                       "  options: 0x000F" + nl +
                       "  recordId: 0xF004" + nl +
                       "  numchildren: 2" + nl +
                       "  children: " + nl +
                       "   Child 0:" + nl +
                       "EscherOptRecord:" + nl +
                       "  isContainer: False" + nl +
                       "  options: 0x0003" + nl +
                       "  recordId: 0xF00B" + nl +
                       "  numchildren: 0" + nl +
                       "  properties:" + nl +
                       "   Child 1:" + nl +
                       "EscherOptRecord:" + nl +
                       "  isContainer: False" + nl +
                       "  options: 0x0003" + nl +
                       "  recordId: 0xF00B" + nl +
                       "  numchildren: 0" + nl +
                       "  properties:" + nl;
            Assert.AreEqual(expected, r.ToString());
        }
開發者ID:xoposhiy,項目名稱:npoi,代碼行數:57,代碼來源:TestEscherContainerRecord.cs


注:本文中的NPOI.DDF.EscherContainerRecord.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。