本文整理汇总了C#中Envelope.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Envelope.Equals方法的具体用法?C# Envelope.Equals怎么用?C# Envelope.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Envelope
的用法示例。
在下文中一共展示了Envelope.Equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CoordToEnvelope_SimpleGridsetTopOrgin_ReturnsEnvelope
public void CoordToEnvelope_SimpleGridsetTopOrgin_ReturnsEnvelope()
{
GridSet g = new GridSet(
"test",
"epsg:test",
new Envelope(0, 0, 100, 100),
new List<double>() { 10, 5, 2.5 },
10,
10
);
Envelope expected = new Envelope(0, 0, 100, 100);
Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(0, 0, 0, true))));
expected = new Envelope(0, 0, 50, 50);
Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(1, 0, 1, true))));
expected = new Envelope(75, 75, 100, 100);
Assert.IsTrue(expected.Equals(g.CoordToEnvelope(new Coord(2, 3, 0, true))));
}
示例2: EnvelopeAll
public void EnvelopeAll()
{
IList results = session.CreateCriteria(typeof(County))
.SetProjection(SpatialProjections.Envelope("Boundaries"))
.List();
Assert.AreEqual(1, results.Count);
IGeometry aggregated = (IGeometry)results[0];
IEnvelope expected = new Envelope(1, 3, 0, 2);
Assert.IsTrue(expected.Equals(aggregated.EnvelopeInternal));
}
示例3: OnTileRendered
/// <summary>
/// Method to raise the map tile available event
/// </summary>
/// <param name="ptInsert"></param>
/// <param name="env"></param>
/// <param name="bmp"></param>
protected virtual void OnTileRendered(Point ptInsert, Envelope env, Bitmap bmp)
{
if (!env.Equals(_lastViewport))
{
System.Threading.Monitor.Enter(_renderLock);
using (var g = Graphics.FromImage(_bitmap))
g.DrawImageUnscaled(bmp, ptInsert);
System.Threading.Monitor.Exit(_renderLock);
}
var h1 = MapNewTileAvaliable;
if (h1 != null)
{
h1(null, env, bmp, bmp.Width, bmp.Height, _imageAttributes);
}
var h2 = DownloadProgressChanged;
if (h2 != null)
{
System.Threading.Interlocked.Decrement(ref _numPendingDownloads);
h2(_numPendingDownloads);
}
}
示例4: TestParse
private static void TestParse(string envString, Envelope env)
{
var envFromString = Envelope.Parse(envString);
Assert.IsTrue(env.Equals(envFromString));
}
示例5: TestEquals
public void TestEquals()
{
Envelope e1 = new Envelope(1, 2, 3, 4);
Envelope e2 = new Envelope(1, 2, 3, 4);
Assert.AreEqual(e1, e2);
Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());
Envelope e3 = new Envelope(1, 2, 3, 5);
Assert.IsTrue(!e1.Equals(e3));
Assert.IsTrue(e1.GetHashCode() != e3.GetHashCode());
e1.SetToNull();
Assert.IsTrue(!e1.Equals(e2));
Assert.IsTrue(e1.GetHashCode() != e2.GetHashCode());
e2.SetToNull();
Assert.AreEqual(e1, e2);
Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());
}