|
1 | | -using System.Collections.Generic; |
2 | | -using System.IO; |
3 | | - |
4 | | -namespace RaveAddIn.ProjectTree |
5 | | -{ |
6 | | - class GISDataset : FileSystemDataset, IGISLayer |
7 | | - { |
8 | | - public string SymbologyKey { get; private set; } |
9 | | - public short Transparency { get; private set; } |
10 | | - |
11 | | - public string GISPath { get { return Path.FullName; } } |
12 | | - |
13 | | - public readonly Dictionary<string, string> Metadata; |
14 | | - |
15 | | - public GISDataset(RaveProject project, string name, FileSystemInfo fsInfo, string symbologyKey, short transparency, int imageIndex_Exists, int imageIndex_Missing, string id, Dictionary<string, string> metadata) |
16 | | - : base(project, name, fsInfo, imageIndex_Exists, imageIndex_Missing, id) |
17 | | - { |
18 | | - SymbologyKey = symbologyKey; |
19 | | - Transparency = transparency; |
20 | | - |
21 | | - Metadata = metadata; |
22 | | - } |
23 | | - } |
24 | | -} |
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.IO; |
| 4 | + |
| 5 | +namespace RaveAddIn.ProjectTree |
| 6 | +{ |
| 7 | + class GISDataset : FileSystemDataset, IGISLayer |
| 8 | + { |
| 9 | + public const string ProgramKey = "_rs_wh_program"; |
| 10 | + public const string ProjectKey = "_rs_wh_id"; |
| 11 | + |
| 12 | + public string SymbologyKey { get; private set; } |
| 13 | + public short Transparency { get; private set; } |
| 14 | + |
| 15 | + public string GISPath { get { return Path.FullName; } } |
| 16 | + |
| 17 | + public readonly Dictionary<string, string> Metadata; |
| 18 | + |
| 19 | + public bool HasWarehouseRefernce |
| 20 | + { |
| 21 | + get |
| 22 | + { |
| 23 | + return Metadata != null && Metadata.Count >= 2 && |
| 24 | + Metadata.ContainsKey(ProgramKey) && Metadata.ContainsKey(ProjectKey); |
| 25 | + |
| 26 | + } |
| 27 | + } |
| 28 | + |
| 29 | + public Uri WarehouseReference |
| 30 | + { |
| 31 | + get |
| 32 | + { |
| 33 | + if (!HasWarehouseRefernce) |
| 34 | + return null; |
| 35 | + |
| 36 | + Uri baseUri = new Uri(Properties.Resources.DataWarehouseURL); |
| 37 | + Uri projectUri = new Uri(baseUri, string.Format("#/{0}/{1}", Metadata[ProgramKey], Metadata[ProjectKey])); |
| 38 | + return projectUri; |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + public GISDataset(RaveProject project, string name, FileSystemInfo fsInfo, string symbologyKey, short transparency, int imageIndex_Exists, int imageIndex_Missing, string id, Dictionary<string, string> metadata) |
| 43 | + : base(project, name, fsInfo, imageIndex_Exists, imageIndex_Missing, id) |
| 44 | + { |
| 45 | + SymbologyKey = symbologyKey; |
| 46 | + Transparency = transparency; |
| 47 | + |
| 48 | + Metadata = metadata; |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments