forked from ktvoelker/di
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished a rough implementation of file chooser visuals
- Loading branch information
Showing
12 changed files
with
232 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// | ||
// Event.cs | ||
// | ||
// Author: | ||
// Karl Voelker <[email protected]> | ||
// | ||
// Copyright (c) 2011 Karl Voelker | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program 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 | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
using System; | ||
namespace Di | ||
{ | ||
public abstract class Event<T> | ||
{ | ||
public T Handler | ||
{ | ||
get; | ||
protected set; | ||
} | ||
|
||
public abstract void Add(T f); | ||
|
||
public abstract void Remove(T f); | ||
} | ||
|
||
public class Event0 : Event<Action> | ||
{ | ||
public Event0() | ||
{ | ||
Handler = () => { return; }; | ||
} | ||
|
||
public override void Add(Action f) | ||
{ | ||
Handler += f; | ||
} | ||
|
||
public override void Remove(Action f) | ||
{ | ||
Handler -= f; | ||
} | ||
} | ||
|
||
public class Event1<T> : Event<Action<T>> | ||
{ | ||
public Event1() | ||
{ | ||
Handler = (x) => { return; }; | ||
} | ||
|
||
public override void Add(Action<T> f) | ||
{ | ||
Handler += f; | ||
} | ||
|
||
public override void Remove(Action<T> f) | ||
{ | ||
Handler -= f; | ||
} | ||
} | ||
|
||
public class Event2<T, U> : Event<Action<T, U>> | ||
{ | ||
public Event2() | ||
{ | ||
Handler = (x, y) => { return; }; | ||
} | ||
|
||
public override void Add(Action<T, U> f) | ||
{ | ||
Handler += f; | ||
} | ||
|
||
public override void Remove(Action<T, U> f) | ||
{ | ||
Handler -= f; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.