// Use a builder convenience method or use a builder constructor.
// Builder convenience methods don't need to run on the MCT.
Envelope envelope = EnvelopeBuilder.CreateEnvelope(100.0, 100.0, 500.0, 500.0);
// shrink the envelope by 50%
Envelope result = envelope.Expand(0.5, 0.5, true);
// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
using (EnvelopeBuilder eBuilder = new EnvelopeBuilder(100.0, 100.0, 500.0, 500.0))
{
// shrink by 50%
eBuilder.Expand(0.5, 0.5, true);
result = eBuilder.ToGeometry();
}
});
// builderEx constructors don't need to run on the MCT.
EnvelopeBuilderEx builderEx = new EnvelopeBuilderEx(100.0, 100.0, 500.0, 500.0);
builderEx.Expand(0.5, 0.5, true);
envelope = builderEx.ToGeometry() as Envelope;