public FormattedString AsFormattedString(Color matchHighlightColor)
        {
            FormattedString formattedString = new FormattedString();

            if (Index != 0)
            {
                formattedString.Spans.Add(new Span()
                {
                    Text = EntryField.Substring(0, Index)
                });
            }
            formattedString.Spans.Add(new Span()
            {
                Text = EntryField.Substring(Index, Length), ForegroundColor = matchHighlightColor
            });
            int endIndex = Index + Length;

            if (endIndex != EntryField.Length)
            {
                formattedString.Spans.Add(new Span()
                {
                    Text = EntryField.Substring(endIndex)
                });
            }
            return(formattedString);
        }
示例#2
0
        private FilterDefinition <Entry> CreateEqFilter(EntryField field, object value)
        {
            switch (field)
            {
            case EntryField.EntryId:
                return(Builders <Entry> .Filter.Eq(x => x.Id, value.ToString()));

            case EntryField.Uri:
                return(Builders <Entry> .Filter.Eq(x => x.Uri, (URI)value));

            case EntryField.UriFullURI:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.FullURI, value.ToString()));

            case EntryField.UriShortURI:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.ShortURI, value.ToString()));

            case EntryField.UriToken:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.Token, value.ToString()));

            case EntryField.UriClicked:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.Clicked, (int)value));

            case EntryField.UriCreated:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.Created, (DateTime)value));

            case EntryField.UriCreater:
                return(Builders <Entry> .Filter.Eq(x => x.Uri.Creater, value.ToString()));

            default:
                throw new InvalidEnumArgumentException();
            }
        }
示例#3
0
        public void Update(EntryField filterField, object filterValue, EntryField updateField, object updateValue)
        {
            var filter = CreateEqFilter(filterField, filterValue);
            var update = CreateSetUpdate(updateField, updateValue);

            _collection.UpdateMany(filter, update);
        }
        protected override void SelectGroups(List <MutableObject> entry)
        {
            SelectedList   = new List <MutableObject>();
            UnSelectedList = new List <MutableObject>();

            var selectedListOnly = SelectedListOnly.GetFirstValue(entry.First());

            int entryCount = 0;
            var maxEntries = NumberOfEntries.GetValue(entry);

            foreach (var subEntry in EntryField.GetEntries(entry))
            {
                if (entryCount++ < maxEntries)
                {
                    SelectedList.Add(subEntry.Last());
                }
                else
                {
                    if (selectedListOnly)
                    {
                        break;
                    }
                    UnSelectedList.Add(subEntry.Last());
                }
            }
        }
        public MaterialDatePicker()
        {
            InitializeComponent();
            EntryField.BindingContext    = this;
            BottomBorder.BackgroundColor = DefaultColor;
            EntryField.Focused          += (s, a) =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    EntryField.Unfocus();
                    Picker.Focus();
                });
            };
            Picker.Focused += async(s, a) =>
            {
                HiddenBottomBorder.BackgroundColor = AccentColor;
                HiddenLabel.TextColor = AccentColor;
                HiddenLabel.IsVisible = true;
                if (string.IsNullOrEmpty(EntryField.Text))
                {
                    // animate both at the same time
                    await Task.WhenAll(
                        HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, BottomBorder.Width, BottomBorder.Height), 200),
                        HiddenLabel.FadeTo(1, 60),
                        HiddenLabel.TranslateTo(HiddenLabel.TranslationX, EntryField.Y - EntryField.Height + 4, 200, Easing.BounceIn)
                        );

                    EntryField.Placeholder = null;
                }
                else
                {
                    await HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, BottomBorder.Width, BottomBorder.Height), 200);
                }
            };
            Picker.Unfocused += async(s, a) =>
            {
                if (IsValid)
                {
                    HiddenLabel.TextColor = DefaultColor;
                }
                Picker_DateSelected(s, new DateChangedEventArgs(Picker.Date, Picker.Date));
                if (string.IsNullOrEmpty(EntryField.Text))
                {
                    // animate both at the same time
                    await Task.WhenAll(
                        HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, 0, BottomBorder.Height), 200),
                        HiddenLabel.FadeTo(0, 180),
                        HiddenLabel.TranslateTo(HiddenLabel.TranslationX, EntryField.Y, 200, Easing.BounceIn)
                        );

                    EntryField.Placeholder = Placeholder;
                }
                else
                {
                    await HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, 0, BottomBorder.Height), 200);
                }
            };

            Picker.DateSelected += Picker_DateSelected;
        }
示例#6
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            var filledGraph = VisualizerFactory.InstantiateFilledGraph();

            filledGraph.Initialize(this, payload);

            AssignStates(filledGraph);


            var mainColor = MainColor.GetFirstValue(payload.Data);


            foreach (var entry in EntryField.GetEntries(payload.Data))
            {
                filledGraph.AddPoint(ZAxis.GetValue(entry),
                                     YAxis.GetValue(entry));
            }

            filledGraph.SetGraphData(
                mainColor);

            filledGraph.ApplyPoints();

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
示例#7
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            //payload.VisualData.Bound.Data = payload.Data;

            var metaEntries = EntryField.GetEntries(payload.Data);

            var createdPayloads = new List <VisualPayload>();

            foreach (var metaEntry in metaEntries)
            {
                // foreach ( var entry in entries )
                // {
                var newBound = payload.VisualData.Bound.CreateDependingBound(Name);

                var newPayload = new VisualPayload(metaEntry.Last(), new VisualDescription(newBound));

                //newBound.Data = metaEntry.Last();

                createdPayloads.Add(newPayload);
            }

            MetaSelectionSet selectionManager = MetaSelectionSet.ConstructPayloadSelectionSet(
                payload.VisualData.Bound, createdPayloads,
                NormalState, SelectedState, NoneSelectedState,
                NormalStateMulti, SelectedStateMulti, NoneSelectedStateMulti);

            var iterator = selectionManager.TransmitAll();

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
        private IList <IEntryField> SetEntryFields(SearchResultModel searchResultModel, int level)
        {
            var entryFields = new List <IEntryField>();

            if (!string.IsNullOrEmpty(searchResultModel.Definition))
            {
                var definitionEntryField = new EntryField
                {
                    Name  = "Definition",
                    Value = searchResultModel.Definition
                };
                entryFields.Add(definitionEntryField);
            }

            if (!string.IsNullOrEmpty(searchResultModel.Domain))
            {
                var domainEntryField = new EntryField
                {
                    Name  = "Domain",
                    Value = searchResultModel.Domain
                };
                entryFields.Add(domainEntryField);
            }

            if (!string.IsNullOrEmpty(searchResultModel.Subdomain))
            {
                var domainEntryField = new EntryField
                {
                    Name  = "Subdomain",
                    Value = searchResultModel.Subdomain
                };
                entryFields.Add(domainEntryField);
            }

            if (level == 2)             // term
            {
                if (!string.IsNullOrEmpty(searchResultModel.TermType))
                {
                    var termTypeEntryField = new EntryField
                    {
                        Name  = "Type",
                        Value = searchResultModel.TermType
                    };
                    entryFields.Add(termTypeEntryField);
                }

                if (searchResultModel.Evaluation > -1)
                {
                    var evaluationEntryField = new EntryField
                    {
                        Name  = "Status",
                        Value = GetStatusName(searchResultModel.Evaluation)
                    };
                    entryFields.Add(evaluationEntryField);
                }
            }

            return(entryFields);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var cleanButton = new UIBarButtonItem("Clean", UIBarButtonItemStyle.Plain, DeleteCheckedItems);

            NavigationItem.RightBarButtonItem = cleanButton;

            ShowSyncButton();

            EntryField.ShouldEndEditing += (sender) => {
                EntryField.ResignFirstResponder();
                return(true);
            };

            EntryField.EditingDidEndOnExit += AddNewItem;

            // Custom initialization
            InitializeDatabase();
            InitializeCouchbaseSummaryView();
            InitializeDatasource();

            Datasource.TableView          = TableView;
            Datasource.TableView.Delegate = new CouchtableDelegate(this, Datasource);
            TableView.SectionHeaderHeight = 0;

            UIImage backgroundImage = null;

            switch (Convert.ToInt32(UIScreen.MainScreen.PreferredMode.Size.Height))
            {
            case 480:
                backgroundImage = UIImage.FromBundle("Default");
                break;

            case 960:
                backgroundImage = UIImage.FromBundle("Default@2x");
                break;

            default:
                backgroundImage = UIImage.FromBundle("Default-568h@2x");
                break;
            }

            var background = new UIImageView(UIImage.FromImage(backgroundImage.CGImage, UIScreen.MainScreen.Scale, UIImageOrientation.Up))
            {
                ContentMode        = UIViewContentMode.ScaleAspectFill,
                ContentScaleFactor = UIScreen.MainScreen.Scale
            };

            background.AutosizesSubviews = true;
            background.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;
            var newLocation = background.Frame.Location;

            newLocation.Y    = -65f;
            background.Frame = new CGRect(newLocation, background.Frame.Size);

            View.InsertSubviewBelow(background, View.Subviews [0]);
        }
示例#10
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            payload.VisualData.Bound.name = "Line Graph Bound";

            var lineGraph = VisualizerFactory.InstantiateLineGraph();

            lineGraph.Initialize(this, payload);

            AssignStates(lineGraph);

            var entries = EntryField.GetLastKeyValue(payload.Data) as IEnumerable <MutableObject>;

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }

            if (!entries.Any())
            {
                yield return(null);

                yield break;
            }

            foreach (var entry in entries)
            {
                Vector3 entryPosition =
                    new Vector3(
                        XAxis.GetLastKeyValue(entry),
                        YAxis.GetLastKeyValue(entry),
                        ZAxis.GetLastKeyValue(entry)
                        );

                Color pointColor = PointColor.GetLastKeyValue(entry);

                lineGraph.AddPoint(entryPosition, pointColor);

                yield return(null);
            }

            yield return(null);

            lineGraph.SetLineData(MainColor.GetLastKeyValue(payload.Data),
                                  LineWidth.GetLastKeyValue(payload.Data),
                                  ZDepthOffset.GetLastKeyValue(payload.Data),
                                  EdgeColor.GetLastKeyValue(payload.Data),
                                  EdgeWidth.GetLastKeyValue(payload.Data),
                                  PointWidth.GetLastKeyValue(payload.Data),
                                  PulseLine.GetLastKeyValue(payload.Data),
                                  PulseWidth.GetLastKeyValue(payload.Data),
                                  Wipe.GetLastKeyValue(payload.Data),
                                  StartTime.GetLastKeyValue(payload.Data),
                                  WipeDuration.GetLastKeyValue(payload.Data)
                                  );

            lineGraph.ApplyPoints();
        }
示例#11
0
        public async Task <IList <Entry> > ReadAsync(EntryField field, object value)
        {
            if (value == null)
            {
                return(null);
            }
            var filter  = CreateEqFilter(field, value);
            var entries = (await _collection.FindAsync(filter)).ToList();

            return(entries);
        }
示例#12
0
        public IList <Entry> Read(EntryField field, object value)
        {
            if (value == null)
            {
                return(null);
            }
            var filter  = CreateEqFilter(field, value);
            var entries = _collection.Find(filter).ToList();

            return(entries);
        }
        protected override void CreateWidgets()
        {
            okButton     = new Button(this);
            cancelButton = new Button(this);
            fontList     = new ListBox(this);
            fontName     = new EntryField(this);

            // fill the listBox with the available font names

            // assemble the widgets in the dialog
        }
示例#14
0
        public void it_returns_full_build_field_attributes()
        {
            var tempBuildConfig = m_client.BuildConfigs.All().First();

            EntryField   entryField   = EntryField.WithFields(name: true, value: true);
            EntriesField entriesField = EntriesField.WithFields(entry: entryField);
            var          buildField   = BuildField.WithFields(attributes: entriesField);
            var          tempBuild    = m_client.Builds.LastBuildByBuildConfigId(tempBuildConfig.Id);
            var          build        = m_client.Builds.GetFields(buildField.ToString()).ById(tempBuild.Id);

            Assert.IsNotNull(build);
        }
示例#15
0
        public MaterialTimePicker()
        {
            InitializeComponent();
            EntryField.BindingContext = this;
            EntryField.Focused       += (s, a) =>
            {
                EntryField.Unfocus();
                Picker.Focus();
            };
            Picker.Focused += async(s, a) =>
            {
                HiddenBottomBorder.BackgroundColor = AccentColor;
                HiddenLabel.TextColor = AccentColor;
                HiddenLabel.IsVisible = true;
                if (string.IsNullOrEmpty(EntryField.Text))
                {
                    // animate both at the same time
                    await Task.WhenAll(
                        HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, BottomBorder.Width, BottomBorder.Height), 200),
                        HiddenLabel.FadeTo(1, 60),
                        HiddenLabel.TranslateTo(HiddenLabel.TranslationX, EntryField.Y - EntryField.Height + 4, 200, Easing.BounceIn)
                        );

                    EntryField.Placeholder = null;
                }
                else
                {
                    await HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, BottomBorder.Width, BottomBorder.Height), 200);
                }
            };
            Picker.Unfocused += async(s, a) =>
            {
                HiddenLabel.TextColor = Color.Gray;
                if (Time == null)
                {
                    // animate both at the same time
                    await Task.WhenAll(
                        HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, 0, BottomBorder.Height), 200),
                        HiddenLabel.FadeTo(0, 180),
                        HiddenLabel.TranslateTo(HiddenLabel.TranslationX, EntryField.Y, 200, Easing.BounceIn)
                        );

                    EntryField.Placeholder = Placeholder;
                }
                else
                {
                    await HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, 0, BottomBorder.Height), 200);
                }
            };

            Picker.PropertyChanged += Picker_PropertyChanged;;
        }
示例#16
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            foreach (var entry in Scope.GetEntries(newSchema))
            {
                SelectGroups(entry);

                var firstEntry = EntryField.GetEntries(entry).First().Last();

                if (firstEntry != null)
                {
                    firstEntry = firstEntry.CloneKeys();
                }
                else
                {
                    firstEntry = new MutableObject();
                }

                if (!firstEntry.ContainsKey(ImplicitSchemaIndicator.KeyName))
                {
                    firstEntry.Add(ImplicitSchemaIndicator.KeyName, new ImplicitSchemaIndicator(this));
                }

                DenoteEmptySelectedList(newSchema, firstEntry);
                DenoteEmptyUnSelectedList(newSchema, firstEntry);

                if (!NewPayloadOnly.GetFirstValue(newSchema))
                {
                    SelectedListTarget.SetValue(SelectedList, entry);
                    UnSelectedListTarget.SetValue(UnSelectedList, entry);
                }
            }

            if (!NewPayloadOnly.GetFirstValue(newSchema))
            {
                SelectedSet.TransmitSchema(newSchema);

                UnSelectedSet.TransmitSchema(newSchema);
            }
            else
            {
                SelectedSet.TransmitSchema(new MutableObject
                {
                    { SelectedListTarget.LastKey, SelectedList }
                });
                UnSelectedSet.TransmitSchema(new MutableObject
                {
                    { UnSelectedListTarget.LastKey, UnSelectedList }
                });
            }
        }
示例#17
0
        private void InitializeMap()
        {
            string mapText = CCFileUtils.GetFileData(filename: "map.txt");

#if __IOS__
            string[] stringSeparators = new string[] { "\n" };
#else
            string[] stringSeparators = new string[] { "\r\n" };
#endif
            string[] lines     = mapText.Split(stringSeparators, StringSplitOptions.None);
            string[] dimension = lines[0].Split(' ');

            Cols    = int.Parse(dimension[0]);
            Rows    = int.Parse(dimension[1]);
            gameMap = new MapEntity[Rows, Cols];

            for (int i = 2; i < lines.Length; i++)
            {
                var items = lines[i].Split(' ');
                for (int j = 0; j < items.Length; j++)
                {
                    switch (items[j])
                    {
                    case "W":
                        gameMap[j, i - 2] = new Wall(j, i - 2);
                        break;

                    case "I":
                        gameMap[j, i - 2] = new EntryField(j, i - 2, this);
                        break;

                    case "F":
                        gameMap[j, i - 2] = new Field(j, i - 2);
                        break;

                    case "O":
                        gameMap[j, i - 2] = new ExitField(j, i - 2);
                        break;
                    }
                }
            }

            for (int i = 0; i < Rows; i++)
            {
                for (int j = 0; j < Cols; j++)
                {
                    AddChild(gameMap[j, i]);
                }
            }
        }
示例#18
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            Debug.LogWarning("[BOUND DEBUG] IsoGrid rendering to bound.", payload.VisualData.Bound);

            IsoGrid = VisualizerFactory.InstantiateIsoGrid();

            IsoGrid.Initialize(this, payload);
            //payload.VisualData.Bound.ChildVisualizer(this, IsoGrid);

            IsoGrid.DrawBackgrounds = ShowBackgrounds.GetLastKeyValue(payload.Data);

            IsoGrid.InitializeIsoGrid(payload.VisualData.Bound);

            IsoGrid.AllowSlicer = AllowSlicerField.GetLastKeyValue(payload.Data);

            AssignStates(IsoGrid);

            var entries = EntryField.GetFirstValue(payload.Data);

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }


            // Determine the full size of the entire isogrid
            int numCellsXAxis = 0;
            int numCellsZAxis = 0;

            if (entries.Any())
            {
                numCellsXAxis = XAxis.GetEntries(payload.Data).Max(e => XAxis.GetValue(e)) + 1;
                numCellsZAxis = ZAxis.GetEntries(payload.Data).Max(e => ZAxis.GetValue(e)) + 1;
            }

            IsoGrid.UpdateHorizontalScale(numCellsXAxis);
            IsoGrid.UpdateDepthScale(numCellsZAxis);

            AssignElements(entries);

            var iterator = IsoGrid.Apply();

            while (iterator.MoveNext( ))
            {
                yield return(null);
            }

            // PROCESS the label stuff, that was specified by the author:
            LabelSystem.Render(payload, IsoGrid.transform, IsoGrid.SelectionManager);
        }
示例#19
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            var elementList = EntryField.GetLastKeyValue(newSchema) as IEnumerable <MutableObject>;

            if (elementList == null)
            {
                Debug.LogError("This isn't a valid schema!  The entries field is empty!");
            }

            //var singleSchema = elementList.First();
            var multiSchema = new MutableObject();

            multiSchema.Add("Entries", elementList);
        }
        public MainPage()
        {
            // Setup the dynamic formfield configuration
            InitializeComponent();
            var onkeyList = new List <string>();

            onkeyList.Add("Intervention 1");
            onkeyList.Add("Intervention 2");
            onkeyList.Add("Intervention 3");

            var EntryList = new List <EntryControl>();

            EntryList.Add(new EntryControl("Office", "OfficeId", "Picker", "Office", "", "Office", "Field is required", "Required", true));
            EntryList.Add(new EntryControl("ControlArea", "ControlAreaId", "Picker", "ControlArea", "", "ControlArea", "Field is required", "Required", true));
            EntryList.Add(new EntryControl("Location", "LocationId", "Entry", "Location", "", "Location", "Field is required", "Required", true));

            foreach (EntryControl item in EntryList)
            {
                if (item.Type == "Entry")
                {
                    EntryField e = new EntryField();
                    e.ClassId          = item.Name;
                    e.AutomationId     = item.AutomationId;
                    e.PlaceHolderText  = item.PlaceHolderText;
                    e.TitleText        = item.TitleText;
                    e.ErrorMessageText = item.ErrorMessageText;
                    e.ErrorType        = item.ErrorType;
                    e.WidthRequest     = 300;
                    e.IsVisible        = item.IsVisible;
                    autoStack.Children.Add(e);
                }
                if (item.Type == "Picker")
                {
                    PickerField e = new PickerField();
                    e.ClassId          = item.Name;
                    e.AutomationId     = item.AutomationId;
                    e.TitleText        = item.TitleText;
                    e.ErrorMessageText = item.ErrorMessageText;
                    e.ErrorType        = item.ErrorType;
                    e.WidthRequest     = 300;
                    e.IsVisible        = item.IsVisible;
                    e.ItemsSourceList  = monkeyList;
                    autoStack.Children.Add(e);
                }
                if (item.Type == "Label")
                {
                }
            }
        }
        public IList<IEntryField> CreateEntryTermFields(int index, IList<string> approvals)
        {
            var result = new List<IEntryField>();
            if (approvals.Count == 0) return result;
            if (index >= approvals.Count) return result;

            var entryField = new EntryField
            {
                Name = "Approved",
                Value = approvals[index]
            };

            result.Add(entryField);
            return result;
        }
示例#22
0
        protected override void SelectGroups(List <MutableObject> entry)
        {
            SelectedList   = new List <MutableObject>();
            UnSelectedList = new List <MutableObject>();

            foreach (var element in EntryField.GetEntries(entry))
            {
                if (IsComms(element))
                {
                    SelectedList.Add(element.Last());
                }
                else
                {
                    UnSelectedList.Add(element.Last());
                }
            }
        }
示例#23
0
        protected override void SelectGroups(List <MutableObject> entry)
        {
            SelectedList   = new List <MutableObject>();
            UnSelectedList = new List <MutableObject>();

            foreach (var subEntry in EntryField.GetEntries(entry))
            {
                if (SelectedBool.GetValue(subEntry))
                {
                    SelectedList.Add(subEntry.Last());
                }
                else
                {
                    UnSelectedList.Add(subEntry.Last());
                }
            }
        }
示例#24
0
        // Set field definition
        private IList <IEntryField> SetEntryFields(SearchResultModel searchResultModel)
        {
            var entryFields = new List <IEntryField>();

            if (!string.IsNullOrEmpty(searchResultModel.Definition))
            {
                var definitionEntryField = new EntryField
                {
                    Name  = "Definition",
                    Value = searchResultModel.Definition
                };
                entryFields.Add(definitionEntryField);
            }

            if (!string.IsNullOrEmpty(searchResultModel.Domain))
            {
                var domainEntryField = new EntryField
                {
                    Name  = "Domain",
                    Value = searchResultModel.Domain
                };
                entryFields.Add(domainEntryField);
            }

            if (!string.IsNullOrEmpty(searchResultModel.Subdomain))
            {
                var domainEntryField = new EntryField
                {
                    Name  = "Subdomain",
                    Value = searchResultModel.Subdomain
                };
                entryFields.Add(domainEntryField);
            }

            if (!string.IsNullOrEmpty(searchResultModel.TermType))
            {
                var termTypeEntryField = new EntryField
                {
                    Name  = "TermType",
                    Value = searchResultModel.TermType
                };
                entryFields.Add(termTypeEntryField);
            }
            return(entryFields);
        }
示例#25
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            SelectGroups(newSchema);


            var firstEntry = EntryField.GetEntries(newSchema).First().Last();


            if (firstEntry != null)
            {
                firstEntry = firstEntry.CloneKeys();
            }
            else
            {
                firstEntry = new MutableObject();
            }

            if (!firstEntry.ContainsKey(GroupSplitter.ImplicitSchemaIndicator.KeyName))
            {
                firstEntry.Add(GroupSplitter.ImplicitSchemaIndicator.KeyName, new GroupSplitter.ImplicitSchemaIndicator(this));
            }

            var outgoingList = SelectedList.Count == 0
                ? new List <MutableObject> {
                firstEntry
            }
                : SelectedList;

            MutableObject outgoingSchema;


            if (NewPayloadOnly.GetFirstValue(newSchema))
            {
                outgoingSchema = new MutableObject();
                outgoingSchema[EntryFieldName] = outgoingList;
            }
            else
            {
                outgoingSchema = newSchema;
                SelectedListTarget.SetValue(outgoingList, outgoingSchema);
            }


            SelectedSet.TransmitSchema(outgoingSchema);
        }
        protected override void SelectGroups(MutableObject mutable)
        {
            var numberOfEntries = NumberOfEntries.GetFirstValue(mutable);

            SelectedList = new List <MutableObject>();

            int entryCount = 0;

            foreach (var entry in EntryField.GetEntries(mutable))
            {
                if (++entryCount > numberOfEntries)
                {
                    break;
                }

                SelectedList.Add(entry.Last());
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (Datasource != null)
            {
                Datasource.Dispose();
                Datasource = null;
            }

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

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
示例#28
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            var elementList = EntryField.GetFirstValue(newSchema) as IEnumerable <MutableObject>;

            if (elementList == null)
            {
                Debug.LogError("This isn't a valid schema!  The entries field is empty!");
            }

            var singleSchema = elementList.First();
            var multiSchema  = new MutableObject();

            multiSchema.Add("Entries", elementList);

            NormalState.TransmitSchema(singleSchema);
            SelectedState.TransmitSchema(singleSchema);
            NoneSelectedState.TransmitSchema(singleSchema);

            NormalStateMulti.TransmitSchema(multiSchema);
            SelectedStateMulti.TransmitSchema(multiSchema);
            NoneSelectedStateMulti.TransmitSchema(multiSchema);
        }
示例#29
0
        public IList <IEntryField> CreateEntryTermFields(int index, IList <string> approvals)
        {
            var result = new List <IEntryField>();

            if (approvals.Count == 0)
            {
                return(result);
            }
            if (index >= approvals.Count)
            {
                return(result);
            }

            var entryField = new EntryField
            {
                Name  = ApprovedFieldName,
                Value = approvals[index]
            };

            result.Add(entryField);
            return(result);
        }
        // To validate the grid, flexlayout and the custom field configuration layout

        public void OnButtonClickedValidate(object sender, EventArgs args)
        {
            foreach (View item in ((StackLayout)this.Content).Children)
            {
                if (item.GetType() == typeof(EntryField))
                {
                    EntryField E = (EntryField)item;
                    E.Validate();
                }
            }

            foreach (View item in formGrid.Children)
            {
                if (item.GetType() == typeof(EntryField))
                {
                    EntryField E = (EntryField)item;
                    E.Validate();
                }
                if (item.GetType() == typeof(PickerField))
                {
                    PickerField P = (PickerField)item;
                    P.Validate();
                }
            }

            foreach (View item in formStack.Children)
            {
                if (item.GetType() == typeof(EntryField))
                {
                    EntryField E = (EntryField)item;
                    E.Validate();
                }
                if (item.GetType() == typeof(PickerField))
                {
                    PickerField P = (PickerField)item;
                    P.Validate();
                }
            }
        }
示例#31
0
        protected override IEnumerator ProcessPayload(VisualPayload payload)
        {
            payload.VisualData.Bound.name = "Scatter Plot Bound";

            var scatterPlot = VisualizerFactory.InstantiateScatterPlot();

            scatterPlot.Initialize(this, payload);

            AssignStates(scatterPlot);

            var entries = EntryField.GetLastKeyValue(payload.Data) as IEnumerable <MutableObject>;

            if (entries == null)
            {
                throw new Exception("Illegal mutable field here!  " + EntryField.AbsoluteKey + " is not an enumerable of mutables!");
            }

            if (!entries.Any())
            {
                yield return(null);

                yield break;
            }

            foreach (var entry in entries)
            {
                Vector3 entryPosition =
                    new Vector3(
                        XAxis.GetLastKeyValue(entry),
                        YAxis.GetLastKeyValue(entry),
                        ZAxis.GetLastKeyValue(entry)
                        );

                scatterPlot.DrawPoint(entryPosition, entry);
            }

            scatterPlot.ApplyPoints();
        }