Skip to content

Instantly share code, notes, and snippets.

Philip Stears philipstears

Block or report user

Report or block philipstears

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View IsRunningRequired.vb
<Task("Name", "embedded://DriveWorks.MyImagePlain16.png", "Category")> _
Public Class DoSomethingWithOpenSpecification
Inherits Task
Private Sub New()
End Sub
''' <summary>
''' Overridden to indicate that a running specification is required by the task to execute.
''' </summary>
View IsNotOwnerCondition.vb
Imports DriveWorks.Specification
<Condition("Is Not Owner", Nothing)>
Public Class IsNotOwner
Inherits Condition
Protected Overrides Function Evaluate(ByVal specificationContext As SpecificationContext) As Boolean
Dim currentUser = specificationContext.Group.CurrentUser.Id
Dim creator = specificationContext.Group.Specifications.GetSpecification(specificationContext.Id).CreatorId
View FlipBits.cs
/// <summary>
/// Flips the order of the bits in the passed-in byte.
/// </summary>
/// <param name="original">The byte whose bits should be flipped.</param>
/// <returns>A byte containing the flipped bits.</returns>
private static byte Flip(byte original)
{
return TABLE_FLIP[original];
}
View gist:3817035
module PubSub {
interface ISubscription {
(...args: any[]): void;
}
interface IDictionary {
[name: string] : ISubscription[];
}
var registry : IDictionary = {
View Release and Swap a COM reference.vb
<Extension()>
Public Sub ReleaseAndExchange(Of T As Class)(ByRef oldComObject As T, ByVal newComObject As T)
If oldComObject IsNot Nothing Then
Marshal.ReleaseComObject(oldComObject)
End If
oldComObject = newComObject
End Sub
You can’t perform that action at this time.