/// <summary> /// method returns the /// </summary> public void Register(IBlazorComponent component) { // if this is the Join object if (component is Join) { // Store the JoinComponent JoinComponent = component as Join; } // if the Login else if (component is Login) { // Store the LoginComponent LoginComponent = component as Login; } else if (component is Chat) { // Store the Chat component ChatComponent = component as Chat; } // if the value for HasChildren is true if (HasChildren) { // add this item this.Children.Add(component); } }
/// <summary> /// This method returns the Child Component By Name /// </summary> public IBlazorComponent FindChildByName(string name) { // initial value IBlazorComponent child = null; // if the value for HasChildren is true if ((HasChildren) && (!String.IsNullOrEmpty(name))) { // Iterate the collection of IBlazorComponent objects foreach (IBlazorComponent childComponent in Children) { // if this is the item being sought if (childComponent.Name == name) { // set the return value child = childComponent; // break out of the loop break; } } } // return value return(child); }
/// <summary> /// method returns the Child By Name /// </summary> public IBlazorComponent FindChildByName(string name) { // initial value IBlazorComponent child = null; // if the value for HasChildren is true if (HasChildren) { // Iterate the collection of IBlazorComponent objects foreach (IBlazorComponent tempChild in Children) { // if this is the item being sought if (TextHelper.IsEqual(tempChild.Name, name)) { // set the return value child = tempChild; // break out of the loop break; } } } // return value return(child); }
/// <summary> /// method returns the /// </summary> public void Register(IBlazorComponent component) { // If the component object exists if (NullHelper.Exists(component)) { // if this is the VideoPlayer in case other components end up on this page if (component is BlazorVideoPlayer) { // Store the VideoPlayer this.VideoPlayer = component as BlazorVideoPlayer; } // Add this component this.Children.Add(component); // Create a new instance of a 'NamedParameter' object. NamedParameter namedParameter = new NamedParameter(); // Set the Name namedParameter.Name = "JSRuntime"; namedParameter.Value = JSRuntime; // Create a message DataJuggler.Blazor.Components.Message message = new DataJuggler.Blazor.Components.Message(); // add the parameter message.Parameters.Add(namedParameter); // Send the message component.ReceiveData(message); } }
/// <summary> /// This method returns the Component Registered /// </summary> public bool IsComponentRegistered(IBlazorComponent component) { // initial value bool isComponentRegistered = false; // if the value for HasChildren is true if ((HasChildren) && (NullHelper.Exists(component))) { // Iterate the collection of IBlazorComponent objects foreach (IBlazorComponent child in Children) { // if the names match if (TextHelper.IsEqual(component.Name, child.Name)) { // set the return value isComponentRegistered = true; // break out of the loop break; } } } // return value return(isComponentRegistered); }
/// <summary> /// method returns the /// </summary> public void Register(IBlazorComponent component) { // If the component object exists if (NullHelper.Exists(component)) { // if this is the UserName component if (component.Name == "UserNameComponent") { // Set the component UserNameComponent = component as ValidationComponent; } else if (component.Name == "EmailAddressComponent") { // Set the component EmailAddressComponent = component as ValidationComponent; } else if (component.Name == "PasswordComponent") { // Set the component PasswordComponent = component as ValidationComponent; } else if (component.Name == "RememberLoginComponent") { // Set the component RememberLoginComponent = component as ValidationComponent; } // if the Children collection exists if (HasChildren) { // Add this item Children.Add(component); } } }
/// <summary> /// Adds the style attribute. /// </summary> /// <param name="component">The instance of <see cref="IBlazorComponent"/>.</param> /// <param name="builder">The UI tree builder.</param> /// <param name="sequence"> An integer that represents the position of the instruction in the source code.</param> public static void AddStyleAttribute(this IBlazorComponent component, RenderTreeBuilder builder, int sequence = 999991) { var styles = component.BuildStylesString(); if (!string.IsNullOrEmpty(styles)) { builder.AddAttribute(sequence, "style", styles); } }
/// <summary> /// Adds the CSS class attribute. /// </summary> /// <param name="component">The instance of <see cref="IBlazorComponent"/>.</param> /// <param name="builder">The UI tree builder.</param> /// <param name="sequence"> An integer that represents the position of the instruction in the source code.</param> public static void AddCssClassAttribute(this IBlazorComponent component, RenderTreeBuilder builder, int sequence = 999990) { var cssClass = component.BuildCssClassString(); if (!string.IsNullOrEmpty(cssClass)) { builder.AddAttribute(sequence, "class", cssClass); } }
/// <summary> /// method returns the Child By Name /// </summary> public IBlazorComponent FindChildByName(string name) { // initial value IBlazorComponent child = null; // return value return(child); }
/// <summary> /// This method Registers the component with this component. /// </summary> public void Register(IBlazorComponent component) { // If the component object exists if (NullHelper.Exists(component, Children)) { // If this is the Login component if (component.Name == "Login") { // Set the Signup control this.Login = component as Login; } // add this child Children.Add(component); } }
/// <summary> /// This method Registers the component with this component. /// </summary> public void Register(IBlazorComponent component) { // If the component object exists if (NullHelper.Exists(component, Children)) { // If this is the SignUp component if (component.Name == "SignUp") { // Set the Signup control this.SignUp = component as SignUp; // Setup the delegate to call this.SignUp.SignUpCallback = OnSignUpComplete; } // add this child Children.Add(component); } }
/// <summary> /// method returns the /// </summary> public void Register(IBlazorComponent component) { // this is only here as an example, I am not sure if we need // to talk to the the selected button. ImageButton button = component as ImageButton; }
/// <summary> /// method returns the /// </summary> public void Register(IBlazorComponent component) { }