Skip to content

Commit 8f2f894

Browse files
author
Edward Forgacs
authored
Merge pull request #26 from PLAIF-dev/optimize-imports
Optimize imports
2 parents 5018c39 + 37443fa commit 8f2f894

File tree

97 files changed

+407
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+407
-554
lines changed

DynamicCreateTest/App.xaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Application x:Class="DynamicCreateTest.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:DynamicCreateTest"
54
StartupUri="MainWindow.xaml">
65
<Application.Resources>
76

DynamicCreateTest/App.xaml.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Data;
5-
using System.Linq;
6-
using System.Threading.Tasks;
7-
using System.Windows;
1+
using System.Windows;
82

93
namespace DynamicCreateTest
104
{

DynamicCreateTest/MainWindow.xaml.cs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using System.Windows;
1+
using System.Windows;
72
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
103
using System.Windows.Input;
11-
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
154
using GraphCtrlLib;
165

176
namespace DynamicCreateTest

DynamicCreateTest/MainWindowViewModel.cs

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
using CommunityToolkit.Mvvm.Input;
2-
using CommunityToolkit.Mvvm.Messaging;
3-
using GraphCtrlLib;
4-
using OxyPlot.Axes;
5-
using System;
1+
using System;
62
using System.Collections.Generic;
73
using System.Collections.ObjectModel;
84
using System.ComponentModel;
9-
using System.Linq;
105
using System.Runtime.CompilerServices;
11-
using System.Text;
12-
using System.Threading;
13-
using System.Threading.Tasks;
14-
using System.Windows.Controls;
156
using System.Windows.Input;
167
using System.Windows.Threading;
8+
using CommunityToolkit.Mvvm.Input;
9+
using CommunityToolkit.Mvvm.Messaging;
10+
using GraphCtrlLib;
11+
using GraphCtrlLib.Message;
1712

1813
namespace DynamicCreateTest
1914
{
@@ -132,7 +127,7 @@ public MainWindowViewModel()
132127
#region Messenger
133128

134129
var Messeenger = WeakReferenceMessenger.Default;
135-
Messeenger.Register<GraphCtrlLib.Message.SharedMessge>(this, OnMessageReceived);
130+
Messeenger.Register<SharedMessge>(this, OnMessageReceived);
136131

137132
#endregion
138133

@@ -142,7 +137,7 @@ public MainWindowViewModel()
142137
/// </summary>
143138
/// <param name="obj"></param> 객체 전송자
144139
/// <param name="message"></param> 메세지
145-
private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge message)
140+
private void OnMessageReceived(object obj, SharedMessge message)
146141
{
147142
double dataX = message.DataX;
148143
double dataY = message.DataY;

GraphCtrlLib/CustomController/CustomController.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using GraphCtrlLib.CustomTrackerManipulator;
2-
using OxyPlot;
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using System.Text;
7-
using System.Threading.Tasks;
1+
using OxyPlot;
82

93
namespace GraphCtrlLib.CustomController
104
{

GraphCtrlLib/CustomTrackerManipulator/StayOpenTrackerManipulator.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
using CommunityToolkit.Mvvm.Messaging;
1+
using System;
2+
using System.Linq;
3+
using CommunityToolkit.Mvvm.Messaging;
24
using GraphCtrlLib.Message;
35
using OxyPlot;
6+
using OxyPlot.Axes;
47
using OxyPlot.Series;
5-
using System;
6-
using System.Collections.Generic;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Threading.Tasks;
108

119
namespace GraphCtrlLib.CustomTrackerManipulator
1210
{
@@ -48,7 +46,7 @@ public override void Completed(OxyMouseEventArgs e)
4846
public void ShowTracker( Series series, DataPoint point, ScreenPoint sPoint, object obj, int Index)
4947
{
5048
//DataPoint를 가지고 현재 객체의 ScreenPoint를 얻는다.
51-
var xAxis = this.PlotView.ActualModel.Axes.FirstOrDefault(a => a.Position == OxyPlot.Axes.AxisPosition.Bottom);
49+
var xAxis = this.PlotView.ActualModel.Axes.FirstOrDefault(a => a.Position == AxisPosition.Bottom);
5250

5351
if(xAxis != null)
5452
{

GraphCtrlLib/GraphModel.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
62

73
namespace GraphCtrlLib
84
{

GraphCtrlLib/GraphViewModel.cs

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
using CommunityToolkit.Mvvm.Input;
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Linq;
6+
using System.Runtime.CompilerServices;
7+
using System.Windows;
8+
using System.Windows.Input;
9+
using CommunityToolkit.Mvvm.Input;
210
using CommunityToolkit.Mvvm.Messaging;
311
using GraphCtrlLib.CustomController;
412
using GraphCtrlLib.CustomTrackerManipulator;
@@ -8,17 +16,8 @@
816
using OxyPlot.Axes;
917
using OxyPlot.Legends;
1018
using OxyPlot.Series;
11-
using System;
12-
using System.Collections.Generic;
13-
using System.ComponentModel;
14-
using System.Linq;
15-
using System.Runtime.CompilerServices;
16-
using System.Text;
17-
using System.Threading.Tasks;
18-
using System.Windows;
19-
using System.Windows.Input;
20-
using System.Windows.Input.Manipulations;
21-
using System.Windows.Media;
19+
using HorizontalAlignment = OxyPlot.HorizontalAlignment;
20+
using VerticalAlignment = OxyPlot.VerticalAlignment;
2221

2322
namespace GraphCtrlLib
2423
{
@@ -100,8 +99,8 @@ public void SetverticalLineTrackerX(double x, string text="")
10099
Type = LineAnnotationType.Vertical,
101100
Color = OxyColors.Red,
102101
LineStyle = LineStyle.Solid,
103-
TextHorizontalAlignment = OxyPlot.HorizontalAlignment.Right,
104-
TextVerticalAlignment = OxyPlot.VerticalAlignment.Bottom,
102+
TextHorizontalAlignment = HorizontalAlignment.Right,
103+
TextVerticalAlignment = VerticalAlignment.Bottom,
105104
};
106105

107106
public ICommand PlotDrop { get; set; }
@@ -230,7 +229,7 @@ private void PlotViewDropCommand(DragEventArgs? e)
230229
if(e != null)
231230
{
232231
var items = e.Data.GetData(typeof(List<object>));
233-
List<GraphModel.GraphDataSet>? listItem = ((System.Collections.IEnumerable)items).Cast<GraphModel.GraphDataSet>().ToList();
232+
List<GraphModel.GraphDataSet>? listItem = ((IEnumerable)items).Cast<GraphModel.GraphDataSet>().ToList();
234233

235234
if (listItem != null)
236235
{
@@ -360,9 +359,9 @@ public void AddLine(string strLineTitle, int LineThickness = 2)
360359
AddLine(strLineTitle, OxyColors.Automatic, LineThickness);
361360
}
362361

363-
public void AddAxis(string strTitle, OxyPlot.Axes.AxisPosition position = AxisPosition.None, bool _PositionAtZeroCrossing = false)
362+
public void AddAxis(string strTitle, AxisPosition position = AxisPosition.None, bool _PositionAtZeroCrossing = false)
364363
{
365-
LinearAxis Axis = new OxyPlot.Axes.LinearAxis()
364+
LinearAxis Axis = new LinearAxis()
366365
{
367366
MajorGridlineStyle = LineStyle.Solid,
368367
MinorGridlineStyle = LineStyle.Dot,

GraphCtrlLib/Message/SharedMessge.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using OxyPlot;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
72

83
namespace GraphCtrlLib.Message
94
{

GraphCtrlLib/UserControl_Graph.xaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
7-
xmlns:local="clr-namespace:GraphCtrlLib"
87
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
98
xmlns:oxy="http://oxyplot.org/wpf"
109
x:Name="graph"
@@ -37,10 +36,10 @@
3736

3837
<oxy:PlotView.ContextMenu>
3938
<ContextMenu>
40-
<MenuItem Header="Reset" Command="{Binding ResetClick}"></MenuItem>
41-
<MenuItem Header="Delete" Command="{Binding DeleteClick}"></MenuItem>
42-
<MenuItem Header="Split line" Command="{Binding SplitClick}"></MenuItem>
43-
<MenuItem Header="View in new window" Command="{Binding ViewInNewWindowClick}"></MenuItem>
39+
<MenuItem Header="Reset" Command="{Binding ResetClick}" />
40+
<MenuItem Header="Delete" Command="{Binding DeleteClick}" />
41+
<MenuItem Header="Split line" Command="{Binding SplitClick}" />
42+
<MenuItem Header="View in new window" Command="{Binding ViewInNewWindowClick}" />
4443
</ContextMenu>
4544
</oxy:PlotView.ContextMenu>
4645

GraphCtrlLib/UserControl_Graph.xaml.cs

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
using System.Windows;
1+
using System.Windows;
72
using System.Windows.Controls;
8-
using System.Windows.Data;
9-
using System.Windows.Documents;
10-
using System.Windows.Input;
11-
using System.Windows.Media;
12-
using System.Windows.Media.Imaging;
13-
using System.Windows.Navigation;
14-
using System.Windows.Shapes;
153

164
namespace GraphCtrlLib
175
{

GraphResearch/App.xaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
x:Class="GraphResearch.App"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:local="clr-namespace:GraphResearch"
65
StartupUri="MainWindow.xaml">
76
<Application.Resources />
87
</Application>

GraphResearch/App.xaml.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
4-
using System.Data;
5-
using System.Linq;
6-
using System.Threading.Tasks;
7-
using System.Windows;
1+
using System.Windows;
82

93
namespace GraphResearch
104
{

GraphResearch/Interface/IWindowService.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
using GraphCtrlLib;
2-
using GraphResearch.View;
1+
using GraphResearch.View;
32
using GraphResearch.ViewModel;
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Text;
8-
using System.Threading.Tasks;
93

104
namespace GraphResearch.Interface
115
{

GraphResearch/MainViewModel.cs

+21-25
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
using CommunityToolkit.Mvvm.Input;
2-
using CommunityToolkit.Mvvm.Messaging;
3-
using GraphCtrlLib;
4-
using System;
1+
using System;
52
using System.Collections.Generic;
63
using System.Collections.ObjectModel;
74
using System.ComponentModel;
85
using System.Linq;
96
using System.Runtime.CompilerServices;
10-
using System.Text;
11-
using System.Threading.Tasks;
12-
using System.Windows.Threading;
7+
using System.Windows;
8+
using System.Windows.Controls;
139
using System.Windows.Input;
10+
using System.Windows.Threading;
11+
using CommunityToolkit.Mvvm.Input;
12+
using CommunityToolkit.Mvvm.Messaging;
13+
using GraphCtrlLib;
14+
using GraphCtrlLib.Message;
1415
using GraphResearch.Interface;
1516
using GraphResearch.Model;
16-
using System.Windows.Controls;
1717
using GraphResearch.Utility;
18-
using System.Drawing;
19-
using System.Numerics;
20-
using System.Windows;
21-
using static GraphCtrlLib.GraphModel;
2218

2319
namespace GraphResearch
2420
{
@@ -81,7 +77,7 @@ public int SelectedInd
8177

8278
private List<PositionNode> temporailySelectedPostions = new();
8379

84-
private System.Windows.Point startpoint = new();
80+
private Point startpoint = new();
8581

8682
public ObservableCollection<GraphModel.GraphDataSet> GraphDataSets { get; set; }
8783

@@ -202,10 +198,10 @@ public MainViewModel()
202198
#region Messenger
203199

204200
var Messeenger = WeakReferenceMessenger.Default;
205-
Messeenger.Register<GraphCtrlLib.Message.SharedMessge>(this, OnMessageReceived);
206-
Messeenger.Register<GraphCtrlLib.Message.SharedSplitMessage>(this, OnSplitMessageReceived);
207-
Messeenger.Register<GraphCtrlLib.Message.SharedDeleteMessage>(this, OnDeleteMessageReceived);
208-
Messeenger.Register<GraphCtrlLib.Message.SharedNewWindowMessage>(this, OnNewWindowMessageReceived);
201+
Messeenger.Register<SharedMessge>(this, OnMessageReceived);
202+
Messeenger.Register<SharedSplitMessage>(this, OnSplitMessageReceived);
203+
Messeenger.Register<SharedDeleteMessage>(this, OnDeleteMessageReceived);
204+
Messeenger.Register<SharedNewWindowMessage>(this, OnNewWindowMessageReceived);
209205
#endregion
210206

211207
}
@@ -214,7 +210,7 @@ public MainViewModel()
214210
/// </summary>
215211
/// <param name="obj"></param> 객체 전송자
216212
/// <param name="message"></param> 메세지
217-
private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge message)
213+
private void OnMessageReceived(object obj, SharedMessge message)
218214
{
219215
double dataX = message.DataX;
220216
double dataY = message.DataY;
@@ -233,7 +229,7 @@ private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge mes
233229
}
234230
}
235231

236-
private void OnSplitMessageReceived(object ojb, GraphCtrlLib.Message.SharedSplitMessage message)
232+
private void OnSplitMessageReceived(object ojb, SharedSplitMessage message)
237233
{
238234
int graphID = message.GraphID;
239235
List<string> linenamelist = message.LineName;
@@ -254,15 +250,15 @@ private void OnSplitMessageReceived(object ojb, GraphCtrlLib.Message.SharedSplit
254250
}
255251
}
256252

257-
private void OnDeleteMessageReceived(object obj, GraphCtrlLib.Message.SharedDeleteMessage message)
253+
private void OnDeleteMessageReceived(object obj, SharedDeleteMessage message)
258254
{
259255
int graphID = message.GraphID;
260256
string graphName = message.GraphName;
261257

262258
Delete_Graph(graphID);
263259
}
264260

265-
private void OnNewWindowMessageReceived(object obj, GraphCtrlLib.Message.SharedNewWindowMessage message)
261+
private void OnNewWindowMessageReceived(object obj, SharedNewWindowMessage message)
266262
{
267263
int graphID = message.GraphID;
268264
string graphName = message.GraphName;
@@ -339,8 +335,8 @@ private void TreeViewPreviewMouseMoveCommand(object? parameter)
339335
{
340336
if (parameter is MouseEventArgs args)
341337
{
342-
System.Windows.Point mousePos = args.GetPosition(null);
343-
System.Windows.Vector diff = startpoint - mousePos;
338+
Point mousePos = args.GetPosition(null);
339+
Vector diff = startpoint - mousePos;
344340

345341
if (args.LeftButton == MouseButtonState.Pressed &&
346342
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
@@ -447,8 +443,8 @@ private void MultiTreeViewPreviewMouseMoveCommand(object? parameter)
447443
{
448444
if (parameter is MouseEventArgs args)
449445
{
450-
System.Windows.Point mousePos = args.GetPosition(null);
451-
System.Windows.Vector diff = startpoint - mousePos;
446+
Point mousePos = args.GetPosition(null);
447+
Vector diff = startpoint - mousePos;
452448

453449
if (args.LeftButton == MouseButtonState.Pressed &&
454450
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||

0 commit comments

Comments
 (0)