This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Veselin\AppData\Roaming\Apple Computer\MobileSync>mklink /J "%APPDATA%\Apple Computer\Mobil | |
eSync\Backup" "D:\Backup\iPhone" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseAdminController : Controller | |
{ | |
protected override void OnException(ExceptionContext filterContext) | |
{ | |
Log.Write(filterContext.Exception.ToString()); | |
EmailHelper.SendAdminEmail(filterContext.Exception); | |
if (!SystemManager.IsDesignMode) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using Telerik.Sitefinity.Mvc; | |
namespace SitefinityWebApp.Mvc.Controllers | |
{ | |
[ControllerToolboxItem(Name = "FileAsyncUploader", Title = "File Async Uploader", SectionName = "Custom MVC", CssClass = "sfMvcIcn")] | |
public class FileAsyncUploaderController: Controller | |
{ | |
[HttpGet] | |
public ActionResult Index() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SitefinityWebApp | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
private void SystemManager_ApplicationStart(object sender, EventArgs e) | |
{ | |
EventHub.Subscribe<ILogoutCompletedEvent>(onLogoutCompleted); | |
} | |
// remove asp.net session cookie, as it is not automatically removed on Logout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("li.adult .config-button.positive")[0].dispatchEvent(new MouseEvent('click', { | |
'view': window, | |
'bubbles': true, | |
'cancelable': true | |
})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.UI; | |
private void AddCanonicalUrl() | |
{ | |
var page = this.HttpContext.CurrentHandler as Page; | |
var cUrl = this.Request.Url.AbsoluteUri; | |
var canonical = (from ctrls in page.Header.Controls.OfType<HtmlLink>() | |
where ctrls.Attributes["rel"].Equals("canonical", StringComparison.CurrentCultureIgnoreCase) | |
select ctrls).FirstOrDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.WindowsAzure.Storage; | |
using System; | |
using System.Linq; | |
using Telerik.Sitefinity.Azure.BlobStorage; | |
using Telerik.Sitefinity.Configuration; | |
using Telerik.Sitefinity.Modules.Libraries.Configuration; | |
namespace SitefinityWebApp.Custom.Pages | |
{ | |
public partial class BlobStorage : System.Web.UI.Page |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CultureInfo culture = CultureInfo.CurrentUICulture; | |
var localizedQuery = " 1 = 1 "; | |
if (IsTypeLocalizable) | |
{ | |
localizedQuery = (culture.Equals(SystemManager.CurrentContext.AppSettings.DefaultFrontendLanguage) ? | |
string.Format("PublishedTranslations.Count = 0 OR PublishedTranslations.Contains(\"{0}\")", culture.Name) : | |
string.Format("PublishedTranslations.Contains(\"{0}\")", culture.Name)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void btn_Click(object sender, EventArgs e) | |
{ | |
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(); | |
Type personType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.People.Person"); | |
DynamicContent personItem = dynamicModuleManager.CreateDataItem(personType); | |
personItem.SetValue("Owner", SecurityManager.GetCurrentUserId()); | |
personItem.SetValue("PublicationDate", DateTime.Now); | |
//to prevent adding 3 items in DB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void CreateTag(string name, string description) | |
{ | |
using (TaxonomyManager taxonomyManager = TaxonomyManager.GetManager()) | |
{ | |
FlatTaxonomy userSegments = taxonomyManager.GetTaxonomies<FlatTaxonomy>() | |
.Where(t => t.Title == TAXONOMY_NAME) | |
.SingleOrDefault(); | |
if (userSegments != null) | |
{ |