示例#1
0
        public MainForm( )
        {
            InitializeComponent();

            Messager.Caption = "JPIP Server Demo";

            _server          = new JpipServer( );
            _displayLogs     = true;
            _deniedIpAddress = new string [0];
            _dataIpAddress   = new string [0];

            AppSettingsReader configReader = new AppSettingsReader( );

            try { _server.Configuration.Port = ( int )configReader.GetValue("Port", typeof(int)); } catch { _server.Configuration.Port = 49201; }
            try { _server.Configuration.DivideSuperBoxes = ( bool )configReader.GetValue("DivideSuperBoxes", typeof(bool)); } catch { _server.Configuration.DivideSuperBoxes = true; }
            try { _server.Configuration.ChunkSize = ( int )configReader.GetValue("ChunkSize", typeof(int)); } catch { _server.Configuration.ChunkSize = 512; }

            SetImagesPath(_server, configReader);

            _service = new ImagesEnumerationService(_server);

            _service.ImagesExtension.Add("*.j2k");
            _service.ImagesExtension.Add("*.jp2");
            _service.ImagesExtension.Add("*.jpx");
        }
        internal ImagesEnumerationServiceDlg
        (
            ImagesEnumerationService enumerationService
        ) : this()
        {
            _enumerationService = enumerationService;

            Init( );

            this.Load        += new EventHandler(ImagesEnumerationServiceDlg_Load);
            this.FormClosing += new FormClosingEventHandler(ImagesEnumerationServiceDlg_FormClosing);
        }