CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of windows
C#
public class HandleTheme
{
    // light
    public static string GetLightUrl(DependencyObject obj)
    {
        return (string)obj.GetValue(LightUrlProperty);
    }
    public static void SetLightUrl(DependencyObject obj, string value)
    {
        obj.SetValue(LightUrlProperty, value);
by Jerry Nixon   November 18, 2011 @ 9:36am
81 Views
no comments
 
C#
public partial class MyDataContext : System.Data.Linq.DataContext
{
    public void OnCreated()
    {
        if (!this.DatabaseExists())
            MoveDatabase("MyDatabase.sdf");
    }
 
    public static void MoveDatabase(string name)
    {
by Jerry Nixon   November 10, 2011 @ 10:13am
101 Views
no comments
 
C#
void DoQuery()
{
    // Register for the LoadCompleted event.
    var _Data = new DataServiceCollection<CityCrime>();
    _Data.LoadCompleted += _Data_LoadCompleted;
 
    // start the servery query
    var _Query = GetContext().CityCrime
        .Where(x => x.State == "Colorado")
        .Where(x => x.City == "Denver");
by Jerry Nixon   November 07, 2011 @ 3:56pm
71 Views
no comments
 
C#
// https://datamarket.azure.com/
private const string AZUREDATAACCOUNT = "Your Customer ID";
private const string AZUREDATAKEY = "Your Account Key";
private const string AZUREDATAURL = 
    "https://api.datamarket.azure.com/Data.ashx/data.gov/Crimes/";
 
// create a new context to the odata feed
private static Mango.Sample.AzureMarket
    .CityCrimeService.datagovCrimesContainer GetContext()
{
by Jerry Nixon   November 07, 2011 @ 3:28pm
57 Views
no comments
 
C#
public void SaveData(string path, object data)
{
    var _Store = IsolatedStorageFile.GetUserStoreForApplication();
    using (var _Stream
        = new IsolatedStorageFileStream(path, FileMode.Create, _Store))
    {
        var _Serializer = new XmlSerializer(data.GetType());
        _Serializer.Serialize(_Stream, data);
    }
}
by Jerry Nixon   November 07, 2011 @ 1:40pm
102 Views
no comments
 
C#
var _Key = "MyUniqueKey";
 
// persist data to the dictionary
var _DataToStore = "Store this string!";
IsolatedStorageSettings
    .ApplicationSettings.Add(_Key, _DataToStore);
 
// test presence in store
var _BoolResult = IsolatedStorageSettings
    .ApplicationSettings.Contains(_Key);
by Jerry Nixon   November 07, 2011 @ 1:37pm
70 Views
no comments
 
C#
const string KEY = "MyUniqueKey";
 
private void SaveButton_Click(object sender, EventArgs e)
{
    var _Store = IsolatedStorageFile.GetUserStoreForApplication();
    using (var _Stream 
        = new IsolatedStorageFileStream(KEY, FileMode.Create, _Store))
    {
        var _Data = MyTextBox.Text;
        var _Serializer = new XmlSerializer(typeof(string));
by Jerry Nixon   November 01, 2011 @ 3:22pm
37 Views
no comments
 
'***********************************************************************************************************************--
'***********************************************************************************************************************--
'This is a Visual Basic Script that hits a WebURL
'The WebURL hit is the one provided as the parameter (in this case through the windows task scheduler)
'Instructions: Set this .vbs as the action for a schedule task and in the parameters section pass in the WebUrl u wish to hit
'***********************************************************************************************************************--
'***********************************************************************************************************************--
 
'Create variable to hold passing in arguments
args = WScript.Arguments.Count
by Egli   October 30, 2011 @ 6:01pm
33 Views
no comments
 
C++
/*
GNOT General Public License!
(c) 1995-2011 Microsoft Corporation
*/
 
#include "dos.h"
#include "win95.h"
#include "win98.h"
#include "sco_unix.h"
#include "metro.h" //windows 8
135 Views
no comments
 
C#
//
// Besides some IoC container hookup and the plumbing for
// EventAggregator and Azure ServiceBus this is what an
// Event Driven Architecture application suited for 
// Continuous Client may look like.
//
// This was not done in an MVVM pattern as it would just
// introduce complexity for people unfamiliar. I wanted to
// focus on the Event Driven Architecture.
//
by Kelly Sommers   June 04, 2011 @ 5:55pm
801 Views
no comments
 
C#
using System;
using System.Collections;
using System.Collections.Generic;
 
namespace Core
{
    /// <summary>
    /// Validation Routines
    /// </summary>
    /// <remarks>
by rickrat   November 24, 2010 @ 9:56pm
444 Views
no comments
 
C#
class Program {  
    static void Main() {  
        if (Environment.UserInteractive) {  
            ServiceManager serviceManager = new ServiceManager();  
            serviceManager.OpenAll();  
            Console.ReadKey();  
            serviceManager.CloseAll();  
        }  
        else  
            ServiceBase.Run(new WindowsService());  
by grenade   December 21, 2009 @ 5:54am
288 Views
no comments
 
foreach ($adminGroup in gwmi -computer "." Win32_Group | where {$_.SID -eq "S-1-5-32-544"} | select -Property __PATH) {foreach ($userPart in gwmi Win32_GroupUser | where {$_.GroupComponent -eq $adminGroup.__PATH} | select PartComponent) {gwmi Win32_Account | where {$_.__PATH -eq $userPart.PartComponent} | select @{Name="Account";Expression={$_.Caption}}}}
by kopelli   November 11, 2009 @ 10:39pm
273 Views
no comments
 
 
C:\Users\administrator.OSM>dism /online /enable-feature /featurename:IIS-WebServ
erRole
 
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
 
Image Version: 6.1.7600.16385
 
Enabling feature(s)
by nobodybutca   September 04, 2009 @ 1:38am
467 Views
no comments
 
param ([string]$computerName = (gc env:computername))
 
function GetExceptionType($type, $logEvent)
{
 if ($type -ne "Error") { $logEvent.ReplacementStrings[17] }
 else {
        $rx = [regex]"Exception:.([0-9a-zA-Z].+)"
        $matches = $rx.match($logEvent.ReplacementStrings[0])
        $matches.Groups[1].Value
 }
by David R. Longnecker   August 25, 2009 @ 12:53pm
612 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate