amxmodx/installer/installtool/LicenseAccept.xaml.cs

57 lines
1.7 KiB
C#
Raw Normal View History

2013-02-19 12:27:10 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace installtool
{
/// <summary>
/// Interaction logic for LicenseAccept.xaml
/// </summary>
public partial class LicenseAccept : UserControl
{
public bool Accepted { get; private set; }
public static readonly RoutedEvent AgreementStateChangedEvent =
EventManager.RegisterRoutedEvent("AgreementStateChanged",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(LicenseAccept));
2013-02-19 12:27:10 +04:00
public LicenseAccept()
{
InitializeComponent();
2013-02-24 09:54:49 +04:00
license_.Text = license_.Text.Replace("&#10;&#13;", "");
2013-02-19 12:27:10 +04:00
}
public event RoutedEventHandler AgreementStateChanged
{
add { AddHandler(AgreementStateChangedEvent, value); }
remove { RemoveHandler(AgreementStateChangedEvent, value); }
}
private void agreeOption_Checked(object sender, RoutedEventArgs e)
{
RoutedEventArgs args = new RoutedEventArgs(AgreementStateChangedEvent);
Accepted = true;
RaiseEvent(args);
}
private void disagreeOption_Checked(object sender, RoutedEventArgs e)
{
RoutedEventArgs args = new RoutedEventArgs(AgreementStateChangedEvent);
Accepted = false;
RaiseEvent(args);
}
2013-02-19 12:27:10 +04:00
}
}