-
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.
Begin work on identifier and value combo
- Loading branch information
Showing
5 changed files
with
49 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
namespace FormSystem; | ||
|
||
// Contains a bunch of extension methods | ||
public enum ControlDirection | ||
{ | ||
X, | ||
Y | ||
} | ||
|
||
public static class FormHelper | ||
{ | ||
public static void Center(this Control control, ControlDirection controlDirection) | ||
{ | ||
switch(controlDirection) | ||
{ | ||
case X: | ||
control.Location = new Point((control.Parent!.Width / 2) - (int)0.5*(control.Width), control.Location.Y); | ||
break; | ||
|
||
case Y: | ||
control.Location = new Point(control.Location.X, (control.Parent!.Height / 2) - (int)0.5*(control.Width)); | ||
break; | ||
} | ||
} | ||
|
||
public static void CenterX(this Control control) | ||
{ | ||
control.Location = new Point((control.Parent!.Width / 2) - (int)0.5 * (control.Width), control.Location.Y); | ||
} | ||
public static void CenterY(this Control control) | ||
{ | ||
control.Location = new Point(control.Location.X, (control.Parent!.Height / 2) - (int)0.5 * (control.Width)); | ||
} | ||
} |
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,11 @@ | ||
namespace StateSystem; | ||
|
||
public class State : Dictionary<IEnumerable<StateType>, object?> | ||
{ | ||
public static State From() | ||
{ | ||
return GetGlobalState(); | ||
} | ||
|
||
// Way of storing objects stored with arbitrary strings | ||
} |
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 |
---|---|---|
|
@@ -19,5 +19,8 @@ public enum StateType | |
FLAG_FAILURE, | ||
|
||
FLAG_NONNULL, | ||
FLAG_NULL | ||
FLAG_NULL, | ||
|
||
FLAG_IDENTIFIER, | ||
FLAG_VALUE | ||
} |