This file contains 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
function ValidateXmlFile { | |
param ([string]$xmlFile = $(read-host "Please specify the path to the Xml file")) | |
$xmlFile = resolve-path $xmlFile | |
"===============================================================" | |
"Validating $xmlFile using the schemas locations specified in it" | |
"===============================================================" | |
# The validating reader silently fails to catch any problems if the schema locations aren't set up properly | |
# So attempt to get to the right place.... | |
pushd (Split-Path $xmlFile) |
This file contains 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
set | |
{ | |
if (value == null) | |
{ | |
this._guid = null; | |
return; | |
} | |
if (value.Length == 0) | |
{ | |
this._guid = new Guid?(Guid.Empty); |
This file contains 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
for (int i = 0; i < 9999999; i++) | |
{ | |
double number = null; | |
if( double.TryParse(bigArray[i], out number) | |
{ | |
ProcessNumber(number); | |
} | |
else | |
{ | |
DoSomethingElse(); |
This file contains 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
for (int i = 0; i < 9999999; i++) | |
{ | |
try | |
{ | |
double number = double.Parse(bigArray[i]); | |
ProcessNumber(number); | |
} | |
catch (Exception) | |
{ | |
DoSomethingElse(); |
This file contains 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
# Setup | |
$publicationId = 20 # The publication where your content is published | |
# Broker database - substitute your own settings here. | |
$connStringBuilder = new-object System.Data.SqlClient.SqlConnectionStringBuilder | |
$connStringBuilder["Data Source"] = "WEB8,1433" | |
$connStringBuilder["Initial Catalog"] = "Tridion_Broker" | |
$connStringBuilder["User ID"] = "TridionBrokerUser" | |
$connStringBuilder["Password"] = "Tridion1" |
This file contains 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
[PresentationsByView(ViewPrefix ="ContentBlock")] | |
public List<IRenderableViewModel> ContentBlocks { get; set; } |
This file contains 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
@foreach (var cp in Model.ContentBlocks) | |
{ | |
@Html.Render(cp) | |
} |
This file contains 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 List<IRenderableViewModel> ContentBlocks { | |
get | |
{ | |
return ComponentPresentations | |
.Where(cp => cp.RenderData.View == "ContentBlock") | |
.ToList<IRenderableViewModel>(); | |
} | |
} |
This file contains 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
@foreach (var cp in Model.ComponentPresentations.Where(cp => cp.RenderData.View == "ContentBlock")) | |
{ | |
@Html.Render(cp) | |
} |
This file contains 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
[ComponentPresentations] | |
public List<IRenderableViewModel> ComponentPresentations { get; set; } |
NewerOlder