Index: src/Common/DelftTools.Controls.Swf/Charting/Tools/CursorLineTool.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/Charting/Tools/CursorLineTool.cs (.../CursorLineTool.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls.Swf/Charting/Tools/CursorLineTool.cs (.../CursorLineTool.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -213,14 +213,7 @@ { if (ToolTipEnabled) { - if (Style == CursorToolStyles.Vertical) - { - ToolTip.Show(string.Format(" {0:N2}", XValue), ChartControl); - } - else - { - ToolTip.Show(string.Format(" {0:N2}", YValue), ChartControl); - } + ToolTip.Show(Style == CursorToolStyles.Vertical ? string.Format(" {0:N2}", XValue) : string.Format(" {0:N2}", YValue), ChartControl); } if (ValueChanged != null) { Index: src/Common/DelftTools.Controls.Swf/Charting/Tracker.cs =================================================================== diff -u -rd9cadb087dc07ab563a285513adfb9b77e8e0344 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/Charting/Tracker.cs (.../Tracker.cs) (revision d9cadb087dc07ab563a285513adfb9b77e8e0344) +++ src/Common/DelftTools.Controls.Swf/Charting/Tracker.cs (.../Tracker.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -126,14 +126,9 @@ private void Generate() { - if (trackerStyle == Style.simpleRect) - { - Bitmap = GenerateSimpleTrackerImage(new Pen(foreColor), new SolidBrush(BackColor), Size, Size); - } - else - { - Bitmap = GenerateCompositeTrackerImage(new Pen(foreColor), new SolidBrush(BackColor), Size, Size, 6, 6); - } + Bitmap = trackerStyle == Style.simpleRect + ? GenerateSimpleTrackerImage(new Pen(foreColor), new SolidBrush(BackColor), Size, Size) + : GenerateCompositeTrackerImage(new Pen(foreColor), new SolidBrush(BackColor), Size, Size, 6, 6); } } } \ No newline at end of file Index: src/Common/DelftTools.Controls.Swf/CollapsibleSplitter.cs =================================================================== diff -u -r3e905c4e56df168cc8fe333589e2d5420a600f04 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/CollapsibleSplitter.cs (.../CollapsibleSplitter.cs) (revision 3e905c4e56df168cc8fe333589e2d5420a600f04) +++ src/Common/DelftTools.Controls.Swf/CollapsibleSplitter.cs (.../CollapsibleSplitter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -272,14 +272,7 @@ // set the current state if (ControlToHide != null) { - if (ControlToHide.Visible) - { - currentState = SplitterState.Expanded; - } - else - { - currentState = SplitterState.Collapsed; - } + currentState = ControlToHide.Visible ? SplitterState.Expanded : SplitterState.Collapsed; } } @@ -618,14 +611,7 @@ Width = 8; // draw the background color for our control image - if (hot) - { - g.FillRectangle(new SolidBrush(hotColor), new Rectangle(rr.X + 1, rr.Y, 6, 115)); - } - else - { - g.FillRectangle(new SolidBrush(BackColor), new Rectangle(rr.X + 1, rr.Y, 6, 115)); - } + g.FillRectangle(hot ? new SolidBrush(hotColor) : new SolidBrush(BackColor), new Rectangle(rr.X + 1, rr.Y, 6, 115)); // draw the top & bottom lines for our control image g.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X + 1, rr.Y, rr.X + rr.Width - 2, rr.Y); @@ -655,14 +641,7 @@ // dark dot g.DrawLine(new Pen(SystemColors.ControlDarkDark), x + 1, y + 1 + (i*3), x + 2, y + 2 + (i*3)); // overdraw the background color as we actually drew 2px diagonal lines, not just dots - if (hot) - { - g.DrawLine(new Pen(hotColor), x + 2, y + 1 + (i*3), x + 2, y + 2 + (i*3)); - } - else - { - g.DrawLine(new Pen(BackColor), x + 2, y + 1 + (i*3), x + 2, y + 2 + (i*3)); - } + g.DrawLine(hot ? new Pen(hotColor) : new Pen(BackColor), x + 2, y + 1 + (i*3), x + 2, y + 2 + (i*3)); } break; @@ -738,14 +717,7 @@ Height = 8; // draw the background color for our control image - if (hot) - { - g.FillRectangle(new SolidBrush(hotColor), new Rectangle(rr.X, rr.Y + 1, 115, 6)); - } - else - { - g.FillRectangle(new SolidBrush(BackColor), new Rectangle(rr.X, rr.Y + 1, 115, 6)); - } + g.FillRectangle(hot ? new SolidBrush(hotColor) : new SolidBrush(BackColor), new Rectangle(rr.X, rr.Y + 1, 115, 6)); // draw the left & right lines for our control image g.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X, rr.Y + 1, rr.X, rr.Y + rr.Height - 2); @@ -775,14 +747,7 @@ // dark dot g.DrawLine(new Pen(SystemColors.ControlDarkDark), x + 1 + (i*3), y + 1, x + 2 + (i*3), y + 2); // overdraw the background color as we actually drew 2px diagonal lines, not just dots - if (hot) - { - g.DrawLine(new Pen(hotColor), x + 1 + (i*3), y + 2, x + 2 + (i*3), y + 2); - } - else - { - g.DrawLine(new Pen(BackColor), x + 1 + (i*3), y + 2, x + 2 + (i*3), y + 2); - } + g.DrawLine(hot ? new Pen(hotColor) : new Pen(BackColor), x + 1 + (i*3), y + 2, x + 2 + (i*3), y + 2); } break; Index: src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/Binding.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/Binding.cs (.../Binding.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/Binding.cs (.../Binding.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -98,15 +98,7 @@ { errorProvider.SetIconAlignment(Control, ErrorIconAlignment.MiddleLeft); string errorMessage; - if (!FieldDescription.Validate(Data, value, out errorMessage)) - { - errorProvider.SetError(Control, errorMessage); - } - - else - { - errorProvider.SetError(Control, string.Empty); - } + errorProvider.SetError(Control, !FieldDescription.Validate(Data, value, out errorMessage) ? errorMessage : string.Empty); } protected object DataValue Index: src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/ControlBindings/CustomControlBinding.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/ControlBindings/CustomControlBinding.cs (.../CustomControlBinding.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls.Swf/DataEditorGenerator/Binding/ControlBindings/CustomControlBinding.cs (.../CustomControlBinding.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -57,14 +57,7 @@ public void Validate(object value) { string errorMessage; - if (!fieldDescription.Validate(Data, value, out errorMessage)) - { - ErrorProvider.SetError(EditControl, errorMessage); - } - else - { - ErrorProvider.SetError(EditControl, string.Empty); - } + ErrorProvider.SetError(EditControl, !fieldDescription.Validate(Data, value, out errorMessage) ? errorMessage : string.Empty); } public void RefreshEnabled() Index: src/Common/DelftTools.Controls.Swf/FileNameUITypeEditor.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/FileNameUITypeEditor.cs (.../FileNameUITypeEditor.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls.Swf/FileNameUITypeEditor.cs (.../FileNameUITypeEditor.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -73,14 +73,7 @@ } fileDlg.Title = "Select " + context.PropertyDescriptor.DisplayName; - if (value == null) - { - fileDlg.FileName = ""; - } - else - { - fileDlg.FileName = value.ToString(); - } + fileDlg.FileName = value == null ? "" : value.ToString(); FileDialogFilterAttribute filterAtt = context.PropertyDescriptor.Attributes[typeof(FileDialogFilterAttribute)] as Index: src/Common/DelftTools.Controls.Swf/Table/TableViewPasteController.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Controls.Swf/Table/TableViewPasteController.cs (.../TableViewPasteController.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Controls.Swf/Table/TableViewPasteController.cs (.../TableViewPasteController.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -170,15 +170,9 @@ { TableViewCell topLeft; var selectedRows = TableView.SelectedRowsIndices; - if (selectedRows.Length == 0) - { - topLeft = new TableViewCell(TableView.RowCount, TableView.GetColumnByDisplayIndex(0)); - } - else - { - //start pasting at the first row - topLeft = new TableViewCell(selectedRows[0], TableView.GetColumnByDisplayIndex(0)); - } + topLeft = selectedRows.Length == 0 + ? new TableViewCell(TableView.RowCount, TableView.GetColumnByDisplayIndex(0)) + : new TableViewCell(selectedRows[0], TableView.GetColumnByDisplayIndex(0)); return new RectangleSelection(topLeft, topLeft); } Index: src/Common/DelftTools.Shell.Core/Workflow/ActivityRunner.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Shell.Core/Workflow/ActivityRunner.cs (.../ActivityRunner.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Shell.Core/Workflow/ActivityRunner.cs (.../ActivityRunner.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -137,14 +137,9 @@ { var task = (AsyncActivityRunner) sender; - if (task.Activity.Status == ActivityStatus.Cancelled) - { - Debug.WriteLine(string.Format("Cancelled activity {0}", task.Activity.Name)); - } - else - { - Debug.WriteLine(string.Format("Finished activity {0}", task.Activity.Name)); - } + Debug.WriteLine(task.Activity.Status == ActivityStatus.Cancelled + ? string.Format("Cancelled activity {0}", task.Activity.Name) + : string.Format("Finished activity {0}", task.Activity.Name)); try { @@ -193,14 +188,9 @@ { if (!sender.CompletedSuccesfully) { - if (String.IsNullOrEmpty(sender.Activity.Name)) - { - log.Error("An error occured while running a background activity: ", sender.Exception); - } - else - { - log.Error(String.Format("An error occured while running activity {0}: ", sender.Activity.Name), sender.Exception); - } + log.Error(String.IsNullOrEmpty(sender.Activity.Name) + ? "An error occured while running a background activity: " + : String.Format("An error occured while running activity {0}: ", sender.Activity.Name), sender.Exception); } if (ActivityCompleted != null) Index: src/Common/DelftTools.Utils/Interop/OcxHelper.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Utils/Interop/OcxHelper.cs (.../OcxHelper.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/DelftTools.Utils/Interop/OcxHelper.cs (.../OcxHelper.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -48,14 +48,7 @@ try { lb = LoadLibrary(ocxPath); - if (register) - { - pa = GetProcAddress(lb, "DllRegisterServer"); - } - else - { - pa = GetProcAddress(lb, "DllUnregisterServer"); - } + pa = GetProcAddress(lb, register ? "DllRegisterServer" : "DllUnregisterServer"); if (CallWindowProc(pa, IntPtr.Zero, 0, UIntPtr.Zero, IntPtr.Zero) == IntPtr.Zero) { Index: src/Common/DelftTools.Utils/Xml/Serialization/ObjectXmlSerializer.cs =================================================================== diff -u -rfbe5d1ac043ae74461b82b0ab71c5388bfbbc58b -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/DelftTools.Utils/Xml/Serialization/ObjectXmlSerializer.cs (.../ObjectXmlSerializer.cs) (revision fbe5d1ac043ae74461b82b0ab71c5388bfbbc58b) +++ src/Common/DelftTools.Utils/Xml/Serialization/ObjectXmlSerializer.cs (.../ObjectXmlSerializer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -304,17 +304,8 @@ private static FileStream CreateFileStream(IsolatedStorageFile isolatedStorageFolder, string path) { - FileStream fileStream; + var fileStream = isolatedStorageFolder == null ? new FileStream(path, FileMode.OpenOrCreate) : new IsolatedStorageFileStream(path, FileMode.OpenOrCreate, isolatedStorageFolder); - if (isolatedStorageFolder == null) - { - fileStream = new FileStream(path, FileMode.OpenOrCreate); - } - else - { - fileStream = new IsolatedStorageFileStream(path, FileMode.OpenOrCreate, isolatedStorageFolder); - } - return fileStream; } @@ -347,52 +338,24 @@ private static TextReader CreateTextReader(IsolatedStorageFile isolatedStorageFolder, string path) { - TextReader textReader; + TextReader textReader = isolatedStorageFolder == null ? new StreamReader(path) : new StreamReader(new IsolatedStorageFileStream(path, FileMode.Open, isolatedStorageFolder)); - if (isolatedStorageFolder == null) - { - textReader = new StreamReader(path); - } - else - { - textReader = new StreamReader(new IsolatedStorageFileStream(path, FileMode.Open, isolatedStorageFolder)); - } - return textReader; } private static TextWriter CreateTextWriter(IsolatedStorageFile isolatedStorageFolder, string path) { - TextWriter textWriter; + TextWriter textWriter = isolatedStorageFolder == null ? new StreamWriter(path) : new StreamWriter(new IsolatedStorageFileStream(path, FileMode.OpenOrCreate, isolatedStorageFolder)); - if (isolatedStorageFolder == null) - { - textWriter = new StreamWriter(path); - } - else - { - textWriter = - new StreamWriter(new IsolatedStorageFileStream(path, FileMode.OpenOrCreate, isolatedStorageFolder)); - } - return textWriter; } private static XmlSerializer CreateXmlSerializer(Type[] extraTypes) { Type ObjectType = typeof(T); - XmlSerializer xmlSerializer; + var xmlSerializer = extraTypes != null ? new XmlSerializer(ObjectType, extraTypes) : new XmlSerializer(ObjectType); - if (extraTypes != null) - { - xmlSerializer = new XmlSerializer(ObjectType, extraTypes); - } - else - { - xmlSerializer = new XmlSerializer(ObjectType); - } - return xmlSerializer; } Index: src/Common/NetTopologySuite/Algorithm/LineIntersector.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Algorithm/LineIntersector.cs (.../LineIntersector.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Algorithm/LineIntersector.cs (.../LineIntersector.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -177,27 +177,13 @@ } else if (p.Equals(p1)) { - if (dx > dy) - { - dist = dx; - } - else - { - dist = dy; - } + dist = dx > dy ? dx : dy; } else { double pdx = Math.Abs(p.X - p0.X); double pdy = Math.Abs(p.Y - p0.Y); - if (dx > dy) - { - dist = pdx; - } - else - { - dist = pdy; - } + dist = dx > dy ? pdx : pdy; // : hack to ensure that non-endpoints always have a non-zero distance if (dist == 0.0 && !p.Equals(p0)) Index: src/Common/NetTopologySuite/Geometries/CoordinateArraySequence.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Geometries/CoordinateArraySequence.cs (.../CoordinateArraySequence.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Geometries/CoordinateArraySequence.cs (.../CoordinateArraySequence.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -47,14 +47,7 @@ /// The coordinate array that will be referenced. public CoordinateArraySequence(ICoordinateSequence coordSeq) { - if (coordSeq != null) - { - coordinates = new ICoordinate[coordSeq.Count]; - } - else - { - coordinates = new ICoordinate[0]; - } + coordinates = coordSeq != null ? new ICoordinate[coordSeq.Count] : new ICoordinate[0]; for (int i = 0; i < coordinates.Length; i++) { coordinates[i] = coordSeq.GetCoordinateCopy(i); Index: src/Common/NetTopologySuite/IO/GeoTools/Dbase/DbaseFileWriter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/GeoTools/Dbase/DbaseFileWriter.cs (.../DbaseFileWriter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/GeoTools/Dbase/DbaseFileWriter.cs (.../DbaseFileWriter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -269,14 +269,7 @@ /// public void Write(bool flag) { - if (flag) - { - _writer.Write('T'); - } - else - { - _writer.Write('F'); - } + _writer.Write(flag ? 'T' : 'F'); } /// Index: src/Common/NetTopologySuite/IO/GeoTools/Handlers/MultiLineHandler.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/GeoTools/Handlers/MultiLineHandler.cs (.../MultiLineHandler.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/GeoTools/Handlers/MultiLineHandler.cs (.../MultiLineHandler.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -64,14 +64,7 @@ { int start, finish, length; start = partOffsets[part]; - if (part == numParts - 1) - { - finish = numPoints; - } - else - { - finish = partOffsets[part + 1]; - } + finish = part == numParts - 1 ? numPoints : partOffsets[part + 1]; length = finish - start; CoordinateList points = new CoordinateList(); points.Capacity = length; Index: src/Common/NetTopologySuite/IO/GeoTools/Handlers/PolygonHandler.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/GeoTools/Handlers/PolygonHandler.cs (.../PolygonHandler.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/GeoTools/Handlers/PolygonHandler.cs (.../PolygonHandler.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -69,14 +69,7 @@ for (int part = 0; part < numParts; part++) { start = partOffsets[part]; - if (part == numParts - 1) - { - finish = numPoints; - } - else - { - finish = partOffsets[part + 1]; - } + finish = part == numParts - 1 ? numPoints : partOffsets[part + 1]; length = finish - start; CoordinateList points = new CoordinateList(); points.Capacity = length; Index: src/Common/NetTopologySuite/IO/MsSqlSpatialReader.cs =================================================================== diff -u -rd9cadb087dc07ab563a285513adfb9b77e8e0344 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/MsSqlSpatialReader.cs (.../MsSqlSpatialReader.cs) (revision d9cadb087dc07ab563a285513adfb9b77e8e0344) +++ src/Common/NetTopologySuite/IO/MsSqlSpatialReader.cs (.../MsSqlSpatialReader.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -11,14 +11,7 @@ ByteOrder byteOrder = (ByteOrder) stream.ReadByte(); try { - if (byteOrder == ByteOrder.BigEndian) - { - reader = new BEBinaryReader(stream); - } - else - { - reader = new BinaryReader(stream); - } + reader = byteOrder == ByteOrder.BigEndian ? new BEBinaryReader(stream) : new BinaryReader(stream); IGeometry geometry = Read(reader); int srid = -1; try Index: src/Common/NetTopologySuite/IO/MsSqlSpatialWriter.cs =================================================================== diff -u -rd9cadb087dc07ab563a285513adfb9b77e8e0344 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/MsSqlSpatialWriter.cs (.../MsSqlSpatialWriter.cs) (revision d9cadb087dc07ab563a285513adfb9b77e8e0344) +++ src/Common/NetTopologySuite/IO/MsSqlSpatialWriter.cs (.../MsSqlSpatialWriter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -17,14 +17,7 @@ BinaryWriter writer = null; try { - if (encodingType == ByteOrder.LittleEndian) - { - writer = new BinaryWriter(stream); - } - else - { - writer = new BEBinaryWriter(stream); - } + writer = encodingType == ByteOrder.LittleEndian ? new BinaryWriter(stream) : new BEBinaryWriter(stream); Write(geometry, writer); writer.Write(geometry.SRID); } Index: src/Common/NetTopologySuite/IO/MyShapeFileReader.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/MyShapeFileReader.cs (.../MyShapeFileReader.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/MyShapeFileReader.cs (.../MyShapeFileReader.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -187,14 +187,7 @@ indexParts = shapeReader.ReadIndexParts(leReader, numParts); ICoordinate[] coordinates = shapeReader.ReadCoordinates(leReader, numPoints); - if (numParts == 1) - { - list.Add(shapeReader.CreateLineString(coordinates)); - } - else - { - list.Add(shapeReader.CreateMultiLineString(numPoints, indexParts, coordinates)); - } + list.Add(numParts == 1 ? shapeReader.CreateLineString(coordinates) : shapeReader.CreateMultiLineString(numPoints, indexParts, coordinates)); } } } @@ -232,14 +225,7 @@ indexParts = shapeReader.ReadIndexParts(reader, numParts); ICoordinate[] coordinates = shapeReader.ReadCoordinates(reader, numPoints); - if (numParts == 1) - { - list.Add(shapeReader.CreateSimpleSinglePolygon(coordinates)); - } - else - { - list.Add(shapeReader.CreateSingleOrMultiPolygon(numPoints, indexParts, coordinates)); - } + list.Add(numParts == 1 ? shapeReader.CreateSimpleSinglePolygon(coordinates) : shapeReader.CreateSingleOrMultiPolygon(numPoints, indexParts, coordinates)); } } } Index: src/Common/NetTopologySuite/IO/PostGisReader.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/PostGisReader.cs (.../PostGisReader.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/PostGisReader.cs (.../PostGisReader.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -56,14 +56,7 @@ stream.Position = 0; try { - if (byteOrder == ByteOrder.BigEndian) - { - reader = new BEBinaryReader(stream); - } - else - { - reader = new BinaryReader(stream); - } + reader = byteOrder == ByteOrder.BigEndian ? new BEBinaryReader(stream) : new BinaryReader(stream); return Read(reader); } finally Index: src/Common/NetTopologySuite/IO/PostGisWriter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/PostGisWriter.cs (.../PostGisWriter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/PostGisWriter.cs (.../PostGisWriter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -52,14 +52,7 @@ BinaryWriter writer = null; try { - if (encodingType == ByteOrder.LittleEndian) - { - writer = new BinaryWriter(stream); - } - else - { - writer = new BEBinaryWriter(stream); - } + writer = encodingType == ByteOrder.LittleEndian ? new BinaryWriter(stream) : new BEBinaryWriter(stream); Write(geometry, writer); } finally Index: src/Common/NetTopologySuite/IO/WKBReader.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/WKBReader.cs (.../WKBReader.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/WKBReader.cs (.../WKBReader.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -59,14 +59,7 @@ ByteOrder byteOrder = (ByteOrder) stream.ReadByte(); try { - if (byteOrder == ByteOrder.BigEndian) - { - reader = new BEBinaryReader(stream); - } - else - { - reader = new BinaryReader(stream); - } + reader = byteOrder == ByteOrder.BigEndian ? new BEBinaryReader(stream) : new BinaryReader(stream); return Read(reader); } finally Index: src/Common/NetTopologySuite/IO/WKBWriter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/IO/WKBWriter.cs (.../WKBWriter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/IO/WKBWriter.cs (.../WKBWriter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -63,14 +63,7 @@ BinaryWriter writer = null; try { - if (encodingType == ByteOrder.LittleEndian) - { - writer = new BinaryWriter(stream); - } - else - { - writer = new BEBinaryWriter(stream); - } + writer = encodingType == ByteOrder.LittleEndian ? new BinaryWriter(stream) : new BEBinaryWriter(stream); Write(geometry, writer); } finally Index: src/Common/NetTopologySuite/Index/Bintree/Root.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Index/Bintree/Root.cs (.../Root.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Index/Bintree/Root.cs (.../Root.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -81,14 +81,7 @@ */ bool isZeroArea = IntervalSize.IsZeroWidth(itemInterval.Min, itemInterval.Max); NodeBase node; - if (isZeroArea) - { - node = tree.Find(itemInterval); - } - else - { - node = tree.GetNode(itemInterval); - } + node = isZeroArea ? tree.Find(itemInterval) : tree.GetNode(itemInterval); node.Add(item); } } Index: src/Common/NetTopologySuite/Index/Sweepline/SweepLineEvent.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Index/Sweepline/SweepLineEvent.cs (.../SweepLineEvent.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Index/Sweepline/SweepLineEvent.cs (.../SweepLineEvent.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -37,14 +37,7 @@ { xValue = x; this.insertEvent = insertEvent; - if (insertEvent != null) - { - eventType = SweepLineEvents.Delete; - } - else - { - eventType = SweepLineEvents.Insert; - } + eventType = insertEvent != null ? SweepLineEvents.Delete : SweepLineEvents.Insert; Interval = sweepInt; } Index: src/Common/NetTopologySuite/Operation/GeometryGraphOperation.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/GeometryGraphOperation.cs (.../GeometryGraphOperation.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/GeometryGraphOperation.cs (.../GeometryGraphOperation.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -29,14 +29,7 @@ public GeometryGraphOperation(IGeometry g0, IGeometry g1) { // use the most precise model for the result - if (g0.PrecisionModel.CompareTo(g1.PrecisionModel) >= 0) - { - ComputationPrecision = g0.PrecisionModel; - } - else - { - ComputationPrecision = g1.PrecisionModel; - } + ComputationPrecision = g0.PrecisionModel.CompareTo(g1.PrecisionModel) >= 0 ? g0.PrecisionModel : g1.PrecisionModel; arg = new GeometryGraph[2]; arg[0] = new GeometryGraph(0, g0); Index: src/Common/NetTopologySuite/Operation/Linemerge/LineSequencer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/Linemerge/LineSequencer.cs (.../LineSequencer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/Linemerge/LineSequencer.cs (.../LineSequencer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -349,14 +349,7 @@ Node fromNode = null; while (true) { - if (pos == null) - { - pos = list.AddLast(de.Sym); - } - else - { - pos = list.AddAfter(pos, de.Sym); - } + pos = pos == null ? list.AddLast(de.Sym) : list.AddAfter(pos, de.Sym); de.Edge.Visited = true; fromNode = de.FromNode; DirectedEdge unvisitedOutDE = FindUnvisitedBestOrientedDE(fromNode); Index: src/Common/NetTopologySuite/Operation/Overlay/LineBuilder.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/Overlay/LineBuilder.cs (.../LineBuilder.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/Overlay/LineBuilder.cs (.../LineBuilder.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -186,14 +186,7 @@ Label label = e.Label; if (e.IsIsolated) { - if (label.IsNull(0)) - { - LabelIsolatedLine(e, 0); - } - else - { - LabelIsolatedLine(e, 1); - } + LabelIsolatedLine(e, label.IsNull(0) ? 0 : 1); } } } Index: src/Common/NetTopologySuite/Operation/Overlay/OverlayOp.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/Overlay/OverlayOp.cs (.../OverlayOp.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/Overlay/OverlayOp.cs (.../OverlayOp.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -438,14 +438,7 @@ var label = n.Label; if (n.IsIsolated) { - if (label.IsNull(0)) - { - LabelIncompleteNode(n, 0); - } - else - { - LabelIncompleteNode(n, 1); - } + LabelIncompleteNode(n, label.IsNull(0) ? 0 : 1); } // now update the labelling for the DirectedEdges incident on this node ((DirectedEdgeStar) n.Edges).UpdateLabelling(label); Index: src/Common/NetTopologySuite/Operation/Relate/EdgeEndBundle.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/Relate/EdgeEndBundle.cs (.../EdgeEndBundle.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/Relate/EdgeEndBundle.cs (.../EdgeEndBundle.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -82,14 +82,7 @@ isArea = true; } } - if (isArea) - { - label = new Label(Locations.Null, Locations.Null, Locations.Null); - } - else - { - label = new Label(Locations.Null); - } + label = isArea ? new Label(Locations.Null, Locations.Null, Locations.Null) : new Label(Locations.Null); // compute the On label, and the side labels if present for (int i = 0; i < 2; i++) Index: src/Common/NetTopologySuite/Operation/Relate/RelateComputer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Operation/Relate/RelateComputer.cs (.../RelateComputer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Operation/Relate/RelateComputer.cs (.../RelateComputer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -396,14 +396,7 @@ Assert.IsTrue(label.GeometryCount > 0, "node with empty label found"); if (n.IsIsolated) { - if (label.IsNull(0)) - { - LabelIsolatedNode(n, 0); - } - else - { - LabelIsolatedNode(n, 1); - } + LabelIsolatedNode(n, label.IsNull(0) ? 0 : 1); } } } Index: src/Common/NetTopologySuite/Triangulate/ConformingDelaunayTriangulator.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Triangulate/ConformingDelaunayTriangulator.cs (.../ConformingDelaunayTriangulator.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Triangulate/ConformingDelaunayTriangulator.cs (.../ConformingDelaunayTriangulator.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -288,40 +288,6 @@ ConvexHull = hull.GetConvexHull(); } - // /** - // * Adds the segments in the Convex Hull of all sites in the input data as - // linear constraints. - // * This is required if TIN Refinement is performed. The hull segments are - // flagged with a - // unique - // * data object to allow distinguishing them. - // * - // * @param convexHullSegmentData the data object to attach to each convex - // hull segment - // */ - // private void addConvexHullToConstraints(Object convexHullSegmentData) { - // Coordinate[] coords = convexHull.getCoordinates(); - // for (int i = 1; i < coords.length; i++) { - // Segment s = new Segment(coords[i - 1], coords[i], convexHullSegmentData); - // addConstraintIfUnique(s); - // } - // } - - // private void addConstraintIfUnique(Segment r) { - // boolean exists = false; - // Iterator it = segments.iterator(); - // Segment s = null; - // while (it.hasNext()) { - // s = (Segment) it.next(); - // if (r.equalsTopo(s)) { - // exists = true; - // } - // } - // if (!exists) { - // segments.add((Object) r); - // } - // } - private ICoordinate[] GetPointArray() { ICoordinate[] pts = new ICoordinate[_initialVertices.Count @@ -341,14 +307,7 @@ private ConstraintVertex CreateVertex(ICoordinate p) { ConstraintVertex v = null; - if (VertexFactory != null) - { - v = VertexFactory.CreateVertex(p, null); - } - else - { - v = new ConstraintVertex(p); - } + v = VertexFactory != null ? VertexFactory.CreateVertex(p, null) : new ConstraintVertex(p); return v; } @@ -361,14 +320,7 @@ private ConstraintVertex CreateVertex(ICoordinate p, Segment seg) { ConstraintVertex v; - if (VertexFactory != null) - { - v = VertexFactory.CreateVertex(p, seg); - } - else - { - v = new ConstraintVertex(p); - } + v = VertexFactory != null ? VertexFactory.CreateVertex(p, seg) : new ConstraintVertex(p); v.IsOnConstraint = true; return v; } @@ -413,13 +365,6 @@ InsertSites(_segVertices); } - /* - * private List findMissingConstraints() { List missingSegs = new ArrayList(); - * for (int i = 0; i < segments.size(); i++) { Segment s = (Segment) - * segments.get(i); QuadEdge q = subdiv.locate(s.getStart(), s.getEnd()); if - * (q == null) missingSegs.add(s); } return missingSegs; } - */ - private int EnforceGabriel(ICollection segsToInsert) { var newSegments = new List(); @@ -507,8 +452,6 @@ return splits; } - // public static final String DEBUG_SEG_SPLIT = "C:\\proj\\CWB\\test\\segSplit.jml"; - /// /// Given a set of points stored in the kd-tree and a line segment defined by /// two points in this set, finds a {@link Coordinate} in the circumcircle of @@ -518,8 +461,7 @@ /// segment. /// /// the line segment - /// a point which is non-Gabriel, - /// or null if no point is non-Gabriel + /// a point which is non-Gabriel, or null if no point is non-Gabriel /// private ICoordinate FindNonGabrielPoint(Segment seg) { Index: src/Common/NetTopologySuite/Triangulate/SplitSegment.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Triangulate/SplitSegment.cs (.../SplitSegment.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Triangulate/SplitSegment.cs (.../SplitSegment.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -27,14 +27,7 @@ { double actualLen = GetConstrainedLength(length); double frac = actualLen/_segLen; - if (endPt.Equals2D(_seg.P0)) - { - SplitPoint = _seg.PointAlong(frac); - } - else - { - SplitPoint = PointAlongReverse(_seg, frac); - } + SplitPoint = endPt.Equals2D(_seg.P0) ? _seg.PointAlong(frac) : PointAlongReverse(_seg, frac); } public void SplitAt(ICoordinate pt) Index: src/Common/NetTopologySuite/Utilities/GeoToolsStreamTokenizer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/NetTopologySuite/Utilities/GeoToolsStreamTokenizer.cs (.../GeoToolsStreamTokenizer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/NetTopologySuite/Utilities/GeoToolsStreamTokenizer.cs (.../GeoToolsStreamTokenizer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -113,15 +113,7 @@ /// The TokenType of the next token. public TokenType NextToken(bool ignoreWhitespace) { - TokenType nextTokenType; - if (ignoreWhitespace) - { - nextTokenType = NextNonWhitespaceToken(); - } - else - { - nextTokenType = NextTokenAny(); - } + var nextTokenType = ignoreWhitespace ? NextNonWhitespaceToken() : NextTokenAny(); return nextTokenType; } Index: src/Common/SharpMap.UI/Forms/MapControl.cs =================================================================== diff -u -r65da9848ca60b1981afea6e99f742761e02f1c19 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap.UI/Forms/MapControl.cs (.../MapControl.cs) (revision 65da9848ca60b1981afea6e99f742761e02f1c19) +++ src/Common/SharpMap.UI/Forms/MapControl.cs (.../MapControl.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -220,14 +220,7 @@ { vectorStyle.Line.Color = Color.FromArgb(128, vectorStyle.Line.Color); SolidBrush solidBrush = vectorStyle.Fill as SolidBrush; - if (null != solidBrush) - { - vectorStyle.Fill = new SolidBrush(Color.FromArgb(127, solidBrush.Color)); - } - else // possibly a multicolor brush - { - vectorStyle.Fill = new SolidBrush(Color.FromArgb(63, Color.DodgerBlue)); - } + vectorStyle.Fill = null != solidBrush ? new SolidBrush(Color.FromArgb(127, solidBrush.Color)) : new SolidBrush(Color.FromArgb(63, Color.DodgerBlue)); if (null != vectorStyle.Symbol) { Bitmap bitmap = new Bitmap(vectorStyle.Symbol.Width, vectorStyle.Symbol.Height); Index: src/Common/SharpMap.UI/Tools/Decorations/ScaleBar.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap.UI/Tools/Decorations/ScaleBar.cs (.../ScaleBar.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/SharpMap.UI/Tools/Decorations/ScaleBar.cs (.../ScaleBar.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -399,14 +399,7 @@ { int digits = (int) Math.Log10(Math.Abs(value)); // if (digits >= 0) ++digits; // if you care about the exact number - if (Math.Abs(digits) >= 5) - { - s = string.Format("{0:0.#E+0}", value); - } - else - { - s = string.Format("{0:0.##}", value); - } + s = string.Format(Math.Abs(digits) >= 5 ? "{0:0.#E+0}" : "{0:0.##}", value); } else { @@ -423,14 +416,9 @@ private void CalcScale(Graphics graphics) { double fScale; - if (MapUnit == MapUnits.ws_muDegree) //LatLong - { - fScale = CalcRFScaleD(graphics, m_fLon1, m_fLon2, m_fLat, m_nPageWidth); - } - else - { - fScale = CalcRFScale(graphics, m_fMapWidth, m_nPageWidth, m_fMapUnitFactor); - } + fScale = MapUnit == MapUnits.ws_muDegree + ? CalcRFScaleD(graphics, m_fLon1, m_fLon2, m_fLat, m_nPageWidth) + : CalcRFScale(graphics, m_fMapWidth, m_nPageWidth, m_fMapUnitFactor); m_fScale = fScale; } @@ -695,16 +683,8 @@ //char buf[MAX_LEN]; Brush brush = new SolidBrush(Color.Black); - if (ScaleText == sbScaleText.ws_stUnitsOnly) - { - graphics.DrawString("0", font, brush, x, y, f); - } - //DrawTextWithAlign( "0", x, y, TA_TOP | TA_LEFT); - else - { - //DrawTextWithAlign( str_unit, x, y, TA_TOP | TA_LEFT); - graphics.DrawString(str_unit, font, brush, x, y, f); - } + //? DrawTextWithAlign( "0", x, y, TA_TOP | TA_LEFT) : DrawTextWithAlign( str_unit, x, y, TA_TOP | TA_LEFT); + graphics.DrawString(ScaleText == sbScaleText.ws_stUnitsOnly ? "0" : str_unit, font, brush, x, y, f); //Set the output format. @@ -903,14 +883,7 @@ var y = nOffsetY; for (int i = 0; i < nNumTics; i++) { - if (i%2 != 0) - { - graphics.DrawLine(pen, x, y, x + nOffsetX, y); - } - else - { - graphics.DrawLine(pen2, x, y, x + nOffsetX, y); - } + graphics.DrawLine(i%2 != 0 ? pen : pen2, x, y, x + nOffsetX, y); x += nTicLength; } } Index: src/Common/SharpMap/Converters/WellKnownText/StreamTokenizer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap/Converters/WellKnownText/StreamTokenizer.cs (.../StreamTokenizer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/SharpMap/Converters/WellKnownText/StreamTokenizer.cs (.../StreamTokenizer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -156,14 +156,7 @@ public TokenType NextToken(bool ignoreWhitespace) { TokenType nextTokenType; - if (ignoreWhitespace) - { - nextTokenType = NextNonWhitespaceToken(); - } - else - { - nextTokenType = NextTokenAny(); - } + nextTokenType = ignoreWhitespace ? NextNonWhitespaceToken() : NextTokenAny(); return nextTokenType; } Index: src/Common/SharpMap/Layers/WmsLayer.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap/Layers/WmsLayer.cs (.../WmsLayer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/SharpMap/Layers/WmsLayer.cs (.../WmsLayer.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -685,14 +685,7 @@ { throw new ApplicationException("Spatial reference system not set"); } - if (wmsClient.WmsVersion == "1.3.0") - { - strReq.AppendFormat("&CRS={0}", spatialReferenceSystem); - } - else - { - strReq.AppendFormat("&SRS={0}", spatialReferenceSystem); - } + strReq.AppendFormat(wmsClient.WmsVersion == "1.3.0" ? "&CRS={0}" : "&SRS={0}", spatialReferenceSystem); strReq.AppendFormat("&VERSION={0}", wmsClient.WmsVersion); strReq.Append("&Styles="); if (stylesList != null && stylesList.Count > 0) Index: src/Common/SharpMap/Rendering/Thematics/GradientTheme.cs =================================================================== diff -u -r2ac736f597049cb6e036d52b604d259c010d8b35 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap/Rendering/Thematics/GradientTheme.cs (.../GradientTheme.cs) (revision 2ac736f597049cb6e036d52b604d259c010d8b35) +++ src/Common/SharpMap/Rendering/Thematics/GradientTheme.cs (.../GradientTheme.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -479,14 +479,7 @@ style.BackColor = InterpolateBrush(min.BackColor, max.BackColor, value); } - if (TextColorBlend != null) - { - style.ForeColor = LineColorBlend.GetColor(Convert.ToSingle(Fraction(value))); - } - else - { - style.ForeColor = InterpolateColor(min.ForeColor, max.ForeColor, value); - } + style.ForeColor = TextColorBlend != null ? LineColorBlend.GetColor(Convert.ToSingle(Fraction(value))) : InterpolateColor(min.ForeColor, max.ForeColor, value); if (min.Halo != null && max.Halo != null) { style.Halo = InterpolatePen(min.Halo, max.Halo, value); Index: src/Common/SharpMap/Rendering/VectorRenderingHelper.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap/Rendering/VectorRenderingHelper.cs (.../VectorRenderingHelper.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/SharpMap/Rendering/VectorRenderingHelper.cs (.../VectorRenderingHelper.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -326,24 +326,10 @@ switch (feature.GeometryType) { case "Polygon": - if (style.EnableOutline) - { - DrawPolygon(g, (IPolygon) feature, style.Fill, style.Outline, clippingEnabled, map); - } - else - { - DrawPolygon(g, (IPolygon) feature, style.Fill, null, clippingEnabled, map); - } + DrawPolygon(g, (IPolygon) feature, style.Fill, style.EnableOutline ? style.Outline : null, clippingEnabled, map); break; case "MultiPolygon": - if (style.EnableOutline) - { - DrawMultiPolygon(g, (IMultiPolygon) feature, style.Fill, style.Outline, clippingEnabled, map); - } - else - { - DrawMultiPolygon(g, (IMultiPolygon) feature, style.Fill, null, clippingEnabled, map); - } + DrawMultiPolygon(g, (IMultiPolygon) feature, style.Fill, style.EnableOutline ? style.Outline : null, clippingEnabled, map); break; case "LineString": DrawLineString(g, (ILineString) feature, style.Line, map); @@ -513,26 +499,12 @@ { if (0 < tin2) { - if (tinx > tiny) - { - line.Add(new PointF(xin, y1 + tinx*deltay)); - } - else - { - line.Add(new PointF(x1 + tiny*deltax, yin)); - } + line.Add(tinx > tiny ? new PointF(xin, y1 + tinx*deltay) : new PointF(x1 + tiny*deltax, yin)); } if (1 > tout) { - if (toutx < touty) - { - line.Add(new PointF(xout, y1 + toutx*deltay)); - } - else - { - line.Add(new PointF(x1 + touty*deltax, yout)); - } + line.Add(toutx < touty ? new PointF(xout, y1 + toutx*deltay) : new PointF(x1 + touty*deltax, yout)); } else { @@ -541,14 +513,7 @@ } else { - if (tinx > tiny) - { - line.Add(new PointF(xin, yout)); - } - else - { - line.Add(new PointF(xout, yin)); - } + line.Add(tinx > tiny ? new PointF(xin, yout) : new PointF(xout, yin)); } } } Index: src/Common/SharpMap/Web/Wms/Client.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/Common/SharpMap/Web/Wms/Client.cs (.../Client.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/Common/SharpMap/Web/Wms/Client.cs (.../Client.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -98,14 +98,7 @@ } nsmgr.AddNamespace(String.Empty, "http://www.opengis.net/wms"); - if (WmsVersion == "1.3.0") - { - nsmgr.AddNamespace("sm", "http://www.opengis.net/wms"); - } - else - { - nsmgr.AddNamespace("sm", ""); - } + nsmgr.AddNamespace("sm", WmsVersion == "1.3.0" ? "http://www.opengis.net/wms" : ""); nsmgr.AddNamespace("xlink", "http://www.w3.org/1999/xlink"); nsmgr.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); } Index: src/DeltaShell/DeltaShell.Gui/Forms/PropertyGrid/PropertyGrid.cs =================================================================== diff -u -r61b1261865cc635e69783ed210f1b22d08da0a25 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/DeltaShell/DeltaShell.Gui/Forms/PropertyGrid/PropertyGrid.cs (.../PropertyGrid.cs) (revision 61b1261865cc635e69783ed210f1b22d08da0a25) +++ src/DeltaShell/DeltaShell.Gui/Forms/PropertyGrid/PropertyGrid.cs (.../PropertyGrid.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -193,15 +193,7 @@ { objects.Add(obj.Current); } - if (objects.Count > 0) - { - SelectedObjects = objects.ToArray(); - } - else - { - // If this was an empty list, set the property grid to null - SelectedObjects = null; - } + SelectedObjects = objects.Count > 0 ? objects.ToArray() : null; // If this was an empty list, set the property grid to null } else { Index: src/DeltaShell/DeltaShell.Gui/Forms/SplashScreen.xaml.cs =================================================================== diff -u -r3e905c4e56df168cc8fe333589e2d5420a600f04 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/DeltaShell/DeltaShell.Gui/Forms/SplashScreen.xaml.cs (.../SplashScreen.xaml.cs) (revision 3e905c4e56df168cc8fe333589e2d5420a600f04) +++ src/DeltaShell/DeltaShell.Gui/Forms/SplashScreen.xaml.cs (.../SplashScreen.xaml.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -208,14 +208,7 @@ ProgressBarValue = newInfo.ProgressValue; ProgressBarText = newInfo.ProgressText; - if (newInfo.Message != "") - { - labelProgressMessage.Content = newInfo.Message; - } - else - { - labelProgressMessage.Content = lastProgressMessage; - } + labelProgressMessage.Content = newInfo.Message != "" ? newInfo.Message : lastProgressMessage; } private void SplashScreen_VisibleChanged(object sender, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapTreeViewNodePresenter.cs =================================================================== diff -u -r5fc71a385897af92ccb092f2f969b5709afab85a -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapTreeViewNodePresenter.cs (.../MapTreeViewNodePresenter.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis.Gui/Forms/MapLegendView/MapTreeViewNodePresenter.cs (.../MapTreeViewNodePresenter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -85,14 +85,7 @@ var layer = (ILayer) item; bool removed; - if (sourceLayerGroup != null) - { - removed = sourceLayerGroup.Layers.Remove(layer); - } - else - { - removed = target.Layers.Remove(layer); // only changing position of layer within map - } + removed = sourceLayerGroup != null ? sourceLayerGroup.Layers.Remove(layer) : target.Layers.Remove(layer); if (removed) { @@ -116,14 +109,7 @@ private static void SetNodeText(ITreeNode node, Map map) { - if (map.CoordinateSystem != null) - { - node.Text = string.Format("{0} ({1})", map.Name, map.CoordinateSystem.Name); - } - else - { - node.Text = map.Name; - } + node.Text = map.CoordinateSystem != null ? string.Format("{0} ({1})", map.Name, map.CoordinateSystem.Name) : map.Name; } } } \ No newline at end of file Index: src/DeltaShell/DeltaShell.Plugins.SharpMapGis/HibernateMappings/StyleTypeConverter.cs =================================================================== diff -u -ra0b4632c9d4f89335cbb7e0de45e525481586392 -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- src/DeltaShell/DeltaShell.Plugins.SharpMapGis/HibernateMappings/StyleTypeConverter.cs (.../StyleTypeConverter.cs) (revision a0b4632c9d4f89335cbb7e0de45e525481586392) +++ src/DeltaShell/DeltaShell.Plugins.SharpMapGis/HibernateMappings/StyleTypeConverter.cs (.../StyleTypeConverter.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -46,14 +46,7 @@ // See what kind of style this is string styleType = csd.GetPropertyValue("display-style"); - if (styleType == "label") - { - style = GetLabelStyle(csd); - } - else - { - style = GetVectorStyle(csd); - } + style = styleType == "label" ? GetLabelStyle(csd) : GetVectorStyle(csd); // Generic style properties assignment GetGeneralProperties(csd, style); Index: test/Common/DelftTools.TestUtils/TestHelper.cs =================================================================== diff -u -rfbe5d1ac043ae74461b82b0ab71c5388bfbbc58b -r98a7464aa2f9a8163979b8a9d5ac617e412ba3a0 --- test/Common/DelftTools.TestUtils/TestHelper.cs (.../TestHelper.cs) (revision fbe5d1ac043ae74461b82b0ab71c5388bfbbc58b) +++ test/Common/DelftTools.TestUtils/TestHelper.cs (.../TestHelper.cs) (revision 98a7464aa2f9a8163979b8a9d5ac617e412ba3a0) @@ -565,15 +565,7 @@ } // 25% is the best result GREEN, less or greater than goes to yellow - double localValue; - if (fraction >= 0.25) - { - localValue = Math.Min(1, (fraction - 0.25)/0.75); - } - else - { - localValue = Math.Max(0, (0.25 - fraction)/0.25); - } + var localValue = fraction >= 0.25 ? Math.Min(1, (fraction - 0.25)/0.75) : Math.Max(0, (0.25 - fraction)/0.25); return colors[(int) (localValue*100.0)]; }