-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ConnectivityStatus.xml
80 lines (68 loc) · 5.6 KB
/
ConnectivityStatus.xml
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
<Type Name="ConnectivityStatus" FullName="System.Web.ClientServices.ConnectivityStatus">
<TypeSignature Language="C#" Value="public static class ConnectivityStatus" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit ConnectivityStatus extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.ClientServices.ConnectivityStatus" />
<TypeSignature Language="VB.NET" Value="Public Class ConnectivityStatus" />
<TypeSignature Language="F#" Value="type ConnectivityStatus = class" />
<TypeSignature Language="C++ CLI" Value="public ref class ConnectivityStatus abstract sealed" />
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Represents the status of an application's network connection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.ClientServices.ConnectivityStatus> class to specify the network connectivity of Windows-based applications that use client application services. When you set the <xref:System.Web.ClientServices.ConnectivityStatus.IsOffline%2A> property to `true`, the client service providers use the offline cache instead of attempting to access the corresponding Web services. The offline status is stored on a per-user and per-application basis. For more information, see [How to: Work Offline with Client Application Services](https://msdn.microsoft.com/library/f792cb16-8520-4a0f-9dc9-07bfbc454e38).
## Examples
The following example code demonstrates how to use this class to update the offline status depending on a check box value. In this example, a <xref:System.Windows.Forms.CheckBox.CheckedChanged> event handler updates the offline status. If the user sets the application to the online state, the event handler attempts to revalidate the user. However, if the authentication server is unavailable, the event handler returns the application to the offline state.
:::code language="csharp" source="~/snippets/csharp/System.Web.ClientServices/ClientFormsIdentity/Overview/Class1.cs" id="Snippet315":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ClientApplicationServices/VB/Class1.vb" id="Snippet315":::
]]></format>
</remarks>
<altmember cref="M:System.Web.ClientServices.ClientFormsIdentity.RevalidateUser" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb384297(v=vs.100)">Client Application Services</related>
</Docs>
<Members>
<Member MemberName="IsOffline">
<MemberSignature Language="C#" Value="public static bool IsOffline { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property bool IsOffline" />
<MemberSignature Language="DocId" Value="P:System.Web.ClientServices.ConnectivityStatus.IsOffline" />
<MemberSignature Language="VB.NET" Value="Public Shared Property IsOffline As Boolean" />
<MemberSignature Language="F#" Value="static member IsOffline : bool with get, set" Usage="System.Web.ClientServices.ConnectivityStatus.IsOffline" />
<MemberSignature Language="C++ CLI" Value="public:
 static property bool IsOffline { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether an application is in offline mode.</summary>
<value>
<see langword="true" /> if the application is in offline mode; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you set the <xref:System.Web.ClientServices.ConnectivityStatus.IsOffline%2A> property, the <xref:System.Web.ClientServices.ConnectivityStatus> class caches the value to the local file system. The client service providers in the <xref:System.Web.ClientServices.Providers> namespace check this value to determine whether to use the offline data cache instead of attempting to access the associated Microsoft Ajax authentication, roles, and profile services.
## Examples
The following example code demonstrates how to use this property to update the offline status depending on a check box value. In this example, a <xref:System.Windows.Forms.CheckBox.CheckedChanged> event handler updates the offline status. If the user sets the application to the online state, the event handler attempts to revalidate the user. However, if the authentication server is unavailable, the event handler returns the application to the offline state.
:::code language="csharp" source="~/snippets/csharp/System.Web.ClientServices/ClientFormsIdentity/Overview/Class1.cs" id="Snippet315":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ClientApplicationServices/VB/Class1.vb" id="Snippet315":::
]]></format>
</remarks>
<altmember cref="M:System.Web.ClientServices.ClientFormsIdentity.RevalidateUser" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2010/bb384297(v=vs.100)">Client Application Services</related>
</Docs>
</Member>
</Members>
</Type>