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


C# Test.GetPayloadRootType方法代碼示例

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


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

示例1: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     try
     {
         m_Serializer = m_KnownTypes==null ? new NetSerializer.Serializer( new Type[]{test.GetPayloadRootType() })
                                           : new NetSerializer.Serializer( new Type[]{test.GetPayloadRootType() }.Concat(m_KnownTypes));
     }
     catch (Exception error)
     {
         test.Abort(this, "Error making NetSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
     }
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:12,代碼來源:NetSerializerSer.cs

示例2: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     try
     {
         m_primaryType = test.GetPayloadRootType();
     }
     catch (Exception error)
     {
         test.Abort(this, "Error making ServiceStackTypeSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
     }
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:11,代碼來源:ServiceStackTypeSerializer.cs

示例3: BeforeRuns

        public override void BeforeRuns(Test test)
        {
            var primaryType = test.GetPayloadRootType();

            try
            {
                m_Serializer = m_KnownTypes.Any() ?
                                new DataContractSerializer(primaryType, m_KnownTypes) :
                                new DataContractSerializer(primaryType);
            }
            catch (Exception error)
            {
                test.Abort(this, "Error making DataContractSerializer instance in serializer BeforeRun() {0}. \n Did you decorate the primary known type correctly?".Args(error.ToMessageWithType()));
            }
        }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:15,代碼來源:MSDataContractSerializer.cs

示例4: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     m_PrimaryType = test.GetPayloadRootType();
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:4,代碼來源:FastJsonSerializer.cs

示例5: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     m_Serializer = MessagePackSerializer.Get(test.GetPayloadRootType());
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:4,代碼來源:MsgPackSerializer.cs

示例6: BeforeRuns

 public override void BeforeRuns(Test test)
 {
     m_RootType = test.GetPayloadRootType();
     //_serializer = new Serializer<CompactBinaryWriter<OutputBuffer>>(m_RootType);
     //_deserializer = new Deserializer<CompactBinaryReader<InputBuffer>>(m_RootType);
 }
開發者ID:huoxudong125,項目名稱:serbench,代碼行數:6,代碼來源:BondSerializer.cs


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