本文整理汇总了C#中Locator类的典型用法代码示例。如果您正苦于以下问题:C# Locator类的具体用法?C# Locator怎么用?C# Locator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Locator类属于命名空间,在下文中一共展示了Locator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BatchGeocoding
public BatchGeocoding()
{
InitializeComponent();
ESRI.ArcGIS.Client.Geometry.Envelope initialExtent =
new ESRI.ArcGIS.Client.Geometry.Envelope(
_mercator.FromGeographic(
new ESRI.ArcGIS.Client.Geometry.MapPoint(-117.387, 33.97)) as MapPoint,
_mercator.FromGeographic(
new ESRI.ArcGIS.Client.Geometry.MapPoint(-117.355, 33.988)) as MapPoint);
initialExtent.SpatialReference = new SpatialReference(102100);
MyMap.Extent = initialExtent;
_locatorTask = new Locator("http://serverapps101.esri.com/arcgis/rest/services/USA_Geocode/GeocodeServer");
_locatorTask.AddressesToLocationsCompleted += _locatorTask_AddressesToLocationsCompleted;
_locatorTask.Failed += LocatorTask_Failed;
geocodedResults = MyMap.Layers["LocationGraphicsLayer"] as GraphicsLayer;
//List of addresses to geocode
batchaddresses.Add(new Dictionary<string, string> { { "Street", "4409 Redwood Dr" }, { "Zip", "92501" } });
batchaddresses.Add(new Dictionary<string, string> { { "Street", "3758 Cedar St" }, { "Zip", "92501" } });
batchaddresses.Add(new Dictionary<string, string> { { "Street", "3486 Orange St" }, { "Zip", "92501" } });
batchaddresses.Add(new Dictionary<string, string> { { "Street", "2999 4th St" }, { "Zip", "92507" } });
batchaddresses.Add(new Dictionary<string, string> { { "Street", "3685 10th St" }, { "Zip", "92501" } });
AddressListbox.ItemsSource = batchaddresses;
}
示例2: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
graphicsLayer.ClearGraphics();
AddressBorder.Visibility = Visibility.Collapsed;
ResultsTextBlock.Visibility = Visibility.Collapsed;
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = MyMap.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(Address.Text))
address.Add("Address", Address.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(StateAbbrev.Text))
address.Add("Region", StateAbbrev.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
locatorTask.AddressToLocationsAsync(addressParams);
}
示例3: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters();
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(Address.Text))
address.Add("Address", Address.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(State.Text))
address.Add("Region", State.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
address.Add("forStorage", "true");
address.Add("token","pgPwo32cfo-kLf0ABYjV9RZjxGNfFB4--xSkGLOY4bUx0UhmFMc0-06KJCPtx4uRsIGuO_9xn_cxI2G2w9IoD3hX7Q-LGulIg2VhKUcvklXu7CblMg1--yg5kznhXjSF");
locatorTask.AddressToLocationsAsync(addressParams);
}
示例4: UDPTransmitter
public UDPTransmitter(Uri uri, int bufferSize)
{
var addresses = System.Net.Dns.GetHostAddresses(uri.Host);
int port = (uri.Port < 0 ? 0 : uri.Port);
if (addresses != null && addresses.Length >= 1)
this.locator = new Locator(addresses[0], port);
}
示例5: AddingToSameKeyTwiceThrows
public void AddingToSameKeyTwiceThrows()
{
object o = new object();
IReadWriteLocator locator = new Locator();
locator.Add("foo1", o);
locator.Add("foo1", o);
}
示例6: CannotCastAReadOnlyLocatorToAReadWriteLocator
public void CannotCastAReadOnlyLocatorToAReadWriteLocator()
{
Locator innerLocator = new Locator();
ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);
Assert.IsTrue(locator.ReadOnly);
Assert.IsNull(locator as IReadWriteLocator);
}
示例7: ResolveByType_WithRegisterdObject_ShouldBeAssignableToIDoSomething
public void ResolveByType_WithRegisterdObject_ShouldBeAssignableToIDoSomething(Locator.Interface.IServiceLocator sut)
{
var instance = sut.Resolve(typeof(IDoSomething));
instance.ShouldNotBeNull();
instance.ShouldBeAssignableTo(typeof(IDoSomething));
}
示例8: UDPReceiver
public UDPReceiver(Uri uri, int bufferSize)
{
this.uri = uri;
this.bufferSize = bufferSize;
var addresses = System.Net.Dns.GetHostAddresses(uri.Host);
int port = (uri.Port < 0 ? 0 : uri.Port);
if (addresses != null && addresses.Length >= 1)
this.locator = new Locator(addresses[0], port);
}
示例9: GenericGetWithSearchModeEnforcesDataType
public void GenericGetWithSearchModeEnforcesDataType()
{
Locator innerLocator = new Locator();
ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);
innerLocator.Add(1, 2);
locator.Get<string>(1, SearchMode.Local);
}
示例10: GenericGetEnforcesDataType
public void GenericGetEnforcesDataType()
{
Locator innerLocator = new Locator();
ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);
innerLocator.Add(1, 2);
locator.Get<string>(1);
}
示例11: GetLocator
public static void GetLocator(this IoBuffer buffer, ref Locator obj)
{
obj.Kind = (LocatorKind)buffer.GetInt32();
obj.Port = (int)buffer.GetInt32(); ;
byte[] tmp = new byte[16];
buffer.Get(tmp, 0, 16);
obj.SocketAddressBytes = tmp;
}
示例12: ReadOnlyLocatorCountReflectsInnerLocatorCount
public void ReadOnlyLocatorCountReflectsInnerLocatorCount()
{
Locator innerLocator = new Locator();
ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);
innerLocator.Add(1, 1);
innerLocator.Add(2, 2);
Assert.AreEqual(innerLocator.Count, locator.Count);
}
示例13: MyMap_MouseClick
private void MyMap_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.LocationToAddressCompleted += LocatorTask_LocationToAddressCompleted;
locatorTask.Failed += LocatorTask_Failed;
// Tolerance (distance) specified in meters
double tolerance = 30;
locatorTask.LocationToAddressAsync(e.MapPoint, tolerance, e.MapPoint);
}
示例14: WebControl
public WebControl(Browser aBrowser, Locator aLocator)
{
myControlAccess = new ControlAccess();
myControlAccess.Browser = aBrowser;
myControlAccess.LocatorType = aLocator.LocatorType;
myControlAccess.Locator = aLocator.ControlLocator;
myControlAccess.ControlType = ControlType.Custom;
myControlAccess.IntializeControlAccess();
//Control = myControlAccess.GetControl();
}
示例15: Locator2Impl
/**
* Copy an existing Locator or Locator2 object.
* If the object implements Locator2, values of the
* <em>encoding</em> and <em>version</em>strings are copied,
* otherwise they set to <em>null</em>.
*
* @param locator The existing Locator object.
*/
public Locator2Impl(Locator locator)
: base(locator)
{
if (locator is Locator2)
{
Locator2 l2 = (Locator2)locator;
version = l2.getXMLVersion();
encoding = l2.getEncoding();
}
}