public void SaveScreenProperties(RippleDictionary.Tile tile) { try { //Get the content Type RippleDictionary.ContentType ct = (RippleDictionary.ContentType) this.CBContentTypeValue.SelectedIndex; RippleDictionary.ScreenContent screenData = new RippleDictionary.ScreenContent(ct, tile.Id, this.HeaderValue.Text, this.ContentValue.Text, (this.LoopVideoValue.SelectedValue.ToString() == "False" ? false : true)); MainPage.rippleData.Screen.CreateOrUpdateScreenContent(tile.Id, screenData); //Once successful update the corresponding screen content type for the floor tile Utilities.HelperMethods.GetFloorTileForID(tile.Id).CorrespondingScreenContentType = ct; } catch (Exception ex) { RippleCommonUtilities.LoggingHelper.LogTrace(1, "Went wrong in SaveScreenProperties for Screen Properties: {0}", ex.Message); } }
/// <summary> /// Gets the required tile object for the Tile ID /// </summary> /// <param name="TileID"></param> /// <returns></returns> public static RippleDictionary.Tile GetFloorTileForID(string TileID) { RippleDictionary.Tile reqdTile = null; try { reqdTile = MainPage.rippleData.Floor.Tiles[TileID]; } catch (Exception) { try { reqdTile = MainPage.rippleData.Floor.Tiles[TileID.Substring(0, TileID.LastIndexOf("SubTile"))].SubTiles[TileID]; } catch (Exception) { return(null); } } return(reqdTile); }
public void SetScreenProperties(RippleDictionary.Tile tile) { try { if (MainPage.rippleData.Screen.ScreenContents.ContainsKey(tile.Id)) { //Get the screen data RippleDictionary.ScreenContent screenData = MainPage.rippleData.Screen.ScreenContents[tile.Id]; //Set the content type this.CBContentTypeValue.SelectedValue = screenData.Type.ToString(); //Set the loop video visibility and value this.LoopVideoValue.SelectedValue = (screenData.LoopVideo == null) ? "False" : (Convert.ToBoolean(screenData.LoopVideo) ? "True" : "False"); if (screenData.Type == RippleDictionary.ContentType.Video) { this.LoopVideoLabel.Visibility = System.Windows.Visibility.Visible; this.LoopVideoValue.Visibility = System.Windows.Visibility.Visible; } else { this.LoopVideoLabel.Visibility = System.Windows.Visibility.Collapsed; this.LoopVideoValue.Visibility = System.Windows.Visibility.Collapsed; } //Set the content URI if ((screenData.Type == RippleDictionary.ContentType.PPT || screenData.Type == RippleDictionary.ContentType.Image || screenData.Type == RippleDictionary.ContentType.Video || screenData.Type == RippleDictionary.ContentType.HTML) && screenData.Content.StartsWith(@"\Assets\")) { this.ContentValue.Text = Utilities.HelperMethods.TargetAssetsRoot + screenData.Content; } else { this.ContentValue.Text = screenData.Content; } //Set the header text this.HeaderValue.Text = screenData.Header; //Set the browse button visibility if (screenData.Type == RippleDictionary.ContentType.Text || screenData.Type == RippleDictionary.ContentType.HTML || screenData.Type == RippleDictionary.ContentType.Nothing) { this.ContentBrowseButton.IsEnabled = false; } else { this.ContentBrowseButton.IsEnabled = true; } //Set the content box properties if (screenData.Type == RippleDictionary.ContentType.HTML || screenData.Type == RippleDictionary.ContentType.Text) { this.ContentValue.IsReadOnlyCaretVisible = false; this.ContentValue.IsReadOnly = false; } else { this.ContentValue.IsReadOnlyCaretVisible = true; this.ContentValue.IsReadOnly = true; } } else { //Just set the defaults this.CBContentTypeValue.SelectedValue = RippleDictionary.ContentType.Nothing.ToString(); this.ContentValue.Text = ""; this.LoopVideoValue.SelectedValue = "False"; this.LoopVideoLabel.Visibility = System.Windows.Visibility.Collapsed; this.LoopVideoValue.Visibility = System.Windows.Visibility.Collapsed; this.HeaderValue.Text = ""; this.ContentBrowseButton.IsEnabled = false; this.ContentValue.IsReadOnlyCaretVisible = true; this.ContentValue.IsReadOnly = true; } } catch (Exception ex) { RippleCommonUtilities.LoggingHelper.LogTrace(1, "Went wrong in SetScreenProperties for Screen Properties: {0}", ex.Message); } }