示例#1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            #region code run
            //try
            //{
            //    var args = new string[] { "" };
            //    Ice.Properties properties = Ice.Util.createProperties();
            //    //单位KB
            //    properties.setProperty("Ice.MessageSizeMax", "2048");
            //    Ice.InitializationData initData = new Ice.InitializationData();
            //    initData.properties = properties;
            //    ic = Ice.Util.initialize(initData);

            //    if (ic == null)
            //    {
            //        Debug.Assert(false, "初始化失败");
            //        return;
            //    }
            //    Ice.ObjectPrx pxy = ic.stringToProxy("myface:tcp -h localhost -p 9996");
            //    facePxy = FaceRecognitionPrxHelper.checkedCast(pxy);
            //    if (facePxy == null)
            //    {
            //        Debug.Assert(false, "代理为空");
            //        return;
            //    }
            //}
            //catch (System.Exception)
            //{
            //    Debug.Assert(false, "初始化失败");
            //    return;
            //}
            #endregion

            #region config run
            Task.Factory.StartNew(() =>
            {
                connect  = new FaceClientEx.Connect();
                var args = new string[] { "ysj" };
                connect.main(args, "config.client");
            });

            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(1000);
                facePxy = connect.pxy;
            });

            #endregion
        }
示例#2
0
        public static FaceRecognitionPrx uncheckedCast(Ice.ObjectPrx b)
        {
            if (b == null)
            {
                return(null);
            }
            FaceRecognitionPrx r = b as FaceRecognitionPrx;

            if (r == null)
            {
                FaceRecognitionPrxHelper h = new FaceRecognitionPrxHelper();
                h.copyFrom__(b);
                r = h;
            }
            return(r);
        }
示例#3
0
        public static FaceRecognitionPrx checkedCast(Ice.ObjectPrx b, _System.Collections.Generic.Dictionary <string, string> ctx)
        {
            if (b == null)
            {
                return(null);
            }
            FaceRecognitionPrx r = b as FaceRecognitionPrx;

            if ((r == null) && b.ice_isA(ice_staticId(), ctx))
            {
                FaceRecognitionPrxHelper h = new FaceRecognitionPrxHelper();
                h.copyFrom__(b);
                r = h;
            }
            return(r);
        }
示例#4
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            string[] args = new string[1] {
                "arg"
            };
            //try
            //{
            //    ic = Ice.Util.initialize(ref args);
            //    if (ic == null)
            //    {
            //        Debug.Assert(false, "初始化失败");
            //        return;
            //    }

            //    Ice.ObjectPrx pxy = ic.stringToProxy("myface:default -p 9996");
            //    facePxy = FaceRecognitionPrxHelper.checkedCast(pxy);
            //    if (facePxy == null)
            //    {
            //        Debug.Assert(false, "代理为空");
            //        return;
            //    }
            //}
            //catch (System.Exception ex)
            //{
            //    Debug.Assert(false, "初始化失败");
            //    return;
            //}

            Task.Factory.StartNew(() =>
            {
                client = new Client(Item);
                client.main(args, "config.client");
            });

            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(1000);
                this.ic      = client.ic;
                this.facePxy = client.facePxy;
            });
        }
示例#5
0
 public static void write__(IceInternal.BasicStream os__, FaceRecognitionPrx v__)
 {
     os__.writeProxy(v__);
 }