//add this just inside the main usercontrol class //Disclaimer Disclaimer disclaimer = new Disclaimer(); public bool DisclaimerShown = false; ... ... //add this in after the MainPage() section #region Disclaimer private void ShowDisclaimerOnLoad(object sender, EventArgs e) { if (DisclaimerShown == false) { if (GetCookie("GIS-Disclaimer") != "TRUE") { SetCookie("GIS-Disclaimer", "TRUE"); disclaimer.Show(); DisclaimerShown = true; } else { //MapBlackout.Visibility = Visibility.Collapsed; } } if (sender.ToString() != "MyMap_Progress") { disclaimer.Show(); } } private void SetCookie(string key, string value) { // Expire in 7 days DateTime expireDate = DateTime.Now + TimeSpan.FromDays(7); string newCookie = key + "=" + value + ";expires=" + expireDate.ToString("R"); HtmlPage.Document.SetProperty("cookie", newCookie); } private string GetCookie(string key) { string[] cookies = HtmlPage.Document.Cookies.Split(';'); foreach (string cookie in cookies) { string[] keyValue = cookie.Split('='); if (keyValue.Length == 2) { if (keyValue[0].ToString() == key) return keyValue[1]; } } return null; } #endregion Disclaimer
<controls:ChildWindow x:Class="COVGIS.Disclaimer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" Width="400" Height="400" Title="Disclaimer" HasCloseButton="False"> <Grid x:Name="LayoutRoot" Margin="2"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <TextBlock TextWrapping="Wrap" FontWeight="Bold" TextAlignment="Center"> GIS(IT) makes no warranty, representation or guaranty as to the content, sequence, accuracy, timeliness or completeness of any of the database information provided herein. </TextBlock> <TextBlock TextWrapping="Wrap" Margin="0,10,0,0"> GIS(IT) makes no warranty, representation or guaranty as to the content, sequence, accuracy, timeliness or completeness of any of the database information provided herein. </TextBlock> <TextBlock TextWrapping="Wrap" Margin="0,10,0,0"> GIS(IT) makes no warranty, representation or guaranty as to the content, sequence, accuracy, timeliness or completeness of any of the database information provided herein. </TextBlock> <TextBlock TextWrapping="Wrap" Margin="0,10,0,0"> some text </TextBlock> <TextBlock TextWrapping="Wrap" Margin="0,10,0,0"> some text </TextBlock> <TextBlock TextWrapping="Wrap" Margin="0,10,0,0" FontStyle="Italic" FontWeight="Normal" FontStretch="Normal" FontSize="10" Foreground="DarkRed"> some text </TextBlock> </StackPanel> <Button x:Name="OKButton" Content="OK" Width="75" Height="23" HorizontalAlignment="center" Grid.Row="1" Click="OKButton_Click" /> </Grid> </controls:ChildWindow>
private void OKButton_Click(object sender, RoutedEventArgs e) { this.DialogResult = true; }
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.