Format:
Recent snippets matching tags of ria
public sealed partial class BlankPage : Page { public BlankPage() { this.InitializeComponent(); var _String = "<special:Users xmlns:special='http://jerry'><User Key='1' Name='Jerry' /><User Key='2' Name='Michael' /></special:Users>"; using (var _Reader = System.Xml.XmlReader.Create(new StringReader(_String))) { var _Serializer = new System.Xml.Serialization.XmlSerializer(typeof(Users));
12 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication8 { class Program { static void Main(string[] args)
17 Views
no comments
using System; using System.Net.Http.Formatting; using System.Threading.Tasks; using System.Web.Script.Serialization; using System.Json; using System.IO; namespace Westwind.Web.WebApi { public class JavaScriptSerializerFormatter : MediaTypeFormatter
390 Views
no comments
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));
69 Views
no comments
<!DOCTYPE html> <html lang="es"> <head> <title>Problema de Física en JS</title> <script type="text/javascript"> //Problema a resolver document.write('<p>Sobre un cuerpo de 36 kg que se encuentra en reposo, se aplica una fuerza durante 7 segundos hasta que alcance una velocidad de 21 m/s. <br /> Calcular: <ol><li>Aceleración</li><li>Espacio</li><li>Fuerza aplicada</li><li>Peso</li></ol></p>'); //Datos iniciales a tener en cuenta var vi = 0; //Velocidad inicial
143 Views
no comments
#include "for_each.h" #include <iostream> #include <tuple> // ------- Fibonacii number generator --------- template<int N> struct Fib { enum { value = Fib<N-1>::value + Fib<N-2>::value }; };
176 Views
no comments
#include "for_each.h" #include <iostream> #include <string> #include <tuple> using namespace std; struct Functor { template<typename T>
125 Views
1 comments
// ===================================================================================== // // Filename: for_each.h // // ===================================================================================== #ifndef FOR_EACH_INC #define FOR_EACH_INC
145 Views
1 comments
// ===================================================================================== // // Filename: indexes.h // // ===================================================================================== #ifndef INDEXES_INC #define INDEXES_INC
152 Views
2 comments
public class DbContextDomainService<TContext> : DomainService where TContext : DbContext, new() { private TContext _DbContext; protected TContext DbContext { get { return _DbContext ?? (_DbContext = CreateDbContext()); } }
141 Views
no comments
public partial class Entities { public void Insert<T>(T entity) where T : class { if (entity == null) throw new ArgumentNullException("entity"); // Note: changing the state to Added on a detached entity is the same as calling // Add on the DbSet. Entry(entity).State = EntityState.Added;
232 Views
no comments
#region Get entity set name public string GetEntitySetName(Type entityType) { if (entityType == null) throw new ArgumentNullException("entityType"); if (!entityType.IsSubclassOf(typeof(EntityObject))) throw new ArgumentException("Only subclasses of EntityObject are supported.", "entityType"); return GetEntitySetNameInternal(entityType);
622 Views
no comments
/// <summary> /// Serialize anything /// </summary> /// <param name="serializeMe"></param> /// <returns></returns> public static string Serialize<T>(T serializeMe) { var serializer = new XmlSerializer(serializeMe.GetType()); var ms = new MemoryStream(); serializer.Serialize(ms, serializeMe);
110 Views
no comments
// System.Runtime.Seriaization.dll and System.Xml.dll are needed.
open System.IO
open System.Runtime.Serialization
open System.Xml
let write(x : float32[]) =
let ds = new DataContractSerializer(typeof<float32[]>)
let ms = new MemoryStream()
ds.WriteObject(ms, x)
ms.ToArray()
177 Views
no comments
/// <summary> /// Returns the content of the POST buffer as string /// </summary> /// <returns></returns> public static string FormBufferToString() { HttpRequest Request = HttpContext.Current.Request; if (Request.TotalBytes > 0) return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
292 Views
no comments
public XDocument ResponseXml { get; protected set; } public T Inflate<T>() where T : class { var attr = typeof(T) .GetCustomAttributes(true) .OfType<XmlRootAttribute>() .SingleOrDefault(); string root = attr.ElementName;
146 Views
no comments
public class MyData { [Key] public int Id { get; set; } public string Name { get; set; } public Queue<DataPoint> DataSerie { get; set; } }
237 Views
no comments
#region $entity$ public IQueryable<$entity$> Get$entities$() { return this.DataContext.$entities$; } public void Insert$entity$($entity$ current$entity$) { this.DataContext.$entities$.InsertOnSubmit(current$entity$);
408 Views
no comments
'Form1.vb #Region " Import Declaratives " Imports DevExpress.XtraEditors Imports DevExpress.Utils.Menu Imports System.IO Imports System.Xml.Serialization #End Region
2635 Views
no comments
[alias] # show author and revision number blame = annotate -u -n # clearer Git style diff output dif = diff --git log5 = log --limit 5 log10 = log --limit 10 log25 = log --limit 25
240 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
