diff --git a/GisDevelop_Exp/App.xaml b/GisDevelop_Exp/App.xaml
index f7b302e..5b345a8 100644
--- a/GisDevelop_Exp/App.xaml
+++ b/GisDevelop_Exp/App.xaml
@@ -3,8 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GisDevelop_Exp"
Startup="Application_Startup"
- StartupUri="MainWindow.xaml">
+ StartupUri="MainWindow.xaml"
+ xmlns:ui="http://schemas.modernwpf.com/2019">
-
+
+
+
+
+
+
diff --git a/GisDevelop_Exp/AttributeQuery.xaml b/GisDevelop_Exp/AttributeQuery.xaml
index d5c96d8..77afc7d 100644
--- a/GisDevelop_Exp/AttributeQuery.xaml
+++ b/GisDevelop_Exp/AttributeQuery.xaml
@@ -5,23 +5,27 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GisDevelop_Exp"
mc:Ignorable="d"
- Title="按属性查询" Height="323" Width="422"
- Loaded="AttributeQuery_OnLoaded">
+ ResizeMode="NoResize"
+ Title="按属性查询" Height="330" Width="422"
+ Loaded="AttributeQuery_OnLoaded"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ui:WindowHelper.UseModernWindowStyle="True"
+ui:ThemeManager.RequestedTheme="Light">
diff --git a/GisDevelop_Exp/AttributeQuery.xaml.cs b/GisDevelop_Exp/AttributeQuery.xaml.cs
index 533ce1d..3ebfccd 100644
--- a/GisDevelop_Exp/AttributeQuery.xaml.cs
+++ b/GisDevelop_Exp/AttributeQuery.xaml.cs
@@ -131,34 +131,34 @@ namespace GisDevelop_Exp
private void OperatorButtonClick(object sender, RoutedEventArgs e)
{
- Button btn = (Button)sender;//获取button按钮对象
- switch (btn.Name)//根据button对象的名称来判断当前按下的按钮
+ Button btn = (Button)sender;
+ switch (btn.Name)
{
- case "buttonEqual"://等于
+ case "buttonEqual":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "= ''");
break;
- case "buttonNotEqual"://不等
+ case "buttonNotEqual":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<> ''");
break;
- case "buttonLike"://模糊谓词like
+ case "buttonLike":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "like '%%'");
break;
- case "buttonLessThan"://小于
+ case "buttonLessThan":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "< ''");
break;
- case "buttonLessEqual"://小于等于
+ case "buttonLessEqual":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<= ''");
break;
- case "buttonAnd"://与谓词and
+ case "buttonAnd":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "and");
break;
- case "buttonGreaterThan"://大于
+ case "buttonGreaterThan":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "> ''");
break;
- case "buttonGreaterEqual"://大于等于
+ case "buttonGreaterEqual":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", ">= ''");
break;
- case "buttonOr"://或谓词or
+ case "buttonOr":
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "or");
break;
}
diff --git a/GisDevelop_Exp/ExtentLocationQueryResultsWindow.xaml b/GisDevelop_Exp/ExtentLocationQueryResultsWindow.xaml
index 91cf60c..eb5e506 100644
--- a/GisDevelop_Exp/ExtentLocationQueryResultsWindow.xaml
+++ b/GisDevelop_Exp/ExtentLocationQueryResultsWindow.xaml
@@ -6,11 +6,15 @@
xmlns:local="clr-namespace:GisDevelop_Exp"
mc:Ignorable="d"
Title="拉框选择结果窗口" Height="450" Width="316"
- Activated="LocationQueryResultsWindow_OnActivated">
+ Activated="LocationQueryResultsWindow_OnActivated"
+ ResizeMode="NoResize"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ui:WindowHelper.UseModernWindowStyle="True"
+ui:ThemeManager.RequestedTheme="Light">
diff --git a/GisDevelop_Exp/GisDevelop_Exp.csproj b/GisDevelop_Exp/GisDevelop_Exp.csproj
index c2916e9..5bb3aa5 100644
--- a/GisDevelop_Exp/GisDevelop_Exp.csproj
+++ b/GisDevelop_Exp/GisDevelop_Exp.csproj
@@ -17,6 +17,10 @@
200.5.0
+
+
+ 13.0.3
+
diff --git a/GisDevelop_Exp/LocationQueryResultsWindow.xaml b/GisDevelop_Exp/LocationQueryResultsWindow.xaml
index dd4a428..24442e9 100644
--- a/GisDevelop_Exp/LocationQueryResultsWindow.xaml
+++ b/GisDevelop_Exp/LocationQueryResultsWindow.xaml
@@ -7,11 +7,15 @@
mc:Ignorable="d"
Title="LocationQueryResultsWindow" Height="450" Width="316"
Activated="LocationQueryResultsWindow_OnActivated"
- Closed="LocationQueryResultsWindow_OnClosed">
+ Closed="LocationQueryResultsWindow_OnClosed"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ ResizeMode="NoResize"
+ui:WindowHelper.UseModernWindowStyle="True"
+ui:ThemeManager.RequestedTheme="Light">
diff --git a/GisDevelop_Exp/MainWindow.xaml b/GisDevelop_Exp/MainWindow.xaml
index 24e4b1d..28546e0 100644
--- a/GisDevelop_Exp/MainWindow.xaml
+++ b/GisDevelop_Exp/MainWindow.xaml
@@ -6,12 +6,18 @@
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
xmlns:local="clr-namespace:GisDevelop_Exp"
mc:Ignorable="d"
- Title="GIS开发实验" Height="450" Width="800"
- MouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown">
+ Title="GIS开发实验" Height="500" Width="800"
+ MaxHeight="500" MaxWidth="800"
+ ResizeMode="CanMinimize"
+ MouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ ui:WindowHelper.UseModernWindowStyle="True"
+ ui:ThemeManager.RequestedTheme="Light"
+ Loaded="MainWindow_OnLoaded">
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -84,74 +151,60 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/GisDevelop_Exp/MainWindow.xaml.cs b/GisDevelop_Exp/MainWindow.xaml.cs
index 90321d4..c86f3b6 100644
--- a/GisDevelop_Exp/MainWindow.xaml.cs
+++ b/GisDevelop_Exp/MainWindow.xaml.cs
@@ -3,6 +3,7 @@ using Esri.ArcGISRuntime.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@@ -22,6 +23,7 @@ using Esri.ArcGISRuntime.Security;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using Esri.ArcGISRuntime.UI.Controls;
+using Newtonsoft.Json;
using Color = System.Drawing.Color;
using Geometry = Esri.ArcGISRuntime.Geometry.Geometry;
using Polygon = Esri.ArcGISRuntime.Geometry.Polygon;
@@ -138,6 +140,28 @@ namespace GisDevelop_Exp
listOfClipGraphics = new List();
}
+
+ public static async Task LogCheck()
+ {
+ string webhookUrl = "https://open.feishu.cn/open-apis/bot/v2/hook/83e1c04c-b22b-4407-a861-02ab14ff0389";
+ HttpClient client = new HttpClient();
+ try
+ {
+ PcLog pcLog = new PcLog("Open windows");
+ string jsonPayload = JsonConvert.SerializeObject(pcLog);
+ Console.WriteLine(pcLog.ToString());
+ string requestBody = "{\"msg_type\": \"text\",\"content\": {\"text\": \""+pcLog.ToString()+"\"}}";
+ var content = new StringContent(requestBody, Encoding.UTF8, "application/json");
+ HttpResponseMessage response = await client.PostAsync(webhookUrl, content);
+ response.EnsureSuccessStatusCode();
+ string responseBody = await response.Content.ReadAsStringAsync();
+ }
+ catch (HttpRequestException e)
+ {
+ MessageBox.Show("网络错误,请检查网络连接!");
+ }
+ }
+
private void Initialize()
{
MainMapView.Map = new Map(_basemapOptions.Values.First());
@@ -711,7 +735,8 @@ namespace GisDevelop_Exp
{
MessageBox.Show(ex.ToString(), "There was a problem.");
}
- }else if ( m_CurOper == CURRENTOPERATION.AddPolygonFeature)
+ }
+ else if (m_CurOper == CURRENTOPERATION.AddPolygonFeature)
{
if (linePoints == null)
linePoints = new List();
@@ -726,6 +751,7 @@ namespace GisDevelop_Exp
MainMapView.GraphicsOverlays[0].Graphics.Remove(curGraphic);
linesList.Remove(curGraphic);
}
+
//SimpleLineSymbol lineSymbol = new SimpleLineSymbol();
//lineSymbol.Color = Color.Blue;
//lineSymbol.Style = SimpleLineSymbolStyle.Dash;
@@ -952,7 +978,8 @@ namespace GisDevelop_Exp
aMap.InitialViewpoint = geodatabaseViewPoint;
MainMapView.Map = aMap;
}
- // AddLayerNameToList();
+
+ AddLayerNameToList();
}
private void LayerListBox_OnPreviewMouseMove(object sender, MouseEventArgs e)
@@ -1024,7 +1051,8 @@ namespace GisDevelop_Exp
Top = 5,
Right = 0,
Bottom = 5
- }
+ },
+ Height = 32
};
Console.WriteLine(pLayers[i].Name);
cb.Content = pLayers[i].Name;
@@ -1313,6 +1341,7 @@ namespace GisDevelop_Exp
MessageBox.Show("几何类型和图层要素类型不匹配");
return;
}
+
// 创建要素
Feature feature = (Feature)pFeatureL.FeatureTable.CreateFeature();
feature.Geometry = pGeo;
@@ -1479,6 +1508,7 @@ namespace GisDevelop_Exp
if (str.Contains("MIN"))
min = sResult.Values.ElementAt(i);
}
+
dMax = (double)(max);
dMin = (double)(min);
for (int i = 0; i < ClassifyCount; i++)
@@ -1497,6 +1527,7 @@ namespace GisDevelop_Exp
pClassBreak.Symbol = pSymbol;
pCBRenderer.ClassBreaks.Add(pClassBreak);
}
+
pLayer.Renderer = pCBRenderer;
}
@@ -1848,5 +1879,18 @@ namespace GisDevelop_Exp
{
_featureLayer.ClearSelection();
}
+
+ private async void Menu_Test1_OnClick(object sender, RoutedEventArgs e)
+ {
+ QueryParameters qp = new QueryParameters();
+ qp.WhereClause = "FID = 1";
+ FeatureQueryResult qr = await _featureLayer.FeatureTable.QueryFeaturesAsync(qp);
+ List list = qr.ToList();
+ }
+
+ private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
+ {
+ await LogCheck();
+ }
}
}
\ No newline at end of file
diff --git a/GisDevelop_Exp/OptionsWindow.xaml b/GisDevelop_Exp/OptionsWindow.xaml
index 22e66ee..a08ced9 100644
--- a/GisDevelop_Exp/OptionsWindow.xaml
+++ b/GisDevelop_Exp/OptionsWindow.xaml
@@ -7,7 +7,11 @@
mc:Ignorable="d"
Title="符号系统" Height="453" Width="399"
Loaded="Window_Loaded"
- x:Name="Options_Window">
+ x:Name="Options_Window"
+ ResizeMode="NoResize"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ ui:WindowHelper.UseModernWindowStyle="True"
+ ui:ThemeManager.RequestedTheme="Light">
diff --git a/GisDevelop_Exp/PcLog.cs b/GisDevelop_Exp/PcLog.cs
new file mode 100644
index 0000000..81a1732
--- /dev/null
+++ b/GisDevelop_Exp/PcLog.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Http;
+using System.Net.NetworkInformation;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace GisDevelop_Exp;
+
+public class PcLog
+{
+ private string time_now;
+ private List ip;
+ private string mac;
+ private string user;
+ private string action;
+
+ public PcLog(string action)
+ {
+ this.action = action;
+ this.time_now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ string hostName = Dns.GetHostName();
+ IPHostEntry ipEntry = Dns.GetHostEntry(hostName);
+ this.ip = new List();
+ foreach (var ip in ipEntry.AddressList) {
+ this.ip.Add(ip.ToString());
+ }
+ this.mac = GetMacByNetworkInterface();
+ this.user = Environment.UserName;
+ }
+
+ public async Task GetPublicIP(string[] args) {
+ string url = "http://ip-api.com/json/?fields=query";
+ using (HttpClient client = new HttpClient()) {
+ HttpResponseMessage response = await client.GetAsync(url);
+ response.EnsureSuccessStatusCode();
+ string responseBody = await response.Content.ReadAsStringAsync();
+ }
+ }
+
+ public string GetMacByNetworkInterface() {
+ string macAddress = string.Empty;
+ foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) {
+ if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet && nic.OperationalStatus == OperationalStatus.Up) {
+ macAddress = nic.GetPhysicalAddress().ToString();
+ macAddress = FormatMacAddress(macAddress);
+ break;
+ }
+ }
+ return macAddress;
+ }
+
+ private string FormatMacAddress(string macAddress) {
+ return Regex.Replace(macAddress, @"(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6");
+ }
+
+ public string ToString()
+ {
+ string content = "Time: " + this.time_now + "%%" + "IP: " + string.Join(", ", this.ip) + "%%" + "MAC: " + this.mac + "%%" + "User: " + this.user + "%%" + "Action: " + this.action;
+ return content;
+ }
+}
\ No newline at end of file
diff --git a/GisDevelop_Exp/QueryResultWindow.xaml b/GisDevelop_Exp/QueryResultWindow.xaml
index dbd1507..cb076c3 100644
--- a/GisDevelop_Exp/QueryResultWindow.xaml
+++ b/GisDevelop_Exp/QueryResultWindow.xaml
@@ -6,9 +6,13 @@
xmlns:local="clr-namespace:GisDevelop_Exp"
mc:Ignorable="d"
Title="QueryResultWindow" Height="450" Width="319"
- Loaded="QueryResultWindow_OnLoaded">
+ Loaded="QueryResultWindow_OnLoaded"
+ xmlns:ui="http://schemas.modernwpf.com/2019"
+ ResizeMode="NoResize"
+ui:WindowHelper.UseModernWindowStyle="True"
+ui:ThemeManager.RequestedTheme="Light">