Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
svn path=/trunk/winforms-tools/; revision=64363
  • Loading branch information
Gert Driesen committed Aug 25, 2006
1 parent 091b31e commit 0f2cd36
Show file tree
Hide file tree
Showing 25 changed files with 2,679 additions and 0 deletions.
44 changes: 44 additions & 0 deletions eventvwr/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// AssemblyInfo.cs
//
// Authors:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2006 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
3 changes: 3 additions & 0 deletions eventvwr/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2006-08-25 Gert Driesen <drieseng@users.sourceforge.net>

* Initial import
91 changes: 91 additions & 0 deletions eventvwr/EventEntryComparer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//
// EventLogEntryComparer.cs
//
// Authors:
// Gert Driesen (drieseng@users.sourceforge.net)
//
// (C) 2006 Novell, Inc (http://www.novell.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.Collections;
using System.Globalization;
using System.Windows.Forms;

namespace Mono.Tools.EventViewer
{
public class EventLogEntryComparer : IComparer
{
private int _column;

public EventLogEntryComparer (int column)
{
_column = column;
}

public int Column
{
get { return _column; }
set { _column = value; }
}

public int Compare (object x, object y)
{
ListViewItem itemX = x as ListViewItem;
ListViewItem itemY = y as ListViewItem;

if (itemX.ListView.Sorting == SortOrder.None)
return 0;

int sortFlag = (itemX.ListView.Sorting == SortOrder.Descending) ? -1 : 1;

if (itemX == null)
return -1 * sortFlag;
if (itemY == null)
return 1 * sortFlag;

int retVal = 0;

switch (_column) {
case 1:
case 2:
DateTime dateX = DateTime.Parse (itemX.SubItems [_column].Text,
CultureInfo.CurrentCulture);
DateTime dateY = DateTime.Parse (itemY.SubItems [_column].Text,
CultureInfo.CurrentCulture);
if (_column == 1)
retVal = DateTime.Compare (dateX, dateY);
else
retVal = TimeSpan.Compare (dateX.TimeOfDay, dateY.TimeOfDay);
break;
default:
retVal = string.Compare (itemX.SubItems [_column].Text,
itemY.SubItems [_column].Text);
break;
}

return retVal * sortFlag;
}

}
}
Loading

0 comments on commit 0f2cd36

Please sign in to comment.