当前位置: 首页>>代码示例>>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;未经允许,请勿转载。