/// <summary> /// /// </summary> public DesktopModule.Builder DesktopModule(DesktopModule component) { #if MVC component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null; #endif return(new DesktopModule.Builder(component)); }
public ActionResult NewFolder(string FolderName, string type) { string FolderIcon="FolderDefaultIcon"; switch (type) { case "Default": FolderIcon = "FolderDefaultIcon"; break; case "Shared": FolderIcon = "FolderSharedIcon"; break; case "Course": FolderIcon = "FolderCourseIcon"; break; case "Favourite": FolderIcon = "FolderFavouriteIcon"; break; case "Images": FolderIcon = "FolderImagesIcon"; break; case "Videos": FolderIcon = "FolderVideosIcon"; break; case "MyPC": FolderIcon = "FolderVirtualUserHDDIcon"; break; } AjaxResult r = new AjaxResult(); Desktop desktop = X.GetCmp<Desktop>("Desktop1"); var folder = new DesktopModule { ModuleID = FolderName, Shortcut = new DesktopShortcut { Name = FolderName, IconCls = FolderIcon, X = "150", Y = "30" }, //Launcher = new Ext.Net.MenuItem //{ // Text = "Dynamic module" //}, Window = { new Window { Title = FolderName, Width = 500, Height = 500, DefaultRenderTo = Ext.Net.DefaultRenderTo.Form, Icon = Icon.ApplicationAdd } }, }; desktop.AddModule(folder); return r; }
protected virtual void Modules_AfterItemRemove(DesktopModule item) { item.Desktop = null; if (item.Launcher != null) { this.Controls.Remove(item.Launcher); this.LazyItems.Remove(item.Launcher); } if (item.Window.Count > 0) { this.Controls.Remove(item.Window[0]); this.LazyItems.Remove(item.Window[0]); } }
/// <summary> /// /// </summary> /// <param name="module"></param> public virtual void AddModule(DesktopModule module) { this.Call("addModule", JRawValue.From(module.RenderToString())); if (module.Launcher != null) { var script = DefaultScriptBuilder.Create(module.Launcher).Build(RenderMode.AddTo, "{0}.getModule(\"{1}\")".FormatWith(this.ClientID, module.ModuleID), null, true, false, "addLauncher", true); this.AddScript(script); } if (module.Window.Count > 0) { var script = DefaultScriptBuilder.Create(module.Window.Primary).Build(RenderMode.AddTo, "{0}.getModule(\"{1}\")".FormatWith(this.ClientID, module.ModuleID), null, true, false, "addWindow", true); this.AddScript(script); } }
/* ConfigOptions * -----------------------------------------------------------------------------------------------*/ /// <summary> /// /// </summary> public virtual TBuilder Module(DesktopModule module) { this.ToComponent().Module = module; return(this as TBuilder); }
private void CreateNewCourseMudole(int id, string name, string iconCls) { DesktopModule m = new DesktopModule { ModuleID = "Course-" + id, Shortcut = new DesktopShortcut { Name = name, IconCls = iconCls, TextCls = "x-folder-text", Handler = "#{winCourse}.show();#{DirectMethods}.LoadCourseData(" + id + ");", } }; MyDesktop.AddModule(m); MyDesktop.ArrangeShortcuts(); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(SessionID)) { X.Redirect("Error.aspx"); } else { object[] obj = new object[] { new object[]{"Black","x-black-folder"}, new object[]{"Beige","x-beige-folder"}, new object[]{"Blue","x-blue-folder"}, new object[]{"Green","x-green-folder"}, new object[]{"Lila","x-lila-folder"}, new object[]{"Orange","x-orange-folder"}, new object[]{"Pink","x-pink-folder"}, new object[]{"White","x-white-folder"} }; storeFolderColors.DataSource = obj; storeFolderColors1.DataSource = obj; if (!X.IsAjaxRequest) { GetAllCourses(); foreach (Course course in Courses.Values) { DesktopModule m = new DesktopModule { ModuleID = "Course-" + course.ID, Shortcut = new DesktopShortcut { Name = course.CourseName, IconCls = course.IconClass, TextCls = "x-folder-text", Handler = "#{winCourse}.show();#{DirectMethods}.LoadCourseData(" + course.ID + ");", } }; MyDesktop.Modules.Add(m); } UserNotification = new List<CMwcf.Notification>(); CMwcf.Notification[] newNoti = CourseMatesWS.GetUserHistoryAndNotification(SessionID, UserID, GetLastNotificationDate()); newNoti.OrderByDescending(x => x.CreatedTime); List<object> obj1 = new List<object>(); foreach (var not in newNoti) { UserNotification.Add(not); obj1.Add( new { Subject = not.Subject, Content = not.Content.Replace("\r\n", "<br>"), Owner = not.Owner, CourseName = not.CourseName, CreatedTime = TimeAgo(not.CreatedTime) }); } storeNotification.DataSource = obj1; } } }
/// <summary> /// /// </summary> /// <param name="module"></param> public virtual void AddModule(DesktopModule module) { this.Call("addModule", JRawValue.From(module.RenderToString())); if (module.Launcher != null) { var script = DefaultScriptBuilder.Create(module.Launcher).Build(RenderMode.AddTo, "{0}.getModule(\"{1}\")".FormatWith(this.ClientID, module.ModuleID), null, true, false, "addLauncher", true); this.AddScript(script); } if (module.Window.Count > 0) { module.Window.Primary.AutoRender = false; var script = DefaultScriptBuilder.Create(module.Window.Primary).Build(RenderMode.AddTo, "{0}.getModule(\"{1}\")".FormatWith(this.ClientID, module.ModuleID), null, true, false, "setWindow", true); this.AddScript(string.Format("{0}.getModule(\"{1}\").addWindow(function(){{{2}}});", this.ClientID, module.ModuleID, script)); } }
protected virtual void Modules_AfterItemRemove(DesktopModule item) { item.Desktop = null; if(item.Launcher != null) { this.Controls.Remove(item.Launcher); this.LazyItems.Remove(item.Launcher); } if(item.Window.Count > 0) { this.Controls.Remove(item.Window[0]); this.LazyItems.Remove(item.Window[0]); } }
/// <summary> /// /// </summary> public DesktopModule.Builder DesktopModule(DesktopModule component) { return(new DesktopModule.Builder(component)); }