本文整理汇总了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_);
}
}
示例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); });
}
示例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;
}
示例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]);
}
示例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;
}
示例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;
}
示例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_);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}