Arcgis for android 离线查询
参考.. 官方API demo 。。。 各种资料
以及。。
- ArcGIS for Android示例解析之高亮要素-----HighlightFeatures
- ttp://blog.csdn.net/wozaifeiyang0/article/details/7323606
- arcgis android 中 Geodatabase geodata = new Geodatabase(filepath);得到geodata为空
- http://zhidao.baidu.com/link?url=iH5IDhbjIKOrZE3WffmhHwJ2ZqFF8AzU8tir8qvSl_BP5AUIHiGSc3aKbqZ7MWVHS1_8Umey4tgNcm9fEm3eVX0pN5DMnhe2_Z7FoGa2ppe&qq-pf-to=pcqq.group
- ArcGIS for Android示例解析之FeatureLayer服务-----SelectFeatures
- http://bbs.hiapk.com/thread-3940420-1-1.html
过程:
1、 FeatureLayer图层对象所需的参数的设置,如:自身的url设置,Options对象设置,以及选择的要素渲染的样式设置等。
2、 定义一个Query对象,并且给其设置所需的值,如:设置查询条件、是否返回几何对象、输入的空间参考、空间要素以及查询的空间关系。
3、 执行FeatureLayer对象的selectFeatures()方法。
sfs);
// add graphic to layer
mGraphicsLayer.addGraphic(graphic);
public static final String GEO_FILENAME="/Arcgis/hello/data/z01.geodatabase";//数据存放地址
- public void onLongPress(MotionEvent point) {
- // Our long press will clear the screen
- mStops.clearFeatures();
- mGraphicsLayer.removeAll();
- mMapView.getCallout().hide();
- }
- public boolean onSingleTap(MotionEvent point) {
- Point mapPoint = mMapView.toMapPoint(point.getX(), point.getY());
- Log.i("zjx",""+mapPoint.getX()/1000+",,,"+(mapPoint.getY()/1000+1));
- Graphic graphic = new Graphic(mapPoint, new SimpleMarkerSymbol(Color.BLUE, 10, STYLE.DIAMOND));
- mGraphicsLayer.addGraphic(graphic);}
单击得到相对地图的位置
try {
geodatabase =new Geodatabase(filename);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<GeodatabaseFeatureTable> table = geodatabase
.getGeodatabaseTables();
Log.i("zjx","list:"+table);
GeodatabaseFeatureTable mytable=geodatabase.getGeodatabaseFeatureTableByLayerId(0);
- FeatureLayer featureLayer = new FeatureLayer(mytable);
- QueryParameters qParameters = new QueryParameters();
- String whereClause = "name='z5'";
- // SpatialReference sr = SpatialReference.create(102100);
- qParameters.setGeometry(mMapView.getExtent());
- // qParameters.setOutSpatialReference(sr);
- qParameters.setReturnGeometry(true);
- qParameters.setWhere(whereClause);
- CallbackListener<FeatureResult> callback=new CallbackListener<FeatureResult>(){
- public void onError(Throwable e) {
- e.printStackTrace();
- }
- public void onCallback(FeatureResult featureIterator) {
- //...
- Log.i("zjx","featureIterator.featureCount():"+featureIterator.featureCount());
- Log.i("zjx","featureIterator.getDisplayFieldName()"+featureIterator.getDisplayFieldName());
- Log.i("zjx","i m callback");
- }
- };
- Log.i("zjx","sb:"+featureLayer.selectFeatures(qParameters, FeatureLayer.SelectionMode.NEW,callback));
- // featureLayer.getU
- Future<FeatureResult> resultFuture=featureLayer.selectFeatures(qParameters, FeatureLayer.SelectionMode.NEW,callback);
- Log.i("zjx","resultFuture:"+ resultFuture);
- try{
- FeatureResult results = resultFuture.get();//最关键 得到结果
- Log.i("zjx","feature.featureCount():"+results.featureCount());//得到结果的数量
- Log.i("zjx","feature.getDisplayFieldName():"+results.getDisplayFieldName());
- if (results != null) {
- Log.i("zjx","results no null");
- int size = (int) results.featureCount();
- int i = 0;
- for (Object element : results) {//得到每个要素
- Log.i("zjx","the element:"+element);
- if (element instanceof Feature) {
- Log.i("zjx","element");
- Feature feature = (Feature) element;
- Log.i("zjx","Feature feature = (Feature) element;:"+element);
- // turn feature into graphic
- Random r = new Random();
- int color = Color.rgb(r.nextInt(255), r.nextInt(255), r.nextInt(255));
- SimpleFillSymbol sfs = new SimpleFillSymbol(color);
- sfs.setAlpha(75);
- Graphic graphic = new Graphic(feature.getGeometry(),
- sfs);
- // add graphic to layer
- mGraphicsLayer.addGraphic(graphic);//显示要素
- }
- i++;
- }
- // update message with results
- }
设置查询条件 高亮样式
- package com.esri.arcgis.android.samples.offlineroutingandgeocoding;
- import java.io.FileNotFoundException;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Map;
- import java.util.Random;
- import java.util.concurrent.Future;
- import android.app.Activity;
- import android.content.Context;
- import android.graphics.Color;
- import android.os.Bundle;
- import android.os.Environment;
- import android.util.Log;
- import android.view.LayoutInflater;
- import android.view.Menu;
- import android.view.MotionEvent;
- import android.view.View;
- import android.widget.AdapterView;
- import android.widget.AdapterView.OnItemSelectedListener;
- import android.widget.ArrayAdapter;
- import android.widget.Spinner;
- import android.widget.TextView;
- import android.widget.Toast;
- import com.esri.android.map.FeatureLayer;
- import com.esri.android.map.GraphicsLayer;
- import com.esri.android.map.GraphicsLayer.RenderingMode;
- import com.esri.android.map.MapOnTouchListener;
- import com.esri.android.map.MapView;
- import com.esri.android.map.TiledLayer;
- import com.esri.android.map.ags.ArcGISLocalTiledLayer;
- import com.esri.core.geodatabase.Geodatabase;
- import com.esri.core.geodatabase.GeodatabaseFeature;
- import com.esri.core.geodatabase.GeodatabaseFeatureTable;
- import com.esri.core.geometry.Geometry;
- import com.esri.core.geometry.Point;
- import com.esri.core.geometry.SpatialReference;
- import com.esri.core.map.CallbackListener;
- import com.esri.core.map.Feature;
- import com.esri.core.map.FeatureResult;
- import com.esri.core.map.FeatureSet;
- import com.esri.core.map.Graphic;
- import com.esri.core.symbol.SimpleFillSymbol;
- import com.esri.core.symbol.SimpleLineSymbol;
- import com.esri.core.symbol.SimpleMarkerSymbol;
- import com.esri.core.symbol.SimpleMarkerSymbol.STYLE;
- import com.esri.core.tasks.geocode.Locator;
- import com.esri.core.tasks.geocode.LocatorReverseGeocodeResult;
- import com.esri.core.tasks.na.NAFeaturesAsFeature;
- import com.esri.core.tasks.na.Route;
- import com.esri.core.tasks.na.RouteDirection;
- import com.esri.core.tasks.na.RouteParameters;
- import com.esri.core.tasks.na.RouteResult;
- import com.esri.core.tasks.na.RouteTask;
- import com.esri.core.tasks.na.StopGraphic;
- import com.esri.core.tasks.query.QueryParameters;
- public class RoutingAndGeocoding extends Activity {
- // Define ArcGIS Elements
- MapView mMapView;
- final String extern = Environment.getExternalStorageDirectory().getPath();
- // final String tpkPath = "/ArcGIS/samples/OfflineRouting/SanDiego.tpk";
- final String tpkPath = "/Arcgis/hello.tpk";
- public static final String GEO_FILENAME="/Arcgis/hello/data/z01.geodatabase";
- TiledLayer mTileLayer = new ArcGISLocalTiledLayer(extern + tpkPath);
- GraphicsLayer mGraphicsLayer = new GraphicsLayer();
- String filename=extern+GEO_FILENAME;
- RouteTask mRouteTask = null;
- NAFeaturesAsFeature mStops = new NAFeaturesAsFeature();
- Locator mLocator = null;
- View mCallout = null;
- Spinner dSpinner;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_routing_and_geocoding);
- // Find the directions spinner
- dSpinner = (Spinner) findViewById(R.id.directionsSpinner);
- dSpinner.setEnabled(false);
- // Retrieve the map and initial extent from XML layout
- mMapView = (MapView) findViewById(R.id.map);
- // Set the tiled map service layer and add a graphics layer
- mMapView.addLayer(mTileLayer);
- mMapView.addLayer(mGraphicsLayer);
- // Initialize the RouteTask and Locator with the local data
- initializeRoutingAndGeocoding();
- mMapView.setOnTouchListener(new TouchListener(RoutingAndGeocoding.this, mMapView));
- // Point mapPoint = null;
- // mapPoint.setXY(0.1942*1928,(0.6842-1)*1928);
- // Log.i("zjx",""+mapPoint);
- // Graphic graphic = new Graphic(mapPoint, new SimpleMarkerSymbol(Color.BLUE, 10, STYLE.DIAMOND));
- // mGraphicsLayer.addGraphic(graphic);
- }
- private void initializeRoutingAndGeocoding() {
- // We will spin off the initialization in a new thread
- new Thread(new Runnable() {
- @Override
- public void run() {
- // Get the external directory
- // String locatorPath = "/ArcGIS/samples/OfflineRouting/Geocoding/SanDiego_StreetAddress.loc";
- // String networkPath = "/ArcGIS/samples/OfflineRouting/Routing/RuntimeSanDiego.geodatabase";
- String locatorPath = "/Arcgis/hello/data/z01.loc";
- String networkPath = "/Arcgis/hello/data/z01.geodatabase";
- String networkName = "Streets_ND";
- // Attempt to load the local geocoding and routing data
- try {
- mLocator = Locator.createLocalLocator(extern + locatorPath);
- mRouteTask = RouteTask.createLocalRouteTask(extern + networkPath, networkName);
- } catch (Exception e) {
- popToast("Error while initializing :" + e.getMessage(), true);
- e.printStackTrace();
- }
- }
- }).start();
- }
- class TouchListener extends MapOnTouchListener {
- private int routeHandle = -1;
- @Override
- public void onLongPress(MotionEvent point) {
- // Our long press will clear the screen
- mStops.clearFeatures();
- mGraphicsLayer.removeAll();
- mMapView.getCallout().hide();
- }
- @Override
- public boolean onSingleTap(MotionEvent point) {
- Point mapPoint = mMapView.toMapPoint(point.getX(), point.getY());
- Log.i("zjx",""+mapPoint.getX()/1000+",,,"+(mapPoint.getY()/1000+1));
- Graphic graphic = new Graphic(mapPoint, new SimpleMarkerSymbol(Color.BLUE, 10, STYLE.DIAMOND));
- mGraphicsLayer.addGraphic(graphic);
- if (mLocator == null) {
- popToast("Locator uninitialized", true);
- return super.onSingleTap(point);
- }
- String stopAddress = "";
- try {
- // Attempt to reverse geocode the point.
- // Our input and output spatial reference will
- // be the same as the map.
- SpatialReference mapRef = mMapView.getSpatialReference();
- LocatorReverseGeocodeResult result = mLocator.reverseGeocode(mapPoint, 50, mapRef, mapRef);
- // Construct a nicely formatted address from the results
- StringBuilder address = new StringBuilder();
- if (result != null && result.getAddressFields() != null) {
- Map<String, String> addressFields = result.getAddressFields();
- address.append(String.format("%s\n%s, %s %s", addressFields.get("Street"), addressFields.get("City"),
- addressFields.get("State"), addressFields.get("ZIP")));
- }
- // Show the results of the reverse geocoding in
- // the map's callout.
- stopAddress = address.toString();
- showCallout(stopAddress, mapPoint);
- } catch (Exception e) {
- Log.v("Reverse Geocode", e.getMessage());
- }
- // Add the touch event as a stop
- StopGraphic stop = new StopGraphic(graphic);
- stop.setName(stopAddress.toString());
- mStops.addFeature(stop);
- return true;
- }
- @Override
- public boolean onDoubleTap(MotionEvent point) {
- Log.i("zjx","double");
- // String filename=Environment.getExternalStorageDirectory().getAbsolutePath()+GEO_FILENAME;
- Geodatabase geodatabase =null;
- try {
- geodatabase =new Geodatabase(filename);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- List<GeodatabaseFeatureTable> table = geodatabase
- .getGeodatabaseTables();
- Log.i("zjx","list:"+table);
- GeodatabaseFeatureTable mytable=geodatabase.getGeodatabaseFeatureTableByLayerId(0);
- FeatureLayer featureLayer = new FeatureLayer(mytable);
- QueryParameters qParameters = new QueryParameters();
- String whereClause = "name='z5'";
- // SpatialReference sr = SpatialReference.create(102100);
- qParameters.setGeometry(mMapView.getExtent());
- // qParameters.setOutSpatialReference(sr);
- qParameters.setReturnGeometry(true);
- qParameters.setWhere(whereClause);
- CallbackListener<FeatureResult> callback=new CallbackListener<FeatureResult>(){
- public void onError(Throwable e) {
- e.printStackTrace();
- }
- public void onCallback(FeatureResult featureIterator) {
- //...
- Log.i("zjx","featureIterator.featureCount():"+featureIterator.featureCount());
- Log.i("zjx","featureIterator.getDisplayFieldName()"+featureIterator.getDisplayFieldName());
- Log.i("zjx","i m callback");
- }
- };
- Log.i("zjx","sb:"+featureLayer.selectFeatures(qParameters, FeatureLayer.SelectionMode.NEW,callback));
- // featureLayer.getU
- Future<FeatureResult> resultFuture=featureLayer.selectFeatures(qParameters, FeatureLayer.SelectionMode.NEW,callback);
- Log.i("zjx","resultFuture:"+ resultFuture);
- try{
- FeatureResult results = resultFuture.get();
- Log.i("zjx","feature.featureCount():"+results.featureCount());
- Log.i("zjx","feature.getDisplayFieldName():"+results.getDisplayFieldName());
- if (results != null) {
- Log.i("zjx","results no null");
- int size = (int) results.featureCount();
- int i = 0;
- for (Object element : results) {
- Log.i("zjx","the element:"+element);
- if (element instanceof Feature) {
- Log.i("zjx","element");
- Feature feature = (Feature) element;
- Log.i("zjx","Feature feature = (Feature) element;:"+element);
- // turn feature into graphic
- Random r = new Random();
- int color = Color.rgb(r.nextInt(255), r.nextInt(255), r.nextInt(255));
- SimpleFillSymbol sfs = new SimpleFillSymbol(color);
- sfs.setAlpha(75);
- Graphic graphic = new Graphic(feature.getGeometry(),
- sfs);
- // add graphic to layer
- mGraphicsLayer.addGraphic(graphic);
- }
- i++;
- }
- // update message with results
- }
- }
- catch (Exception e){
- Log.i("zjx","e:"+e);
- }
- // Log.i("zjx","featureLayer2:"+featureLayer);
- // mMapView.addLayer(featureLayer);
- // QueryParameters query = new QueryParameters();
- //// query.setWhere("*");
- //
- // query.setOutFields(new String[]{"*"});
- // Log.i("zjx","query:"+query.toString());
- //
- // Future resultFuture = mytable.queryFeatures(query, callback);
- // try{
- // Log.i("zjx","resultFuture:"+resultFuture.get().toString());
- // Object result = resultFuture.get();
- // Feature feature = (Feature) result;
- // Map attrs = feature.getAttributes();
- // Log.i("zjx","feature:"+feature);
- // Log.i("zjx","attrs:"+attrs);
- // }
- // catch(Exception e){
- //
- // Log.i("zjx","error:"+e);
- // }
- // Future resultFuture = gdbFeatureTable.queryFeatures(query, new CallbackListener() {
- //
- // public void onError(Throwable e) {
- // e.printStackTrace();
- // }
- //
- // public void onCallback(FeatureResult featureIterator) {
- // // ...
- // }
- // });
- //
- // for (Object result : resultFuture.get()) {
- // Feature feature = (Feature) result;
- // // Map attrs = feature.getAttributes();
- // }
- // Return default behavior if we did not initialize properly.
- // if (mRouteTask == null) {
- // popToast("RouteTask uninitialized.", true);
- // return super.onDoubleTap(point);
- // }
- //
- // try {
- //
- // // Set the correct input spatial reference on the stops and the
- // // desired output spatial reference on the RouteParameters object.
- // SpatialReference mapRef = mMapView.getSpatialReference();
- // RouteParameters params = mRouteTask.retrieveDefaultRouteTaskParameters();
- // params.setOutSpatialReference(mapRef);
- // mStops.setSpatialReference(mapRef);
- //
- // // Set the stops and since we want driving directions,
- // // returnDirections==true
- // params.setStops(mStops);
- // params.setReturnDirections(true);
- //
- // // Perform the solve
- // RouteResult results = mRouteTask.solve(params);
- //
- // // Grab the results; for offline routing, there will only be one
- // // result returned on the output.
- // Route result = results.getRoutes().get(0);
- //
- // // Remove any previous route Graphics
- // if (routeHandle != -1)
- // mGraphicsLayer.removeGraphic(routeHandle);
- //
- // // Add the route shape to the graphics layer
- // Geometry geom = result.getRouteGraphic().getGeometry();
- // routeHandle = mGraphicsLayer.addGraphic(new Graphic(geom, new SimpleLineSymbol(0x99990055, 5)));
- // mMapView.getCallout().hide();
- //
- // // Get the list of directions from the result
- // List<RouteDirection> directions = result.getRoutingDirections();
- //
- // // enable spinner to receive directions
- // dSpinner.setEnabled(true);
- //
- // // Iterate through all of the individual directions items and
- // // create a nicely formatted string for each.
- // List<String> formattedDirections = new ArrayList<String>();
- // for (int i = 0; i < directions.size(); i++) {
- // RouteDirection direction = directions.get(i);
- // formattedDirections.add(String.format("%s\nGo %.2f %s For %.2f Minutes", direction.getText(),
- // direction.getLength(), params.getDirectionsLengthUnit().name(), direction.getMinutes()));
- // }
- //
- // // Add a summary String
- // formattedDirections.add(0, String.format("Total time: %.2f Mintues", result.getTotalMinutes()));
- //
- // // Create a simple array adapter to visualize the directions in
- // // the Spinner
- // ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(),
- // android.R.layout.simple_spinner_item, formattedDirections);
- // adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
- // dSpinner.setAdapter(adapter);
- //
- // // Add a custom OnItemSelectedListener to the spinner to allow
- // // panning to each directions item.
- // dSpinner.setOnItemSelectedListener(new DirectionsItemListener(directions));
- //
- // } catch (Exception e) {
- // popToast("Solve Failed: " + e.getMessage(), true);
- // e.printStackTrace();
- // }
- return true;
- }
- public TouchListener(Context context, MapView view) {
- super(context, view);
- }
- }
- class DirectionsItemListener implements OnItemSelectedListener {
- private List<RouteDirection> mDirections;
- public DirectionsItemListener(List<RouteDirection> directions) {
- mDirections = directions;
- }
- @Override
- public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
- // We have to account for the added summary String
- if (mDirections != null && pos > 0 && pos <= mDirections.size())
- mMapView.setExtent(mDirections.get(pos - 1).getGeometry());
- }
- @Override
- public void onNothingSelected(AdapterView<?> arg0) {
- }
- }
- private void showCallout(String text, Point location) {
- // If the callout has never been created, inflate it
- if (mCallout == null) {
- LayoutInflater inflater = (LayoutInflater) getApplication().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- mCallout = inflater.inflate(R.layout.callout, null);
- }
- // Show the callout with the given text at the given location
- ((TextView) mCallout.findViewById(R.id.calloutText)).setText(text);
- mMapView.getCallout().show(location, mCallout);
- mMapView.getCallout().setMaxWidth(700);
- }
- private void popToast(final String message, final boolean show) {
- // Simple helper method for showing toast on the main thread
- if (!show)
- return;
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(RoutingAndGeocoding.this, message, Toast.LENGTH_SHORT).show();
- }
- });
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.routing_and_geocoding, menu);
- return true;
- }
- }
Arcgis for android 离线查询的更多相关文章
- ArcGIS for Android离线数据编辑实现原理
来自:http://blog.csdn.net/arcgis_mobile/article/details/7565877 ArcGIS for Android中现已经提供了离线缓存图片的加载功能,极 ...
- ArcGIS For Android 的标绘与可视化
参考 1. CSDN 相关博文 2. ArcGIS for Android 离线数据空间分析--叠加分析 3. ArcGIS for Android Runtime100 基本操作(五)——绘制图层和 ...
- arcgis for android常见问题回答
Q:arcgis for android最新版本是多少?(2014-7-18) Arcgis for android 10.2.3 sdk 百度盘下载地址:http://pan.baidu.com/s ...
- Arcgis For Android之离线地图实现的几种方式
为什么要用,我想离线地图的好处是不言而喻的,所以很多人做系统的时候都会考虑用离线地图.在此,我给大家介绍几种Arcgis For Android下加载离线地图的方式. 在Arcgis For Andr ...
- 【Arcgis for android】相关教程收集自网络
请加入qq群:143501213 一起交流和学习 推荐博客: 张云飞VIR http://www.cnblogs.com/vir56k/tag/arcgis%20for%20android/ arcg ...
- ArcGis for Android 工作与学习
ArcGis安装 需求 windows7(32/64) Eclipse3.6以上版本 Android Sdk 2.2以上 Jdk 7 安装步骤 Eclipse安装 下载ArcGis插件 在Eclips ...
- 外业数据采集平台(GPS+Android Studio+Arcgis for android 100.2.1)
外业数据采集平台 1. 综述 在室外,通过平板或者手机接收GPS坐标,实时绘制点.线.面数据,以便为后续进行海域监测.土地确权.地图绘图提供有效数据和依据. 2. 技术路线 Android studi ...
- 创建一个ArcGIS for Android 新项目并显示出本地的地图
1.准备工作:首先要配置好android的开发环境,然后在Eclipse中安装ArcGIS for Android的开发控件:在ArcCatalog中发布好本地的地图服务. 2.安装完ArcGIS f ...
- ArcGIS for Android地图控件的5大常见操作
GIS的开发中,什么时候都少不了地图操作.ArcGIS for Android中,地图组件就是MapView,MapView是基于Android中ViewGroup的一个类(参考),也是ArcGIS ...
随机推荐
- Application MyTest has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.
运行react-native项目时报错. 说明一下:项目本来是好的,再次运行就报错了 解决解决办法倒是有,不过具体什么原因不知道.希望有知道具体原因的童鞋能够补充一下 第一种情况:真的是注册的时候写错 ...
- angularjs + seajs构建Web Form前端(二)
回顾 上一篇讲解了引入bootstrap构建一个简单的登录页面,如何让angularjs自动启动并绑定视图,操作过程当中如何使用ui-bootstrap,继而完成简单功能后如何引入seajs后如何使n ...
- HIVE: Transform应用实例
数据文件内容 steven:100;steven:90;steven:99^567^22 ray:90;ray:98^456^30 Tom:81^222^33 期望最终放到数据库的数据格式如下: st ...
- java攻城师之路--复习java web之jsp入门_El表达式_JSTL标签库
JSP 技术掌握:JSP语法 + EL + JSTL 为什么sun推出 JSP技术 ? Servlet 生成网页比较复杂,本身不支持HTML语法,html代码需要通过response输出流输出,JSP ...
- C#将Json字符串反序列化成List对象类集合
摘自:http://blog.csdn.net/cdefg198/article/details/7520398 using System.IO; using System.Web.Script.Se ...
- UML系列04之 UML时序图
概要 本章对UML的时序图进行介绍,主要内容包括:时序图介绍时序图组成 转载请注明出处:http://www.cnblogs.com/skywang12345/p/3523355.html 时序图介绍 ...
- Android程序ToDoList
本文的目的是创建一个简单的ToDoList列表. 这个应用的功能是记录我的代办事项,简单到不需要本地存储,所有的代办事项都只是存储在内存中,就是只有程序打开的时候可以增加查看代办事项,当程序关闭的时候 ...
- EF增删查改(三)------终极版
1.Add #region 1.1 新增学生信息(定义成Int类型,返回受影响的行数) /// <summary> /// 新增学生信息 /// </summary> /// ...
- C#设计模式——代理模式(Proxy Pattern)
一.概述在软件开发中,有些对象由于创建成本高.访问时需要与其它进程交互等原因,直接访问会造成系统速度慢.复杂度增大等问题.这时可以使用代理模式,给系统增加一层间接层,通过间接层访问对象,从而达到隐藏系 ...
- mvc、mvp、mvvm使用关系总结
MVC MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑.数据.界面显示分离的方法 ...