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;
using System.Net;

using FLY.Thick.Base.Client;
namespace ThickTcpUiInWindow
{
    /// <summary>
    /// Page_ScanWarning.xaml 的交互逻辑
    /// </summary>
    public partial class Page_ScanWarning : Page
    {
        ScanWarningService mScanWarningService;

        public Page_ScanWarning()
        {
            InitializeComponent();
        }
        public void Init(IPEndPoint serverep)
        {
            mScanWarningService = new ScanWarningService();

            FObjBase.FObjSys.Current.Connect_to_Another_OBJSys(
                serverep, mScanWarningService.ID);

            this.DataContext = mScanWarningService;
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {

        }
        private void Page_Unloaded(object sender, RoutedEventArgs e)
        {
            mScanWarningService.Dispose();
        }

        private void button_apply_Click(object sender, RoutedEventArgs e)
        {
            if (Window_Password.Authorize(1))
            {
                mScanWarningService.Apply();
                FLY.ControlLibrary.Window_Tip.Show("应用成功",
                    null,
                    TimeSpan.FromSeconds(2));
            }
        }
    }
}
