-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommom.cs
129 lines (124 loc) · 5.24 KB
/
Commom.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
using System;
using System.Drawing;
namespace UChat
{
/// <summary>
/// CommonFoundations,存放全局变量的地方。
/// </summary>
public static class CommonFoundations
{
public static string xml_FilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat/Contact.xml";
public static string HostUsers_FilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat/HostUsers.xml";
public static string Directory_Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat";
public static string History_Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat/History";
public static string QuickSignIn_Path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat/Flag.qsi";
/// <summary>
/// 带多一个斜杠的聊天历史记录路径。
/// </summary>
public static string history_Path_Slash = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/UChat/History/";
public static string HostName = "";
public static string HostUID = "";
/// <summary>
/// 正在聊天的UID。
/// </summary>
public static string RemoteUID = "";
/// <summary>
/// 正在聊天的名字。
/// </summary>
public static string RemoteName = "";
/// <summary>
/// 正在聊天的IP。
/// </summary>
public static string RemoteIP = "";
public static bool fileExist = false;
public static Color MainBlue = Color.FromArgb(0, 125, 236);
public static Color MainBlack = Color.FromArgb(25, 25, 25);
public static Color DarkBlue = Color.FromArgb(26, 33, 42);
public static Color LightGray = Color.FromArgb(81, 83, 85);
public static Color Orange = Color.FromArgb(255, 128, 0);
public static Color YourTextColor = MainBlue;
public static Color MyTextColor = Color.White;
/// <summary>
/// 文件传输的缓存变量。
/// </summary>
public class FileTransferTempData
{
/// <summary>
/// 一键重设缓存数据。
/// </summary>
public static void ResetFTRTempData()
{
FRSourcePath = "";
FRSourceIP = "";
FRDestinationFolder = "";
FRDestinationIP = "";
FileFullName = "";
FlieTransferAcceptLock = false;
FileLengthBytes = 0;
FTRTimeOut = 179;
FTRPercentage = 0;
FTRPercentage2 = 0;
CancelFTR = false;
TotalBlocks = 0;
CurrentBlocks = 0;
PassBlocks = 0;
}
/// <summary>
/// 发起文件传输请求的文件路径。包括路径,文件名,扩展名。
/// </summary>
public static string FRSourcePath = "";
/// <summary>
/// 发起文件传输请求的源 IP。
/// </summary>
public static string FRSourceIP = "";
/// <summary>
/// 文件传输请求的目的文件夹。
/// </summary>
public static string FRDestinationFolder = "";
/// <summary>
/// 文件传输请求的目的 IP。
/// </summary>
public static string FRDestinationIP = "";
/// <summary>
/// 文件传输锁,确保同一时刻只能存在一个文件传输进程。当这个值为 true 时,将自动拒绝后续一切文件传输请求。
/// </summary>
public static bool FlieTransferAcceptLock = false;
/// <summary>
/// 对面想要传输的文件全名,包括扩展名,不是路径。
/// </summary>
public static string FileFullName = "";
/// <summary>
/// 对面想要传输的文件长度。
/// </summary>
public static long FileLengthBytes = 0;
/// <summary>
/// 文件传输请求超时计数器。
/// </summary>
public static int FTRTimeOut = 179;
/// <summary>
/// 文件传输任务的百分比。这是一个小于 1 的浮点数,用于进度条时需要乘以 100.
/// </summary>
public static double FTRPercentage = 0;
/// <summary>
/// 文件传输任务的百分比。
/// </summary>
public static int FTRPercentage2 = 0;
/// <summary>
/// 指示是否要中断文件传输进程。
/// </summary>
public static bool CancelFTR = false;
/// <summary>
/// 指示文件传输总块数。
/// </summary>
public static long TotalBlocks = 0;
/// <summary>
/// 指示文件传输当前块数。
/// </summary>
public static long CurrentBlocks = 0;
/// <summary>
/// 指示文件传输上一次块数。
/// </summary>
public static long PassBlocks = 0;
}
}
}