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 Convert
C#
public class MatchConverter : IValueConverter
{
    public object Convert(object value, Type targetType,
        object parameter, System.Globalization.CultureInfo c)
    {
        if (value == null && Match == null)
            return Then;
 
        // convert Match to the value's type
        if (Match != null && value != null)
by Jerry Nixon   January 10, 2012 @ 4:07pm
84 Views
no comments
 
C#
public static class TimeZoneInfoHelper
    {
        public static TimeSpan FindUtcOffsetByTimeZone(TimeZoneInfo timeZone)
        {
            var converted = FindCurrentDateTimeByTimeZoneInfo(timeZone);
 
            return converted.HasValue ? timeZone.GetUtcOffset(converted.Value) : TimeSpan.Zero;
        }
 
by Jason Rowe   March 28, 2011 @ 7:23pm
83 Views
no comments
 
C#
using System;
using System.Windows.Controls;
using System.Windows.Data;
 
namespace ContosoSales
{
    /// <summary>
    /// Step down the opacity of something based on the length of the
    /// text entered into the TextBox for which this watermark is used.
    /// </summary>
by Jeff Handley   February 22, 2010 @ 4:24pm
229 Views
no comments
 
C#
using System;
using System.Text;
 
namespace ConsoleApplication2 {
    class Program {
        static void Main(string[] args) {
            //ავიღოთ რაიმე სტრინგი
            string s = "me miyvars samyaro imitom rom mze amodis da natels fens yovels";
            //გადავიყვანოთ ბაიტების მასივში, რადგან Convert.ToBase64String ბაიტის მასივს იღებს პარამეტრად
            byte[] strBytes = Encoding.ASCII.GetBytes(s);//თუ გაქვთ უნიკოდური ტექსტი უნდა გამოიყენოთ შესაბამისი კლასი. მაგ Encoding.Unicode
by Zviadi   February 10, 2010 @ 4:47am
279 Views
no comments
 
#!/bin/python
# -*- coding: utf-8 -*-
from xml.dom import minidom
 
def nhm2keymaps(layout):
    layout = minidom.parse(layout)
    Maps = layout.getElementsByTagName("Map")
    keymaps = []
    for map in Maps:
    char = map.childNodes[3].firstChild.data
by Ravi Chhabra   August 14, 2009 @ 9:38am
168 Views
no comments
 
C#
public static T EnumConverter<T>(string value)
    {
        return (T)Enum.Parse(typeof(T), value);
    }
by Giuliano Lemes   July 28, 2009 @ 6:43am
266 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