コード例 #1
0
        /// <summary>
        /// Starts the server
        /// </summary>
        /// <param name="uiEventArgs"></param>
        public void StartServer(ProxyUiEventArgs uiEventArgs)
        {
            bufferSize = ValidateBufferSize(uiEventArgs.Buffer);
            port       = ValidatePort(uiEventArgs.Port);

            server = new Server(port, bufferSize, uiEventArgs);

            server.MessagesCollection.CollectionChanged += OnAddedToList;

            server.Start();
        }
コード例 #2
0
        private void StartProxy(object sender, RoutedEventArgs e)
        {
            var args = new ProxyUiEventArgs()
            {
                Buffer = BufferSizeTxtB.Text,
                Port   = PortTxtB.Text,
                AdvertisementFilterEnabled = AdvertiseFilterCb.IsChecked != null && AdvertiseFilterCb.IsChecked.Value,
                PrivacyFilterEnabled       = PrivacyFilterCb.IsChecked != null && PrivacyFilterCb.IsChecked.Value,
                CacheEnabled = CacheCb.IsChecked != null && CacheCb.IsChecked.Value
            };

            _viewModel.StartServer(args);
            Switch();
        }