private void LoadTabs(DisplayTab tabs, DisplayTab tab) { List <DisplayTab> items = new List <DisplayTab>(); if (tabs != DisplayTab.None) { if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.List)) { items.Add(DisplayTab.List); } if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.Send)) { items.Add(DisplayTab.Send); } if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.Sent)) { items.Add(DisplayTab.Sent); } if (!items.Contains(tab)) { tab = items.Where(t => t != DisplayTab.Sent).FirstOrDefault(); } } View.LoadTabs(items, tab); }
public void LoadTab(DisplayTab current) { if (UserContext.isAnonymous) { SessionTimeout(View.CurrentIdCommunity, current); } else { //switch (current) { // case DisplayTab.List: // if (!View.IsInitializedList) // InitializeList(null, View.CurrentIdCommunity, View.CurrentTemplateType, View.ModulePermissions); // View.DisplayList(); // break; // case DisplayTab.Send: // if (!View.IsInitializedSender) // { // //GetAvailableSaveAs(), // View.InitializeSendMessage(false, View.CurrentIdCommunity, View.CurrentModuleCode); // } // View.DisplaySendMessage(); // break; //} View.SelectedTab = current; } }
private void LoadTabs(DisplayTab tabs, DisplayTab tab, dtoModuleContext context) { List <DisplayTab> items = new List <DisplayTab>(); if (tabs != DisplayTab.None) { if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.List)) { items.Add(DisplayTab.List); } if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.Send)) { items.Add(DisplayTab.Send); } if (lm.Comol.Core.DomainModel.PermissionHelper.CheckPermissionSoft((long)tabs, (long)DisplayTab.Sent) && MailService.HasMessages(context.ModuleObject)) { items.Add(DisplayTab.Sent); } if (!items.Contains(tab)) { tab = items.Where(t => t != DisplayTab.Sent).FirstOrDefault(); } } View.LoadTabs(items, tab); }
public static String ListAvailableTemplates(String moduleCode, DisplayTab tabs, UserSelection sMode, Boolean selectTemplates = false, String backUrl = "", long idModuleAction = 0, Boolean actionEmpty = false, long idTemplate = 0, long idVersion = 0, Int32 idCommunity = -1, Int32 idModule = 0, lm.Comol.Core.DomainModel.ModuleObject obj = null) { String url = modulehome + "SendMessage.aspx?" + BaseQueryString(moduleCode, DisplayTab.List, tabs, sMode, selectTemplates, backUrl, idModuleAction, actionEmpty, idTemplate, idVersion, idCommunity, idModule, obj); url += (idVersion > 0) ? "#ver_" + idVersion.ToString() : (idTemplate > 0) ? "#tmp_" + idTemplate.ToString() : ""; return(url); }
private static String BaseQueryString(String moduleCode, DisplayTab current, DisplayTab tabs, UserSelection sMode, Boolean selectTemplates, String backUrl = "", long idModuleAction = 0, Boolean actionEmpty = false, long idTemplate = 0, long idVersion = 0, Int32 idCommunity = -1, Int32 idModule = 0, lm.Comol.Core.DomainModel.ModuleObject obj = null) { return("code=" + moduleCode + ((idModuleAction == 0) ? "" : "&action=" + idModuleAction.ToString()) + ((actionEmpty) ? "&aEmpty=true" : "") + "&tab=" + (int)current + "&tabs=" + (int)tabs + "&sl=" + ((int)sMode).ToString() + ((selectTemplates) ? "&dtsl=" + selectTemplates.ToString() : "") + ((idTemplate > 0) ? "&idTemplate=" + idTemplate.ToString() : "") + ((idVersion > 0) ? "&idVersion=" + idVersion.ToString() : "") + ObjectOwnerQueryString(idCommunity, idModule, obj) + ((String.IsNullOrEmpty(backUrl)) ? "" : "&back=" + backUrl)); }
public void LoadSendMessage(DisplayTab tab, long idTemplate, long idVersion) { View.SelectedTab = tab; View.IsInitializedSender = true; //GetAvailableSaveAs(), View.InitializeSendMessage(false, View.CurrentIdCommunity, View.CurrentModuleCode, idTemplate, idVersion); View.DisplaySendMessage(); }
private void SetCurrentItems(TemplateType type, Int32 idCommunity, DisplayTab current) { View.CurrentModuleCode = View.PreloadModuleCode; View.AvailableTabs = View.PreloadTabs; View.CurrentIdCommunity = idCommunity; View.CurrentIdModule = View.PreloadIdModule; View.CurrentModuleObject = View.PreloadModuleObject; System.Guid sessionId = Guid.NewGuid(); View.CurrentSessionId = sessionId; View.SetBackUrl(View.PreloadBackUrl, sessionId, GetCurrentUrl(current)); }
public MainForm() { InitializeComponent(); Model = new ViewModel(this, new BrightColorProfile()); InitRenderers(); SetRenderer(typeof(GdiRenderer)); Model.SetRoot(Model.CurrentRoot); // init first node in history RedrawTimer.Interval = 1000 / XRay.TargetFps; RedrawTimer.Enabled = true; RevalueTimer.Interval = 1000; RevalueTimer.Enabled = true; InstanceTab.Init(this); DisplayTab.Init(this); ConsoleTab.Init(this); CodeTab.Init(this); NamespaceTab.Init(this); SettingsTab.Init(this); CodeTab.Visible = false; InstanceTab.Visible = false; NamespaceTab.Visible = false; //var x = Assembly.GetEntryAssembly(); //Text = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location) + " Code Perspective"; //Text = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) + " Code Perspective"; Text = "Code Perspective"; if (XRay.Remote != null && XRay.Remote.RemoteDatHash != null) { Text = "Remote " + Text; } if (Pro.Verified) { Text += " Pro"; } Show(); WindowState = FormWindowState.Normal; BringToFront(); }
private String GetCurrentUrl(DisplayTab current) { switch (current) { case DisplayTab.List: return(ExternalModuleRootObject.ListAvailableTemplates(View.PreloadModuleCode, View.PreloadTabs, View.PreloadSelectionMode, View.PreloadAllowSelectTemplate, View.GetEncodedBackUrl(View.PreloadBackUrl), View.PreloadIdAction, View.PreloadWithEmptyActions, View.PreloadIdTemplate, View.PreloadIdVersion, View.PreloadIdCommunity, View.PreloadIdModule, View.PreloadModuleObject)); case DisplayTab.Send: return(ExternalModuleRootObject.SendMessage(View.PreloadModuleCode, View.PreloadTabs, View.PreloadSelectionMode, View.PreloadAllowSelectTemplate, View.GetEncodedBackUrl(View.PreloadBackUrl), View.PreloadIdAction, View.PreloadWithEmptyActions, View.PreloadIdTemplate, View.PreloadIdVersion, View.PreloadIdCommunity, View.PreloadIdModule, View.PreloadModuleObject)); case DisplayTab.Sent: return(ExternalModuleRootObject.MessagesSent(View.PreloadModuleCode, View.PreloadTabs, View.PreloadSelectionMode, View.PreloadAllowSelectTemplate, View.GetEncodedBackUrl(View.PreloadBackUrl), View.PreloadIdAction, View.PreloadWithEmptyActions, View.PreloadIdTemplate, View.PreloadIdVersion, View.PreloadIdCommunity, View.PreloadIdModule, View.PreloadModuleObject)); default: return(""); } }
private void SetCurrentItems(TemplateType type, Int32 idCommunity, DisplayTab current) { View.CurrentModuleCode = View.PreloadModuleCode; View.AvailableTabs = View.PreloadTabs; View.SelectionMode = View.PreloadSelectionMode; View.AllowSelectTemplate = View.PreloadAllowSelectTemplate; View.CurrentIdTemplate = View.PreloadIdTemplate; View.CurrentIdVersion = View.PreloadIdVersion; View.CurrentIdAction = View.PreloadIdAction; View.AlsoWithEmptyActions = View.PreloadWithEmptyActions; View.CurrentIdCommunity = idCommunity; View.CurrentIdModule = View.PreloadIdModule; View.CurrentTemplateType = type; View.CurrentModuleObject = View.PreloadModuleObject; System.Guid sessionId = Guid.NewGuid(); View.CurrentSessionId = sessionId; View.SetBackUrl(View.PreloadBackUrl, sessionId, GetCurrentUrl(current)); }
public void InitView() { Int32 idCommunity = View.PreloadIdCommunity; if (idCommunity < 0) { idCommunity = UserContext.CurrentCommunityID; } dtoModuleMessagesContext context = GetContext(); View.ContainerContext = context; if (UserContext.isAnonymous) { SessionTimeout(idCommunity, View.PreloadSelectedTab); } else { DisplayTab tabs = View.PreloadTabs; DisplayTab tab = View.PreloadSelectedTab; if (tabs == DisplayTab.None) { tab = DisplayTab.Sent; } TemplateType type = View.PreloadTemplateType; if (type == TemplateType.None) { type = TemplateType.Module; } SetCurrentItems(type, idCommunity, tab); LoadTabs(tabs, tab); Int32 idOtherModule = CurrentManager.GetModuleID(context.ModuleCode); Boolean otherModule = (context.ModuleCode != ModuleTemplateMessages.UniqueCode); switch (tab) { case DisplayTab.List: case DisplayTab.Send: View.GoToUrl(GetCurrentUrl(tab)); break; case DisplayTab.Sent: View.InitializeFilterSelector(new List <DisplayItems>() { DisplayItems.ByRecipient, DisplayItems.ByMessage }, DisplayItems.ByRecipient); if (HasPermission(context)) { DisplayItems displayBy = View.PreloadDisplayBy; View.CurrentDisplayBy = displayBy; if (MailService.HasMessages(context.ModuleObject)) { switch (displayBy) { case DisplayItems.ByRecipient: InitializeByRecipients(context); break; case DisplayItems.ByMessage: IntializeByMessage(context); break; } } else { View.DisplayObjectWithNoMessage(); } } else { View.DisplayNoPermission(idCommunity, idOtherModule, context.ModuleCode); } break; default: if (otherModule) { View.DisplayNoPermission(idCommunity, idOtherModule, context.ModuleCode); } else { View.DisplayNoPermission(idCommunity, Service.ServiceModuleID()); } break; } } }
private void SessionTimeout(Int32 idCommunity, DisplayTab current) { View.DisplaySessionTimeout(idCommunity, GetCurrentUrl(current)); }
public void InitView() { Int32 idCommunity = View.PreloadIdCommunity; if (idCommunity < 0) { idCommunity = UserContext.CurrentCommunityID; } View.CurrentIdCommunity = idCommunity; if (UserContext.isAnonymous) { SessionTimeout(idCommunity, View.PreloadSelectedTab); } else { DisplayTab tabs = View.PreloadTabs; DisplayTab tab = View.PreloadSelectedTab; if (tab == DisplayTab.Sent && tabs != DisplayTab.None) { tab = DisplayTab.Send; } TemplateType type = View.PreloadTemplateType; if (type == TemplateType.None) { type = TemplateType.Module; } SetCurrentItems(type, idCommunity, tab); String moduleCode = View.PreloadModuleCode; long permissions = View.PreloadFromModulePermissions; Int32 idOtherModule = CurrentManager.GetModuleID(moduleCode); Boolean otherModule = (moduleCode != ModuleTemplateMessages.UniqueCode); dtoModuleContext context = GetModuleContext(moduleCode, permissions, idCommunity, type); LoadTabs(tabs, tab, context); Boolean allowView = context.Permissions.Administration || context.Permissions.List; switch (tab) { case DisplayTab.List: if (allowView) { InitializeList(context, idCommunity, type, permissions); View.DisplayList(); } else { View.DisplayNoPermission(idCommunity, Service.ServiceModuleID()); } break; case DisplayTab.Send: LoadTab(DisplayTab.Send); break; case DisplayTab.Sent: break; default: if (otherModule) { View.DisplayNoPermission(idCommunity, idOtherModule, moduleCode); } else { View.DisplayNoPermission(idCommunity, Service.ServiceModuleID()); } break; } } }
//public static String SendMessage(String moduleCode, UserSelection sMode = (UserSelection.FromInputText | UserSelection.FromModule), Boolean selectTemplates = false, String backUrl = "", long idModuleAction = 0, Boolean actionEmpty = false, long idTemplate = 0, long idVersion = 0, Int32 idCommunity = -1, Int32 idModule = 0, lm.Comol.Core.DomainModel.ModuleObject obj = null) //{ // return SendMessage(moduleCode, DisplayTab.None, sMode, selectTemplates, backUrl, idModuleAction, actionEmpty, idTemplate, idVersion, idCommunity, idModule, obj); //} public static String SendMessage(String moduleCode, DisplayTab tabs = (DisplayTab.List | DisplayTab.Send | DisplayTab.Sent), UserSelection sMode = (UserSelection.FromInputText | UserSelection.FromModule), Boolean selectTemplates = false, String backUrl = "", long idModuleAction = 0, Boolean actionEmpty = false, long idTemplate = 0, long idVersion = 0, Int32 idCommunity = -1, Int32 idModule = 0, lm.Comol.Core.DomainModel.ModuleObject obj = null) { String url = modulehome + "SendMessage.aspx?" + BaseQueryString(moduleCode, DisplayTab.Send, tabs, sMode, selectTemplates, backUrl, idModuleAction, actionEmpty, idTemplate, idVersion, idCommunity, idModule, obj); return(url); }