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_WarningSystem.xaml 的交互逻辑
    /// </summary>
    public partial class Page_WarningSystem : Page
    {
        WarningService mWarningService;
        public Page_WarningSystem()
        {
            InitializeComponent();
        }

        private void button_apply_Click(object sender, RoutedEventArgs e)
        {
            if (Window_Password.Authorize(1))
            {
                mWarningService.Apply();
                FLY.ControlLibrary.Window_Tip.Show("应用成功",
                    null,
                    TimeSpan.FromSeconds(2));
            }
        }
        public void Init(IPEndPoint serverep) 
        {
             mWarningService = new WarningService();

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

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

        }

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

        private void button_reset_Click(object sender, RoutedEventArgs e)
        {
            mWarningService.Reset();
        }

        private void button_access_Click(object sender, RoutedEventArgs e)
        {

        }

    }
}
