Mercurial > postarc > postarc
comparison Postarc/Postarc/Geodatabase/SelectionSet.cs @ 0:1aca3d413885 tip
Initial import of Postarc
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 05 Oct 2012 23:55:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1aca3d413885 |
---|---|
1 /* | |
2 * Postarc | |
3 * | |
4 * Author: | |
5 * Christian Lins <christian.lins@intevation.de> | |
6 * | |
7 * Copyright: | |
8 * Copyright (C) 2012 Intevation GmbH <http://www.intevation.de/> | |
9 * | |
10 * This program is free software: you can redistribute it and/or modify | |
11 * it under the terms of the GNU Lesser General Public License as published by | |
12 * the Free Software Foundation, either version 3 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU Lesser General Public License | |
21 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
22 */ | |
23 | |
24 using System; | |
25 using System.Collections.Generic; | |
26 using System.Linq; | |
27 using System.Text; | |
28 using ESRI.ArcGIS.Geodatabase; | |
29 | |
30 namespace Postarc.Geodatabase | |
31 { | |
32 public class SelectionSet : ISelectionSet | |
33 { | |
34 protected Postarc.Feature.FeatureClass featureClass; | |
35 protected List<int> list = new List<int>(); | |
36 | |
37 internal List<int> List | |
38 { | |
39 get | |
40 { | |
41 return this.list; | |
42 } | |
43 } | |
44 | |
45 public SelectionSet(Postarc.Feature.FeatureClass featureClass) | |
46 { | |
47 this.featureClass = featureClass; | |
48 } | |
49 | |
50 public void Add(int oid) | |
51 { | |
52 this.list.Add(oid); | |
53 } | |
54 | |
55 /// <summary> | |
56 /// Do not call this method, says API... okay... | |
57 /// </summary> | |
58 /// <param name="Count"></param> | |
59 /// <param name="OIDList"></param> | |
60 public void AddList(int Count, ref int OIDList) | |
61 { | |
62 // Does nothing | |
63 } | |
64 | |
65 public void Combine(ISelectionSet otherSet, esriSetOperation setOp, out ISelectionSet resultSet) | |
66 { | |
67 SelectionSet newSet = new SelectionSet(featureClass); | |
68 newSet.list.AddRange(list); | |
69 newSet.list.AddRange(((SelectionSet)otherSet).list); | |
70 resultSet = newSet as ISelectionSet; | |
71 } | |
72 | |
73 public int Count | |
74 { | |
75 get | |
76 { | |
77 return this.list.Count; | |
78 } | |
79 } | |
80 | |
81 /// <summary> | |
82 /// Always returns null. | |
83 /// </summary> | |
84 public ESRI.ArcGIS.esriSystem.IName FullName | |
85 { | |
86 get | |
87 { | |
88 return null; | |
89 } | |
90 } | |
91 | |
92 public IEnumIDs IDs | |
93 { | |
94 get | |
95 { | |
96 return new SelectionSetEnumerator(this); | |
97 } | |
98 } | |
99 | |
100 /// <summary> | |
101 /// Not implemented. | |
102 /// </summary> | |
103 public void MakePermanent() | |
104 { | |
105 throw new NotImplementedException(); | |
106 } | |
107 | |
108 public void Refresh() | |
109 { | |
110 | |
111 } | |
112 | |
113 /// <summary> | |
114 /// Do not call | |
115 /// </summary> | |
116 /// <param name="Count"></param> | |
117 /// <param name="OIDList"></param> | |
118 public void RemoveList(int count, ref int oidList) | |
119 { | |
120 | |
121 } | |
122 | |
123 public void Search(IQueryFilter queryFilter, bool recycling, out ICursor cursor) | |
124 { | |
125 // TODO: Merge queryFilter with this SelectionSet | |
126 cursor = featureClass.Search(queryFilter, recycling) as ICursor; | |
127 } | |
128 | |
129 public ISelectionSet Select( | |
130 IQueryFilter queryFilter, | |
131 esriSelectionType selType, | |
132 esriSelectionOption selOption, | |
133 IWorkspace selectionContainer) | |
134 { | |
135 throw new NotImplementedException(); | |
136 } | |
137 | |
138 public ITable Target | |
139 { | |
140 get | |
141 { | |
142 return this.featureClass; | |
143 } | |
144 } | |
145 } | |
146 } |