Skip to content

Commit bdcf8f8

Browse files
committed
Removes more unused code
1 parent c08db70 commit bdcf8f8

File tree

9 files changed

+7
-198
lines changed

9 files changed

+7
-198
lines changed

src/Umbraco.Core/ApplicationContext.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,7 @@ private string ConfigurationStatus
208208
}
209209
}
210210

211-
private void AssertIsReady()
212-
{
213-
if (!this.IsReady)
214-
throw new Exception("ApplicationContext is not ready yet.");
215-
}
216-
217-
private void AssertIsNotReady()
211+
private void AssertIsNotReady()
218212
{
219213
if (this.IsReady)
220214
throw new Exception("ApplicationContext has already been initialized.");

src/Umbraco.Tests/UmbracoExamine/IndexTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ public void Index_Delete_Index_Item_Ensure_Heirarchy_Removed()
192192

193193
#region Private methods and properties
194194

195-
private readonly TestContentService _contentService = new TestContentService();
196-
private readonly TestMediaService _mediaService = new TestMediaService();
195+
private readonly TestMediaService _mediaService = new TestMediaService();
197196

198197
private static UmbracoExamineSearcher _searcher;
199198
private static UmbracoContentIndexer _indexer;

src/Umbraco.Web/Install/Controllers/InstallApiController.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Net;
5-
using System.Net.Http;
64
using System.Reflection;
7-
using System.Text;
85
using System.Web.Http;
96
using Newtonsoft.Json;
107
using Newtonsoft.Json.Linq;
@@ -281,14 +278,5 @@ internal InstallSetupResult ExecuteStep(InstallSetupStep step, JToken instructio
281278
}
282279
}
283280
}
284-
285-
private HttpResponseMessage Json(object jsonObject, HttpStatusCode status)
286-
{
287-
var response = Request.CreateResponse(status);
288-
var json = JObject.FromObject(jsonObject);
289-
response.Content = new StringContent(json.ToString(), Encoding.UTF8, "application/json");
290-
return response;
291-
}
292-
293281
}
294282
}

src/Umbraco.Web/umbraco.presentation/template.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public Control parseStringBuilder(StringBuilder tempOutput, page umbPage)
280280
macro tempMacro;
281281
String macroID = helper.FindAttribute(attributes, "macroid");
282282
if (macroID != String.Empty)
283-
tempMacro = getMacro(macroID);
283+
tempMacro = GetMacro(macroID);
284284
else
285285
tempMacro = macro.GetMacro(helper.FindAttribute(attributes, "macroalias"));
286286

@@ -409,7 +409,7 @@ public void Parse(page umbPage)
409409
String macroID = helper.FindAttribute(attributes, "macroid");
410410
if (macroID != "")
411411
{
412-
macro tempMacro = getMacro(macroID);
412+
macro tempMacro = GetMacro(macroID);
413413
_templateOutput.Replace(tag.Value.ToString(), tempMacro.MacroContent.ToString());
414414
}
415415
}
@@ -427,7 +427,7 @@ public void Parse(page umbPage)
427427
String macroID = helper.FindAttribute(tempAttributes, "macroid");
428428
if (Convert.ToInt32(macroID) > 0)
429429
{
430-
macro tempContentMacro = getMacro(macroID);
430+
macro tempContentMacro = GetMacro(macroID);
431431
_templateOutput.Replace(tag.Value.ToString(), tempContentMacro.MacroContent.ToString());
432432
}
433433

@@ -452,21 +452,12 @@ public void Parse(page umbPage)
452452

453453
#region private methods
454454

455-
private macro getMacro(String macroID)
455+
private static macro GetMacro(String macroID)
456456
{
457457
System.Web.HttpContext.Current.Trace.Write("umbracoTemplate", "Starting macro (" + macroID.ToString() + ")");
458458
return macro.GetMacro(Convert.ToInt16(macroID));
459459
}
460460

461-
private String FindAttribute(Hashtable attributes, String key)
462-
{
463-
if (attributes[key] != null)
464-
return attributes[key].ToString();
465-
else
466-
return "";
467-
}
468-
469-
470461
#endregion
471462

472463
protected static ISqlHelper SqlHelper

src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Collections.Generic;
44
using System.Data;
55
using System.Globalization;
6-
using System.IO;
76
using System.Linq;
87
using System.Web;
98
using System.Web.Mvc;
@@ -24,7 +23,6 @@
2423
using umbraco.cms.businesslogic;
2524
using umbraco.cms.businesslogic.propertytype;
2625
using umbraco.cms.businesslogic.web;
27-
using umbraco.cms.helpers;
2826
using umbraco.controls.GenericProperties;
2927
using umbraco.presentation;
3028
using umbraco.BasePages;
@@ -476,114 +474,8 @@ private void SetupInfoPane()
476474
else
477475
lt_icon.Text = _contentType.IconUrl.TrimStart('.');
478476

479-
/*
480-
var dirInfo = new DirectoryInfo(Server.MapPath(SystemDirectories.Umbraco + "/images/umbraco"));
481-
var fileInfo = dirInfo.GetFiles();
482-
483-
var spriteFileNames = CMSNode.DefaultIconClasses.Select(IconClassToIconFileName).ToList();
484-
var diskFileNames = fileInfo.Select(FileNameToIconFileName).ToList();
485-
var listOfIcons = new List<ListItem>();
486-
// .sprNew was never intended to be in the document type editor
487-
foreach (var iconClass in CMSNode.DefaultIconClasses.Where(iconClass => iconClass.Equals(".sprNew", StringComparison.InvariantCultureIgnoreCase) == false))
488-
{
489-
// Still shows the selected even if we tell it to hide sprite duplicates so as not to break an existing selection
490-
if (_contentType.IconUrl.Equals(iconClass, StringComparison.InvariantCultureIgnoreCase) == false
491-
&& UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideSpriteDuplicates
492-
&& diskFileNames.Contains(IconClassToIconFileName(iconClass)))
493-
continue;
494-
495-
AddSpriteListItem(iconClass, listOfIcons);
496-
}
497-
498-
foreach (var file in fileInfo)
499-
{
500-
// NH: don't show the sprite file
501-
if (file.Name.ToLowerInvariant() == "sprites.png".ToLowerInvariant() || file.Name.ToLowerInvariant() == "sprites_ie6.gif".ToLowerInvariant())
502-
continue;
503-
504-
// Still shows the selected even if we tell it to hide file duplicates so as not to break an existing selection
505-
if (_contentType.IconUrl.Equals(file.Name, StringComparison.InvariantCultureIgnoreCase) == false
506-
&& UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour == IconPickerBehaviour.HideFileDuplicates
507-
&& spriteFileNames.Contains(FileNameToIconFileName(file)))
508-
continue;
509-
510-
var listItemValue = ResolveClientUrl(SystemDirectories.Umbraco + "/images/umbraco/" + file.Name);
511-
512-
AddFileListItem(file.Name, listItemValue, listOfIcons);
513-
}
514-
515-
ddlIcons.Items.AddRange(listOfIcons.OrderBy(o => o.Text).ToArray());
516-
517-
518-
// Get thumbnails
519-
dirInfo = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Umbraco + "/images/thumbnails"));
520-
fileInfo = dirInfo.GetFiles();
521-
522-
foreach (var file in fileInfo)
523-
{
524-
var li = new ListItem(file.Name);
525-
li.Attributes.Add("title", this.ResolveClientUrl(SystemDirectories.Umbraco + "/images/thumbnails/" + file.Name));
526-
527-
if (this.Page.IsPostBack == false && li.Value == _contentType.Thumbnail)
528-
li.Selected = true;
529-
530-
// ddlThumbnails.Items.Add(li);
531-
}
532-
533-
534-
Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", string.Format(@"
535-
function refreshDropDowns() {{
536-
jQuery('#{1}').msDropDown({{ showIcon: true, style: 'width:250px;' }});
537-
jQuery('#{3}').msDropDown({{ showIcon: false, rowHeight: '130', visibleRows: '2', style: 'width:250px;' }});
538-
}}
539-
jQuery(document).ready(function() {{ refreshDropDowns(); }});
540-
", ddlIcons.ClientID, ddlIcons.ClientID, ddlIcons.ClientID, ddlThumbnails.ClientID, 500), true);
541-
txtName.Text = _contentType.GetRawText();
542-
txtAlias.Text = _contentType.Alias;
543-
description.Text = _contentType.GetRawDescription();
544-
*/
545-
}
546-
547-
private void AddSpriteListItem(string iconClass, ICollection<ListItem> listOfIcons)
548-
{
549-
var li = new ListItem(
550-
helper.SpaceCamelCasing((iconClass.Substring(1, iconClass.Length - 1)))
551-
.Replace("Spr Tree", "")
552-
.Trim(), iconClass);
553-
554-
li.Attributes.Add("class", "spriteBackground sprTree " + iconClass.Trim('.'));
555-
li.Attributes.Add("style", "padding-left:24px !important; background-repeat:no-repeat; width:auto; height:auto;");
556-
557-
AddListItem(listOfIcons, li);
558-
}
559-
560-
private void AddFileListItem(string fileName, string listItemValue, ICollection<ListItem> listOfIcons)
561-
{
562-
var li = new ListItem(fileName, fileName);
563-
564-
li.Attributes.Add("title", listItemValue);
565-
566-
AddListItem(listOfIcons, li);
567-
}
568-
569-
private void AddListItem(ICollection<ListItem> listOfIcons, ListItem li)
570-
{
571-
if (this.Page.IsPostBack == false && li.Value == _contentType.IconUrl)
572-
li.Selected = true;
573-
574-
listOfIcons.Add(li);
575477
}
576478

577-
private static string IconClassToIconFileName(string iconClass)
578-
{
579-
return iconClass.Substring(1, iconClass.Length - 1).ToLowerInvariant().Replace("sprTree".ToLowerInvariant(), "");
580-
}
581-
582-
private static string FileNameToIconFileName(FileInfo file)
583-
{
584-
return file.Name.Substring(0, file.Name.LastIndexOf(".", StringComparison.Ordinal)).ToLowerInvariant();
585-
}
586-
587479
#endregion
588480

589481
#region "Structure" Pane
@@ -1070,18 +962,6 @@ private void UpdatePropertyTypes(IContentTypeComposition contentTypeItem)
1070962
}
1071963
}
1072964

1073-
private bool DoesPropertyTypeAliasExist(GenericProperty gpData)
1074-
{
1075-
bool hasAlias = _contentType.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
1076-
ContentType ct = _contentType;
1077-
while (ct.MasterContentType > 0)
1078-
{
1079-
ct = new ContentType(ct.MasterContentType);
1080-
hasAlias = ct.getPropertyType(Casing.SafeAliasWithForcingCheck(gpData.Alias.Trim())) != null;
1081-
}
1082-
return !hasAlias;
1083-
}
1084-
1085965
/// <summary>
1086966
/// Called asynchronously in order to delete a content type property
1087967
/// </summary>

src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,6 @@ private void PerformRefreshAction(int packageId, string dir, string url, string
336336
PerformPostInstallCleanup(packageId, dir);
337337
}
338338

339-
/// <summary>
340-
/// Runs Post refresh actions such reloading the correct tree nodes, etc...
341-
/// </summary>
342-
private void PerformPostRefreshAction()
343-
{
344-
BasePage.Current.ClientTools.ReloadActionNode(true, true);
345-
}
346-
347339
/// <summary>
348340
/// Runs Post install actions such as clearning any necessary cache, reloading the correct tree nodes, etc...
349341
/// </summary>

src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/NodeExtensions.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -504,17 +504,6 @@ public static T GetProperty<T>(this INode node, string propertyAlias)
504504
return default(T);
505505
}
506506

507-
/// <summary>
508-
/// Get a string value for the supplied property alias
509-
/// </summary>
510-
/// <param name="node">an umbraco.presentation.nodeFactory.Node object</param>
511-
/// <param name="propertyAlias">alias of propety to get</param>
512-
/// <returns>empty string, or property value as string</returns>
513-
private static string GetPropertyAsString(this Node node, string propertyAlias)
514-
{
515-
return GetPropertyAsString((INode)node, propertyAlias);
516-
}
517-
518507
/// <summary>
519508
/// Get a string value for the supplied property alias
520509
/// </summary>
@@ -534,17 +523,6 @@ private static string GetPropertyAsString(this INode node, string propertyAlias)
534523
return propertyValue;
535524
}
536525

537-
/// <summary>
538-
/// Get a boolean value for the supplied property alias (works with built in Yes/No dataype)
539-
/// </summary>
540-
/// <param name="node">an umbraco.presentation.nodeFactory.Node object</param>
541-
/// <param name="propertyAlias">alias of propety to get</param>
542-
/// <returns>true if can cast value, else false for all other circumstances</returns>
543-
private static bool GetPropertyAsBoolean(this Node node, string propertyAlias)
544-
{
545-
return GetPropertyAsBoolean((INode)node, propertyAlias);
546-
}
547-
548526
/// <summary>
549527
/// Get a boolean value for the supplied property alias (works with built in Yes/No dataype)
550528
/// </summary>

src/UmbracoExamine/UmbracoMemberIndexer.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,5 @@ protected override void OnGatheringNodeData(IndexingNodeDataEventArgs e)
192192
e.Fields.Add("_searchEmail", e.Node.Attribute("email").Value.Replace(".", " ").Replace("@", " "));
193193
}
194194
}
195-
196-
private static XElement GetMemberItem(int nodeId)
197-
{
198-
//TODO: Change this so that it is not using the LegacyLibrary, just serialize manually!
199-
var nodes = LegacyLibrary.GetMember(nodeId);
200-
return XElement.Parse(nodes.Current.OuterXml);
201-
}
202195
}
203196
}

src/umbraco.businesslogic/BasePages/ClientTools.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Text;
4-
using System.Web;
54
using umbraco.BasePages;
65
using System.Web.UI;
76
using Umbraco.Core.IO;
@@ -326,12 +325,7 @@ public ClientTools OpenModalWindow(string url, string name, bool showHeader, int
326325
return this;
327326
}
328327

329-
private Page GetCurrentPage()
330-
{
331-
return HttpContext.Current.CurrentHandler as Page;
332-
}
333-
334-
/// <summary>
328+
/// <summary>
335329
/// This will use the ScriptManager to register the script if one is available, otherwise will default to the ClientScript
336330
/// class of the page.
337331
/// </summary>

0 commit comments

Comments
 (0)