Esempio n. 1
0
        public StageOperationHolderWidget(StageOperationParametersWidget operationParametersWidget)
        {
            this.Build();

            _TitleWidget = new StageOperationTitleWidget();
            vbox.Add(_TitleWidget);
            _TitleWidget.Show();

            _OperationParametersWidget = operationParametersWidget;

            _TitleWidget.Title = StageOperationDescriptionAttribute.GetName(_OperationParametersWidget.Parameters.GetSOType());

            vbox.Add(operationParametersWidget);
            ((Box.BoxChild)vbox[operationParametersWidget]).Position = 1;
            ((Box.BoxChild)vbox[operationParametersWidget]).Fill     = false;
            ((Box.BoxChild)vbox[operationParametersWidget]).Expand   = false;

            _TitleWidget.Active = _OperationParametersWidget.Parameters.Active;

            // Active
            _OperationParametersWidget.Parameters.Changed += delegate {
                _TitleWidget.Active = _OperationParametersWidget.Parameters.Active;
            };


            _TitleWidget.UpButtonClicked += delegate {
                OnUpTitleButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.DownButtonClicked += delegate {
                OnDownTitleButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.TitleCheckButtonClicked += delegate {
                _OperationParametersWidget.Parameters.Active = _TitleWidget.Active;
                OnStageActiveButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.ViewButtonClicked += delegate {
                OnViewButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.FreezeButtonClicked += delegate {
                OnFreezeButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.RemoveButtonClicked += delegate {
                OnRemoveButtonClicked(this, EventArgs.Empty);
            };

            // Checking if editing mode supported
            _TitleWidget.SetEditModeSupported(false);
            Type parametersType = operationParametersWidget.GetType();

            object[] attrs = parametersType.GetCustomAttributes(typeof(StageOperationParametersEditModeSupportedAttribute), true);
            if (attrs.Length > 0)
            {
                if (((StageOperationParametersEditModeSupportedAttribute)attrs[0]).Supported)
                {
                    _TitleWidget.SetEditModeSupported(true);
                }
            }

            operationParametersWidget.Show();
        }
        public StageOperationHolderWidget(StageOperationParametersWidget operationParametersWidget)
        {
            this.Build ();

            _TitleWidget = new StageOperationTitleWidget();
            vbox.Add(_TitleWidget);
            _TitleWidget.Show();

            _OperationParametersWidget = operationParametersWidget;

            _TitleWidget.Title = StageOperationDescriptionAttribute.GetName(_OperationParametersWidget.Parameters.GetSOType());

            vbox.Add(operationParametersWidget);
            ((Box.BoxChild)vbox[operationParametersWidget]).Position = 1;
            ((Box.BoxChild)vbox[operationParametersWidget]).Fill = false;
            ((Box.BoxChild)vbox[operationParametersWidget]).Expand = false;

            _TitleWidget.Active = _OperationParametersWidget.Parameters.Active;

            // Active
            _OperationParametersWidget.Parameters.Changed += delegate {
                _TitleWidget.Active = _OperationParametersWidget.Parameters.Active;
            };

            _TitleWidget.UpButtonClicked += delegate {
                OnUpTitleButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.DownButtonClicked += delegate {
                OnDownTitleButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.TitleCheckButtonClicked += delegate {
                _OperationParametersWidget.Parameters.Active = _TitleWidget.Active;
                OnStageActiveButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.ViewButtonClicked += delegate {
                OnViewButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.FreezeButtonClicked += delegate {
                OnFreezeButtonClicked(this, EventArgs.Empty);
            };
            _TitleWidget.RemoveButtonClicked += delegate {
                OnRemoveButtonClicked(this, EventArgs.Empty);
            };

            // Checking if editing mode supported
            _TitleWidget.SetEditModeSupported(false);
            Type parametersType = operationParametersWidget.GetType();
            object[] attrs = parametersType.GetCustomAttributes(typeof(StageOperationParametersEditModeSupportedAttribute), true);
            if (attrs.Length > 0)
            {
                if (((StageOperationParametersEditModeSupportedAttribute)attrs[0]).Supported)
                    _TitleWidget.SetEditModeSupported(true);
            }

            operationParametersWidget.Show();
        }