コード例 #1
0
        private void InitUI()
        {
            BOWidgetBox boxValue      = null;
            BOWidgetBox ComboboxValue = null;

            try
            {
                cfg_configurationpreferenceparameter dataSourceRow = (cfg_configurationpreferenceparameter)_dataSourceRow;

                //Define Label for Value
                string valueLabel = (resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString) != null)
                    ? resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], dataSourceRow.ResourceString)
                    : "LABEL NOT DEFINED IN Field  [ResourceString]";

                //Define RegEx for Value
                string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]";
                if (dataSourceRow.RegEx != null)
                {
                    //Try to get Value
                    object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx);
                    if (objectValueRegEx != null)
                    {
                        valueRegEx = objectValueRegEx.ToString();
                    }
                }

                //Define Label for Value
                bool valueRequired = (dataSourceRow.Required)
                    ? dataSourceRow.Required
                    : false;

                //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber
                if (dataSourceRow.Token == "COMPANY_POSTALCODE")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode;
                }
                if (dataSourceRow.Token == "COMPANY_FISCALNUMBER")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber;
                }

                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_order"), entryOrd);
                vboxTab1.PackStart(boxLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Code
                Entry       entryCode = new Entry();
                BOWidgetBox boxCode   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_token"), entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true));

                //Get InputType
                PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true);

                Entry entryValue = new Entry();

                switch (inputType)
                {
                case PreferenceParameterInputType.Text:
                case PreferenceParameterInputType.TextPassword:
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell
                    if (inputType.Equals(PreferenceParameterInputType.TextPassword))
                    {
                        entryValue.Visibility = false;
                    }

                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // ValueTip
                    if (!string.IsNullOrEmpty(dataSourceRow.ValueTip))
                    {
                        entryValue.TooltipText = string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_prefparam_value_tip_format"), dataSourceRow.ValueTip);
                    }
                    break;

                case PreferenceParameterInputType.Multiline:
                    EntryMultiline entryMultiline = new EntryMultiline();
                    entryMultiline.Value.Text = dataSourceRow.Value;
                    entryMultiline.ScrolledWindow.BorderWidth = 1;
                    entryMultiline.HeightRequest = 122;
                    Label labelMultiline = new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_notes"));
                    boxValue = new BOWidgetBox(valueLabel, entryMultiline);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent + 100;
                    break;

                case PreferenceParameterInputType.CheckButton:
                    CheckButton checkButtonValue = new CheckButton(valueLabel);
                    vboxTab1.PackStart(checkButtonValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value"));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent - 20;
                    break;

                //Mudar a lingua da Aplicação - Não é genérico
                //IN009296 BackOffice - Mudar a língua da aplicação
                case PreferenceParameterInputType.ComboBox:
                    string getCultureFromDB;
                    try
                    {
                        string sql = "SELECT value FROM cfg_configurationpreferenceparameter where token = 'CULTURE';";
                        getCultureFromDB = GlobalFramework.SessionXpo.ExecuteScalar(sql).ToString();
                    }
                    catch
                    {
                        getCultureFromDB = GlobalFramework.Settings["customCultureResourceDefinition"];
                    }

                    string[] getCulturesValues = new string[8];
                    getCulturesValues[0] = "pt-PT";
                    getCulturesValues[1] = "pt-AO";
                    getCulturesValues[2] = "pt-BR";
                    getCulturesValues[3] = "pt-MZ";
                    getCulturesValues[4] = "en-GB";
                    getCulturesValues[5] = "en-US";
                    getCulturesValues[6] = "fr-FR";
                    getCulturesValues[7] = "es-ES";

                    string[] getCulturesLabels = new string[8];
                    getCulturesLabels[0] = "Português(Portugal)";
                    getCulturesLabels[1] = "Português(Angola)";
                    getCulturesLabels[2] = "Português(Brasil)";
                    getCulturesLabels[3] = "Português(Moçambique)";
                    getCulturesLabels[4] = "English(GB)";
                    getCulturesLabels[5] = "English(USA)";
                    getCulturesLabels[6] = "Françes";
                    getCulturesLabels[7] = "Espanol";

                    TreeIter  iter;
                    TreeStore store = new TreeStore(typeof(string), typeof(string));
                    for (int i = 0; i < getCulturesLabels.Length; i++)
                    {
                        iter = store.AppendValues(getCulturesValues.GetValue(i), getCulturesLabels.GetValue(i));
                    }

                    ComboBox xpoComboBoxInputType = new ComboBox(getCulturesLabels);

                    xpoComboBoxInputType.Model.GetIterFirst(out iter);
                    int cbox = 0;
                    do
                    {
                        GLib.Value thisRow = new GLib.Value();
                        xpoComboBoxInputType.Model.GetValue(iter, 0, ref thisRow);
                        //if ((thisRow.Val as string).Equals(getCultureFromDB))
                        if (getCulturesValues[cbox] == getCultureFromDB)
                        {
                            xpoComboBoxInputType.SetActiveIter(iter);
                            break;
                        }
                        cbox++;
                    } while (xpoComboBoxInputType.Model.IterNext(ref iter));

                    ComboboxValue = new BOWidgetBox(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_language"), xpoComboBoxInputType);
                    vboxTab1.PackStart(ComboboxValue, false, false, 0);

                    entryValue.Text       = getCulturesValues[xpoComboBoxInputType.Active];
                    entryValue.Visibility = false;

                    xpoComboBoxInputType.Changed += delegate
                    {
                        entryValue.Text = getCulturesValues[xpoComboBoxInputType.Active];
                        if (Utils.IsLinux)
                        {
                            SaveSettings(getCulturesValues[xpoComboBoxInputType.Active].ToString());
                        }
                        //GlobalFramework.CurrentCulture = new System.Globalization.CultureInfo(getCulturesValues[xpoComboBoxInputType.Active]);
                        //GlobalFramework.Settings["customCultureResourceDefinition"] = getCulturesValues[xpoComboBoxInputType.Active];
                        //CustomResources.UpdateLanguage(getCulturesValues[xpoComboBoxInputType.Active]);
                        //_crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    };
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                case PreferenceParameterInputType.FilePicker:
                case PreferenceParameterInputType.DirPicker:
                    //FilePicker
                    FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder;
                    FileChooserButton fileChooser       = new FileChooserButton(string.Empty, fileChooserAction)
                    {
                        HeightRequest = 23
                    };
                    if (inputType.Equals(PreferenceParameterInputType.FilePicker))
                    {
                        fileChooser.SetFilename(dataSourceRow.Value);
                        fileChooser.Filter = Utils.GetFileFilterImages();
                    }
                    else
                    {
                        fileChooser.SetCurrentFolder(dataSourceRow.Value);
                    }
                    boxValue = new BOWidgetBox(valueLabel, fileChooser);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                default:
                    break;
                }

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_main_detail")));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryToken.Sensitive = false;

                //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data
                cfg_configurationpreferenceparameter parameter = (_dataSourceRow as cfg_configurationpreferenceparameter);
                if (entryValue != null)
                {
                    entryValue.Sensitive = (
                        parameter.Token != "COMPANY_NAME" &&
                        parameter.Token != "COMPANY_BUSINESS_NAME" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY_CODE2" &&
                        parameter.Token != "COMPANY_FISCALNUMBER" &&
                        parameter.Token != "SYSTEM_CURRENCY" &&
                        parameter.Token != "REPORT_FILENAME_LOGO"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID"
                        );
                }
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
コード例 #2
0
        private void InitUI()
        {
            //Get Values from Config
            Guid systemCountry;
            Guid systemCurrency;
            bool debug = false;
            bool useDatabaseDataDemo = Convert.ToBoolean(GlobalFramework.Settings["useDatabaseDataDemo"]);

            if (GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"] != string.Empty)
            {
                systemCountry = new Guid(GlobalFramework.Settings["xpoOidConfigurationCountrySystemCountry"]);
            }
            else
            {
                systemCountry = SettingsApp.XpoOidConfigurationCountryPortugal;
            }

            if (GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"] != string.Empty)
            {
                systemCurrency = new Guid(GlobalFramework.Settings["xpoOidConfigurationCurrencySystemCurrency"]);
            }
            else
            {
                systemCurrency = SettingsApp.XpoOidConfigurationCurrencyEuro;
            }

            //Init Inital Values
            CFG_ConfigurationCountry  intialValueConfigurationCountry  = (CFG_ConfigurationCountry)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCountry), systemCountry);
            CFG_ConfigurationCurrency intialValueConfigurationCurrency = (CFG_ConfigurationCurrency)FrameworkUtils.GetXPGuidObject(typeof(CFG_ConfigurationCurrency), systemCurrency);

            try
            {
                //Init dictionary for Parameters + Widgets
                _dictionaryObjectBag = new Dictionary <CFG_ConfigurationPreferenceParameter, EntryBoxValidation>();

                //Pack VBOX
                VBox vbox = new VBox(true, 2)
                {
                    WidthRequest = 300
                };

                //Country
                CriteriaOperator criteriaOperatorSystemCountry = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1) AND (RegExFiscalNumber IS NOT NULL)");
                _entryBoxSelectSystemCountry = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCountry, TreeViewConfigurationCountry>(this, Resx.global_country, "Designation", "Oid", intialValueConfigurationCountry, criteriaOperatorSystemCountry, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCountry.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCountry.EntryValidation.Validate(_entryBoxSelectSystemCountry.Value.Oid.ToString());
                //Disabled, Now Country and Currency are disabled
                _entryBoxSelectSystemCountry.ButtonSelectValue.Sensitive = true;
                _entryBoxSelectSystemCountry.EntryValidation.Sensitive   = true;
                _entryBoxSelectSystemCountry.ClosePopup += delegate
                {
                    ////Require to Update RegEx
                    _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                    _entryBoxZipCode.EntryValidation.Validate();
                    //Require to Update RegEx and Criteria to filter Country Clients Only
                    _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                    _entryBoxFiscalNumber.EntryValidation.Validate();
                    if (_entryBoxFiscalNumber.EntryValidation.Validated)
                    {
                        bool isValidFiscalNumber = FiscalNumber.IsValidFiscalNumber(_entryBoxFiscalNumber.EntryValidation.Text, _entryBoxSelectSystemCountry.Value.Code2);
                        _entryBoxFiscalNumber.EntryValidation.Validated = isValidFiscalNumber;
                    }
                    //Call Main Validate
                    Validate();
                };

                //Currency
                CriteriaOperator criteriaOperatorSystemCurrency = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");
                _entryBoxSelectSystemCurrency = new XPOEntryBoxSelectRecordValidation <CFG_ConfigurationCurrency, TreeViewConfigurationCurrency>(this, Resx.global_currency, "Designation", "Oid", intialValueConfigurationCurrency, criteriaOperatorSystemCurrency, SettingsApp.RegexGuid, true);
                _entryBoxSelectSystemCurrency.EntryValidation.IsEditable = false;
                _entryBoxSelectSystemCurrency.EntryValidation.Validate(_entryBoxSelectSystemCurrency.Value.Oid.ToString());

                //Disabled, Now Country and Currency are disabled
                //_entryBoxSelectSystemCurrency.ButtonSelectValue.Sensitive = false;
                //_entryBoxSelectSystemCurrency.EntryValidation.Sensitive = false;
                _entryBoxSelectSystemCurrency.ClosePopup += delegate
                {
                    //Call Main Validate
                    Validate();
                };

                //Add to Vbox
                vbox.PackStart(_entryBoxSelectSystemCountry, true, true, 0);
                vbox.PackStart(_entryBoxSelectSystemCurrency, true, true, 0);

                //Start Render Dynamic Inputs
                CriteriaOperator criteriaOperator = CriteriaOperator.Parse("(Disabled = 0 OR Disabled is NULL) AND (FormType = 1 AND FormPageNo = 1)");
                SortProperty[]   sortProperty     = new SortProperty[2];
                sortProperty[0] = new SortProperty("Ord", SortingDirection.Ascending);
                XPCollection xpCollection = new XPCollection(GlobalFramework.SessionXpo, typeof(CFG_ConfigurationPreferenceParameter), criteriaOperator, sortProperty);
                if (xpCollection.Count > 0)
                {
                    string label    = string.Empty;
                    string regEx    = string.Empty;
                    object regExObj = null;
                    bool   required = false;

                    foreach (CFG_ConfigurationPreferenceParameter item in xpCollection)
                    {
                        label = (item.ResourceString != null && Resx.ResourceManager.GetString(item.ResourceString) != null)
                            ? Resx.ResourceManager.GetString(item.ResourceString)
                            : string.Empty;
                        regExObj = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), item.RegEx);
                        regEx    = (regExObj != null) ? regExObj.ToString() : string.Empty;
                        required = Convert.ToBoolean(item.Required);

                        //Override Db Regex
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            regEx = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        //Debug
                        //_log.Debug(string.Format("Label: [{0}], RegEx: [{1}], Required: [{2}]", label, regEx, required));

                        EntryBoxValidation entryBoxValidation = new EntryBoxValidation(
                            this,
                            label,
                            KeyboardMode.AlfaNumeric,
                            regEx,
                            required
                            )
                        {
                            Name = item.Token
                        };

                        //Only Assign Value if Debugger Attached : Now the value for normal user is cleaned in Init Database, we keep this code here, may be usefull
                        if (Debugger.IsAttached == true || useDatabaseDataDemo)
                        {
                            entryBoxValidation.EntryValidation.Text = item.Value;
                        }
                        if (Debugger.IsAttached == true)
                        {
                            if (debug)
                            {
                                _log.Debug(String.Format("[{0}:{1}]:item.Value: [{2}], entryBoxValidation.EntryValidation.Text: [{3}]", Debugger.IsAttached == true, useDatabaseDataDemo, item.Value, entryBoxValidation.EntryValidation.Text));
                            }
                        }

                        //Assign shared Event
                        entryBoxValidation.EntryValidation.Changed += EntryValidation_Changed;

                        //If is ZipCode Assign it to _entryBoxZipCode Reference
                        if (item.Token == "COMPANY_POSTALCODE")
                        {
                            _entryBoxZipCode = entryBoxValidation;
                            _entryBoxZipCode.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExZipCode;
                        }
                        //If is FiscalNumber Assign it to entryBoxSelectCustomerFiscalNumber Reference
                        else if (item.Token == "COMPANY_FISCALNUMBER")
                        {
                            _entryBoxFiscalNumber = entryBoxValidation;
                            _entryBoxFiscalNumber.EntryValidation.Rule = _entryBoxSelectSystemCountry.Value.RegExFiscalNumber;
                        }

                        if (item.Token == "COMPANY_TAX_ENTITY")
                        {
                            entryBoxValidation.EntryValidation.Text = "Global";
                        }

                        //Call Validate
                        entryBoxValidation.EntryValidation.Validate();
                        //Pack and Add to ObjectBag
                        vbox.PackStart(entryBoxValidation, true, true, 0);
                        _dictionaryObjectBag.Add(item, entryBoxValidation);
                    }
                }

                Viewport viewport = new Viewport()
                {
                    ShadowType = ShadowType.None
                };
                viewport.Add(vbox);

                _scrolledWindow            = new ScrolledWindow();
                _scrolledWindow.ShadowType = ShadowType.EtchedIn;
                _scrolledWindow.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
                _scrolledWindow.Add(viewport);

                viewport.ResizeMode        = ResizeMode.Parent;
                _scrolledWindow.ResizeMode = ResizeMode.Parent;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
コード例 #3
0
        private void InitUI()
        {
            BOWidgetBox boxValue = null;

            try
            {
                CFG_ConfigurationPreferenceParameter dataSourceRow = (CFG_ConfigurationPreferenceParameter)_dataSourceRow;

                //Define Label for Value
                string valueLabel = (Resx.ResourceManager.GetString(dataSourceRow.ResourceString) != null)
                    ? Resx.ResourceManager.GetString(dataSourceRow.ResourceString)
                    : "LABEL NOT DEFINED IN Field  [ResourceString]";

                //Define RegEx for Value
                string valueRegEx = "REGULAR EXPRESSION NOT DEFINED IN Field [RegEx]";
                if (dataSourceRow.RegEx != null)
                {
                    //Try to get Value
                    object objectValueRegEx = FrameworkUtils.GetFieldValueFromType(typeof(SettingsApp), dataSourceRow.RegEx);
                    if (objectValueRegEx != null)
                    {
                        valueRegEx = objectValueRegEx.ToString();
                    }
                }

                //Define Label for Value
                bool valueRequired = (dataSourceRow.Required)
                    ? dataSourceRow.Required
                    : false;

                //Override Db Regex with ConfigurationSystemCountry RegExZipCode and RegExFiscalNumber
                if (dataSourceRow.Token == "COMPANY_POSTALCODE")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExZipCode;
                }
                if (dataSourceRow.Token == "COMPANY_FISCALNUMBER")
                {
                    valueRegEx = SettingsApp.ConfigurationSystemCountry.RegExFiscalNumber;
                }

                //Tab1
                VBox vboxTab1 = new VBox(false, _boxSpacing)
                {
                    BorderWidth = (uint)_boxSpacing
                };

                //Ord
                Entry       entryOrd = new Entry();
                BOWidgetBox boxLabel = new BOWidgetBox(Resx.global_record_order, entryOrd);
                vboxTab1.PackStart(boxLabel, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxLabel, _dataSourceRow, "Ord", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Code
                Entry       entryCode = new Entry();
                BOWidgetBox boxCode   = new BOWidgetBox(Resx.global_record_code, entryCode);
                vboxTab1.PackStart(boxCode, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxCode, _dataSourceRow, "Code", SettingsApp.RegexIntegerGreaterThanZero, true));

                //Token
                Entry       entryToken = new Entry();
                BOWidgetBox boxToken   = new BOWidgetBox(Resx.global_token, entryToken);
                vboxTab1.PackStart(boxToken, false, false, 0);
                _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxToken, _dataSourceRow, "Token", SettingsApp.RegexAlfaNumericExtended, true));

                //Get InputType
                PreferenceParameterInputType inputType = (PreferenceParameterInputType)Enum.Parse(typeof(PreferenceParameterInputType), dataSourceRow.InputType.ToString(), true);

                Entry entryValue = new Entry();

                switch (inputType)
                {
                case PreferenceParameterInputType.Text:
                case PreferenceParameterInputType.TextPassword:
                    boxValue = new BOWidgetBox(valueLabel, entryValue);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    // Turn entry into a TextPassword, curently we not use it, until we can turn Visibility = false into TreeView Cell
                    if (inputType.Equals(PreferenceParameterInputType.TextPassword))
                    {
                        entryValue.Visibility = false;
                    }

                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // ValueTip
                    if (!string.IsNullOrEmpty(dataSourceRow.ValueTip))
                    {
                        entryValue.TooltipText = string.Format(Resx.global_prefparam_value_tip_format, dataSourceRow.ValueTip);
                    }
                    break;

                case PreferenceParameterInputType.Multiline:
                    EntryMultiline entryMultiline = new EntryMultiline();
                    entryMultiline.Value.Text = dataSourceRow.Value;
                    entryMultiline.ScrolledWindow.BorderWidth = 1;
                    entryMultiline.HeightRequest = 122;
                    Label labelMultiline = new Label(Resx.global_notes);
                    boxValue = new BOWidgetBox(valueLabel, entryMultiline);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", valueRegEx, valueRequired));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent + 100;
                    break;

                case PreferenceParameterInputType.CheckButton:
                    CheckButton checkButtonValue = new CheckButton(valueLabel);
                    vboxTab1.PackStart(checkButtonValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(checkButtonValue, _dataSourceRow, "Value"));
                    // Override Default Window Height
                    _windowHeight = _windowHeightForTextComponent - 20;
                    break;

                case PreferenceParameterInputType.ComboBox:
                    break;

                case PreferenceParameterInputType.FilePicker:
                case PreferenceParameterInputType.DirPicker:
                    //FilePicker
                    FileChooserAction fileChooserAction = (inputType.Equals(PreferenceParameterInputType.FilePicker)) ? FileChooserAction.Open : FileChooserAction.SelectFolder;
                    FileChooserButton fileChooser       = new FileChooserButton(string.Empty, fileChooserAction)
                    {
                        HeightRequest = 23
                    };
                    if (inputType.Equals(PreferenceParameterInputType.FilePicker))
                    {
                        fileChooser.SetFilename(dataSourceRow.Value);
                        fileChooser.Filter = Utils.GetFileFilterImages();
                    }
                    else
                    {
                        fileChooser.SetCurrentFolder(dataSourceRow.Value);
                    }
                    boxValue = new BOWidgetBox(valueLabel, fileChooser);
                    vboxTab1.PackStart(boxValue, false, false, 0);
                    _crudWidgetList.Add(new GenericCRUDWidgetXPO(boxValue, _dataSourceRow, "Value", string.Empty, false));
                    break;

                default:
                    break;
                }

                //Append Tab
                _notebook.AppendPage(vboxTab1, new Label(Resx.global_record_main_detail));

                //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

                //Disable Components
                entryToken.Sensitive = false;

                //Protect PreferenceParameterInputType : Disable if is COMPANY_FISCALNUMBER or Other Sensitive Data
                CFG_ConfigurationPreferenceParameter parameter = (_dataSourceRow as CFG_ConfigurationPreferenceParameter);
                if (entryValue != null)
                {
                    entryValue.Sensitive = (
                        parameter.Token != "COMPANY_NAME" &&
                        parameter.Token != "COMPANY_BUSINESS_NAME" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY" &&
                        parameter.Token != "COMPANY_COUNTRY_CODE2" &&
                        parameter.Token != "COMPANY_FISCALNUMBER" &&
                        parameter.Token != "SYSTEM_CURRENCY"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION"
                        //&& parameter.Token != "COMPANY_CIVIL_REGISTRATION_ID"
                        );
                }
            }
            catch (System.Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }