Compare commits
No commits in common. "master" and "Linux_VS_Code" have entirely different histories.
master
...
Linux_VS_C
2 changed files with 0 additions and 45 deletions
|
|
@ -10,8 +10,6 @@ namespace NotesDataAnalyst
|
|||
private PointF _initialNodePosition; // Õðàíèò íà÷àëüíóþ ïîçèöèþ íîäû
|
||||
private PointF _initialTouchPosition; // Õðàíèò íà÷àëüíóþ ïîçèöèþ êàñàíèÿ
|
||||
private SizeF _initialNodeSize; // Õðàíèò íà÷àëüíûé ðàçìåð íîäû
|
||||
private DateTime tapStartTime;
|
||||
private const int longPressDuration = 3000; // 3 ñåêóíäû â ìèëëèñåêóíäàõ
|
||||
|
||||
private readonly List<GraphNode> _nodes = new();
|
||||
private readonly List<GraphConnection> _connections = new();
|
||||
|
|
@ -36,48 +34,6 @@ namespace NotesDataAnalyst
|
|||
var tapGesture = new TapGestureRecognizer();
|
||||
tapGesture.Tapped += OnCanvasTapped;
|
||||
canvasView.GestureRecognizers.Add(tapGesture);
|
||||
|
||||
var tapGestureRecognizer = new TapGestureRecognizer();
|
||||
tapGestureRecognizer.Tapped += OnTapped;
|
||||
canvasView.GestureRecognizers.Add(tapGestureRecognizer);
|
||||
}
|
||||
|
||||
|
||||
private void OnTapped(object sender, EventArgs e)
|
||||
{
|
||||
tapStartTime = DateTime.Now;
|
||||
|
||||
Device.StartTimer(TimeSpan.FromMilliseconds(longPressDuration), () =>
|
||||
{
|
||||
if ((DateTime.Now - tapStartTime).TotalMilliseconds >= longPressDuration)
|
||||
{
|
||||
// Çäåñü âûïîëíÿåòñÿ äåéñòâèå ïðè äëèòåëüíîì íàæàòèè
|
||||
OnNodeLongPressed();
|
||||
}
|
||||
return false; // Îñòàíàâëèâàåì òàéìåð
|
||||
});
|
||||
}
|
||||
|
||||
private void OnNodeLongPressed()
|
||||
{
|
||||
if (_selectedNode != null)
|
||||
{
|
||||
// Äîáàâëÿåì äî÷åðíþþ íîäó ðÿäîì ñ àêòèâíîé
|
||||
var childNode = new GraphNode
|
||||
{
|
||||
Text = "Äî÷åðíÿÿ íîäà",
|
||||
Position = new Point(_selectedNode.Position.X + 50, _selectedNode.Position.Y + 50),
|
||||
Size = new Size(150, 100)
|
||||
};
|
||||
|
||||
_nodes.Add(childNode);
|
||||
_connections.Add(new GraphConnection { FromNode = _selectedNode, ToNode = childNode });
|
||||
|
||||
canvasView.Invalidate(); // Ïåðåðèñîâûâàåì
|
||||
}
|
||||
|
||||
// Çäåñü ðåàëèçóéòå äåéñòâèå ïðè äëèòåëüíîì íàæàòèè
|
||||
// DisplayAlert("Äëèòåëüíîå íàæàòèå", "Âû íàæàëè è óäåðæèâàëè ýëåìåíò", "ÎÊ");
|
||||
}
|
||||
|
||||
private void OnNodeTapped(object sender, TappedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using CommunityToolkit.Maui;
|
|||
|
||||
namespace NotesDataAnalyst
|
||||
{
|
||||
//Пиздец!
|
||||
public static class MauiProgram
|
||||
{
|
||||
public static MauiApp CreateMauiApp()
|
||||
|
|
|
|||
Loading…
Reference in a new issue