/// <summary> /// Create a new page. /// </summary> public override void Execute() { EnterValueWindow dlg = new EnterValueWindow(); dlg.Title = "Create Page"; dlg.InputLabel = "Page Name:"; dlg.ActionLabel = "Create"; dlg.InputMaxLength = 80; if (App.ShowDialog(dlg)) { Project project = App.Instance.SalesForceApp.CurrentProject; if (project != null) { using (App.Wait("Creating Page")) { SourceFile file = project.Client.Meta.CreatePage(dlg.EnteredValue, EditorSettings.VisualForceSettings.CreateHeader()); ApexPageFolderNode folder = App.Instance.Navigation.GetNode <ApexPageFolderNode>(); if (folder != null) { folder.AddApexPage(file); } App.Instance.Content.OpenDocument(new VisualForceEditorDocument(project, file)); } } } }
/// <summary> /// Toggle the checkout system on/off. /// </summary> /// <param name="sender">Object that raised the event.</param> /// <param name="e">Event arguments.</param> private void ToggleCheckOutSystem(object sender, EventArgs e) { Project project = App.Instance.SalesForceApp.CurrentProject; if (project != null) { string text = project.Client.Checkout.IsEnabled() ? "Disabling the check out system will delete a previously created custom object and impact all Walli users of the organization. Are you sure you want to proceed?" : "Enabling the check out system requires a new custom object be created and will impact all Walli users of the organization. Are you sure you want to proceed?"; if (App.MessageUser(text, "Check out system", System.Windows.MessageBoxImage.Warning, new string[] { "Yes", "No" }) == "Yes") { using (App.Wait("Updating check out system")) { project.Client.Checkout.Enable(!project.Client.Checkout.IsEnabled()); App.Instance.UpdateWorkspaces(); // refresh open folders IFunction refreshFunction = App.Instance.GetFunction <RefreshFolderFunction>(); INode currentActiveNode = App.Instance.Navigation.ActiveNode; ApexClassFolderNode classFolderNode = App.Instance.Navigation.GetNode <ApexClassFolderNode>(); if (classFolderNode != null) { App.Instance.Navigation.ActiveNode = classFolderNode; refreshFunction.Execute(); } ApexTriggerFolderNode triggerFolderNode = App.Instance.Navigation.GetNode <ApexTriggerFolderNode>(); if (triggerFolderNode != null) { App.Instance.Navigation.ActiveNode = triggerFolderNode; refreshFunction.Execute(); } ApexPageFolderNode pageFolderNode = App.Instance.Navigation.GetNode <ApexPageFolderNode>(); if (pageFolderNode != null) { App.Instance.Navigation.ActiveNode = pageFolderNode; refreshFunction.Execute(); } ApexComponentFolderNode componentFolderNode = App.Instance.Navigation.GetNode <ApexComponentFolderNode>(); if (componentFolderNode != null) { App.Instance.Navigation.ActiveNode = componentFolderNode; refreshFunction.Execute(); } App.Instance.Navigation.ActiveNode = currentActiveNode; } App.MessageUser("The check out system has been changed. All users that currently have an open project in Walli for this organization will need to close those projects and then reopen them to see the change take effect.", "Check out system changed", System.Windows.MessageBoxImage.Information, new string[] { "OK" }); } SourceControlSetupWindow dlg = sender as SourceControlSetupWindow; if (dlg != null) { dlg.IsCheckoutEnabled = project.Client.Checkout.IsEnabled(); } } }