AppUtility.cs
3.05 KB
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
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace DMSSSOAgent
{
public static class ParameterSettings
{
//私有静态变量
private static string userid = "";
//私有静态变量
private static string username = "";
// 私有静态变量
private static string password = "";
//真实姓名
private static string name = "";
public static string Name
{
get { return ParameterSettings.name; }
set { ParameterSettings.name = value; }
}
private static bool isrelogin = false;
public static string UserID
{
get { return userid; }
set { userid = value; }
}
public static string UserName
{
get { return username; }
set { username = value; }
}
public static string Password
{
get { return password; }
set { password = value; }
}
public static bool IsReLogin
{
get { return isrelogin; }
set { isrelogin = value; }
}
}
/// <summary>
/// 窗口渐时显示隐藏
/// </summary>
public class FormShowHideFx
{
#region 变量
#region dwflag的取值
private const Int32 AW_HOR_POSITIVE = 0x00000001;
//从左到右显示
private const Int32 AW_HOR_NEGATIVE = 0x00000002;
//从右到左显示
private const Int32 AW_VER_POSITIVE = 0x00000004;
//从上到下显示
private const Int32 AW_VER_NEGATIVE = 0x00000008;
//从下到上显示
private const Int32 AW_CENTER = 0x00000010;
//若使用了AW_HIDE标志,则使窗口向内重叠,即收缩窗口;否则使窗口向外扩展,即展开窗口
private const Int32 AW_HIDE = 0x00010000;
//隐藏窗口,缺省则显示窗口
private const Int32 AW_ACTIVATE = 0x00020000;
//激活窗口。在使用了AW_HIDE标志后不能使用这个标志
private const Int32 AW_SLIDE = 0x00040000;
//使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略
private const Int32 AW_BLEND = 0x00080000;
#endregion
#endregion
#region 私有方法
[DllImport("user32")]
private static extern bool AnimateWindow(IntPtr whnd, int dwtime, int dwflag);
#endregion
#region 公开方法
/// <summary>
/// 由中心向边界扩展渐进打开窗口
/// </summary>
public static void ShowFXCenter(IntPtr wnd, int dwtime)
{
AnimateWindow(wnd, dwtime, AW_CENTER | AW_ACTIVATE | AW_SLIDE);
}
/// <summary>
/// 由边界向中心扩展渐进关闭窗口
/// </summary>
public static void HideFXCenter(IntPtr wnd, int dwtime)
{
AnimateWindow(wnd, dwtime, AW_CENTER | AW_HIDE | AW_SLIDE);
}
#endregion
}
}