Archive for the Category development

 
 

Create your own addin for Reflector

Jason Haley shows how to develop a simple addin for Reflector.

Technorati tags: reflector, dotnet

Code annotation tool for Reflector.

Review is a lightweight code annotation tool for Reflector. It can be used during code reviews or API reviews to take notes and pass them to other project members.
A review contains a list of code annotations. An annotation is associated to a code element (type, method, etc…) and contains a list of changes. A change is composed of a comment, a date, a user, a status and resolution. All data is stored in an XML file. Multiple review files can be merged into one file.

reflector-review

Download Review for Reflector from CodePlex.com

Technorati tags: reflector, tools, dotnet

[Via Peli's Farm]

Reflector 5 is available for download

The new version comes with a lot of great new features

  1. C# 3.0 support
    • Extension methods
    • Object initializers
    • LINQ query expressions
    • Collection initializers
    • Lambda expressions
  2. Code URL support
    • Navigate to code://mscorlib/System.Object via IE
    • Ctrl+Alt+C to copy the URL for current item
    • Add to HTML pages using <a href=“code://…”>
  3. Assembly Browser
    • Multiple Windows: Analyzer and Disassembler windows can be open at the same time
    • Update assembly location if loading the same assembly twice from different locations
    • Back and Forward mouse buttons and shortcut keys work from all windows
  4. Disassembler
    • Expand Methods and Expand Types feature
    • Context-sensitive documentation view
    • Click on declaration jumps to item in the browser
    • Tab to cycle through links, Up/Down to scroll
    • Context-based automatic variable naming
  5. Analyzer
    • Add and analyze multiple items (DEL to remove)
    • Find overrides of virtual methods
    • “Exposed By” and “Instantiated By” search
    • “Assigned By” search for fields
  6. Search
    • String or Constant search
    • Exact matching of multiple words
  7. Assembly Lists
  8. Resource Viewer
    • Save byte arrays in .resources file to disk
    • Double-click opens using shell file extension
  9. Options Dialog
    • Use hex or decimal number format
    • Indentation setting for text output
    • Switch between public only and all items
    • Automatically resolve assembly references
    • Optimization setting (show raw code)
  10. Windows Shell integration
    • Run Reflector.exe /register to register file extensions
    • Right-click and “Browse…”
    • Improved 120 DPI support
    • Windows Vista support

Download Reflector 5.0

Download Reflector 5.0 Add-Ins

 

[Via Computer Zen Blog]

 

Technorati tags: reflector, dotnet, c#, tool

Displaying large amount of data in DataGridView

DataGridView supports the special mode (Virtual Mode). The basic idea is that inside the control not stored any data.
In given below example of the primitive electronic table, the data stored in the hashtable.The electronic table has a large amount of cells. In this example the number of cells equals to 100000 lines * 100 columns = 10000000. Also the programm save and loads changed cells on the disk

Note: The SerializableDictionary can be found here

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.IO; 
using System.Text; 
using System.Windows.Forms; 
using System.Xml.Serialization; 
namespace Devintelligence.Example { 
    public partial class Form1 : Form 
    { 
        #region Fields  
        public SerializableDictionary<string, int> data = new SerializableDictionary<string, int>(); 
        private Font systemFont; 
        private XmlSerializer serializer = new XmlSerializer(typeof(SerializableDictionary<string, int>)); 
        #endregion  
        public Form1() 
        { 
            InitializeComponent(); 
        } 
        private void Form1_Load(object sender, EventArgs e) 
        { 
            if (File.Exists(FilePath)) 
            { 
                // load from file & desirialize  
                using (FileStream filestream = File.OpenRead(FilePath)) 
                { 
                    data = serializer.Deserialize(filestream) as SerializableDictionary<string, int>; 
                } 
            } 
            ((ISupportInitialize)dataGridView1).BeginInit(); 
            dataGridView1.VirtualMode = true; 
            dataGridView1.CellValueNeeded += new DataGridViewCellValueEventHandler(dataGridView1_CellValueNeeded); 
            dataGridView1.CellValuePushed += new DataGridViewCellValueEventHandler(dataGridView1_CellValuePushed); 
            // create columns  
            for (int i = 0; i < 100 ; i++) 
            { 
                string name = string.Format("{0}", i); 
                dataGridView1.Columns.Add(name, name); 
            } 
            dataGridView1.RowCount = 100000; 
            systemFont = new Font(dataGridView1.Font,FontStyle.Bold); 
            ((ISupportInitialize)dataGridView1).EndInit(); 
        } 
        /// <summary>  
        /// Calculates the unique hash key based on row and column indexes. 
        /// </summary>  
        /// <param name="rowIndex">Index of the row.</param>  
        /// <param name="columnIndex">Index of the column.</param>  
        /// <returns></returns>  
        private static string CalculateKey(int rowIndex, int columnIndex) 
        { 
            return string.Format("{0}_{1}", rowIndex, columnIndex); 
        } 
        /// <summary>  
        /// Handles the CellValuePushed event of the dataGridView1 control. 
        /// </summary>  
        /// <param name="sender">The source of the event.</param>  
        /// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> 
        /// instance containing the event data.</param>  
        void dataGridView1_CellValuePushed(object sender, DataGridViewCellValueEventArgs e) 
        { 
            data[CalculateKey(e.RowIndex, e.ColumnIndex)] = Convert.ToInt32(e.Value); 
            // mark changed cells  
            dataGridView1[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.LightPink; 
            dataGridView1[e.ColumnIndex, e.RowIndex].Style.Font = systemFont; 
        } 
        /// <summary>  
        /// Handles the CellValueNeeded event of the dataGridView1 control. 
        /// </summary>  
        /// <param name="sender">The source of the event.</param>  
        /// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/>  
        /// instance containing the event data.</param>  
        void dataGridView1_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) 
        { 
            int value; 
            if (data.TryGetValue(CalculateKey(e.RowIndex, e.ColumnIndex), out value)) 
            { 
                e.Value = value; 
                // mark changed cells  
                dataGridView1[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.LightPink; 
                dataGridView1[e.ColumnIndex, e.RowIndex].Style.Font = systemFont; 
            } 
            else  
            { 
                e.Value = e.ColumnIndex*e.RowIndex; 
            } 
        } 
        
        private static string FilePath 
        { 
            get  
            { 
                // the data file will be saved in file named data.xml  
                return Path.Combine(Application.StartupPath, "data.xml"); 
            } 
        } 
        private void Form1_FormClosing(object sender, FormClosingEventArgs e) 
        { 
            // serialize & save entered data  
            using (FileStream filestream = File.Open(FilePath, FileMode.Create)) 
            { 
                serializer.Serialize(filestream, data); 
            } 
        } 
    } 
}

Interesting blog posts (February 11)

Ohad’s Weblog IE7Pro – a must have add-in if you use IE7 !

Simple Living Simple Thinking Zip and Unzip files programmatically

Bill’s House O Insomnia AcceptChanges and Updates once more

Certifications and Software Development More C# 3.0 ? Extension Methods

Thom Robbins .NET Weblog Introduction to Building XML Web Services with ASMX


Page 12 of 37« First...1011121314...2030...Last »