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 COM
C#
public static int Main(params string[] args)
{
           List<string> filesList = new List<string>();
            foreach (string arg in args)
            {
                if (arg.StartsWith("-"))
                {
                    if (arg.ToLower().Contains("nogui"))
                        ...;
                    else if (arg.ToLower().Contains("autostart"))
by none_100   January 26, 2012 @ 5:23am
15 Views
no comments
 
try { document.execCommand("BackgroundImageCache", false, true); } catch (e) { }
var popUpWin;
function PopUpCenterWindow(URLStr, width, height, newWin, scrollbars) {
    var popUpWin = 0;
    if (typeof (newWin) == "undefined") {
        newWin = false;
    }
    if (typeof (scrollbars) == "undefined") {
        scrollbars = 0;
    }
by medyunhavba   January 17, 2012 @ 12:56am
Tags: js, commen.js
20 Views
no comments
 
Dim VT as new bidiCardEntities
 
Dim Uyeler=Sorgula.Kont(VT , item.ID)
 
 
Public Class Sorgula
Public Shared ReadOnly Kont As Func(Of bidiCardEntities, Integer, IQueryable(Of Uye)) =
    CompiledQuery.Compile(
        Function(vt As bidiCardEntities, ID As Integer) vt.Uye.Where(Function(x) x.ID = ID) )
End Class
by Berat Bilgin   November 23, 2011 @ 8:25am
Tags: compiled
35 Views
no comments
 
copy $(ProjectDir)\..\{path to file} $(TargetDir)
 
rem add '1>nul' to NOT display any messages from the copy.
rem add '2>nul' to NOT fail the build and to NOT display any error messages from the copy.
 
 
by Al Gonzalez   June 16, 2011 @ 3:44pm
120 Views
no comments
 
package juddiv3admin.gui;
 
import java.awt.Frame;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JDialog;
import javax.swing.SwingWorker;
 
public class SwingWorkerCompletionWaiter implements PropertyChangeListener
{
by Martynas   March 29, 2011 @ 5:35am
118 Views
no comments
 
C#
/// <summary>
/// Add in item to a collection if it does not contain the specified element by using a IEqualityComparer<>. 
/// </summary>
/// <typeparam name="T">Type of the items in a collection</typeparam>
/// <param name="collection">The collection to add  the item</param>
/// <param name="item">The item to add to the collection</param>
/// <param name="comparer">An equality comparer to compare values.</param>
/// <returns>true if the item was added to the collection; otherwise, false.</returns>
public static bool Add<T>(this ICollection<T> collection, T item, IEqualityComparer<T> comparer)
{
by brentj   February 18, 2011 @ 7:26am
151 Views
no comments
 
C#
/// <summary>
/// An entry that can be either a single ip or a range
/// </summary>
public class IpEntry
{
    public string StartRange { get; set; }
 
    public string EndRange { get; set; }
 
    public bool IsRange
by rawbert   January 17, 2011 @ 1:29am
196 Views
2 comments
 
C#
public static void Copy(string sourceDirName, string destDirName, bool excludeSubdirectories)
{
    // Style #1: fluent
    Guard.MethodArgument("sourceDirName").IsNotNullOrEmpty(sourceDirName);
    Guard.MethodArgument("destDirName").IsNotNullOrEmpty(destDirName, "The destination directory is required!");
 
    // Style #2: lambdas and expressions
    Guard.Argument.IsNotNullOrWhiteSpace(()=>sourceDirName);
    Guard.Argument.IsNotNullOrWhiteSpace(()=>destDirName, "The destination directory is required!");
by Al Gonzalez   May 24, 2010 @ 8:58pm
310 Views
1 comments
 
C#
using System;
using System.Runtime.InteropServices;
using System.Threading;
using AcroPDFLib;
 
// Related to: http://stackoverflow.com/questions/2702164
namespace ComConsoleApplication
{
    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00000016-0000-0000-C000-000000000046")]
    public interface IMessageFilter
by knutkj   April 23, 2010 @ 3:40pm
338 Views
no comments
 
C#
// Controller Action
        public JsonResult SearchItem(string nature, string term)
        {
            IEnumerable<Item> list = null;
 
            Transactional(() =>
                              {
                                  switch (nature.ToLowerInvariant())
                                  {
                                      case "ricambi":
by andreabalducci   March 29, 2010 @ 2:42am
501 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Lucilla.Framework.Web.Mvc;
using DemoApp.Services.Model;
 
namespace DemoApp.WebSite.Controllers
{
by andreabalducci   March 26, 2010 @ 4:31am
525 Views
no comments
 
C#
public class FullScreenCommand : ICommand
{
    public event EventHandler CanExecuteChanged;
 
    public bool CanExecute(object parameter)
    {
        bool isFullScreen = (bool.TryParse(parameter.ToString(), out isFullScreen)) ? isFullScreen : true;
 
        return Application.Current.Host.Content.IsFullScreen != isFullScreen;
    }
by Andrej Tozon   March 18, 2010 @ 8:49am
1469 Views
no comments
 
C#
using(OleDbConnection connection = new OleDbConnection(ConnectionString))
{
    using(OleDbCommand cmd = new OleDbCommand(sql, connection) { CommandType = CommandType.Text })
    { 
        try
        {
            connection.Open();
        }
        catch (OleDbException ex)
        {
by dereklawless   February 12, 2010 @ 6:25pm
165 Views
no comments
 
C#
 
/// <summary>
/// Creates a COM instance from a ProgID. Loads either
/// Exe or DLL servers.
/// </summary>
/// <param name="progId"></param>
/// <returns></returns>
public static object CreateComInstance(string progId)
{
    Type type = Type.GetTypeFromProgID(progId);
by Rick Strahl   January 29, 2010 @ 2:52pm
Tags: COM
373 Views
no comments
 
C#
class Program
{
    static void Main(string[] args)
    {
        var instance = new Program();
        var cat = new AssemblyCatalog(typeof(Program).Assembly);
        var container = new CompositionContainer(cat);
        container.ComposeParts(instance);
 
        foreach (var plug in instance.Plugins)
by bnaya   January 29, 2010 @ 4:10am
933 Views
no comments
 
C#
class Program
{
    private static ImpCls s_imp = new ImpCls();
    private static string[] s_beforeState;
 
    static void Main(string[] args)
    {
        var c = new TypeCatalog(typeof(ExpMtd1));
        var catalog = new AggregateCatalog(c);
        var container = new CompositionContainer(catalog);
by bnaya   January 15, 2010 @ 1:17am
685 Views
no comments
 
C#
/// <param name="p">The p.</param>
by Nick Kirkes   December 11, 2009 @ 9:33am
224 Views
no comments
 
C#
 
 
public class CSLExportProvider : ExportProvider
{
    private IServiceLocator serviceLocator;
    private IDictionary<string, Type> contractMapping;
    
    public CSLExportProvider(IServiceLocator serviceLocator)
    {
        this.contractMapping = new Dictionary<string, Type>();
by Glenn Block   September 26, 2009 @ 12:25am
1746 Views
2 comments
 
C#
public interface IQuery<TResult>
{
    //Execute method that accepts an ObjectContext and returns a TResult
    TResult Execute(EntityContext context);
}
 
public abstract class QueryBase<TResult> : IQuery<TResult>
{
    //userCompiled parameter to decide whether to use compiled query or plain one
    protected QueryBase(bool useCompiled)
by Muhammad Mosa   September 05, 2009 @ 7:08pm
523 Views
no comments
 
C#
public static class A
{
   private static Func<MyContextEntities, int, Orders> compiledGetById;
 
  static A()
  {
     compiledGetById = CompiledQuery.Compile<MyContextEntities, int, Orders>(((ctxt, orderId) => (from o in ctxt.Orders where o.Id == orderId select o).FirstOrDefault()));
  }
 
  public static Orders GetOrderById(int orderId)
408 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