コード例 #1
0
        /// <summary>
        /// Method generates a list of UPMTiles
        /// </summary>
        /// <returns>
        /// List <see cref="UPMTile"/>
        /// </returns>
        private List <UPMTile> GetUPMTiles()
        {
            var recordTiles = new List <UPMTile>();

            if (Tiles?.Tiles != null)
            {
                foreach (var tile in Tiles.Tiles)
                {
                    if (string.IsNullOrWhiteSpace(tile.Value) && string.IsNullOrWhiteSpace(tile.Text))
                    {
                        continue;
                    }

                    var tileElement = new UPMTile(StringIdentifier.IdentifierWithStringId(TileIdentifier))
                    {
                        TextField = new UPMStringField(StringIdentifier.IdentifierWithStringId(TileTextIdentifier))
                        {
                            StringValue = tile.Text
                        },
                        ValueField = new UPMStringField(StringIdentifier.IdentifierWithStringId(ValueTextIdentifier))
                        {
                            StringValue = tile.Value
                        },
                        ImageName = tile.ImageName
                    };

                    recordTiles.Add(tileElement);
                }
            }

            return(recordTiles);
        }
コード例 #2
0
        /// <summary>
        /// Tileses the did finish with success.
        /// </summary>
        /// <param name="crmTiles">The CRM tiles.</param>
        /// <param name="data">The data.</param>
        public void TilesDidFinishWithSuccess(UPCRMTiles crmTiles, object data)
        {
            this.Tiles = crmTiles;
            UPMOrganizer detailOrganizer = (UPMOrganizer)this.TopLevelElement;

            if (detailOrganizer.ExpandFound)
            {
                List <UPMTile> recordTiles = new List <UPMTile>();
                foreach (UPCRMTile tile in this.Tiles.Tiles)
                {
                    if (string.IsNullOrEmpty(tile.Value) && string.IsNullOrEmpty(tile.Text))
                    {
                        continue;
                    }

                    UPMTile tileElement = new UPMTile(StringIdentifier.IdentifierWithStringId("Tile"))
                    {
                        TextField = new UPMStringField(StringIdentifier.IdentifierWithStringId("TileText"))
                        {
                            StringValue = tile.Text
                        },
                        ValueField = new UPMStringField(StringIdentifier.IdentifierWithStringId("ValueText"))
                        {
                            StringValue = tile.Value
                        },
                        ImageName = tile.ImageName
                    };
                    recordTiles.Add(tileElement);
                }

                detailOrganizer.Tiles = recordTiles;
                this.InformAboutDidChangeTopLevelElement(this.Organizer, this.Organizer, null, UPChangeHints.ChangeHintsWithHint("RecordDataChanged"));
            }
            else
            {
                this.ContinueBuildDetailsOrganizerPageTilesLoaded();
            }
        }