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


C# Capo類代碼示例

本文整理匯總了C#中Capo的典型用法代碼示例。如果您正苦於以下問題:C# Capo類的具體用法?C# Capo怎麽用?C# Capo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: Deserialize

 public override void Deserialize(Deserializer deserializer)
 {
     base.Deserialize(deserializer);
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         deserializer.Read(out message_);
     }
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:9,代碼來源:HeadFirst.cs

示例2: TestCreation

        public void TestCreation()
        {
            var fp = new Fingerprint(7);

            var window = new Capo<bool>(fp, 0);
            Assert.AreEqual(7, window.Length);

            window = new Capo<bool>(fp, 3);
            Assert.AreEqual(4, window.Length);

            // Invalid offset initialization attempt never throws
            Assert.DoesNotThrow(() => { window = new Capo<bool>(fp, 7); });
        }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:13,代碼來源:CapoTests.cs

示例3: GetHashCode

 public override int GetHashCode(Fingerprint fingerprint)
 {
     var hash = new Hash(base.GetHashCode(fingerprint));
     if (fingerprint.Length <= tag.Offset)
     {
         return hash.Code;
     }
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         hash.Update(name);
     }
     return hash.Code;
 }
開發者ID:nice1378,項目名稱:x2clr,代碼行數:14,代碼來源:LinkClose.cs

示例4: TestCapoing

        public void TestCapoing()
        {
            var fp = new Fingerprint(8);
            fp.Touch(2);
            fp.Touch(4);

            var window = new Capo<bool>(fp, 3);
            Assert.False(window[0]);
            Assert.True(window[1]);
            Assert.False(window[2]);

            fp.Wipe(4);
            Assert.False(window[1]);

            // Out-of-range indexing never throws
            Assert.False(window[-8]);
            Assert.False(window[8]);
        }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:18,代碼來源:CapoTests.cs

示例5: IsEquivalent

 protected override bool IsEquivalent(Cell other, Fingerprint fingerprint)
 {
     if (!base.IsEquivalent(other, fingerprint))
     {
         return false;
     }
     LinkSessionConnected o = (LinkSessionConnected)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (linkName_ != o.linkName_)
         {
             return false;
         }
     }
     if (touched[1])
     {
         if (result_ != o.result_)
         {
             return false;
         }
     }
     if (touched[2])
     {
         if (context_ != o.context_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:jaykang920,項目名稱:x2clr,代碼行數:31,代碼來源:LinkEvents.cs

示例6: IsEquivalent

 public override bool IsEquivalent(Cell other)
 {
     if (!base.IsEquivalent(other))
     {
         return false;
     }
     SampleEvent1 o = (SampleEvent1)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (foo_ != o.foo_)
         {
             return false;
         }
     }
     if (touched[1])
     {
         if (bar_ != o.bar_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:24,代碼來源:Sample.cs

示例7: Load

 public override void Load(x2.Buffer buffer)
 {
     base.Load(buffer);
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         buffer.Read(out result_);
     }
 }
開發者ID:nice1378,項目名稱:x2clr,代碼行數:9,代碼來源:Events.cs

示例8: GetHashCode

 public override int GetHashCode(Fingerprint fingerprint)
 {
     var hash = new Hash(base.GetHashCode(fingerprint));
     if (fingerprint.Length <= tag.Offset)
     {
         return hash.Code;
     }
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         hash.Update(linkName_);
     }
     if (touched[1])
     {
         hash.Update(handle_);
     }
     if (touched[2])
     {
         hash.Update(context_);
     }
     return hash.Code;
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:22,代碼來源:SocketLinkEvents.cs

示例9: IsEquivalent

 protected override bool IsEquivalent(Cell other, Fingerprint fingerprint)
 {
     if (!base.IsEquivalent(other, fingerprint))
     {
         return false;
     }
     TestReq o = (TestReq)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (serial_ != o.serial_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:jaykang920,項目名稱:x2clr,代碼行數:17,代碼來源:SessionRecovery.cs

示例10: IsEquivalent

 public override bool IsEquivalent(Cell other)
 {
     if (!base.IsEquivalent(other))
     {
         return false;
     }
     HandshakeResp o = (HandshakeResp)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (data_ != o.data_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:17,代碼來源:LinkEvents.cs

示例11: IsEquivalent

 public override bool IsEquivalent(Cell other)
 {
     if (!base.IsEquivalent(other))
     {
         return false;
     }
     TimeoutEvent o = (TimeoutEvent)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if ((object)key != null)
         {
             if (key is Cell)
             {
                 if (!((Cell)key).IsEquivalent((Cell)o.key))
                 {
                     return false;
                 }
             }
             else
             {
                 if (!key.Equals(o.key))
                 {
                     return false;
                 }
             }
         }
         else if ((object)o.key != null)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:nice1378,項目名稱:x2clr,代碼行數:34,代碼來源:TimeFlowEvents.cs

示例12: IsEquivalent

 protected override bool IsEquivalent(Cell other, Fingerprint fingerprint)
 {
     if (!base.IsEquivalent(other, fingerprint))
     {
         return false;
     }
     SampleCell3 o = (SampleCell3)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (qux_ != o.qux_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:jaykang920,項目名稱:x2clr,代碼行數:17,代碼來源:Sample.cs

示例13: IsEquivalent

 public override bool IsEquivalent(Cell other)
 {
     if (!base.IsEquivalent(other))
     {
         return false;
     }
     TimeoutEvent o = (TimeoutEvent)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (key_ != o.key_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:17,代碼來源:BuiltinEvents.cs

示例14: IsEquivalent

 protected override bool IsEquivalent(Cell other, Fingerprint fingerprint)
 {
     if (!base.IsEquivalent(other, fingerprint))
     {
         return false;
     }
     HelloResp o = (HelloResp)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (result_ != o.result_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:jaykang920,項目名稱:x2clr,代碼行數:17,代碼來源:HelloWorld.cs

示例15: IsEquivalent

 public override bool IsEquivalent(Cell other)
 {
     if (!base.IsEquivalent(other))
     {
         return false;
     }
     LinkSessionRecovered o = (LinkSessionRecovered)other;
     var touched = new Capo<bool>(fingerprint, tag.Offset);
     if (touched[0])
     {
         if (linkName_ != o.linkName_)
         {
             return false;
         }
     }
     if (touched[1])
     {
         if (handle_ != o.handle_)
         {
             return false;
         }
     }
     if (touched[2])
     {
         if (context_ != o.context_)
         {
             return false;
         }
     }
     return true;
 }
開發者ID:gitter-badger,項目名稱:x2clr,代碼行數:31,代碼來源:SocketLinkEvents.cs


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