Ejemplo n.º 1
0
        public Search(Manager.Session Session)
            : base(Session)
        {
            // Create Selected
            this.Selected = new Model.ObservableList <Model.Item>();

            // Create Page
            this.Page       = new Properties.Integer(this.Session);
            this.Page.Value = 1;

            // Create No Pages
            this.NoPages       = new Properties.Integer(this.Session);
            this.NoPages.Value = 0;

            // Create Grid
            this.Grid             = new Grid(this.Session);
            this.Grid.AllowSelect = true;
            this.Grid.Width       = this.Width;
            this.Children.Add(this.Grid);

            // Watch for Rows Selected in Grid
            this.Grid.RowsSelected += Grid_RowsSelected;

            // Create Commands
            this.Refresh      = new RefreshCommand(this);
            this.Filters      = new FiltersCommand(this);
            this.Clear        = new ClearCommand(this);
            this.NextPage     = new NextPageCommand(this);
            this.PreviousPage = new PreviousPageCommand(this);

            // Create Page Size
            this.PageSize                  = new Properties.Integers.Spinner(this.Session);
            this.PageSize.Tooltip          = "Page Size";
            this.PageSize.Width            = 40;
            this.PageSize.Enabled          = true;
            this.PageSize.MinValue         = 5;
            this.PageSize.MaxValue         = 100;
            this.PageSize.Value            = 25;
            this.PageSize.PropertyChanged += PageSize_PropertyChanged;
        }
Ejemplo n.º 2
0
        public ViewModel.Property CreateProperty(Model.PropertyType PropertyType, System.Boolean SubstitueStringForText)
        {
            ViewModel.Property viewmodelproperty = null;

            switch (PropertyType.GetType().Name)
            {
            case "String":
                viewmodelproperty = new Properties.String(this, (Model.PropertyTypes.String)PropertyType);
                break;

            case "Federated":
                viewmodelproperty = new Properties.Federated(this, (Model.PropertyTypes.Federated)PropertyType);
                break;

            case "Integer":
                viewmodelproperty = new Properties.Integer(this, (Model.PropertyTypes.Integer)PropertyType);
                break;

            case "Float":
                viewmodelproperty = new Properties.Float(this, (Model.PropertyTypes.Float)PropertyType);
                break;

            case "Sequence":
                viewmodelproperty = new Properties.Sequence(this, (Model.PropertyTypes.Sequence)PropertyType);
                break;

            case "Item":
                viewmodelproperty = new Properties.Item(this, (Model.PropertyTypes.Item)PropertyType);
                break;

            case "Decimal":
                viewmodelproperty = new Properties.Decimal(this, (Model.PropertyTypes.Decimal)PropertyType);
                break;

            case "Date":
                viewmodelproperty = new Properties.Date(this, (Model.PropertyTypes.Date)PropertyType);
                break;

            case "Text":

                if (SubstitueStringForText)
                {
                    viewmodelproperty = new Properties.String(this, (Model.PropertyTypes.Text)PropertyType);
                }
                else
                {
                    viewmodelproperty = new Properties.Text(this, (Model.PropertyTypes.Text)PropertyType);
                }

                break;

            case "Boolean":
                viewmodelproperty = new Properties.Boolean(this, (Model.PropertyTypes.Boolean)PropertyType);
                break;

            case "List":
                viewmodelproperty = new Properties.List(this, (Model.PropertyTypes.List)PropertyType);
                break;

            default:
                throw new Model.Exceptions.ArgumentException("PropertyType not implmented: " + PropertyType.GetType().Name);
            }

            return(viewmodelproperty);
        }