Format:
Recent snippets matching tags of COM
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"))
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; }
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
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.
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 {
118 Views
no comments
/// <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) {
151 Views
no comments
/// <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
196 Views
2 comments
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!");
310 Views
1 comments
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
338 Views
no comments
// Controller Action public JsonResult SearchItem(string nature, string term) { IEnumerable<Item> list = null; Transactional(() => { switch (nature.ToLowerInvariant()) { case "ricambi":
501 Views
no comments
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 {
525 Views
no comments
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; }
1469 Views
no comments
using(OleDbConnection connection = new OleDbConnection(ConnectionString)) { using(OleDbCommand cmd = new OleDbCommand(sql, connection) { CommandType = CommandType.Text }) { try { connection.Open(); } catch (OleDbException ex) {
165 Views
no comments
/// <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);
373 Views
no comments
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)
933 Views
no comments
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);
685 Views
no comments
public class CSLExportProvider : ExportProvider { private IServiceLocator serviceLocator; private IDictionary<string, Type> contractMapping; public CSLExportProvider(IServiceLocator serviceLocator) { this.contractMapping = new Dictionary<string, Type>();
1746 Views
2 comments
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)
523 Views
no comments
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
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
