コード例 #1
0
 protected virtual void OnResourceSelected(ResourceSelectedEventArgs args)
 {
     if (ResourceSelected != null)
     {
         ResourceSelected(this, args);
     }
 }
コード例 #2
0
        void BrowseContentDialog_ResourceSelected(object sender, ResourceSelectedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            IDataSourceWithResources dataSource = DataSourceProvider.CreateNewDataSourceForConnectionType(e.ConnectionType) as IDataSourceWithResources;

            if (dataSource == null)
            {
                return;
            }
            Resource resource = e.Resource;

            if (resource == null)
            {
                return;
            }

            // Notify listeners that a resource has been selected
            OnResourceSelected(e);

            dataSource.CreateLayerCompleted += (o, args) =>
            {
                Dispatcher.BeginInvoke((Action) delegate
                {
                    OnLayerAdded(new LayerAddedEventArgs()
                    {
                        Layer = args.Layer
                    });
                });
            };
            dataSource.CreateLayerFailed += (o, args) =>
            {
                Dispatcher.BeginInvoke((Action) delegate
                {
                    Logger.Instance.LogError(args.Exception);
                    OnLayerAddFailed(args);
                    return;
                });
            };
            dataSource.CreateLayerAsync(resource, Map != null ? Map.SpatialReference : BrowseContentDialog.MapSpatialReference, null);
            // NOTE:- layer can only be instantiated on the UI thread because it has a Canvas (UI) element
        }
コード例 #3
0
 protected virtual void OnResourceSelected(ResourceSelectedEventArgs args)
 {
     if (ResourceSelected != null)
         ResourceSelected(this, args);
 }
コード例 #4
0
        void BrowseContentDialog_ResourceSelected(object sender, ResourceSelectedEventArgs e)
        {
            if (e == null)
                return;
            IDataSourceWithResources dataSource = DataSourceProvider.CreateNewDataSourceForConnectionType(e.ConnectionType) as IDataSourceWithResources;
            if (dataSource == null)
                return;
            Resource resource = e.Resource;
            if (resource == null)
                return;

            // Notify listeners that a resource has been selected
            OnResourceSelected(e);

            dataSource.CreateLayerCompleted += (o, args) =>
            {
                Dispatcher.BeginInvoke((Action)delegate
                {
                    OnLayerAdded(new LayerAddedEventArgs() { Layer = args.Layer });
                });
            };
            dataSource.CreateLayerFailed += (o, args) =>
            {
                Dispatcher.BeginInvoke((Action)delegate
                {
                    Logger.Instance.LogError(args.Exception);
                    OnLayerAddFailed(args);
                    return;
                });
            };
            dataSource.CreateLayerAsync(resource, Map != null ? Map.SpatialReference : BrowseContentDialog.MapSpatialReference, null);
            // NOTE:- layer can only be instantiated on the UI thread because it has a Canvas (UI) element
        }
コード例 #5
0
 private void AddContentDialog_ResourceSelected(object sender, ResourceSelectedEventArgs e)
 {
     ShowMapContentsTab();
 }