当前位置: 首页>>代码示例>>C#>>正文


C# Locator类代码示例

本文整理汇总了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;
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:30,代码来源:BatchGeocoding.xaml.cs

示例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);
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:28,代码来源:AddressToLocation.xaml.cs

示例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);
        }
开发者ID:ApexGIS,项目名称:developer-support,代码行数:25,代码来源:MainWindow.xaml.cs

示例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);
  }
开发者ID:Egipto87,项目名称:DOOP.ec,代码行数:7,代码来源:UDPTransmitter.cs

示例5: AddingToSameKeyTwiceThrows

        public void AddingToSameKeyTwiceThrows()
        {
            object o = new object();
            IReadWriteLocator locator = new Locator();

            locator.Add("foo1", o);
            locator.Add("foo1", o);
        }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:8,代码来源:LocatorFixture.cs

示例6: CannotCastAReadOnlyLocatorToAReadWriteLocator

		public void CannotCastAReadOnlyLocatorToAReadWriteLocator()
		{
			Locator innerLocator = new Locator();
			ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);

			Assert.IsTrue(locator.ReadOnly);
			Assert.IsNull(locator as IReadWriteLocator);
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:8,代码来源:ReadOnlyLocatorFixture.cs

示例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));
        }
开发者ID:raulnq,项目名称:Jal.Locator,代码行数:8,代码来源:ServiceLocatorTest.cs

示例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);
 }
开发者ID:Egipto87,项目名称:DOOP.ec,代码行数:9,代码来源:UDPReceiver.cs

示例9: GenericGetWithSearchModeEnforcesDataType

        public void GenericGetWithSearchModeEnforcesDataType()
        {
            Locator innerLocator = new Locator();
            ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);

            innerLocator.Add(1, 2);

            locator.Get<string>(1, SearchMode.Local);
        }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:9,代码来源:ReadOnlyLocatorFixture.cs

示例10: GenericGetEnforcesDataType

        public void GenericGetEnforcesDataType()
        {
            Locator innerLocator = new Locator();
            ReadOnlyLocator locator = new ReadOnlyLocator(innerLocator);

            innerLocator.Add(1, 2);

            locator.Get<string>(1);
        }
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:9,代码来源:ReadOnlyLocatorFixture.cs

示例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;
        }
开发者ID:Egipto87,项目名称:DOOP.ec,代码行数:9,代码来源:LocatorEncoder.cs

示例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);
		}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:10,代码来源:ReadOnlyLocatorFixture.cs

示例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);
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:10,代码来源:LocationToAddress.xaml.cs

示例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();
 }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:10,代码来源:WebControl.cs

示例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();
            }
        }
开发者ID:sailesh341,项目名称:JavApi,代码行数:19,代码来源:org.xml.sax.ext.Locator2Impl.cs


注:本文中的Locator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。