コード例 #1
0
ファイル: LyrebirdChannel.cs プロジェクト: spearfish/Lyrebird
        public void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    lock (_locker)
                    {
                        if (null != _channel)
                        {
                            //TODO: This is an odd cast...
                            ((IClientChannel)_channel).Abort();
                            _channel = null;
                        }

                        if (null != _factory)
                        {
                            _factory.Abort();
                            _factory = null;
                        }

                        _endpoint = null;
                        _binding  = null;
                    }
                    _disposed = true;
                }
            }
        }
コード例 #2
0
ファイル: LyrebirdChannel.cs プロジェクト: samuto/Lyrebird
        // Public Creator
        public bool Create()
        {
            bool rc = false;
            try
            {
                _binding = new NetNamedPipeBinding();
                _binding.MaxReceivedMessageSize = 10485760;
                if (productId == 0)
                {
                    //_endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2013/LyrebirdService");
                }
                else if (productId == 2)
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2015/LyrebirdService");
                }
                else if (productId == 3)
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2016/LyrebirdService");
                }

                else
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2014/LyrebirdService");
                }
                _factory = new ChannelFactory<ILyrebirdService>(_binding, _endpoint);
                _channel = _factory.CreateChannel();
                
                rc = true;
            }
            catch (Exception ex)
            { 
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return rc;
        }
コード例 #3
0
        // Public Creator
        public bool Create()
        {
            bool rc = false;

            try
            {
                _binding = new NetNamedPipeBinding();
                if (productId == 0)
                {
                    //_endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2013/LyrebirdService");
                }
                else if (productId == 2)
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2015/LyrebirdService");
                }
                else
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2014/LyrebirdService");
                }
                _factory = new ChannelFactory <ILyrebirdService>(_binding, _endpoint);
                _channel = _factory.CreateChannel();
                rc       = true;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return(rc);
        }
コード例 #4
0
ファイル: LyrebirdChannel.cs プロジェクト: samuto/Lyrebird
        public void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    lock (_locker)
                    {
                        if (null != _channel)
                        {
                            //TODO: This is an odd cast...
                            ((IClientChannel)_channel).Abort();
                            _channel = null;
                        }

                        if (null != _factory)
                        {
                            _factory.Abort();
                            _factory = null;
                        }

                        _endpoint = null;
                        _binding = null;
                    }
                    _disposed = true;
                }
            }
        }