Skip to content

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmairegger committed Nov 9, 2017
1 parent abe45a3 commit cdf44e7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 47 deletions.
5 changes: 1 addition & 4 deletions Mairegger.Printing/Content/BlankLine.cs
Expand Up @@ -30,9 +30,6 @@ internal BlankLine(double height)
_height = height;
}

public UIElement Content
{
get { return new FrameworkElement { Height = _height }; }
}
public UIElement Content => new FrameworkElement { Height = _height };
}
}
5 changes: 1 addition & 4 deletions Mairegger.Printing/Content/PageBreak.cs
Expand Up @@ -27,9 +27,6 @@ private PageBreak()

public static IPrintContent Instance => LazyInstance.Value;

UIElement IPrintContent.Content
{
get { throw new InvalidOperationException("There is no available content."); }
}
UIElement IPrintContent.Content => throw new InvalidOperationException("There is no available content.");
}
}
7 changes: 1 addition & 6 deletions Mairegger.Printing/Content/PrintDocumentBackground.cs
Expand Up @@ -23,13 +23,8 @@ public sealed class PrintDocumentBackground
{
public PrintDocumentBackground([NotNull] Panel panel, Rect size = new Rect())
{
if (panel == null)
{
throw new ArgumentNullException(nameof(panel));
}

Element = panel ?? throw new ArgumentNullException(nameof(panel));
Size = size;
Element = panel;
}

public Panel Element { get; }
Expand Down
4 changes: 1 addition & 3 deletions Mairegger.Printing/Internal/InternalPrintProcessor.cs
Expand Up @@ -393,9 +393,7 @@ private PageHelper CreateNewPageHelper()
_printProcessor.CurrentPage++;
_printProcessor.OnPageBreak();

Brush borderBrush;
double gridTableHeight;
var table = _printProcessor.GetTable(out gridTableHeight, out borderBrush);
var table = _printProcessor.GetTable(out var gridTableHeight, out var borderBrush);

var itemsControl = new ItemsControl();

Expand Down
46 changes: 20 additions & 26 deletions Mairegger.Printing/Internal/PrintDialogWrapper.cs
Expand Up @@ -26,66 +26,60 @@ internal class PrintDialogWrapper : IPrintDialog

public bool CurrentPageEnabled
{
get { return _printDialog.CurrentPageEnabled; }
set { _printDialog.CurrentPageEnabled = value; }
get => _printDialog.CurrentPageEnabled;
set => _printDialog.CurrentPageEnabled = value;
}

public int MaxPage
{
get { return (int)_printDialog.MaxPage; }
set { _printDialog.MaxPage = (uint)value; }
get => (int)_printDialog.MaxPage;
set => _printDialog.MaxPage = (uint)value;
}

public int MinPage
{
get { return (int)_printDialog.MinPage; }
set { _printDialog.MinPage = (uint)value; }
get => (int)_printDialog.MinPage;
set => _printDialog.MinPage = (uint)value;
}

public PageRange PageRange
{
get { return _printDialog.PageRange; }
set { _printDialog.PageRange = value; }
get => _printDialog.PageRange;
set => _printDialog.PageRange = value;
}

public PageRangeSelection PageRangeSelection
{
get { return _printDialog.PageRangeSelection; }
set { _printDialog.PageRangeSelection = value; }
get => _printDialog.PageRangeSelection;
set => _printDialog.PageRangeSelection = value;
}

public double PrintableAreaHeight
{
get { return _printDialog.PrintableAreaHeight; }
}
public double PrintableAreaHeight => _printDialog.PrintableAreaHeight;

public double PrintableAreaWidth
{
get { return _printDialog.PrintableAreaWidth; }
}
public double PrintableAreaWidth => _printDialog.PrintableAreaWidth;

public PrintQueue PrintQueue
{
get { return _printDialog.PrintQueue; }
set { _printDialog.PrintQueue = value; }
get => _printDialog.PrintQueue;
set => _printDialog.PrintQueue = value;
}

public PrintTicket PrintTicket
{
get { return _printDialog.PrintTicket; }
set { _printDialog.PrintTicket = value; }
get => _printDialog.PrintTicket;
set => _printDialog.PrintTicket = value;
}

public bool SelectedPagesEnabled
{
get { return _printDialog.SelectedPagesEnabled; }
set { _printDialog.SelectedPagesEnabled = value; }
get => _printDialog.SelectedPagesEnabled;
set => _printDialog.SelectedPagesEnabled = value;
}

public bool UserPageRangeEnabled
{
get { return _printDialog.UserPageRangeEnabled; }
set { _printDialog.UserPageRangeEnabled = value; }
get => _printDialog.UserPageRangeEnabled;
set => _printDialog.UserPageRangeEnabled = value;
}

public void PrintDocument(DocumentPaginator documentPaginator, string description)
Expand Down
4 changes: 2 additions & 2 deletions Mairegger.Printing/Internal/WindowsProvider.cs
Expand Up @@ -25,8 +25,8 @@ internal class WindowsProvider : IWindowProvider

public event EventHandler Closed
{
add { _window.Closed += value; }
remove { _window.Closed -= value; }
add => _window.Closed += value;
remove => _window.Closed -= value;
}

public void Show(string windowTitle, DocumentViewer documentViewer)
Expand Down
4 changes: 2 additions & 2 deletions Mairegger.Printing/PrintProcessor/PrintProcessorCollection.cs
Expand Up @@ -60,8 +60,8 @@ public PrintProcessorCollection([NotNull] IList<PrintProcessor> coll, string fil

public string FileName
{
get { return _fileName; }
set { _fileName = PrintProcessor.ReplaceInvalidCharsFromFilename(value); }
get => _fileName;
set => _fileName = PrintProcessor.ReplaceInvalidCharsFromFilename(value);
}

/// <summary>
Expand Down

0 comments on commit cdf44e7

Please sign in to comment.