예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var callback    = new EditorCallback();
            var context     = new InstanceContext(callback);
            var pipeFactory = new DuplexChannelFactory <IEditorService>(context, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/AlloyEditor"));

            try
            {
                service = pipeFactory.CreateChannel();
                service.Connect();
                service.ShowMessage("Alloy Editor Client Connected!");
            }
            catch (Exception e)
            {
                Logging.LogError("Alloy Engine Editor", e.Message);
                service = null;
            }
        }