Esempio n. 1
0
        internal void Bind(IInvokeUrlCommand invokeUrlCommandType, IEditorService service)
        {
            cmbTargetFrame.DataSource = Enum.GetValues(typeof(TargetType));
            Bind(service);
            service.RegisterCustomNotifier(this);

            TextBoxBinder.BindText(txtUrl, invokeUrlCommandType, "URL");
            TextBoxBinder.BindText(txtFrame, invokeUrlCommandType, "TargetFrame");
            ComboBoxBinder.BindSelectedIndexChanged(cmbTargetFrame, "SelectedItem", invokeUrlCommandType, "Target");
            CheckBoxBinder.BindChecked(chkDisableIfEmpty, invokeUrlCommandType, "DisableIfSelectionEmpty");

            foreach (var p in invokeUrlCommandType.AdditionalParameter)
            {
                _params.Add(p);
            }
            grdParameters.DataSource = _params;
            _params.ListChanged += OnParamsListChanged;
            _params.AddingNew += OnAddingNew;
            lstLayers.DataSource = invokeUrlCommandType.LayerSet.Layer;

            invokeUrlCommandType.PropertyChanged += OnCommandPropertyChanged;
            _cmd = invokeUrlCommandType;
        }
        internal void Bind(IInvokeUrlCommand invokeUrlCommandType, IEditorService service)
        {
            cmbTargetFrame.DataSource = Enum.GetValues(typeof(TargetType));
            Bind(service);
            service.RegisterCustomNotifier(this);

            TextBoxBinder.BindText(txtUrl, invokeUrlCommandType, nameof(invokeUrlCommandType.URL));
            TextBoxBinder.BindText(txtFrame, invokeUrlCommandType, nameof(invokeUrlCommandType.TargetFrame));
            ComboBoxBinder.BindSelectedIndexChanged(cmbTargetFrame, nameof(cmbTargetFrame.SelectedItem), invokeUrlCommandType, nameof(invokeUrlCommandType.Target));
            CheckBoxBinder.BindChecked(chkDisableIfEmpty, invokeUrlCommandType, nameof(invokeUrlCommandType.DisableIfSelectionEmpty));

            foreach (var p in invokeUrlCommandType.AdditionalParameter)
            {
                _params.Add(p);
            }
            grdParameters.DataSource = _params;
            _params.ListChanged     += OnParamsListChanged;
            _params.AddingNew       += OnAddingNew;
            lstLayers.DataSource     = invokeUrlCommandType.LayerSet.Layer;

            invokeUrlCommandType.PropertyChanged += WeakEventHandler.Wrap <PropertyChangedEventHandler>(OnCommandPropertyChanged, (eh) => invokeUrlCommandType.PropertyChanged -= eh);
            _cmd = invokeUrlCommandType;
        }