コード例 #1
0
        /// <summary>
        /// Binds the specified service.
        /// </summary>
        /// <param name="service">The service.</param>
        public override void Bind(IEditorService service)
        {
            _ed = service;
            _lp = _ed.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.ILoadProcedure;
            Debug.Assert(_lp != null);

            service.RegisterCustomNotifier(this);

            CollapsiblePanel tp = null;

            if (_lp.SubType.Type == LoadType.Sdf)
            {
                var trans = new SdfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Shp)
            {
                var trans = new ShpTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Dwf)
            {
                var trans = new DwfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else if (_lp.SubType.Type == LoadType.Sqlite)
            {
                var trans = new SqliteTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            else
            {
                throw new NotSupportedException();
            }

            var input = new InputFilesCtrl();
            input.Bind(service);

            var target = new LoadTargetCtrl();
            target.Bind(service);

            tp.Dock = DockStyle.Top;
            input.Dock = DockStyle.Top;
            target.Dock = DockStyle.Top;

            var exec = new ExecuteCtrl();
            exec.Dock = DockStyle.Bottom;
            exec.Execute += new EventHandler(OnExecute);

            this.Controls.Add(exec);
            this.Controls.Add(target);
            this.Controls.Add(tp);
            this.Controls.Add(input);
        }
コード例 #2
0
        /// <summary>
        /// Binds the specified service.
        /// </summary>
        /// <param name="service">The service.</param>
        public override void Bind(IEditorService service)
        {
            _ed = service;
            _lp = _ed.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.ILoadProcedure;
            Debug.Assert(_lp != null);

            service.RegisterCustomNotifier(this);

            CollapsiblePanel tp = null;

            switch (_lp.SubType.Type)
            {
            case LoadType.Sdf:
            {
                var trans = new SdfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            break;

            case LoadType.Shp:
            {
                var trans = new ShpTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            break;

            case LoadType.Dwf:
            {
                var trans = new DwfTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            break;

            case LoadType.Sqlite:
            {
                var trans = new SqliteTransformationCtrl();
                trans.Bind(service);
                tp = trans;
            }
            break;

            default:
                throw new NotSupportedException();
            }

            var input = new InputFilesCtrl();

            input.Bind(service);

            var target = new LoadTargetCtrl();

            target.Bind(service);

            tp.Dock     = DockStyle.Top;
            input.Dock  = DockStyle.Top;
            target.Dock = DockStyle.Top;

            var exec = new ExecuteCtrl();

            exec.Dock     = DockStyle.Bottom;
            exec.Execute += new EventHandler(OnExecute);

            this.Controls.Add(exec);
            this.Controls.Add(target);
            this.Controls.Add(tp);
            this.Controls.Add(input);
        }