Skip to content

Commit 79e3d00

Browse files
committed
update
1 parent 2869585 commit 79e3d00

File tree

7 files changed

+29
-53
lines changed

7 files changed

+29
-53
lines changed

Crystallography.Controls/Crystallography.Controls.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<OutputType>Library</OutputType>
55
<TargetFramework>net7.0-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7-
<AssemblyVersion>2023.10.7.0542</AssemblyVersion>
8-
<FileVersion>2023.10.7.0542</FileVersion>
7+
<AssemblyVersion>2023.10.7.0557</AssemblyVersion>
8+
<FileVersion>2023.10.7.0557</FileVersion>
99
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
1010
<ApplicationUseCompatibleTextRendering>true</ApplicationUseCompatibleTextRendering>
1111
<ApplicationVisualStyles>true</ApplicationVisualStyles>

Crystallography.Controls/ScalablePictureBox.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public ScalablePictureBox()
167167
public bool VerticalFlip
168168
{
169169
set { PseudoBitmap.VerticalFlip = value; drawPictureBox(); }
170-
get { return PseudoBitmap.VerticalFlip; }
170+
get => PseudoBitmap.VerticalFlip;
171171
}
172172

173173
private bool horizontalFlip = false;
@@ -178,7 +178,7 @@ public bool VerticalFlip
178178
public bool HorizontalFlip
179179
{
180180
set { PseudoBitmap.HorizontalFlip = value; drawPictureBox(); }
181-
get { return PseudoBitmap.HorizontalFlip; }
181+
get => PseudoBitmap.HorizontalFlip;
182182
}
183183

184184
private double minZoom = 0.1f;
@@ -235,9 +235,6 @@ public PointD Center
235235
get => _Center.IsNaN ? new PointD(0, 0) : _Center;
236236
}
237237

238-
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
239-
private Vector3DBase zoomAndCenter = new(1, 0, 0);
240-
241238
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
242239
public (double Zoom, PointD Center) ZoomAndCenter
243240
{
@@ -307,7 +304,7 @@ public bool ShowAreaRectangle
307304
}
308305

309306
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
310-
private RectangleD areaRentagle = new RectangleD();
307+
private RectangleD areaRentagle = new();
311308
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
312309
public RectangleD AreaRectangle
313310
{
@@ -331,7 +328,7 @@ public RectangleD AreaRectangle
331328
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
332329
public Color TextColor { get => label.ForeColor; set => label.ForeColor = value; }
333330

334-
private PseudoBitmap _pseudoBitmap = new PseudoBitmap();
331+
private PseudoBitmap _pseudoBitmap = new();
335332

336333
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
337334
public PseudoBitmap PseudoBitmap

Crystallography/Crystallography.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<OutputType>Library</OutputType>
55
<TargetFramework>net7.0-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7-
<AssemblyVersion>2023.10.7.0542</AssemblyVersion>
8-
<FileVersion>2023.10.7.0542</FileVersion>
7+
<AssemblyVersion>2023.10.7.0557</AssemblyVersion>
8+
<FileVersion>2023.10.7.0557</FileVersion>
99
</PropertyGroup>
1010

1111
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

Crystallography/PointD.cs

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@ public struct RectangleD
1515
public double Width { set; get; }
1616
public double Height { set; get; }
1717

18-
public double UpperX { get { return X + Width; } }
19-
public double UpperY { get { return Y + Height; } }
18+
public readonly double UpperX => X + Width;
19+
public readonly double UpperY => Y + Height;
2020

21-
public readonly bool IsInsde(PointD p)
22-
{
23-
return p.X >= X && p.X <= X + Width && p.Y >= Y && p.Y <= Y + Height;
24-
}
21+
public readonly bool IsInsde(PointD p) => p.X >= X && p.X <= X + Width && p.Y >= Y && p.Y <= Y + Height;
2522

2623
public RectangleD(double x, double y, double width, double height) : this()
2724
{
@@ -63,16 +60,16 @@ public RectangleD(PointD pt1, PointD pt2) : this()
6360
Height = Math.Abs(pt2.Y - pt1.Y);
6461
}
6562

66-
public readonly RectangleF ToRectangleF() => new RectangleF((float)X, (float)Y, (float)Width, (float)Height);
63+
public readonly RectangleF ToRectangleF() => new((float)X, (float)Y, (float)Width, (float)Height);
6764

68-
public readonly SizeD ToSizeD() => new SizeD(Width, Height);
69-
public readonly SizeF ToSizeF() => new SizeF((float)Width, (float)Height);
65+
public readonly SizeD ToSizeD() => new(Width, Height);
66+
public readonly SizeF ToSizeF() => new((float)Width, (float)Height);
7067

7168
/// <summary>
7269
/// 四捨五入して整数サイズに変換
7370
/// </summary>
7471
/// <returns></returns>
75-
public readonly Size ToSize() => new Size((int)(Width + 0.5), (int)(Height + 0.5));
72+
public readonly Size ToSize() => new((int)(Width + 0.5), (int)(Height + 0.5));
7673

7774
}
7875

@@ -108,27 +105,21 @@ public SizeD(Size size) : this()
108105
Height = size.Height;
109106
}
110107

111-
public readonly SizeF ToSizeF()
112-
{
113-
return new SizeF((float)Width, (float)Height);
114-
}
108+
public readonly SizeF ToSizeF() => new((float)Width, (float)Height);
115109

116110
#region 演算子のオーバーロード
117111

118-
public override int GetHashCode()
119-
{
120-
return HashCode.Combine(Width, Height);
121-
}
112+
public override readonly int GetHashCode() => HashCode.Combine(Width, Height);
122113

123-
public override bool Equals(object obj) => obj is SizeD d && Equals(d);
114+
public override readonly bool Equals(object obj) => obj is SizeD d && Equals(d);
124115

125-
public bool Equals(in SizeD other) => Width == other.Width && Height == other.Height;
116+
public readonly bool Equals(in SizeD other) => Width == other.Width && Height == other.Height;
126117

127118
public static SizeD operator +(in SizeD p1, in SizeD p2) => new(p1.Width + p2.Width, p1.Height + p2.Height);
128119

129120
public static SizeD operator -(in SizeD p1, in SizeD p2) => new(p1.Width - p2.Width, p1.Height - p2.Height);
130121

131-
public static SizeD operator -(in SizeD p) => new SizeD(-p.Width, -p.Height);
122+
public static SizeD operator -(in SizeD p) => new(-p.Width, -p.Height);
132123

133124
public static SizeD operator *(in double d, in SizeD p) => new(d * p.Width, d * p.Height);
134125

@@ -177,7 +168,7 @@ public PointD(in PointD pt)
177168

178169
public readonly PointF ToPointF() => new((float)X, (float)Y);
179170

180-
public int CompareTo(object obj)
171+
public readonly int CompareTo(object obj)
181172
{
182173
int value = X.CompareTo(((PointD)obj).X);
183174
if (value != 0)
@@ -191,11 +182,11 @@ public int CompareTo(object obj)
191182
/// <returns></returns>
192183
public override readonly string ToString() => string.Format("({0}, {1})", this.X, this.Y);
193184

194-
public override bool Equals(object obj) => obj is PointD d && Equals(d);
185+
public override readonly bool Equals(object obj) => obj is PointD d && Equals(d);
195186

196-
public bool Equals(PointD other) => X == other.X && Y == other.Y;
187+
public readonly bool Equals(PointD other) => X == other.X && Y == other.Y;
197188

198-
public override int GetHashCode() => HashCode.Combine(X, Y);
189+
public override readonly int GetHashCode() => HashCode.Combine(X, Y);
199190

200191
#region 演算子のオーバーロード
201192

PDIndexer/FormMain.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
737737

738738
#region レジストリ操作
739739

740-
private void ClearRegistry()
740+
private static void ClearRegistry()
741741
{
742742
try { Microsoft.Win32.Registry.CurrentUser.DeleteSubKey("Software\\Crystallography\\PDIndexer"); }
743743
catch { }
@@ -1551,7 +1551,7 @@ private void DrawGradiation()
15511551
var pen = new Pen(colorControlScaleLine.Color, 1);
15521552

15531553
gMain.DrawLine(pen, OriginPos.X, pictureBoxMain.Height - OriginPos.Y, pictureBoxMain.Width, pictureBoxMain.Height - OriginPos.Y);
1554-
Font strFont = new Font(new FontFamily("tahoma"), 8);
1554+
using Font strFont = new(new FontFamily("tahoma"), 8);
15551555
for (int i = (int)(LowerX / AngleGradiation) + 1; i < UpperX / AngleGradiation; i++)
15561556
{
15571557
pen = new Pen(colorControlScaleLine.Color, 1);

PDIndexer/PDIndexer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net7.0-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7-
<AssemblyVersion>2023.10.7.0542</AssemblyVersion>
8-
<FileVersion>2023.10.7.0542</FileVersion>
7+
<AssemblyVersion>2023.10.7.0557</AssemblyVersion>
8+
<FileVersion>2023.10.7.0557</FileVersion>
99
<ApplicationIcon>App.ico</ApplicationIcon>
1010
</PropertyGroup>
1111

PDIndexer/Version.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,12 @@ static class Version
66
{
77
public const string Software = "PDIndexer";
88

9-
static public string RecentHistory
10-
{
11-
get
12-
{
13-
var list = History.Remove(0, 10).Split(new string[] { "\r\n " }, StringSplitOptions.RemoveEmptyEntries);
14-
var str = "";
15-
for (int i = 0; i < 5; i++)
16-
str += list[i] + "<br>\r\n";
17-
return str;
18-
}
19-
}
20-
219
/// <summary>
2210
/// 更新履歴
2311
/// </summary>
2412
public const string History =
2513
"History" +
26-
"\r\n ver4.441(2023/10/07) Fixed minor bugs." +
14+
"\r\n ver4.442(2023/10/07) Update crystal database. Fixed minor bugs." +
2715
"\r\n ver4.441(2023/07/01) Fixed a bug on loading *.pdi2 format files." +
2816
"\r\n ver4.440(2023/05/24) Improved registry read/write.The registry is cleared the first time this version is launched." +
2917
"\r\n ver4.439(2023/05/23) Fixed bugs on loading txt-format profiles." +

0 commit comments

Comments
 (0)