Skip to content

Optimize imports #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DynamicCreateTest/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Application x:Class="DynamicCreateTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DynamicCreateTest"
StartupUri="MainWindow.xaml">
<Application.Resources>

Expand Down
8 changes: 1 addition & 7 deletions DynamicCreateTest/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;

namespace DynamicCreateTest
{
Expand Down
13 changes: 1 addition & 12 deletions DynamicCreateTest/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GraphCtrlLib;

namespace DynamicCreateTest
Expand Down
19 changes: 7 additions & 12 deletions DynamicCreateTest/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib;
using OxyPlot.Axes;
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib;
using GraphCtrlLib.Message;

namespace DynamicCreateTest
{
Expand Down Expand Up @@ -132,7 +127,7 @@ public MainWindowViewModel()
#region Messenger

var Messeenger = WeakReferenceMessenger.Default;
Messeenger.Register<GraphCtrlLib.Message.SharedMessge>(this, OnMessageReceived);
Messeenger.Register<SharedMessge>(this, OnMessageReceived);

#endregion

Expand All @@ -142,7 +137,7 @@ public MainWindowViewModel()
/// </summary>
/// <param name="obj"></param> 객체 전송자
/// <param name="message"></param> 메세지
private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge message)
private void OnMessageReceived(object obj, SharedMessge message)
{
double dataX = message.DataX;
double dataY = message.DataY;
Expand Down
8 changes: 1 addition & 7 deletions GraphCtrlLib/CustomController/CustomController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using GraphCtrlLib.CustomTrackerManipulator;
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OxyPlot;

namespace GraphCtrlLib.CustomController
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using CommunityToolkit.Mvvm.Messaging;
using System;
using System.Linq;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib.Message;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

if(xAxis != null)
{
Expand Down
6 changes: 1 addition & 5 deletions GraphCtrlLib/GraphModel.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace GraphCtrlLib
{
Expand Down
33 changes: 16 additions & 17 deletions GraphCtrlLib/GraphViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Input;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib.CustomController;
using GraphCtrlLib.CustomTrackerManipulator;
Expand All @@ -8,17 +16,8 @@
using OxyPlot.Axes;
using OxyPlot.Legends;
using OxyPlot.Series;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Input.Manipulations;
using System.Windows.Media;
using HorizontalAlignment = OxyPlot.HorizontalAlignment;
using VerticalAlignment = OxyPlot.VerticalAlignment;

namespace GraphCtrlLib
{
Expand Down Expand Up @@ -100,8 +99,8 @@ public void SetverticalLineTrackerX(double x, string text="")
Type = LineAnnotationType.Vertical,
Color = OxyColors.Red,
LineStyle = LineStyle.Solid,
TextHorizontalAlignment = OxyPlot.HorizontalAlignment.Right,
TextVerticalAlignment = OxyPlot.VerticalAlignment.Bottom,
TextHorizontalAlignment = HorizontalAlignment.Right,
TextVerticalAlignment = VerticalAlignment.Bottom,
};

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

if (listItem != null)
{
Expand Down Expand Up @@ -360,9 +359,9 @@ public void AddLine(string strLineTitle, int LineThickness = 2)
AddLine(strLineTitle, OxyColors.Automatic, LineThickness);
}

public void AddAxis(string strTitle, OxyPlot.Axes.AxisPosition position = AxisPosition.None, bool _PositionAtZeroCrossing = false)
public void AddAxis(string strTitle, AxisPosition position = AxisPosition.None, bool _PositionAtZeroCrossing = false)
{
LinearAxis Axis = new OxyPlot.Axes.LinearAxis()
LinearAxis Axis = new LinearAxis()
{
MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Dot,
Expand Down
7 changes: 1 addition & 6 deletions GraphCtrlLib/Message/SharedMessge.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using OxyPlot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace GraphCtrlLib.Message
{
Expand Down
9 changes: 4 additions & 5 deletions GraphCtrlLib/UserControl_Graph.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:GraphCtrlLib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:oxy="http://oxyplot.org/wpf"
x:Name="graph"
Expand Down Expand Up @@ -37,10 +36,10 @@

<oxy:PlotView.ContextMenu>
<ContextMenu>
<MenuItem Header="Reset" Command="{Binding ResetClick}"></MenuItem>
<MenuItem Header="Delete" Command="{Binding DeleteClick}"></MenuItem>
<MenuItem Header="Split line" Command="{Binding SplitClick}"></MenuItem>
<MenuItem Header="View in new window" Command="{Binding ViewInNewWindowClick}"></MenuItem>
<MenuItem Header="Reset" Command="{Binding ResetClick}" />
<MenuItem Header="Delete" Command="{Binding DeleteClick}" />
<MenuItem Header="Split line" Command="{Binding SplitClick}" />
<MenuItem Header="View in new window" Command="{Binding ViewInNewWindowClick}" />
</ContextMenu>
</oxy:PlotView.ContextMenu>

Expand Down
14 changes: 1 addition & 13 deletions GraphCtrlLib/UserControl_Graph.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GraphCtrlLib
{
Expand Down
1 change: 0 additions & 1 deletion GraphResearch/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
x:Class="GraphResearch.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GraphResearch"
StartupUri="MainWindow.xaml">
<Application.Resources />
</Application>
8 changes: 1 addition & 7 deletions GraphResearch/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows;

namespace GraphResearch
{
Expand Down
8 changes: 1 addition & 7 deletions GraphResearch/Interface/IWindowService.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using GraphCtrlLib;
using GraphResearch.View;
using GraphResearch.View;
using GraphResearch.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GraphResearch.Interface
{
Expand Down
46 changes: 21 additions & 25 deletions GraphResearch/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib;
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using GraphCtrlLib;
using GraphCtrlLib.Message;
using GraphResearch.Interface;
using GraphResearch.Model;
using System.Windows.Controls;
using GraphResearch.Utility;
using System.Drawing;
using System.Numerics;
using System.Windows;
using static GraphCtrlLib.GraphModel;

namespace GraphResearch
{
Expand Down Expand Up @@ -81,7 +77,7 @@ public int SelectedInd

private List<PositionNode> temporailySelectedPostions = new();

private System.Windows.Point startpoint = new();
private Point startpoint = new();

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

Expand Down Expand Up @@ -202,10 +198,10 @@ public MainViewModel()
#region Messenger

var Messeenger = WeakReferenceMessenger.Default;
Messeenger.Register<GraphCtrlLib.Message.SharedMessge>(this, OnMessageReceived);
Messeenger.Register<GraphCtrlLib.Message.SharedSplitMessage>(this, OnSplitMessageReceived);
Messeenger.Register<GraphCtrlLib.Message.SharedDeleteMessage>(this, OnDeleteMessageReceived);
Messeenger.Register<GraphCtrlLib.Message.SharedNewWindowMessage>(this, OnNewWindowMessageReceived);
Messeenger.Register<SharedMessge>(this, OnMessageReceived);
Messeenger.Register<SharedSplitMessage>(this, OnSplitMessageReceived);
Messeenger.Register<SharedDeleteMessage>(this, OnDeleteMessageReceived);
Messeenger.Register<SharedNewWindowMessage>(this, OnNewWindowMessageReceived);
#endregion

}
Expand All @@ -214,7 +210,7 @@ public MainViewModel()
/// </summary>
/// <param name="obj"></param> 객체 전송자
/// <param name="message"></param> 메세지
private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge message)
private void OnMessageReceived(object obj, SharedMessge message)
{
double dataX = message.DataX;
double dataY = message.DataY;
Expand All @@ -233,7 +229,7 @@ private void OnMessageReceived(object obj, GraphCtrlLib.Message.SharedMessge mes
}
}

private void OnSplitMessageReceived(object ojb, GraphCtrlLib.Message.SharedSplitMessage message)
private void OnSplitMessageReceived(object ojb, SharedSplitMessage message)
{
int graphID = message.GraphID;
List<string> linenamelist = message.LineName;
Expand All @@ -254,15 +250,15 @@ private void OnSplitMessageReceived(object ojb, GraphCtrlLib.Message.SharedSplit
}
}

private void OnDeleteMessageReceived(object obj, GraphCtrlLib.Message.SharedDeleteMessage message)
private void OnDeleteMessageReceived(object obj, SharedDeleteMessage message)
{
int graphID = message.GraphID;
string graphName = message.GraphName;

Delete_Graph(graphID);
}

private void OnNewWindowMessageReceived(object obj, GraphCtrlLib.Message.SharedNewWindowMessage message)
private void OnNewWindowMessageReceived(object obj, SharedNewWindowMessage message)
{
int graphID = message.GraphID;
string graphName = message.GraphName;
Expand Down Expand Up @@ -339,8 +335,8 @@ private void TreeViewPreviewMouseMoveCommand(object? parameter)
{
if (parameter is MouseEventArgs args)
{
System.Windows.Point mousePos = args.GetPosition(null);
System.Windows.Vector diff = startpoint - mousePos;
Point mousePos = args.GetPosition(null);
Vector diff = startpoint - mousePos;

if (args.LeftButton == MouseButtonState.Pressed &&
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
Expand Down Expand Up @@ -447,8 +443,8 @@ private void MultiTreeViewPreviewMouseMoveCommand(object? parameter)
{
if (parameter is MouseEventArgs args)
{
System.Windows.Point mousePos = args.GetPosition(null);
System.Windows.Vector diff = startpoint - mousePos;
Point mousePos = args.GetPosition(null);
Vector diff = startpoint - mousePos;

if (args.LeftButton == MouseButtonState.Pressed &&
(Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
Expand Down
Loading
Loading