Добавьте файлы проекта.
This commit is contained in:
30
CairoObjective/Set.cs
Normal file
30
CairoObjective/Set.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace CairoObjective
|
||||
{
|
||||
public static class Set
|
||||
{
|
||||
public static void CheckContext()
|
||||
{
|
||||
if (Context == null)
|
||||
{
|
||||
throw new NullReferenceException("Context is Null. Set context on Set class.");
|
||||
}
|
||||
}
|
||||
public static Cairo.Context? Context;
|
||||
public static Cairo.Color Color = new Cairo.Color(1,1,1);//White
|
||||
#pragma warning disable CS8602 // Разыменование вероятной пустой ссылки.
|
||||
public static void Background(Cairo.Color color)
|
||||
{
|
||||
CheckContext();
|
||||
var context = Set.Context;
|
||||
context.SetSourceColor(color);
|
||||
context.Paint();
|
||||
}
|
||||
public static void Background()
|
||||
{
|
||||
CheckContext();
|
||||
var context = Set.Context;
|
||||
context.SetSourceColor(Color);
|
||||
context.Paint();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user