-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMore.cs
218 lines (197 loc) · 7.76 KB
/
More.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Scrcpy_GUI
{
public partial class More : Form
{
SelectDevices selectDevices = new SelectDevices();
public string device;
public More()
{
InitializeComponent();
}
private void More_FormClosed(object sender, FormClosedEventArgs e)
{
this.Hide();
}
private void OnTop_MouseHover(object sender, EventArgs e) //设置OnTop悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.OnTop, "窗口置顶");
}
private void DisableScreenProtect_MouseHover(object sender, EventArgs e) //设置DisableScreenProtect悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.DisableScreenProtect, "不知道有什么用");
}
private void CutpadSync_MouseHover(object sender, EventArgs e) //设置CutpadSync悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.CutpadSync, "电脑上复制的东西可以粘贴到设备上,反之亦然");
}
private void DisableControl_MouseHover(object sender, EventArgs e) //设置DisableControl悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.DisableControl, "电脑上只显示设备的画面,不可控制");
}
private void StandOn_MouseHover(object sender, EventArgs e) //设置StandOn悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.StandOn, "不让设备自动息屏");
}
private void EnableAudio_MouseHover(object sender, EventArgs e) //设置EnableAudio悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.EnableAudio, "设备的声音将通过电脑播放");
}
private void ScreenOff_MouseHover(object sender, EventArgs e) //设置ScreenOff悬浮提示
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.ScreenOff, "关闭投屏后,设备将会关闭屏幕");
}
private void AlwaysShowToolBar_MouseHover(object sender, EventArgs e)
{
ToolTip toolTip = new ToolTip();
toolTip.AutoPopDelay = 5000;
toolTip.InitialDelay = 500;
toolTip.ReshowDelay = 500;
toolTip.ShowAlways = true;
toolTip.SetToolTip(this.ScreenOff, "默认10秒不移动隐藏工具栏,开启此项以禁用");
}
private void Enter_Click(object sender, EventArgs e)
{
Settings.Default["置顶"] = OnTop.Checked;
Settings.Default["禁用屏幕保护程序"] = DisableScreenProtect.Checked;
Settings.Default["剪切板同步"] = CutpadSync.Checked;
Settings.Default["禁用控制"] = DisableControl.Checked;
Settings.Default["音频流转"] = EnableAudio.Checked;
Settings.Default["结束后关闭屏幕"] = ScreenOff.Checked;
Settings.Default["保持唤醒"] = StandOn.Checked;
Settings.Default["始终显示工具栏"] = AlwaysShowToolBar.Checked;
if (WindowTitle.Text == "")
{
Settings.Default["窗口标题"] = "Untitled";
}
else
{
Settings.Default["窗口标题"] = WindowTitle.Text;
}
if (FileFolder.Text == "")
{
Settings.Default["文件存放目录"] = "/sdcard/Download/";
}
else
{
Settings.Default["文件存放目录"] = FileFolder.Text;
}
Settings.Default.Save();
this.Hide();
selectDevices.Cmd("taskkill /F /IM scrcpy.exe");
selectDevices.Cmd(this.GetType().Assembly.Location + " " + device);
}
private void OnTop_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void DisableScreenProtect_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void CutpadSync_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void DisableControl_CheckedChanged(object sender, EventArgs e)
{
if (DisableControl.Checked)
{
StandOn.Checked = false;
}
Source.Enabled = true;
}
private void EnableAudio_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void ScreenOff_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void StandOn_CheckedChanged(object sender, EventArgs e)
{
if (StandOn.Checked)
{
DisableControl.Checked = false;
}
Source.Enabled = true;
}
private void AlwaysShowToolBar_CheckedChanged(object sender, EventArgs e)
{
Source.Enabled = true;
}
private void WindowTitle_TextChanged(object sender, EventArgs e)
{
label1.Text = WindowTitle.Text;
WindowTitle.Width = label1.Width + 10;
WindowTitle.Left = WindowTitleLabel.Left + WindowTitleLabel.Width / 2 - WindowTitle.Width / 2;
Source.Enabled = true;
}
private void FileFolder_TextChanged(object sender, EventArgs e)
{
label1.Text= FileFolder.Text;
if(FileFolder.Right <= this.ClientRectangle.Right - 30)
{
FileFolder.Width = label1.Width + 10;
}
FileFolder.Left = FileFolderLabel.Left + FileFolderLabel.Width / 2 - FileFolder.Width / 2;
Source.Enabled = true;
}
private void Cancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void WindowTitle_KeyPress(object sender, KeyPressEventArgs e)
{
if (WindowTitle.Left <= this.ClientRectangle.Left + 30)
{
e.Handled = true;
}
}
}
}