Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd290c0e

Browse files
committed
undo
1 parent498a3ad commitd290c0e

File tree

3 files changed

+310
-313
lines changed

3 files changed

+310
-313
lines changed
Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
usingSystem;
2-
usingWindows.UI;
3-
usingCoder.Desktop.App.ViewModels;
4-
usingMicrosoft.UI.Xaml.Data;
5-
usingMicrosoft.UI.Xaml.Media;
6-
7-
namespaceCoder.Desktop.App.Converters;
8-
9-
publicclassAgentStatusToColorConverter:IValueConverter
10-
{
11-
privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89));
12-
privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48));
13-
privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147));
14-
privatestaticreadonlySolidColorBrushYellow=new(Color.FromArgb(255,204,1,0));
15-
16-
publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage)
17-
{
18-
if(valueis notAgentConnectionStatusstatus)returnGray;
19-
20-
returnstatusswitch
21-
{
22-
AgentConnectionStatus.Green=>Green,
23-
AgentConnectionStatus.Red=>Red,
24-
AgentConnectionStatus.Yellow=>Yellow,
25-
_=>Gray,
26-
};
27-
}
28-
29-
publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage)
30-
{
31-
thrownewNotImplementedException();
32-
}
33-
}
1+
usingSystem;
2+
usingWindows.UI;
3+
usingCoder.Desktop.App.ViewModels;
4+
usingMicrosoft.UI.Xaml.Data;
5+
usingMicrosoft.UI.Xaml.Media;
6+
7+
namespaceCoder.Desktop.App.Converters;
8+
9+
publicclassAgentStatusToColorConverter:IValueConverter
10+
{
11+
privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89));
12+
privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48));
13+
privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147));
14+
15+
publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage)
16+
{
17+
if(valueis notAgentConnectionStatusstatus)returnGray;
18+
19+
returnstatusswitch
20+
{
21+
AgentConnectionStatus.Green=>Green,
22+
AgentConnectionStatus.Red=>Red,
23+
_=>Gray,
24+
};
25+
}
26+
27+
publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage)
28+
{
29+
thrownewNotImplementedException();
30+
}
31+
}

‎App/ViewModels/AgentViewModel.cs

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
1-
usingWindows.ApplicationModel.DataTransfer;
2-
usingCommunityToolkit.Mvvm.Input;
3-
usingMicrosoft.UI.Xaml;
4-
usingMicrosoft.UI.Xaml.Controls;
5-
usingMicrosoft.UI.Xaml.Controls.Primitives;
6-
7-
namespaceCoder.Desktop.App.ViewModels;
8-
9-
publicenumAgentConnectionStatus
10-
{
11-
Green,
12-
Red,
13-
Yellow,
14-
Gray,
15-
}
16-
17-
publicpartialclassAgentViewModel
18-
{
19-
publicrequiredstringHostname{get;set;}
20-
21-
publicrequiredstringHostnameSuffix{get;set;}// including leading dot
22-
23-
publicrequiredAgentConnectionStatusConnectionStatus{get;set;}
24-
25-
publicstringFullHostname=>Hostname+HostnameSuffix;
26-
27-
publicrequiredstringDashboardUrl{get;set;}
28-
29-
[RelayCommand]
30-
privatevoidCopyHostname(objectparameter)
31-
{
32-
vardataPackage=newDataPackage
33-
{
34-
RequestedOperation=DataPackageOperation.Copy,
35-
};
36-
dataPackage.SetText(FullHostname);
37-
Clipboard.SetContent(dataPackage);
38-
39-
if(parameteris notFrameworkElementframeworkElement)return;
40-
41-
varflyout=newFlyout
42-
{
43-
Content=newTextBlock
44-
{
45-
Text="DNS Copied",
46-
Margin=newThickness(4),
47-
},
48-
};
49-
FlyoutBase.SetAttachedFlyout(frameworkElement,flyout);
50-
FlyoutBase.ShowAttachedFlyout(frameworkElement);
51-
}
52-
}
1+
usingWindows.ApplicationModel.DataTransfer;
2+
usingCommunityToolkit.Mvvm.Input;
3+
usingMicrosoft.UI.Xaml;
4+
usingMicrosoft.UI.Xaml.Controls;
5+
usingMicrosoft.UI.Xaml.Controls.Primitives;
6+
7+
namespaceCoder.Desktop.App.ViewModels;
8+
9+
publicenumAgentConnectionStatus
10+
{
11+
Green,
12+
Red,
13+
Gray,
14+
}
15+
16+
publicpartialclassAgentViewModel
17+
{
18+
publicrequiredstringHostname{get;set;}
19+
20+
publicrequiredstringHostnameSuffix{get;set;}// including leading dot
21+
22+
publicrequiredAgentConnectionStatusConnectionStatus{get;set;}
23+
24+
publicstringFullHostname=>Hostname+HostnameSuffix;
25+
26+
publicrequiredstringDashboardUrl{get;set;}
27+
28+
[RelayCommand]
29+
privatevoidCopyHostname(objectparameter)
30+
{
31+
vardataPackage=newDataPackage
32+
{
33+
RequestedOperation=DataPackageOperation.Copy,
34+
};
35+
dataPackage.SetText(FullHostname);
36+
Clipboard.SetContent(dataPackage);
37+
38+
if(parameteris notFrameworkElementframeworkElement)return;
39+
40+
varflyout=newFlyout
41+
{
42+
Content=newTextBlock
43+
{
44+
Text="DNS Copied",
45+
Margin=newThickness(4),
46+
},
47+
};
48+
FlyoutBase.SetAttachedFlyout(frameworkElement,flyout);
49+
FlyoutBase.ShowAttachedFlyout(frameworkElement);
50+
}
51+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp