35 lines
780 B
C#
35 lines
780 B
C#
|
using System;
|
||
|
using BITKit;
|
||
|
using Godot;
|
||
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
|
||
|
namespace BITFactory;
|
||
|
|
||
|
public partial class SearchRegister:Node
|
||
|
{
|
||
|
[Export] private LineEdit keyLine;
|
||
|
[Export] private LineEdit valueLine;
|
||
|
[Export] private LineEdit nameLine;
|
||
|
[Export] private LineEdit idLine;
|
||
|
[Export] private LineEdit registryRecordLine;
|
||
|
[Export] private Button registryButton;
|
||
|
public override void _Ready()
|
||
|
{
|
||
|
registryButton.Pressed += Create;
|
||
|
}
|
||
|
|
||
|
private void Create()
|
||
|
{
|
||
|
var result = new SearchResult()
|
||
|
{
|
||
|
Key = keyLine.Text,
|
||
|
Value = valueLine.Text,
|
||
|
Display = nameLine.Text,
|
||
|
Id = idLine.Text,
|
||
|
RegistryRecord = registryRecordLine.Text,
|
||
|
CreateDate = DateTime.Now,
|
||
|
UpdateDate = DateTime.Now,
|
||
|
};
|
||
|
DI.Get<ISearchEngine>().Add(result);
|
||
|
}
|
||
|
}
|