This project is read-only.

HasPublicInfo, HasGMInfo, HasOwnerInfo

All data may have extra information associated to it (in form of strings). The way of showing if the data has this type of info is using some calculated properties with the following code.

partial void HasPublicInfo_Compute(ref bool? result)
{
    result = !string.IsNullOrEmpty(this.PublicInfo);
}

partial void HasGMInfo_Compute(ref bool? result)
{
    result = !string.IsNullOrEmpty(this.GMInfo);
}

partial void HasOwnerInfo_Compute(ref bool? result)
{
    result = !string.IsNullOrEmpty(this.OwnerInfo);
}

Showing detailed information

Screens that show summary of data should allow the user to see the detailed data when double clicking on it. This will be handled using a custom modal window that will be by default hidden in the Screen layout tree.

The code needed to show this modal window is the following.

partial void DetailsCollectionSelected_Execute()
{
    if (this.Collection.SelectedItem != null)
    {
        this.OpenModalWindow("ModalWindow");
        this.FindControl("ModalWindow").ControlAvailable += new EventHandler<ControlAvailableEventArgs>(ModalWindow_ControlAvailable);
        this.FindControl("PublicInfo").IsVisible = this.Collection.SelectedItem.HasPublicInfo;
        // Check for Onwer Info if needed
    }
}

void ModalWindow_ControlAvailable(object sender, ControlAvailableEventArgs e)
{
    ChildWindow window = (ChildWindow)e.Control;
    window.Closed += new EventHandler(window_Closed);
}

void window_Closed(object sender, EventArgs e)
{
    ChildWindow window = (ChildWindow)sender;
    if (!(window.DialogResult.HasValue && window.DialogResult.Value))
    {
        window.Closed -= window_Closed;
    }
}

partial void SubmitModalWindow_Execute()
{
    this.CloseModalWindow("ModalWindow");
}

Last edited Oct 27, 2011 at 2:29 PM by Vicente, version 3

Comments

No comments yet.