From f7517fa64b930211bd66420d6b499881ef343c7e Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 28 Jun 2018 20:01:44 +0200 Subject: [PATCH] Revert whitespace changes and csproj file --- src/Umbraco.Core/Services/ContentService.cs | 22 +++---- src/Umbraco.Core/Services/ServiceContext.cs | 2 +- .../Strategies/RelateOnCopyHandler.cs | 3 +- .../Strategies/RelateOnTrashHandler.cs | 4 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 3 +- .../umbraco/dialogs/rollBack.aspx.cs | 66 +++++++++---------- 6 files changed, 47 insertions(+), 53 deletions(-) diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 5282f135ec..33131bbb52 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -694,7 +694,7 @@ namespace Umbraco.Core.Services } query.Where(x => x.Path.SqlStartsWith(string.Format("{0},", contentPath[0].Path), TextColumnType.NVarchar)); } - + // get filter IQuery filterQuery = null; @@ -991,7 +991,7 @@ namespace Umbraco.Core.Services FROM umbracoNode JOIN cmsDocument ON umbracoNode.id=cmsDocument.nodeId AND cmsDocument.published=@0 WHERE umbracoNode.trashed=@1 AND umbracoNode.id IN (@2)", - true, false, ids); + true, false, ids); var x = uow.Database.Fetch(sql); return ids.Length == x.Count; } @@ -1260,7 +1260,7 @@ namespace Umbraco.Core.Services var repository = RepositoryFactory.CreateContentBlueprintRepository(uow); var blueprint = repository.Get(id); if (blueprint != null) - ((Content)blueprint).IsBlueprint = true; + ((Content) blueprint).IsBlueprint = true; return blueprint; } } @@ -1283,7 +1283,7 @@ namespace Umbraco.Core.Services if (content.ParentId != -1) content.ParentId = -1; - ((Content)content).IsBlueprint = true; + ((Content) content).IsBlueprint = true; using (new WriteLock(Locker)) { @@ -1357,7 +1357,7 @@ namespace Umbraco.Core.Services } var blueprints = repository.GetByQuery(query).Select(x => { - ((Content)x).IsBlueprint = true; + ((Content) x).IsBlueprint = true; return x; }).ToArray(); @@ -1373,7 +1373,7 @@ namespace Umbraco.Core.Services public void DeleteBlueprintsOfType(int contentTypeId, int userId = 0) { - DeleteBlueprintsOfTypes(new[] { contentTypeId }, userId); + DeleteBlueprintsOfTypes(new[] {contentTypeId}, userId); } /// @@ -1597,7 +1597,7 @@ namespace Umbraco.Core.Services /// Optional Id of the user issueing the delete operation public void DeleteContentOfType(int contentTypeId, int userId = 0) { - DeleteContentOfTypes(new[] { contentTypeId }, userId); + DeleteContentOfTypes(new[] {contentTypeId}, userId); } /// @@ -1854,9 +1854,7 @@ namespace Umbraco.Core.Services foreach (var tag in tags) uow.Database.Insert(new TagRelationshipDto { - NodeId = copy.Id, - TagId = tag.TagId, - PropertyTypeId = tag.PropertyTypeId + NodeId = copy.Id, TagId = tag.TagId, PropertyTypeId = tag.PropertyTypeId }); } uow.Commit(); // todo - this should flush, not commit @@ -2145,7 +2143,7 @@ namespace Umbraco.Core.Services } return repository.GetByQuery(query).Select(x => { - ((Content)x).IsBlueprint = true; + ((Content) x).IsBlueprint = true; return x; }); } @@ -2569,7 +2567,7 @@ namespace Umbraco.Core.Services //We need to check if children and their publish state to ensure that we 'republish' content that was previously published if (published && previouslyPublished == false && HasChildren(content.Id)) { - //TODO: Horrible for performance if there are lots of descendents! We should page if anything but this is crazy + //TODO: Horrible for performance if there are lots of descendents! We should page if anything but this is crazy var descendants = GetPublishedDescendants(content); _publishingStrategy.PublishingFinalized(uow, descendants, false); } diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index 3677c3742b..24596aefc3 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -165,7 +165,7 @@ namespace Umbraco.Core.Services CacheHelper cache, RepositoryFactory repositoryFactory, ILogger logger, - IEventMessagesFactory eventMessagesFactory, + IEventMessagesFactory eventMessagesFactory, IdkMap idkMap) { EventMessagesFactory = eventMessagesFactory; diff --git a/src/Umbraco.Core/Strategies/RelateOnCopyHandler.cs b/src/Umbraco.Core/Strategies/RelateOnCopyHandler.cs index a4b0b60a03..654ecb4891 100644 --- a/src/Umbraco.Core/Strategies/RelateOnCopyHandler.cs +++ b/src/Umbraco.Core/Strategies/RelateOnCopyHandler.cs @@ -26,8 +26,7 @@ namespace Umbraco.Core.Strategies relationType = new RelationType(new Guid(Constants.ObjectTypes.Document), new Guid(Constants.ObjectTypes.Document), Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, - Constants.Conventions.RelationTypes.RelateDocumentOnCopyName) - { IsBidirectional = true }; + Constants.Conventions.RelationTypes.RelateDocumentOnCopyName) { IsBidirectional = true }; relationService.Save(relationType); } diff --git a/src/Umbraco.Core/Strategies/RelateOnTrashHandler.cs b/src/Umbraco.Core/Strategies/RelateOnTrashHandler.cs index 005990ace2..38477aca47 100644 --- a/src/Umbraco.Core/Strategies/RelateOnTrashHandler.cs +++ b/src/Umbraco.Core/Strategies/RelateOnTrashHandler.cs @@ -69,8 +69,8 @@ namespace Umbraco.Core.Strategies item.Entity.Id); } - + } } } -} +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 05ca9b5137..e8a73300e4 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -49,7 +49,6 @@ true true - bin\ @@ -1038,7 +1037,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" True 7120 / - http://localhost:7111 + http://localhost:7120 False False diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs index f06c60f26d..b28e40163b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs @@ -15,20 +15,19 @@ using umbraco.cms.businesslogic.property; namespace umbraco.presentation.dialogs { - /// - /// Summary description for rollBack. - /// - public partial class rollBack : UmbracoEnsuredPage - { - public rollBack() - { + /// + /// Summary description for rollBack. + /// + public partial class rollBack : UmbracoEnsuredPage + { + public rollBack() + { CurrentApp = BusinessLogic.DefaultApps.content.ToString(); - } + } private Document currentDoc = new Document(int.Parse(helper.Request("nodeId"))); - - protected void version_load(object sender, EventArgs e) - { + + protected void version_load(object sender, EventArgs e) { if (allVersions.SelectedValue != "") { @@ -95,7 +94,7 @@ namespace umbraco.presentation.dialogs } Button1.Visible = true; - + } else @@ -106,8 +105,8 @@ namespace umbraco.presentation.dialogs } - protected void Page_Load(object sender, System.EventArgs e) - { + protected void Page_Load(object sender, System.EventArgs e) + { if (String.IsNullOrEmpty(allVersions.SelectedValue)) rbl_mode.AutoPostBack = false; @@ -117,41 +116,40 @@ namespace umbraco.presentation.dialogs currentVersionTitle.Text = currentDoc.Text; currentVersionMeta.Text = ui.Text("content", "createDate") + ": " + currentDoc.VersionDate.ToShortDateString() + " " + currentDoc.VersionDate.ToShortTimeString(); - if (!IsPostBack) - { - allVersions.Items.Add(new ListItem(ui.Text("rollback", "selectVersion") + "...", "")); - - foreach (DocumentVersionList dl in currentDoc.GetVersions()) - { - //we don't need to show the current version - if (dl.Version == currentDoc.Version) - continue; + if (!IsPostBack) { + allVersions.Items.Add(new ListItem(ui.Text("rollback", "selectVersion")+ "...", "")); + + foreach (DocumentVersionList dl in currentDoc.GetVersions()) + { + //we don't need to show the current version + if (dl.Version == currentDoc.Version) + continue; allVersions.Items.Add(new ListItem(dl.Text + " (" + ui.Text("content", "createDate") + ": " + dl.Date.ToShortDateString() + " " + dl.Date.ToShortTimeString() + ")", dl.Version.ToString())); } Button1.Text = ui.Text("actions", "rollback"); } - } - - protected void doRollback_Click(object sender, System.EventArgs e) - { - if (allVersions.SelectedValue.Trim() != "") + } + + protected void doRollback_Click(object sender, System.EventArgs e) + { + if (allVersions.SelectedValue.Trim() != "") { Document d = new Document(int.Parse(helper.Request("nodeId"))); d.RollBack(new Guid(allVersions.SelectedValue), base.getUser()); - + BusinessLogic.Log.Add(BusinessLogic.LogTypes.RollBack, base.getUser(), d.Id, "Version rolled back to revision '" + allVersions.SelectedValue + "'"); - + Document rollback = new Document(d.Id, new Guid(allVersions.SelectedValue)); feedBackMsg.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; - string[] vars = { rollback.Text, rollback.VersionDate.ToLongDateString() }; - + string[] vars = {rollback.Text, rollback.VersionDate.ToLongDateString()}; + feedBackMsg.Text = ui.Text("rollback", "documentRolledBack", vars, new global::umbraco.BusinessLogic.User(0)) + "

" + ui.Text("closeThisWindow") + ""; diffPanel.Visible = false; pl_buttons.Visible = false; ClientTools.ReloadLocationIfMatched(string.Format("/content/content/edit/{0}", d.Id)); } - } - } + } + } }