Ejemplo n.º 1
0
        private bool ParseStatus(Element el)
        {
            StatusField field = new StatusField
            {
                Label = el.label,

                Options = el.statusType.Select(val => new StatusType()
                {
                    Value      = val.Value,
                    IconPath   = val.IconPath,
                    MappingTag = val.MappingTag,
                    TagValue   = val.TagValue
                }).ToArray(),
                DefaultValue     = el.defaultValue.Trim(),
                ReadOnly         = el.readOnly,
                Required         = el.required,
                Searchable       = el.searchable,
                ModifyEnabled    = el.modifyEnable,
                HiddenField      = el.hiddenField,
                ClientId         = el.clientId,
                ColumnName       = Utils.SafeSQLName(el.label),
                ResultVisibility = el.resultVisibility,
                ResultPosition   = el.resultPosition,
                Layout           = new LayoutPosition
                {
                    PanelId   = el.columns.ToString(),
                    ColNumber = el.columns,
                    RowNumber = el.rows
                }
            };

            sections.AddCtrl(field);
            return(true);
        }
Ejemplo n.º 2
0
 public TutorialButtonRow(Control c)
 {
     checkSolution = new CheckSolutionButton(c);
     undo = new UndoButton(c);
     statusField = new StatusField(c);
     float width = 300f;
     position = new Rect(Screen.width/2-width/2,Screen.height-110,width,40);
 }
Ejemplo n.º 3
0
 public ButtonRow(Control c)
 {
     endturn = new EndTurnButton(c);
     statusField = new StatusField(c);
     undo = new UndoButton(c);
     float width = 300f;
     position = new Rect(Screen.width/2-width/2,Screen.height-110,width,40);
 }
Ejemplo n.º 4
0
 private ButtonRow(IGUIMessages receiver)
 {
     this.receiver = receiver;
     endturn = new EndTurnButton(receiver);
     statusField = new StatusField();
     undo = new UndoButton(receiver);
     float width = 300f;
     position = new Rect(Screen.width/2-width/2,Screen.height-110,width,40);
 }
Ejemplo n.º 5
0
 private void OnModelPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (HeaderField != null && HeaderField.Contains(e.PropertyName))
     {
         BeginInvokeInUiThread(SyncHeaderAutomatic);
     }
     if (StatusField != null && StatusField.Contains(e.PropertyName))
     {
         BeginInvokeInUiThread(SyncStatusImageAutomatic);
     }
     if (ColorField != null && ColorField.Contains(e.PropertyName))
     {
         BeginInvokeInUiThread(SyncColorAutomatic);
     }
 }
Ejemplo n.º 6
0
        void ReleaseDesignerOutlets()
        {
            if (StatusField != null)
            {
                StatusField.Dispose();
                StatusField = null;
            }

            if (ContextBox != null)
            {
                ContextBox.Dispose();
                ContextBox = null;
            }

            if (ConnectionBox != null)
            {
                ConnectionBox.Dispose();
                ConnectionBox = null;
            }

            if (ConnectionButton != null)
            {
                ConnectionButton.Dispose();
                ConnectionButton = null;
            }

            if (ResultTextBox != null)
            {
                ResultTextBox.Dispose();
                ResultTextBox = null;
            }

            if (ResultTable != null)
            {
                ResultTable.Dispose();
                ResultTable = null;
            }

            if (EditorBox != null)
            {
                EditorBox.Dispose();
                EditorBox = null;
            }
        }
Ejemplo n.º 7
0
        void ReleaseDesignerOutlets()
        {
            if (HostField != null)
            {
                HostField.Dispose();
                HostField = null;
            }

            if (MessageField != null)
            {
                MessageField.Dispose();
                MessageField = null;
            }

            if (PortField != null)
            {
                PortField.Dispose();
                PortField = null;
            }

            if (StatusField != null)
            {
                StatusField.Dispose();
                StatusField = null;
            }

            if (TargetField != null)
            {
                TargetField.Dispose();
                TargetField = null;
            }

            if (UseridField != null)
            {
                UseridField.Dispose();
                UseridField = null;
            }

            if (PasswordField != null)
            {
                PasswordField.Dispose();
                PasswordField = null;
            }
        }
        public static string GetUDSValue(FieldBaseType field)
        {
            string ret = string.Empty;

            if (field is StatusField)
            {
                StatusField rField = field as StatusField;
                if (!string.IsNullOrEmpty(rField.Value))
                {
                    ret = rField.Value;
                }
                return(ret);
            }
            if (field is LookupField)
            {
                LookupField rField = field as LookupField;
                if (!string.IsNullOrEmpty(rField.Value))
                {
                    ret = string.Join(", ", JsonConvert.DeserializeObject <string[]>(rField.Value));
                }
                return(ret);
            }
            if (field is EnumField)
            {
                EnumField rField = field as EnumField;
                if (!string.IsNullOrEmpty(rField.Value))
                {
                    ret = string.Join(", ", JsonConvert.DeserializeObject <string[]>(rField.Value));
                }
                return(ret);
            }
            if (field is NumberField)
            {
                NumberField rField = field as NumberField;
                if (rField.Value != double.MinValue)
                {
                    ret = rField.Value.ToString(rField.Format);
                }
                return(ret);
            }
            if (field is BoolField)
            {
                BoolField rField = field as BoolField;
                ret = rField.Value ? "vero" : "falso";
                return(ret);
            }
            if (field is DateField)
            {
                DateField rField = field as DateField;
                if (rField.Value != DateTime.MinValue)
                {
                    ret = rField.Value.ToLongDateString();
                    if (rField.RestrictedYear)
                    {
                        ret = rField.Value.Year.ToString();
                    }
                }
                return(ret);
            }
            if (field is TextField)
            {
                TextField rField = field as TextField;
                ret = rField.Value;
            }
            return(ret);
        }
Ejemplo n.º 9
0
        private Element CreateFieldElement(FieldBaseType obj)
        {
            if (obj.GetType() == typeof(EnumField))
            {
                EnumField field     = obj as EnumField;
                Element   enumField = new Element
                {
                    ctrlType           = ctlEnum,
                    label              = field.Label,
                    enumOptions        = field.Options,
                    defaultValue       = field.DefaultValue ?? "",
                    defaultSearchValue = field.DefaultSearchValue ?? "",
                    readOnly           = field.ReadOnly,
                    required           = field.Required,
                    columnName         = field.ColumnName,
                    searchable         = field.Searchable,
                    modifyEnable       = field.ModifyEnabled,
                    hiddenField        = field.HiddenField,
                    clientId           = field.ClientId,
                    resultVisibility   = field.ResultVisibility,
                    resultPosition     = field.ResultPosition,
                    multipleValues     = field.MultipleValues
                };
                if (field.Layout != null)
                {
                    enumField.rows    = field.Layout.RowNumber;
                    enumField.columns = field.Layout.ColNumber;
                }

                return(enumField);
            }

            if (obj.GetType() == typeof(StatusField))
            {
                StatusField field       = obj as StatusField;
                Element     statusField = new Element
                {
                    ctrlType           = ctlStatus,
                    label              = field.Label,
                    statusType         = field.Options,
                    defaultValue       = field.DefaultValue ?? "",
                    defaultSearchValue = field.DefaultSearchValue ?? "",
                    readOnly           = field.ReadOnly,
                    required           = field.Required,
                    columnName         = field.ColumnName,
                    searchable         = field.Searchable,
                    modifyEnable       = field.ModifyEnabled,
                    hiddenField        = field.HiddenField,
                    clientId           = field.ClientId,
                    resultVisibility   = field.ResultVisibility,
                    resultPosition     = field.ResultPosition
                };
                if (field.Layout != null)
                {
                    statusField.rows    = field.Layout.RowNumber;
                    statusField.columns = field.Layout.ColNumber;
                }

                return(statusField);
            }

            if (obj.GetType() == typeof(TextField))
            {
                TextField field     = obj as TextField;
                Element   textField = new Element
                {
                    ctrlType           = ctlText,
                    label              = field.Label,
                    multiLine          = field.Multiline,
                    HTMLEnable         = field.HTMLEnable,
                    defaultValue       = field.DefaultValue ?? "",
                    defaultSearchValue = field.DefaultSearchValue ?? "",
                    readOnly           = field.ReadOnly,
                    required           = field.Required,
                    columnName         = field.ColumnName,
                    searchable         = field.Searchable,
                    modifyEnable       = field.ModifyEnabled,
                    hiddenField        = field.HiddenField,
                    clientId           = field.ClientId,
                    resultVisibility   = field.ResultVisibility,
                    resultPosition     = field.ResultPosition
                };
                if (field.Layout != null)
                {
                    textField.rows    = field.Layout.RowNumber;
                    textField.columns = field.Layout.ColNumber;
                }

                return(textField);
            }

            if (obj.GetType() == typeof(DateField))
            {
                DateField field   = obj as DateField;
                Element   element = new Element
                {
                    ctrlType           = ctlDate,
                    label              = field.Label,
                    defaultSearchValue = field.DefaultSearchValue.ToString("dd/MM/yyyy") ?? "",
                    restrictedYear     = field.RestrictedYear,
                    enableDefaultDate  = field.DefaultTodayEnabled,
                    readOnly           = field.ReadOnly,
                    required           = field.Required,
                    columnName         = field.ColumnName,
                    searchable         = field.Searchable,
                    modifyEnable       = field.ModifyEnabled,
                    hiddenField        = field.HiddenField,
                    clientId           = field.ClientId,
                    resultVisibility   = field.ResultVisibility,
                    resultPosition     = field.ResultPosition
                };

                element.defaultValue = "";
                if (field.DefaultValueSpecified && field.DefaultValue != DateTime.MinValue)
                {
                    element.defaultValue = field.DefaultValue.ToString("dd/MM/yyyy");
                }

                if (field.Layout != null)
                {
                    element.rows    = field.Layout.RowNumber;
                    element.columns = field.Layout.ColNumber;
                }

                return(element);
            }

            if (obj.GetType() == typeof(NumberField))
            {
                NumberField field       = obj as NumberField;
                Element     numberField = new Element
                {
                    ctrlType     = ctlNumber,
                    label        = field.Label,
                    defaultValue = field.DefaultValueSpecified == true?field.DefaultValue.ToString() : "",
                                       readOnly         = field.ReadOnly,
                                       required         = field.Required,
                                       columnName       = field.ColumnName,
                                       searchable       = field.Searchable,
                                       modifyEnable     = field.ModifyEnabled,
                                       hiddenField      = field.HiddenField,
                                       clientId         = field.ClientId,
                                       resultVisibility = field.ResultVisibility,
                                       resultPosition   = field.ResultPosition,
                                       format           = field.Format
                };
                if (field.MinValueSpecified)
                {
                    numberField.minValue = field.MinValue;
                }
                if (field.MaxValueSpecified)
                {
                    numberField.maxValue = field.MaxValue;
                }
                if (field.Layout != null)
                {
                    numberField.rows    = field.Layout.RowNumber;
                    numberField.columns = field.Layout.ColNumber;
                }
                return(numberField);
            }

            if (obj.GetType() == typeof(BoolField))
            {
                BoolField field     = obj as BoolField;
                Element   boolField = new Element
                {
                    ctrlType         = ctlCheckbox,
                    label            = field.Label,
                    defaultValue     = field.DefaultValue == true && field.DefaultValueSpecified ? "True" : "",
                    readOnly         = field.ReadOnly,
                    required         = field.Required,
                    columnName       = field.ColumnName,
                    searchable       = field.Searchable,
                    modifyEnable     = field.ModifyEnabled,
                    hiddenField      = field.HiddenField,
                    clientId         = field.ClientId,
                    resultVisibility = field.ResultVisibility,
                    resultPosition   = field.ResultPosition
                };
                if (field.Layout != null)
                {
                    boolField.rows    = field.Layout.RowNumber;
                    boolField.columns = field.Layout.ColNumber;
                }
                return(boolField);
            }

            if (obj.GetType() == typeof(LookupField))
            {
                LookupField field  = obj as LookupField;
                Element     lookup = new Element
                {
                    ctrlType             = ctlLookup,
                    label                = field.Label,
                    required             = field.Required,
                    columnName           = field.ColumnName,
                    lookupRepositoryName = field.LookupArchiveName,
                    lookupFieldName      = field.LookupArchiveColumnName == "_subject" ? "Oggetto" : field.LookupArchiveColumnName,
                    searchable           = field.Searchable,
                    modifyEnable         = field.ModifyEnabled,
                    hiddenField          = field.HiddenField,
                    clientId             = field.ClientId,
                    resultVisibility     = field.ResultVisibility,
                    resultPosition       = field.ResultPosition,
                    multipleValues       = field.MultipleValues
                };
                if (field.Layout != null)
                {
                    lookup.rows    = field.Layout.RowNumber;
                    lookup.columns = field.Layout.ColNumber;
                }
                return(lookup);
            }

            return(null);
        }