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 ThickTcpUiInWindow.Converter;

using System.Net;

using FLY.Thick.Base.Common;
using FLY.Thick.Base.Client;
namespace ThickTcpUiInWindow
{
    /// <summary>
    /// Page_Initparam.xaml 的交互逻辑
    /// </summary>
    public partial class Page_Initparam : Page
    {
        InitParamServiceClient mInitParamService;

        public Page_Initparam()
        {
            InitializeComponent();
        }
        public void Init(IPEndPoint serverep) 
        {
            mInitParamService = new InitParamServiceClient(FLY.Thick.Base.OBJ_INTERFACE.OBJ_INTERFACE_ID.INITPARAM_ID);

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

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

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


        private void Page_UnLoaded(object sender, RoutedEventArgs e)
        {
            mInitParamService.Dispose();
        }
    }
}
