From 435935691a099f84490ce160c23b97abdfb2c79d Mon Sep 17 00:00:00 2001 From: Markus Ewald Date: Fri, 1 Feb 2019 20:06:36 +0000 Subject: [PATCH] Updated copyright statement and pasted it where it was missing; some cosmetic fixes git-svn-id: file:///srv/devel/repo-conversion/nuwi@40 d2e56fa2-650e-0410-a79f-9358c0239efd --- .../AsyncProgressBar.Designer.cs | 20 +++++++++++ .../AsyncProgressBar/AsyncProgressBar.Test.cs | 2 +- Source/AsyncProgressBar/AsyncProgressBar.cs | 30 ++++++++++++---- .../ContainerListView.Designer.cs | 2 +- .../ContainerListView.Test.cs | 2 +- Source/ContainerListView/ContainerListView.cs | 19 ++++++---- .../ListViewEmbeddedControl.cs | 2 +- .../ProgressReporterForm.Designer.cs | 20 +++++++++++ .../ProgressReporter/ProgressReporterForm.cs | 35 ++++++++++++++----- Source/TrackingBar/ToolStripTrackingBar.cs | 26 ++++++++++++-- Source/TrackingBar/TrackingBar.Designer.cs | 2 +- Source/TrackingBar/TrackingBar.cs | 2 +- 12 files changed, 132 insertions(+), 30 deletions(-) diff --git a/Source/AsyncProgressBar/AsyncProgressBar.Designer.cs b/Source/AsyncProgressBar/AsyncProgressBar.Designer.cs index 76d4688..12904bc 100644 --- a/Source/AsyncProgressBar/AsyncProgressBar.Designer.cs +++ b/Source/AsyncProgressBar/AsyncProgressBar.Designer.cs @@ -1,3 +1,23 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2019 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + namespace Nuclex.Windows.Forms { partial class AsyncProgressBar { diff --git a/Source/AsyncProgressBar/AsyncProgressBar.Test.cs b/Source/AsyncProgressBar/AsyncProgressBar.Test.cs index f39ac27..0995923 100644 --- a/Source/AsyncProgressBar/AsyncProgressBar.Test.cs +++ b/Source/AsyncProgressBar/AsyncProgressBar.Test.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2009 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as diff --git a/Source/AsyncProgressBar/AsyncProgressBar.cs b/Source/AsyncProgressBar/AsyncProgressBar.cs index a285376..e3b8fdf 100644 --- a/Source/AsyncProgressBar/AsyncProgressBar.cs +++ b/Source/AsyncProgressBar/AsyncProgressBar.cs @@ -1,11 +1,26 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2019 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; using System.Threading; +using System.Windows.Forms; namespace Nuclex.Windows.Forms { @@ -82,8 +97,9 @@ namespace Nuclex.Windows.Forms { // begin the next update - since we know that the value the UI thread has extracted // is no longer the most recent one. if(oldValue == -1.0f) { - if(this.progressUpdateAsyncResult != null) + if(this.progressUpdateAsyncResult != null) { EndInvoke(this.progressUpdateAsyncResult); + } this.progressUpdateAsyncResult = BeginInvoke(this.updateProgressDelegate); } diff --git a/Source/ContainerListView/ContainerListView.Designer.cs b/Source/ContainerListView/ContainerListView.Designer.cs index dfee615..a39e339 100644 --- a/Source/ContainerListView/ContainerListView.Designer.cs +++ b/Source/ContainerListView/ContainerListView.Designer.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2007 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as diff --git a/Source/ContainerListView/ContainerListView.Test.cs b/Source/ContainerListView/ContainerListView.Test.cs index a5375d1..6867ff0 100644 --- a/Source/ContainerListView/ContainerListView.Test.cs +++ b/Source/ContainerListView/ContainerListView.Test.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2009 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as diff --git a/Source/ContainerListView/ContainerListView.cs b/Source/ContainerListView/ContainerListView.cs index fb696bb..efb14da 100644 --- a/Source/ContainerListView/ContainerListView.cs +++ b/Source/ContainerListView/ContainerListView.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2007 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as @@ -116,11 +116,13 @@ namespace Nuclex.Windows.Forms { /// protected Rectangle GetSubItemBounds(ListViewItem item, int subItem) { int[] order = GetColumnOrder(); - if(order == null) // No Columns + if(order == null) { // No Columns return Rectangle.Empty; + } - if(subItem >= order.Length) + if(subItem >= order.Length) { throw new IndexOutOfRangeException("SubItem " + subItem + " out of range"); + } // Determine the border of the entire ListViewItem, including all sub items Rectangle itemBounds = item.GetBounds(ItemBoundsPortion.Entire); @@ -132,8 +134,9 @@ namespace Nuclex.Windows.Forms { int i; for(i = 0; i < order.Length; ++i) { columnHeader = this.Columns[order[i]]; - if(columnHeader.Index == subItem) + if(columnHeader.Index == subItem) { break; + } subItemX += columnHeader.Width; } @@ -209,8 +212,9 @@ namespace Nuclex.Windows.Forms { foreach(ListViewEmbeddedControl embeddedControl in this.embeddedControls) { if(ReferenceEquals(embeddedControl.Control, sender)) { - if((embeddedControl.Row > 0) && (embeddedControl.Row < Items.Count)) + if((embeddedControl.Row > 0) && (embeddedControl.Row < Items.Count)) { Items[embeddedControl.Row].Selected = true; + } } } } @@ -224,8 +228,9 @@ namespace Nuclex.Windows.Forms { private int[] GetColumnOrder() { int[] order = new int[this.Columns.Count]; - for(int i = 0; i < this.Columns.Count; ++i) - order[this.Columns[i].DisplayIndex] = i; + for(int index = 0; index < this.Columns.Count; ++index) { + order[this.Columns[index].DisplayIndex] = index; + } return order; } diff --git a/Source/ContainerListView/ListViewEmbeddedControl.cs b/Source/ContainerListView/ListViewEmbeddedControl.cs index 072d52e..1d0536b 100644 --- a/Source/ContainerListView/ListViewEmbeddedControl.cs +++ b/Source/ContainerListView/ListViewEmbeddedControl.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2007 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as diff --git a/Source/ProgressReporter/ProgressReporterForm.Designer.cs b/Source/ProgressReporter/ProgressReporterForm.Designer.cs index be41daa..7a8d2d6 100644 --- a/Source/ProgressReporter/ProgressReporterForm.Designer.cs +++ b/Source/ProgressReporter/ProgressReporterForm.Designer.cs @@ -1,3 +1,23 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2019 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + namespace Nuclex.Windows.Forms { partial class ProgressReporterForm { /// diff --git a/Source/ProgressReporter/ProgressReporterForm.cs b/Source/ProgressReporter/ProgressReporterForm.cs index d67980f..f3749c8 100644 --- a/Source/ProgressReporter/ProgressReporterForm.cs +++ b/Source/ProgressReporter/ProgressReporterForm.cs @@ -1,11 +1,27 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2019 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; using System.Threading; +using System.Windows.Forms; using Nuclex.Support.Scheduling; using Nuclex.Support.Tracking; @@ -73,8 +89,9 @@ namespace Nuclex.Windows.Forms { // process has already ended. This is an accepted race condition: If the process // finishes right after this line, it doesn't change the outcome, it just // causes the progress dialog to be constructed needlessly. - if(transaction.Ended) + if(transaction.Ended) { return; + } // Open the form and let it monitor the transaction's state using(ProgressReporterForm theForm = new ProgressReporterForm()) { @@ -107,8 +124,9 @@ namespace Nuclex.Windows.Forms { private void track(string windowTitle, Transaction transaction) { // Set the window title if the user wants to use a custom one - if(windowTitle != null) + if(windowTitle != null) { Text = windowTitle; + } // Only enable the cancel button if the transaction can be aborted this.abortReceiver = (transaction as IAbortable); @@ -124,8 +142,9 @@ namespace Nuclex.Windows.Forms { // callback to be called immediately and synchronously! transaction.AsyncEnded += this.asyncEndedDelegate; IProgressReporter progressReporter = transaction as IProgressReporter; - if(progressReporter != null) + if(progressReporter != null) { progressReporter.AsyncProgressChanged += this.asyncProgressChangedDelegate; + } // The transaction might have ended before this line was reached, if that's // the case, we don't show the dialog at all. diff --git a/Source/TrackingBar/ToolStripTrackingBar.cs b/Source/TrackingBar/ToolStripTrackingBar.cs index 42ab6c9..f13d5a9 100644 --- a/Source/TrackingBar/ToolStripTrackingBar.cs +++ b/Source/TrackingBar/ToolStripTrackingBar.cs @@ -1,3 +1,23 @@ +#region CPL License +/* +Nuclex Framework +Copyright (C) 2002-2019 Nuclex Development Labs + +This library is free software; you can redistribute it and/or +modify it under the terms of the IBM Common Public License as +published by the IBM Corporation; either version 1.0 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +IBM Common Public License for more details. + +You should have received a copy of the IBM Common Public +License along with this library +*/ +#endregion + using System; using System.ComponentModel; using System.Drawing; @@ -53,8 +73,9 @@ namespace Nuclex.Windows.Forms { /// Default margin to leave around the control in the tool strip protected override Padding DefaultMargin { get { - if((base.Owner != null) && (base.Owner is StatusStrip)) + if((base.Owner != null) && (base.Owner is StatusStrip)) { return new Padding(1, 3, 1, 3); + } return new Padding(1, 2, 1, 1); } @@ -73,8 +94,9 @@ namespace Nuclex.Windows.Forms { TrackingBarControl.VisibleChanged += new EventHandler(trackingBarVisibleChanged); LicenseUsageMode usageMode = System.ComponentModel.LicenseManager.UsageMode; - if(usageMode == LicenseUsageMode.Runtime) + if(usageMode == LicenseUsageMode.Runtime) { base.Visible = false; + } } /// diff --git a/Source/TrackingBar/TrackingBar.Designer.cs b/Source/TrackingBar/TrackingBar.Designer.cs index a2a146a..4a03fe1 100644 --- a/Source/TrackingBar/TrackingBar.Designer.cs +++ b/Source/TrackingBar/TrackingBar.Designer.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2007 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as diff --git a/Source/TrackingBar/TrackingBar.cs b/Source/TrackingBar/TrackingBar.cs index 5b1f18b..18c4d0a 100644 --- a/Source/TrackingBar/TrackingBar.cs +++ b/Source/TrackingBar/TrackingBar.cs @@ -1,7 +1,7 @@ #region CPL License /* Nuclex Framework -Copyright (C) 2002-2007 Nuclex Development Labs +Copyright (C) 2002-2019 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as