vendredi 3 juillet 2009

The DataGridViewPrinter Class

http://www.codeproject.com/KB/printing/datagridviewprinter.aspx

Printing with WPF

http://www.switchonthecode.com/tutorials/wpf-printing-part-2-pagination

lundi 29 juin 2009

F# - Presentation

Great presentation from Laurent Le Brun
In French and in English :-)

http://laurent.le-brun.eu/

Dynamic LINQ

http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

Here how to retrieve the result from the Dynamic Generated Class
Thanks to Daniel
http://www.albamond.com/blog/Daniel/post/Dynamic-Linq-is-love.aspx

Working with events in F#

http://tomasp.net/articles/reactive-i-fsevents.aspx

dimanche 28 juin 2009

The F# 1.9.6 Draft Language Specification

http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec2.aspx

Lightweight WPF Twitter client sample F# script

http://www.strangelights.com/fsharp/wiki/default.aspx/FSharpWiki/fsweet.html

F# and Collective Intelligence

http://www.slideshare.net/robertfpickering/tech-days-paris-intoduction-f-and-collective-intelligence

samedi 27 juin 2009

F# Webcast

Another great presentation of F#.
Including a fully working application.

http://tomasp.net/blog/fsharp-webcast-functional.aspx

F Sharp Programming

Very very nice tuorial
http://en.wikibooks.org/wiki/F_Sharp_Programming

Interfaces + Factory pattern = Decoupled architecture

http://www.codegain.com/index.php?option=com_content&view=article&id=174:interfaces-factory-pattern-decoupled-architecture&catid=166:interview-questions&Itemid=142

mardi 23 juin 2009

VSTO Excel : GetRange

        /// <summary>
        /// Return a range starting from cell C
        /// The range can contain empty cell
        /// C - - - - - -
        ///  - -   - - - -
        ///  - - - - - - -
        ///  - -   - -          
        ///  </summary>
        /// <param name="ws"></param>
        /// <param name="start"></param>
        /// <returns></returns>
        public Excel.Range GetRightDownRegion(Excel.Worksheet ws, Excel.Range start)
        {
            Excel.Range curCell = start;
            Excel.Range endCell = start;
                  
            int lastCol;
            int offsetCol;
            int j = 0;

            while (curCell.Value2 != null)
            {
                curCell = start.get_Offset(0, j);
                if (curCell.Value2 != null)
                {
                    endCell = curCell;
                }
                j++;
            }
            
            lastCol = endCell.Column;

            int i = 0;
            curCell = start;
            endCell = start;

            while (curCell.Value2 != null)
            {
                curCell = start.get_Offset(i, 0);
                if (curCell.Value2 != null)
                {
                    endCell = curCell;
                }
                i++;
            }
            
            offsetCol = lastCol - endCell.Column;

            endCell = endCell.get_Offset(0, offsetCol);
                                    
            return ws.get_Range(start, endCell);            
        }
    }

mercredi 17 juin 2009

LINQ to Objects in C#

http://www.codedigest.com/Articles/CSHARP/218_LINQ_to_Objects_in_C_.aspx

jeudi 11 juin 2009

VSTO : ListObjects

VSTO is not obvious, here is to name columns


using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using Microsoft.VisualStudio.Tools.Applications.Runtime;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;

namespace ExcelWorkbook7
{
public partial class Feuil1
{
NorthwindDataContext ctx = new NorthwindDataContext();

private void Feuil1_Startup(object sender, System.EventArgs e)
{
var cs = from cust in ctx.Customers
select cust;

Microsoft.Office.Tools.Excel.ListObject customerData;
customerData = this.Controls.AddListObject(this.get_Range(this.Cells[1,1],this.Cells[1,2]), "Customers");
DataGridTableStyle s = new DataGridTableStyle();

customerData.TableStyle = "TableStyleLight10";
customerData.ListColumns.get_Item(1).Name = "ID";
customerData.ListColumns.get_Item(2).Name = "Name";
customerData.SetDataBinding(cs,"","CustomerID","CompanyName");

}

private void Feuil1_Shutdown(object sender, System.EventArgs e)
{
}

#region VSTO Designer generated code

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InternalStartup()
{

this.Startup += new System.EventHandler(this.Feuil1_Startup);
this.Shutdown += new System.EventHandler(this.Feuil1_Shutdown);

}

#endregion

}
}

How to programmatically display data into an excel worksheet

http://thedotnet.com/nntp/156520/showpost.aspx

Excel Object Model reference

http://msdn.microsoft.com/en-us/library/bb149081.aspx

VSTO : Add ListObject Controls to Worksheets

http://msdn.microsoft.com/en-us/library/eyfs6478(VS.80).aspx

Trie paramétrable

http://forum.hardware.fr/hfr/Programmation/CNET-managed/parametrable-list-sort-sujet_111411_1.htm

mercredi 10 juin 2009

Other Patterns Articles

ASP ALLIANCE

Comprendre le design Pattern Adaptateur

http://badger.developpez.com/tutoriels/dotnet/patterns/adaptateur/
http://aspalliance.com/993

Some Design Patterns

http://www.java2s.com/Code/CSharp/Design-Patterns/CatalogDesign-Patterns.htm

Observer Pattern Demo

http://www.java2s.com/Code/CSharp/Design-Patterns/ObserverPatternDemo.htm

mardi 9 juin 2009

Linq articles

http://www.codeproject.com/KB/linq/

LINQ to SQL: All common operations

http://www.codeproject.com/KB/linq/LINQToSQLBaseCRUDClass.aspx

Partial Methods in Linq

http://blog.benhall.me.uk/2007/07/partial-methods-in-linq.html

lundi 8 juin 2009

Working with the Range Object

http://codeidol.com/csharp/c-sharp-in-office/Working-with-Excel-Objects/Working-with-the-Range-Object/

Excel Solutions - MSDN

http://msdn.microsoft.com/en-us/library/bb386107.aspx

Microsoft Office Excel Programming Using VSTO 3.0

http://www.packtpub.com/article/microsoft-office-excel-programming-using-vsto