public override void ViewDidLoad() { base.ViewDidLoad(); NavigationController.NavigationBarHidden = false; var profiles = VideoProfiles.Get(); var profilesModel = new ProfilesModel(profiles); profilesModel.ItemSelected += UpdateProfileValues; ProfilePicker.Model = profilesModel; var selectedProfile = profiles.First(profile => profile.Id == AgoraSettings.Current.Profile); ProfilePicker.Select(profiles.IndexOf(selectedProfile), 0, true); UpdateProfileValues(selectedProfile); UseSettingsSwitch.On = AgoraSettings.Current.UseMySettings; }
void ReleaseDesignerOutlets() { if (ProfileNameValue != null) { ProfileNameValue.Dispose(); ProfileNameValue = null; } if (ResolutionValue != null) { ResolutionValue.Dispose(); ResolutionValue = null; } if (MaxBitrateValue != null) { MaxBitrateValue.Dispose(); MaxBitrateValue = null; } if (MaxFrameRateValue != null) { MaxFrameRateValue.Dispose(); MaxFrameRateValue = null; } if (ProfilePicker != null) { ProfilePicker.Dispose(); ProfilePicker = null; } if (UseSettingsSwitch != null) { UseSettingsSwitch.Dispose(); UseSettingsSwitch = null; } }
/// <summary> /// Create all the controls necessary for the user to be able to add /// the placemarks into a personal tag. /// </summary> private void CreateProfileControls() { HtmlGenericControl profileCancel, profileShow, span; Literal lt; // // Create the "Create Tag..." link that will show the download controls. // profileShow = new HtmlGenericControl("SPAN"); profileShow.InnerText = "Create Tag..."; profileShow.Attributes.Add("class", "smallText"); profileShow.Style.Add("cursor", "pointer"); profileShow.Attributes.Add("onclick", this.ClientID + "_ShowProfile();"); if (commandDiv.Controls.Count > 0) { lt = new Literal(); lt.Text = " "; commandDiv.Controls.Add(lt); } commandDiv.Controls.Add(profileShow); // // Create the profile controls area. // profileDiv = new HtmlGenericControl("DIV"); Controls.Add(profileDiv); profileDiv.ID = "profileDiv"; profileDiv.Style.Add("display", "none"); lt = new Literal(); lt.Text = "<br />"; profileDiv.Controls.Add(lt); // // Create the "new tag" text field. // span = new HtmlGenericControl("SPAN"); span.Attributes.Add("class", "smallText"); span.InnerText = "Add to new tag: "; profileDiv.Controls.Add(span); profileName = new TextBox(); profileDiv.Controls.Add(profileName); profileName.ID = "profileName"; profileName.Width = Unit.Pixel(150); lt = new Literal(); lt.Text = "<br />"; profileDiv.Controls.Add(lt); // // Create the "Existing tag" selection. // span = new HtmlGenericControl("SPAN"); span.Attributes.Add("class", "smallText"); span.InnerText = "Or existing tag: "; profileDiv.Controls.Add(span); profilePicker = new ProfilePicker(); profileDiv.Controls.Add(profilePicker); profilePicker.ID = "profilePicker"; profilePicker.AllowRemove = true; profilePicker.IncludeEvents = false; profilePicker.SelectableRoots = false; profilePicker.ProfileType = Enums.ProfileType.Ministry; profilePicker.ProfileID = -1; profilePicker.AllowedPermission = (short)Arena.Security.OperationType.Edit_People; lt = new Literal(); lt.Text = "<br />"; profileDiv.Controls.Add(lt); // // Add the "only adults" check box. // profileOnlyAdults = new CheckBox(); profileDiv.Controls.Add(profileOnlyAdults); profileOnlyAdults.ID = "profileOnlyAdults"; profileOnlyAdults.Text = "Only include adults"; profileOnlyAdults.ToolTip = "This will only add adults to the tag you have selected, no children will be added."; profileOnlyAdults.CssClass = "smallText"; lt = new Literal(); lt.Text = "<br />"; profileDiv.Controls.Add(lt); // // Create the button that triggers a download action. // createTagButton = new LinkButton(); profileDiv.Controls.Add(createTagButton); createTagButton.CssClass = "smallText"; createTagButton.ID = "createTag"; createTagButton.Text = "Add to tag"; createTagButton.OnClientClick = this.ClientID + "_HideProfile();"; createTagButton.Click += new EventHandler(createTagButton_Click); lt = new Literal(); lt.Text = " "; profileDiv.Controls.Add(lt); // // Create the "cancel" link that will hide the download controls. // profileCancel = new HtmlGenericControl("SPAN"); profileDiv.Controls.Add(profileCancel); profileCancel.InnerText = "Cancel"; profileCancel.Attributes.Add("class", "smallText"); profileCancel.Style.Add("cursor", "pointer"); profileCancel.Attributes.Add("onclick", this.ClientID + "_HideProfile();"); // // Generate all the javascript needed. // StringBuilder script = new StringBuilder(); script.Append("<script language=\"javascript\" type=\"text/javascript\">\n" + "function " + this.ClientID + "_ShowProfile() {\n" + " $('#" + commandDiv.ClientID + "').hide('fast', function() { $('#" + profileDiv.ClientID + "').show(); });\n" + "}\n" + "function " + this.ClientID + "_HideProfile() {\n" + " $('#" + profileDiv.ClientID + "').hide('fast', function() { $('#" + commandDiv.ClientID + "').show(); });\n" + "}\n" + "</script>\n"); Page.ClientScript.RegisterStartupScript(typeof(Page), this.ClientID + "_Profile", script.ToString()); }