User Profile & Activity

Alex H Member
Page
of 3
 FirmSubscriptions firmsubs = FirmSubscriptions.GetFirmSubscriptions(GetFirmID());
foreach (FirmSubscription firmsub in firmsubs)
{
foreach (Shortcut sc in firmsub.Module.Shortcuts)
{
if ((sc.UserType == "FirmUser") ||
(sc.UserType == "FirmAdmin" && (FirmUser.IsFirmAdmin || FirmUser.IsAdmin)) ||
(sc.UserType == "Admin" && FirmUser.IsAdmin))
{
ISNet.WebUI.WebDesktop.WebDesktopShortcut shortcut = new ISNet.WebUI.WebDesktop.WebDesktopShortcut();
shortcut.Name = "sc" + sc.ShortName;
shortcut.WindowName = "wnd" + sc.ShortName;
shortcut.Text = sc.ShortcutName;
shortcut.ToolTip = sc.Tooltip;
shortcut.TargetURL = sc.TargetURL;
shortcut.Image = sc.IconURL;
shortcut.Visible = true;
WebDesktopManager1.ShortcutIcons.Add(shortcut);


ISNet.WebUI.WebDesktop.WebDesktopWindow window = new ISNet.WebUI.WebDesktop.WebDesktopWindow();
window.Name = "wnd" + sc.ShortName;
window.Text = sc.WindowName;
window.ShowInTaskBar = true;
if (sc.Maximized)
window.WindowState = ISNet.WebUI.WebDesktop.WindowState.Maximized;

if (sc.AllowMaximize)
window.AllowMaximize = ISNet.WebUI.WebDesktop.AllowMaximize.Yes;
else
window.AllowMaximize = ISNet.WebUI.WebDesktop.AllowMaximize.No;

if (sc.AllowMinimize)
window.AllowMinimize = ISNet.WebUI.WebDesktop.AllowMinimize.Yes;
else
window.AllowMinimize = ISNet.WebUI.WebDesktop.AllowMinimize.No;

if (sc.AllowClose)
window.AllowClose = ISNet.WebUI.WebDesktop.CloseMode.Yes;
else
window.AllowClose = ISNet.WebUI.WebDesktop.CloseMode.No;


window.ClientVisible = sc.ClientVisible;
window.ContentURL = sc.TargetURL;
window.ContentMode = ISNet.WebUI.WebDesktop.ContentMode.UseIFrame;

if (sc.SizeMin != "")
{
try
{

int x = 0; int y = 0;
x = Int32.Parse(sc.SizeMin.Substring(0, sc.SizeMin.IndexOf("x")));
y = Int32.Parse(sc.SizeMin.Substring(sc.SizeMin.IndexOf("x") + 1));
window.MinimumSize = new System.Drawing.Size(x, y);
}
catch { Response.Redirect("/Error.aspx?message=Invalid window dimensions");}
}

if (sc.SizeMax != "")
{
try
{
int x = 0; int y = 0;
x = Int32.Parse(sc.SizeMax.Substring(0, sc.SizeMax.IndexOf("x")));
y = Int32.Parse(sc.SizeMax.Substring(sc.SizeMax.IndexOf("x") + 1));
window.MaximumSize = new System.Drawing.Size(x, y);
}
catch { Response.Redirect("/Error.aspx?message=Invalid window dimensions"); }
}


WebDesktopManager1.Windows.Add(window);
}
}

}

WebDesktopManager1.ShortcutIconsVisible = true;


Thank you for your reply.


All windows and shortcuts are set dynamically upon pageload based upon the logged in user permissions.  Below is a code snip so you can see the properties assigned to the window / sc. 


Thank you for your reply.

The WebDesktop is remarkably simply at this stage of development. 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Authenticated.aspx.cs" Inherits="MDSPortal.Web.Partner.Authenticated" %>

<%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop"
TagPrefix="ISWebDesktop" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
<head id="Head1" runat="server">
<title>**************** - Authenticated User</title>
</head>
<body style="padding:0px; margin:0px; overflow:hidden;">
<form id="form1" runat="server">
<div>
<ISWebDesktop:WebDesktopManager ID="WebDesktopManager1" runat="server"
ActiveWindowIndex="0" Height="100%" Width="100%">
<FrameStyle BackColor="WhiteSmoke"></FrameStyle>

<TaskBarButtonStyle>

<Normal Cursor="Default" Font-Names="segoe ui,tahoma" Font-Size="9pt" Width="150px">
<BorderSettings>
<Bottom Color="Gray" />
<Right Color="Gray" />
</BorderSettings>
</Normal>
<Over BackgroundImage="url(/CommonLibrary/Images/WebDesktop/npi_o7_over.gif)"
BaseStyle="Normal">
</Over>
<Active BaseStyle="Normal"
BackColor="WhiteSmoke"
backgroundimage="url(/CommonLibrary/Images/WebDesktop/npi_o7_active.gif)">
<BorderSettings>
<Bottom Color="White"></Bottom>

<Right Color="White"></Right>
</BorderSettings>
</Active>

</TaskBarButtonStyle>

<WindowSettings bordertype="ComplexImages" commandbuttonbordertype="ComplexImages">
<WindowStyle>
<Active BaseStyle="Normal" BorderColor="#B0CFF7">
<BorderSettings>
<Top Color="176, 207, 247" Width="0px" />
</BorderSettings>
</Active>

<Normal BackColor="White" BorderColor="LightGray" BorderStyle="Solid"
BorderWidth="3px" Font-Names="segoe ui,tahoma" Font-Size="9pt" height="100%"
overflow="Auto" overflowx="Auto" overflowy="Auto">
<BorderSettings>
<Top Color="LightGray" Style="Solid" Width="0px" />
</BorderSettings>
</Normal>
</WindowStyle>

<CaptionStyle>
<Active BaseStyle="Normal" forecolor="#15428B"></Active>

<Normal Cursor="Default" Font-Names="segoe ui,tahoma" Font-Size="10pt"
ForeColor="Gray">
<Padding Top="3px" Left="2px" Right="2px" Bottom="2px"></Padding>
</Normal>
</CaptionStyle>

<CaptionButtonStyle>

<Normal Overflow="Hidden" OverflowY="Hidden" OverflowX="Hidden"></Normal>

<Over BaseStyle="Normal">
<BorderSettings>
<Bottom Color="Gray" />
<Right Color="Gray" />
</BorderSettings>
</Over>
<Active BaseStyle="Normal">
<BorderSettings>
<Left Color="Gray" />
<Top Color="Gray" />
</BorderSettings>
</Active>
</CaptionButtonStyle>

<ContainerStyle Overflow="Auto" OverflowY="Auto" OverflowX="Auto" BackColor="White"
Font-Names="segoe ui,tahoma" Font-Size="9pt" Height="100%" Width="100%">
<Padding Top="4px" Left="4px" Right="4px" Bottom="4px"></Padding>
</ContainerStyle>

<CommandButtonStyle>
<Active BaseStyle="Normal"></Active>

<Normal BorderStyle="None" Font-Names="segoe ui,tahoma" Font-Size="9pt"
forecolor="Black"></Normal>

<Over BaseStyle="Normal"></Over>
</CommandButtonStyle>

<CommandButtonDisabledStyle BackColor="Control" BorderColor="ControlDarkDark"
BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma" Font-Size="8pt"
ForeColor="Gray"></CommandButtonDisabledStyle>
</WindowSettings>

<ImagesSettings ButtonCenterActive="o7/button_center_active.gif"
ButtonCenterInactive="o7/button_center_normal.gif"
ButtonCenterOver="o7/button_center_over.gif"
ButtonLeftActive="o7/button_left_active.gif"
ButtonLeftInactive="o7/button_left_normal.gif"
ButtonLeftOver="o7/button_left_over.gif"
ButtonRightActive="o7/button_right_active.gif"
ButtonRightInactive="o7/button_right_normal.gif"
ButtonRightOver="o7/button_right_over.gif"
CaptionCenterActive="o7/center_active.gif"
CaptionCenterInactive="o7/center_inactive.gif"
CaptionLeftActive="o7/left_active.gif"
CaptionLeftInactive="o7/left_inactive.gif"
CaptionRightActive="o7/right_active.gif"
CaptionRightInactive="o7/right_inactive.gif" CloseActive="o7/close_active.gif"
CloseDown="o7/close_down.gif" CloseInactive="o7/close_inactive.gif"
CloseOver="o7/close_over.gif" MaximizeActive="o7/max_active.gif"
MaximizeDown="o7/max_down.gif" MaximizeInactive="o7/max_inactive.gif"
MaximizeOver="o7/max_over.gif" MinimizeActive="o7/min_active.gif"
MinimizeDown="o7/min_down.gif" MinimizeInactive="o7/min_inactive.gif"
MinimizeOver="o7/min_over.gif" RestoreActive="o7/restore_active.gif"
RestoreDown="o7/restore_down.gif" RestoreInactive="o7/restore_inactive.gif"
RestoreOver="o7/restore_over.gif" />

<ShortcutStyle>
<Active BaseStyle="Normal" BackColor="#A7CDF0"></Active>

<Normal Cursor="Default" Font-Names="Segoe UI,Tahoma" Font-Size="9pt"></Normal>
</ShortcutStyle>

<MenuStyles>
<System backgroundstripcolor="233, 238, 238" backgroundstripcolor2=""
menuanimation="True" menudropshadow="True" menuwindowtype="Normal">
<ItemStyle>
<Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt"></Normal>

<Over BaseStyle="Normal" BackColor="#FFE7A2" bordercolor="#FFBD69"
borderstyle="Solid" borderwidth="1px"></Over>
</ItemStyle>

<DisabledItemStyle>
<Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt" ForeColor="Silver"></Normal>

<Over BaseStyle="Normal" BackColor="WhiteSmoke" bordercolor="#FFBD69"
borderstyle="Solid" borderwidth="1px" forecolor="Gray"></Over>
</DisabledItemStyle>

<CheckedItemStyle>
<Normal BackColor="#FFBD69" BorderColor="#FFAB3F" BorderStyle="Solid"
BorderWidth="1px">
</Normal>
<Over BackColor="#FB8C3C" BorderColor="#FB8C3C" BorderStyle="Solid"
BorderWidth="1px">
</Over>
</CheckedItemStyle>

<FrameStyle BackColor="White" BorderColor="#404040" BorderStyle="Solid" BorderWidth="1px"></FrameStyle>

<SeparatorStyle>
<BorderSettings>
<Top Width="1px" Color="154, 198, 255" Style="Solid"></Top>
</BorderSettings>
</SeparatorStyle>
</System>
<Application BackgroundStripColor="233, 238, 238" BackgroundStripColor2=""
MenuAnimation="True" MenuDropShadow="True" MenuWindowType="Normal">
<ItemStyle>
<Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt">
</Normal>
<Over BackColor="#FFE7A2" BaseStyle="Normal" BorderColor="#FFBD69"
BorderStyle="Solid" BorderWidth="1px">
</Over>
</ItemStyle>
<DisabledItemStyle>
<Normal Font-Names="segoe ui,tahoma" Font-Size="8.25pt" ForeColor="Silver">
</Normal>
<Over BackColor="WhiteSmoke" BaseStyle="Normal" BorderColor="#FFBD69"
BorderStyle="Solid" BorderWidth="1px" ForeColor="Gray">
</Over>
</DisabledItemStyle>
<CheckedItemStyle>
<Normal BackColor="#FFBD69" BorderColor="#FFAB3F" BorderStyle="Solid"
BorderWidth="1px">
</Normal>
<Over BackColor="#FB8C3C" BorderColor="#FB8C3C" BorderStyle="Solid"
BorderWidth="1px">
</Over>
</CheckedItemStyle>
<FrameStyle BackColor="White" BorderColor="#6593CF" BorderStyle="Solid"
BorderWidth="1px">
</FrameStyle>
<SeparatorStyle>
<BorderSettings>
<Top Color="154, 198, 255" Style="Solid" Width="1px" />
</BorderSettings>
</SeparatorStyle>
</Application>
</MenuStyles>

<Windows>
</Windows>

<TaskBarStyle Overflow="Hidden" OverflowY="Hidden" OverflowX="Hidden" BackColor="#A1BDCF"
Height="30px"
backgroundimage="url(/CommonLibrary/Images/WebDesktop/npi_o7_normal.gif)">
<BorderSettings>
<Bottom Color="161, 189, 207" Style="Solid" Width="1px" />
<Top Color="161, 189, 207" Style="Solid" Width="1px" />
</BorderSettings>
</TaskBarStyle>
</ISWebDesktop:WebDesktopManager>
</div>
</form>
</body>
</html>


Attached is a screen capture.

Note that at first, when I was trying to move the Window I was "click and dragging".  Thereafter, the window was stuck in the "move" state, and the window would move without the mouse click pressed.


Posted: October 15, 2009 10:55 AM

Hello,

For now, we have a property for changing the background (DesktopManager.ImagesSettings.OverlayBackground). But if you would like to do it via client side, you can also rewrite the element at frame level. I have attached a simple sample to show you how. Hope this helps.

Regards,
Handy

 

Thank you for your reply.

I see the when specifying an Image URL to this property, the image is stretched to the maximum dimensions of the desktop.

How can we set the maximum dimensions for the background image and specify the absolute position on the desktop?

Thank you in advance.

Posted: October 13, 2009 11:06 PM

How can this be accomplished upon page_load using .NET C# statements -- instead of client side javascript. 


I assumed the following would work, but it did not:


ISNet.WebUI.WebDesktop.WebDesktopWindow window = new ISNet.WebUI.WebDesktop.WebDesktopWindow();
window.Name = "wndTest";
window.Text = "Window Text";
window.ContentMode = ISNet.WebUI.WebDesktop.ContentMode.UseIFrame;
window.ContentURL = "/Error.aspx";
window.ClientVisible = true;
WebDesktopManager1.Windows.Add(window);
ISNet.WebUI.WebDesktop.WebDesktopShortcut shortcut = new ISNet.WebUI.WebDesktop.WebDesktopShortcut();
shortcut.Name = "Sample Shortcut";
shortcut.ToolTip = "Tooltip Text";
shortcut.TargetURL = "/Welcome.aspx";
shortcut.Image = "icon.ico";
shortcut.Visible = true;
shortcut.WindowName = "wndTest";
WebDesktopManager1.ShortcutIcons.Add(shortcut);


}


Posted: October 13, 2009 3:43 PM

Hello,

Are you creating your control by dragging the element to the page design view?  I have run into this issue when copying and pasting the HTML code itself in code view.  I find that copying and pasting causes errors for me -- and I must create the controls by dragging them from the toolbox.  I believe this has to do with how that are created and instantiated within the design file.

All times are GMT -5. The time now is 9:20 PM.
Previous Next