예제 #1
0
        public MultiSelectPicklistAttributeMetadataControl(bool fillAllways, MultiSelectPicklistAttributeMetadata attributeMetadata, OptionSetValueCollection initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValues = new HashSet <int>();

            if (initialValue != null)
            {
                foreach (var item in initialValue)
                {
                    this._initialValues.Add(item.Value);
                }
            }

            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            FillListBox();

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
예제 #2
0
        public LookupAttributeMetadataControl(
            IWriteToOutput iWriteToOutput
            , IOrganizationServiceExtented service
            , LookupAttributeMetadata attributeMetadata
            , EntityReference initialValue
            , bool allwaysAddToEntity
            , bool showRestoreButton
            )
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._service        = service;
            this._iWriteToOutput = iWriteToOutput;

            this._initialValue       = initialValue;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            SetEntityReference(_initialValue);

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #3
0
        public EntityReferenceMappingControl(IOrganizationServiceExtented service
                                             , LookupAttributeMetadata attributeMetadata
                                             , EntityReference entityReferenceConnection1
                                             , EntityReference entityReferenceConnection2
                                             )
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._service = service;

            this._entityReferenceConnection1 = entityReferenceConnection1;
            this._entityReferenceConnection2 = entityReferenceConnection2;

            this.AttributeMetadata = attributeMetadata;

            txtBEntityReferenceConnection1EntityName.Text = this._entityReferenceConnection1.LogicalName;
            txtBEntityReferenceConnection1EntityId.Text   = this._entityReferenceConnection1.Id.ToString();

            if (!string.IsNullOrEmpty(this._entityReferenceConnection1.Name))
            {
                txtBEntityReferenceConnection1Name.Text = this._entityReferenceConnection1.Name;
            }
            else
            {
                txtBEntityReferenceConnection1Name.IsEnabled  = false;
                txtBEntityReferenceConnection1Name.Visibility = Visibility.Collapsed;
            }

            btnRestore.IsEnabled  = _entityReferenceConnection2 != null;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;

            SetEntityReference(entityReferenceConnection2);
        }
예제 #4
0
        public StatusAttributeMetadataControl(
            StatusAttributeMetadata attributeMetadataStatus
            , StateAttributeMetadata attributeMetadataState
            , int?initialValueStatus
            , int?initialValueState
            , string statusFormattedValue
            , bool allwaysAddToEntity
            , bool showRestoreButton
            )
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadataStatus);

            this._initialValueStatus          = initialValueStatus;
            this._initialValueState           = initialValueState;
            this._initialStatusFormattedValue = statusFormattedValue;

            this._allwaysAddToEntity = allwaysAddToEntity;

            this.AttributeMetadata       = attributeMetadataStatus;
            this._stateAttributeMetadata = attributeMetadataState;

            FillComboBox();

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #5
0
        public StatusAttributeMetadataControl(bool fillAllways
                                              , Entity entity
                                              , StatusAttributeMetadata attributeMetadataStatus
                                              , StateAttributeMetadata attributeMetadataState
                                              , int?initialValueStatus
                                              , int?initialValueState
                                              )
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadataStatus);

            this._initialValueStatus = initialValueStatus;
            this._initialValueState  = initialValueState;

            this._fillAllways = fillAllways;

            this.AttributeMetadata       = attributeMetadataStatus;
            this._stateAttributeMetadata = attributeMetadataState;

            FillComboBox(entity);

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
예제 #6
0
        public MemoAttributeMetadataControl(bool fillAllways, MemoAttributeMetadata attributeMetadata, string initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            if (string.IsNullOrEmpty(initialValue))
            {
                initialValue = string.Empty;
            }

            this._initialValue     = initialValue;
            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            txtBValue.Text = _initialValue;

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
        public EntityNameAttributeMetadataControl(ConnectionData connectionData, EntityNameAttributeMetadata attributeMetadata, string initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(initialValue))
            {
                initialValue = null;
            }

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue       = initialValue;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this._connectionData     = connectionData;

            this.AttributeMetadata = attributeMetadata;

            FillComboBox();

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #8
0
        public MultiSelectPicklistAttributeMetadataControl(MultiSelectPicklistAttributeMetadata attributeMetadata, OptionSetValueCollection initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValues = new HashSet <int>();

            if (initialValue != null)
            {
                foreach (var item in initialValue)
                {
                    this._initialValues.Add(item.Value);
                }
            }

            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            FillListBox();

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #9
0
        public EntityNameAttributeMetadataControl(IOrganizationServiceExtented service, bool fillAllways, EntityNameAttributeMetadata attributeMetadata, string initialValue)
        {
            InitializeComponent();

            if (string.IsNullOrEmpty(initialValue))
            {
                initialValue = null;
            }

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue = initialValue;
            this._fillAllways  = fillAllways;
            this._service      = service;

            this.AttributeMetadata = attributeMetadata;

            FillComboBox();

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
        public MoneyAttributeMetadataControl(MoneyAttributeMetadata attributeMetadata, Money initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue       = initialValue?.Value;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            txtBValue.Text = this._initialValue.ToString();

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #11
0
        public BooleanAttributeMetadataControl(BooleanAttributeMetadata attributeMetadata, bool?initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue       = initialValue;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            FillComboBox();

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #12
0
        public BooleanManagedPropertyAttributeMetadataControl(bool fillAllways, ManagedPropertyAttributeMetadata attributeMetadata, BooleanManagedProperty initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue     = initialValue;
            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            FillComboBox();

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
        public DecimalAttributeMetadataControl(bool fillAllways, DecimalAttributeMetadata attributeMetadata, decimal?initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue     = initialValue;
            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            txtBValue.Text = _initialValue.ToString();

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
예제 #14
0
        public DateTimeAttributeMetadataControl(DateTimeAttributeMetadata attributeMetadata, DateTime?initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue       = initialValue;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            if (_initialValue.HasValue)
            {
                dPValue.SelectedDate = _initialValue.Value;
            }

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
예제 #15
0
        public LookupAttributeMetadataControl(IOrganizationServiceExtented service, bool fillAllways, LookupAttributeMetadata attributeMetadata, EntityReference initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._service = service;

            this._initialValue     = initialValue;
            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            SetEntityReference(_initialValue);

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }
예제 #16
0
        public StringAttributeMetadataControl(StringAttributeMetadata attributeMetadata, string initialValue, bool allwaysAddToEntity, bool showRestoreButton)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            if (string.IsNullOrEmpty(initialValue))
            {
                initialValue = string.Empty;
            }

            this._initialValue       = initialValue;
            this._allwaysAddToEntity = allwaysAddToEntity;
            this.AttributeMetadata   = attributeMetadata;

            txtBValue.Text = _initialValue;

            Views.WindowBase.SetElementsEnabledAndVisible(allwaysAddToEntity, btnRemoveControl);

            Views.WindowBase.SetElementsEnabledAndVisible(showRestoreButton, btnRestore);

            Views.WindowBase.SetElementsVisible(showRestoreButton, chBChanged);
        }
        public DateTimeAttributeMetadataControl(bool fillAllways, DateTimeAttributeMetadata attributeMetadata, DateTime?initialValue)
        {
            InitializeComponent();

            AttributeMetadataControlFactory.SetGroupBoxNameByAttributeMetadata(gbAttribute, attributeMetadata);

            this._initialValue     = initialValue;
            this._fillAllways      = fillAllways;
            this.AttributeMetadata = attributeMetadata;

            if (_initialValue.HasValue)
            {
                dPValue.SelectedDate = _initialValue.Value;
            }

            btnRemoveControl.IsEnabled = _fillAllways;

            btnRemoveControl.Visibility = btnRemoveControl.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
            chBChanged.Visibility       = _fillAllways ? Visibility.Collapsed : Visibility.Visible;

            btnRestore.IsEnabled  = !_fillAllways;
            btnRestore.Visibility = btnRestore.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
        }