Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
namespace XpoTests
{
public static class ExpressionExtensions
{
@shamp00
shamp00 / MyClass.cs
Created August 30, 2012 17:05
Fix for XAF selection box which does not deselect after clearing the selection.
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Templates;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.Web;
using DevExpress.ExpressApp.Web.Editors.ASPx;
using DevExpress.ExpressApp.Web.Templates;
using DevExpress.Web.ASPxEditors;
@shamp00
shamp00 / BootCampControlPanel.cmd
Created October 9, 2012 16:42
Access the BootCamp ControlPanel from Windows 8. Run as Administrator.
@echo off
runas /trustlevel:0x20000 "C:\Windows\System32\AppleControlPanel"
if %ERRORLEVEL% neq 0 goto error
goto OK
:ERROR
echo.
echo Are you sure you are running from a shortcut as Administrator?
pause
@shamp00
shamp00 / MainDemo_CycleThroughTabs.js
Created April 3, 2013 15:26
Sample Selenium script for load testing the XAF MainDemo. See http://blog.zerosharp.com/load-testing-xaf-part-2-selenium/ for more information.
// MainDemo_CycleThroughTabs.js
/*global test */
// Settings for Neustar:
// replace the following with the public address of the application server,
var targetHost = "http://zerosharp-maindemo.elasticbeanstalk.com/";
var virtualShare = "MainDemo.Web_deploy";
// Settings for debug webserver:
using System;
using System.Linq;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
namespace XpoConsoleApplication1
{
class Program
{
public class Photo : XPObject
@shamp00
shamp00 / gist:7272527
Created November 1, 2013 21:51
StackOverflow caching routine from Marco Cecconi's presentation (https://www.youtube.com/watch?v=t6kM2EM6so4)
private static List<HelpPost> All()
{
return Current
.GlobalCache
.GetSet<List<HelpPost>>(
CacheKey,
(old, ctx) =>
{
using (SiteDBContext siteDb = SiteDBContext.NewContext())
{
@shamp00
shamp00 / Reflector.cfg
Last active December 30, 2015 00:19
Config file for .NET Reflector including assembly lists for several versions of DevExpress XAF.
; ==========================================================
; Config file for .NET Reflector including assembly lists
; for several versions of DevExpress XAF.
;
; Copy this file to:
; %LocalAppData%\Red Gate\.NET Reflector 8\Reflector.cfg
; ==========================================================
[AssemblyBrowser]
AssemblyList="DevExpress 13.2"
# Boxstarter script for blog post http://blog.zerosharp.com/provisioning-a-new-development-machine-with-boxstarter
# Allow reboots
$Boxstarter.RebootOk=$true
$Boxstarter.NoPassword=$false
$Boxstarter.AutoLogin=$true
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Public NotInheritable Partial Class MoreEnumerable
Private Sub New()
End Sub
<System.Runtime.CompilerServices.Extension> _
Public Shared Function Batch(Of TSource)(source As IEnumerable(Of TSource), size As Integer) As IEnumerable(Of IEnumerable(Of TSource))
Return Batch(source, size, Function(x) x)
End Function
<System.Runtime.CompilerServices.Extension> _
@shamp00
shamp00 / ContactsReport.repx
Last active December 9, 2015 13:04
Comparison of XAF 15.2 report layout serialization
/// <XRTypeInfo>
/// <AssemblyFullName>DevExpress.XtraReports.v15.2, Version=15.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</AssemblyFullName>
/// <AssemblyLocation>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\DevExpress.XtraReports.v15.2\v4.0_15.2.3.0__b88d1754d700e49a\DevExpress.XtraReports.v15.2.dll</AssemblyLocation>
/// <TypeName>DevExpress.XtraReports.UI.XtraReport</TypeName>
/// <Localization />
/// <Version>15.2</Version>
/// <References>
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\DevExpress.Persistent.Base.v15.2\v4.0_15.2.3.0__b88d1754d700e49a\DevExpress.Persistent.Base.v15.2.dll" />
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" />
/// <Reference Path="C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" />