本文整理汇总了C#中WS类的典型用法代码示例。如果您正苦于以下问题:C# WS类的具体用法?C# WS怎么用?C# WS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WS类属于命名空间,在下文中一共展示了WS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bst_GetAllBooksCompleted
static void bst_GetAllBooksCompleted(object sender, WS.GetAllBooksCompletedEventArgs e)
{
foreach (var book in e.Result)
{
Console.WriteLine("{0}\t{1}",book.BookName,book.BookPrice);
};
}
示例2: Logout
public bool Logout(string pSession)
{
try
{
WS ws = new WS();
return ws.Logout(pSession);
}
catch (Exception ex)
{
hzyMessage.ErrorMessage = ex.Message;
HZY.COM.Common.Log.WirteLogWS(ex, "");
return false;
}
}
示例3: Login
public string Login(string pAppName, string pCompany, string pEnv, string pLoginEnv, string pUserName, string pPassword)
{
hzyMessage = new HZYmessage();
try
{
WS ws = new WS();
return ws.Login(pEnv, pLoginEnv, pUserName, pPassword);
}
catch (Exception ex)
{
hzyMessage.ErrorMessage = ex.Message;
HZY.COM.Common.Log.WirteLogWS(ex,"");
return "";
}
}
示例4: MessageWindow
public MessageWindow(CS classStyle, WS style, WS_EX exStyle, Rect location, string name, WndProc callback)
{
// A null callback means just use DefWindowProc.
_wndProcCallback = callback;
_className = "MessageWindowClass+" + Guid.NewGuid().ToString();
var wc = new WNDCLASSEX
{
cbSize = Marshal.SizeOf(typeof(WNDCLASSEX)),
style = classStyle,
lpfnWndProc = s_WndProc,
hInstance = NativeMethods.GetModuleHandle(null),
hbrBackground = NativeMethods.GetStockObject(StockObject.NULL_BRUSH),
lpszMenuName = "",
lpszClassName = _className,
};
NativeMethods.RegisterClassEx(ref wc);
GCHandle gcHandle = default(GCHandle);
try
{
gcHandle = GCHandle.Alloc(this);
IntPtr pinnedThisPtr = (IntPtr)gcHandle;
Handle = NativeMethods.CreateWindowEx(
exStyle,
_className,
name,
style,
(int)location.X,
(int)location.Y,
(int)location.Width,
(int)location.Height,
IntPtr.Zero,
IntPtr.Zero,
IntPtr.Zero,
pinnedThisPtr);
}
finally
{
gcHandle.Free();
}
_dispatcher = Dispatcher.CurrentDispatcher;
}
示例5: LookupAllExplicit
public void LookupAllExplicit()
{
var x = new WS();
var y = new DbW();
var z = new DbR();
var w = new UI();
var needs = new Needs();
needs.Set<IWebService>(x);
needs.Set<IDatabaseCommand>(y);
needs.Set<IDatabaseQuery>(z);
needs.Set<IUserInterface>(w);
Expect.Some(z, needs.Get<IDatabaseQuery>());
Expect.Some(y, needs.Get<IDatabaseCommand>());
Expect.Some(w, needs.Get<IUserInterface>());
Expect.Some(x, needs.Get<IWebService>());
}
示例6: Check
private void Check()
{
string strSession_ID, strMenuID;
string strReturn = "";
strSession_ID = Request["SessionID"];
strMenuID = Request["MenuID"];
if (strSession_ID == null || strSession_ID == "")
{
strReturn = "缺少参数:SessionID";
}
else if (strMenuID == null || strMenuID == "")
{
strReturn = "缺少参数:MenuID";
}
else
{
System.Threading.Thread.Sleep(5000);
WS ws = new WS();
strReturn = ws.CheckUser_Authorization(strSession_ID, strMenuID, "", "");
}
if (Request["jsoncallback"] != null)
{
Response.Write(Request["jsoncallback"]);
}
//Response.Write("({\"msg\":\""+strReturn+"\"})");
Response.Write("var msg={msg:\"" + strReturn + "\"};");
//Response.Write(strReturn);
//Response.Write("var ojb = {msg:'js跨域请求成功'};");
Response.End();
}
示例7: _ModifyStyle
/// <summary>Add and remove a native WindowStyle from the HWND.</summary>
/// <param name="removeStyle">The styles to be removed. These can be bitwise combined.</param>
/// <param name="addStyle">The styles to be added. These can be bitwise combined.</param>
/// <returns>Whether the styles of the HWND were modified as a result of this call.</returns>
private bool _ModifyStyle(WS removeStyle, WS addStyle)
{
Assert.IsNotDefault(_hwnd);
var dwStyle = (WS)NativeMethods.GetWindowLongPtr(_hwnd, GWL.STYLE).ToInt32();
var dwNewStyle = (dwStyle & ~removeStyle) | addStyle;
if (dwStyle == dwNewStyle)
{
return false;
}
NativeMethods.SetWindowLongPtr(_hwnd, GWL.STYLE, new IntPtr((int)dwNewStyle));
return true;
}
示例8: _ModifyStyle
public static bool _ModifyStyle(this IntPtr _hwnd, WS removeStyle, WS addStyle)
{
var dwStyle = GetWindowLong(_hwnd, GWL.STYLE);
var dwNewStyle = (dwStyle & ~removeStyle) | addStyle;
if (dwStyle == dwNewStyle)
{
return false;
}
SetWindowLong(_hwnd, GWL.STYLE, dwNewStyle);
return true;
}
示例9: SetWindowLong
internal static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, WS dwNewLong);
示例10: SetWindowLong
public static WS SetWindowLong(this IntPtr hWnd, WS dwNewLong)
{
return (WS) SetWindowLong(hWnd, (int) GWL.STYLE, (int) dwNewLong);
}
示例11: _AdjustWindowRectEx
private static extern bool _AdjustWindowRectEx(ref RECT lpRect, WS dwStyle, [MarshalAs(UnmanagedType.Bool)] bool bMenu, WS_EX dwExStyle);
示例12: AdjustWindowRectEx
public static RECT AdjustWindowRectEx(RECT lpRect, WS dwStyle, bool bMenu, WS_EX dwExStyle)
{
// Native version modifies the parameter in place.
if (!_AdjustWindowRectEx(ref lpRect, dwStyle, bMenu, dwExStyle))
{
HRESULT.ThrowLastError();
}
return lpRect;
}
示例13: CreateWindowEx
public static extern HWND CreateWindowEx(WS_EX dwExStyle, string lpClassName, string lpWindowName, WS dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam);
示例14: AdjustWindowRectEx
public static extern bool AdjustWindowRectEx(ref RECT lpRect, WS style, bool bMenu, WS_EX exStyle);
示例15: SetWindowStyle
/// <summary>
///
/// </summary>
/// <param name="hwnd"></param>
/// <param name="value"></param>
public static void SetWindowStyle(IntPtr hwnd, WS value)
{
NativeMethods.SetWindowLong(hwnd, GWL.STYLE, (int)value);
}