RSS

Category Archives: .NET Programming

FREE open source DotNetNuke modules

Following is a list of free open source DotNetNuke modules available at CodePlex.

NB_Store – Free DotNetNuke Ecommerce Catalog Module – http://nbstore.codeplex.com/
NB_Store is a Free DotNetNuke E-Commerce / Catalog Module that supports multiple languages, customization through html templates, Export/Import, Order Admin, client Admin, Stock Control and Products support multiple models and options. It’s developed in VB.Net.

IWeb – DotNetNuke WebServices Module – http://iweb.codeplex.com/
IWEB allows you to create Web Services for your DotNetNuke Portal. You simply upload the module and start adding your own methods.
Intergrates with DNN authentication and API.
IWeb is an extensible framework for DotNetNuke allowing developers to use web methods that are integrated with the DotNetNuke security context.

IWebCF – DotNetNuke WCF Services Module – http://iwebcf.codeplex.com/
IWebCF provides a platform for developers to extend DotNetNuke using WCF services. IWebCF brings the power of SOA to DotNetNuke, allowing DNN to be more easily inter grated with enterprise applications and services.

IWebCF is the next generation of the original IWeb module for DotNetNuke. IWeb originally was developed using the classic ASMX web services and allowed extension methods to be added very easily. File management extension methods were added to the module and a file manager client was also included. IWebCF picks up at this point and migrates the underlying technology to WCF and away from ASMX web services.
MSBuild DotNetNuke Tasks – http://msbuilddnntasks.codeplex.com/
The MSBuild DotNetNuke Tasks Project is an open source project for MSBuild tasks for automatically updating the DotNetNuke Manifest file (.dnn) based on the actual state of the module. This will help in removing repetitive and easy to forgot tasks when creating DNN manifest files
Whenever you release a new version of a DotNetNuke module you have to carefully review the DotNetNuke manifest file ( .dnn) to reflect the current status of the module.
jQuery UI DotNetNuke integration – http://jquidnn.codeplex.com/
The goal of jQUI-DNN is to provide an easily deployable solution for developers wanting to use jQuery UI in a DotNetNuke context. The core and themes are provided as separate modules for easy deployment in a DotNetNuke host. It is developed in C#.
User Directory Module for DotNetNuke – http://userdirectory.codeplex.com/
With the Effority.Net User Directory Module for DotNetNuke you can search easily for your DotNetNuke users and display information like names, telephone numbers or all other profile data.

So you can easily provide a member directory, dealer directory or phonebook.
DotNetNuke Linq to Sql Model Adapter – http://dnnlinqtosqladapter.codeplex.com/
A DataContext adapter allowing DotNetNuke modules using Linq to Sql to automatically apply an end user’s database owner and object qualifier at runtime.
Organization chart with galleryhttp://trombi.codeplex.com/
is a DotNetNuke module, in french: “trombinoscope”. It is used to show the organisation chart with photos and hierarchy. It is alors possible to perform a search to find people in the company.
Workflow HTML / Versioning HTML Module for DotNetNuke – http://workflow.codeplex.com/
Based on the “Text/HTML Core Module” the Text/HTML Workflow Module offers simple versioning and approval abilities for your Text/HTML Module content.
Key features:

  • Versioning Text/HTML content
  • Roles: Viewer (Reader), Editor, Approval
  • Workflow Control Center: Manage Texts Versions
  • Viewer always gets the latest approved version of the content
  • Notifies Workflow Member if new content is available
  • Each submitted Text is stored as separated version


DotNetNuke Developers Help File –
http://dnnhelpsystem.codeplex.com/
MSDN Style help based upon inline code comments in de DotNetNuke Source Modules.

The help files are generated using SandCastle and the SandCastle Help File Builder using the unmodified sources from DotNetNuke, which can be downloaded from www.DotNetNuke.com
Silverlight Media for DotNetNuke – http://dnnslmedia.codeplex.com/
SilverlightMedia is a module for DotNetNuke®. Its a container for showing Silverlight applications in a DotNetNuke@ portal.
SilverlightDesktop for DotNetNuke – http://silverlightdesktpdnn.codeplex.com/
DotNetNuke module version of SilverlightDesktop.
WillStrohl.Injection Module for DotNetNuke – http://wnsinj.codeplex.com/
This is a content injection module, written by Will Strohl. Its purpose is to allow you to inject markup into the header or footer of the page. This version is compatible with DNN version 4.06.02 and up.

This module is meant to make it easy for DNN hosts and admins to add HTML markup into a DotNetNuke website, either in the header, or the footer of the page. This module can easily be used on a single page, or across an entire portal. Examples of how this might benefit you are:
jQuery script , Google Analytics script , Quantcast script, HTML comments / snippets, Inline JavaScript snippets, 3rd party widgets (non-DNN), Advertising snippets and whatever else you figure out to do…
DotNetNuke IdentitySwitcher – http://identityswitcher.codeplex.com/
The IdentitySwitcher is a simple, but very useful tool when it comes to DNN Module Development. Using this module you can easily switch between users, without knowing their passwords. Even switching to host users is supported (must be allowed by the host user).

Do not use this module in production environment.

SwfObject4DNN – Adobe Flash and Flex Module for DotNetNuke – http://swfobject4dnn.codeplex.com/
Gives you everything you need to use Adobe Flex or Adobe Flash files as modules in DotNetNuke. Along with IWebLite and Web Services, SwfObject4DNN helps you take advantage of user management in DotNetNuke from within your Flex or Flash application. The template is parameterized to make setting up and making changes easy.

Magic Content – http://magiccontent.codeplex.com/
Magic Content
is a multi-lingual content publishing module that can be used as a replacement for the current Text/HTML module. It’s very easy to use and extends content publishing by many useful features.

Image Upload and Editor Control – http://imageeditor.codeplex.com/
ASP.Net 2.0/MS AJAX 1.1 Image Editor custom server control provides client-side cropping, rotation/flip, brightness/contrast/saturation enhancement with dynamically generated image preview. Accompanying Image Editor Control is a full-featured image file selection and upload custom server control for DotNetNuke v 4.6.2 and above which handles all folder (including DNN secure and database folders) and file operations with respect for DNN permissions. A DNN module is also provided to demonstrate the control’s capabilities and properties. It may also be used as a stand-alone image upload and editing module.

WillStrohl.FeedHandler Module for DotNetNuke – http://wnsfh.codeplex.com/
This module is meant to help DNN site admins deal with the core RSS feed issues that modules output. For example, the Announcements module has the module name at the beginning of each <item> element value. The FeedHandler module allows you to perform a little Regular Expression magic to clean up and change your RSS feeds. However, you will need to supply a different feed URL to those who consume your RSS feed.

DNN Content Builder WCMS – http://dnncb.codeplex.com/
Content management is about to transform raw content into assets, managing every aspect of its life cycle. We are talking about workflow, scheduling, versioning, staging, personalization and much more than simply create HTML or inserting images into a page.

DNN Live Messenger – http://dnnlivemessenger.codeplex.com/
DNN Live Messenger makes it easy for users to integrate Windows Live UI Controls into their DotNetNuke Website. Instantly add the Windows Live Messenger webbar and enable users to use Windows Live Messenger from your Website. This module uses Delegated Authentication and requires you to register your site with Windows Live Services to recieve and AppID and to register a shared secret.

DNNFlashImageRotator – http://dnnfir.codeplex.com/
DotNetNuke Flash Image Rotator is based on JW Image Rortator, an open source flash project enables you to show a couple of photos in sequence, with fluid transitions between them. It supports rotation of an RSS, XSPF or ASX playlists with JPG, GIF and PNG images, a wide range of flashvars (variables) for tweaking both behavior and appearance and an extensive javascript API.

SharePointNuke – http://sharepointnuke.codeplex.com/
Open source module that connects to a SharePoint server and displays the content of a specified list into DotNetNuke.

DnnScanFree – http://dnnscanfree.codeplex.com/
A DotNetNuke module and associated windows forms client that facilitates the scanning and processing of documents using box codes. Additional information on this project can be found here: http://www.adefwebserver.com/DotNetNukeHELP/Misc/ScanFree/dnScanFree.htm

DnnBlogML – http://dnnblogml.codeplex.com/
DnnBlogML allows import/export between the core DotNetNuke Blog module and the BlogML format. It’s developed in Visual Basic, targeting .NET 3.5 SP1 framework, DotNetNuke 05.00.01, Blog 03.05.01.

DotNetNuke Event Publisher – http://dnneventpublisher.codeplex.com/
A DotNetNuke module that allows you to sync events based on data retrieved from SQL queries or existing UserDefinedTable modules to your Google Calendars.

DotNetNuke News Module – http://easynews.codeplex.com/
This is a DotNetNuke 5.5+ module for news. It allows users to create, manage and preview news on DotNetNuke portals. Module is template based and can work on multilanguage portals. It is free of charge and constantly improving.

Advertisements
 
Comments Off on FREE open source DotNetNuke modules

Posted by on December 9, 2014 in .NET Programming, DotNetNuke

 

Compiling Java in Visual Studio

Compiling Java in Visual Studio

http://improve.dk/compiling-java-in-visual-studio/

Java Language Support Plugin

http://visualstudiogallery.msdn.microsoft.com/bc561769-36ff-4a40-9504-e266e8706f93

 
Comments Off on Compiling Java in Visual Studio

Posted by on February 28, 2014 in .NET Programming, Java

 

Tags:

Efficient File I/O From C#

This article describes and benchmarks different ways to do file I/O from C#. All of the code referenced in this article is available for download and is free to use.

There are many different ways to do file I/O in C#. The .NET framework provides the following classes:

File – Provides static methods for the creation, opening of files, copying, deleting, moving, reading, and writing of files.
BinaryReader – Reads primitive data types as binary values using a specific encoding.
BinaryWriter – Writes primitive types in binary to a stream and supports writing strings using a specific encoding.
StreamReader – Implements a TextReader that reads characters from a byte stream using a particular encoding.
StreamWriter – Implements a TextWriter for writing characters to a stream using a particular encoding.
FileStream – Exposes a Stream around a file, supporting both synchronous and asynchronous read and write operations.
The Windows operating system also provides at least two functions to read and write files:

ReadFile – Reads data from a file. This function supports both synchronous and asynchronous operations.
WriteFile – Writes data to a file. This function supports both synchronous and asynchronous operation.
One small problem with using the Windows ReadFile and WriteFile functions is that the interface requires using pointers. In C#, pointers can only be used in a method or class declared unsafe. So, since some organizations are somewhat leery of using pointers and unsafe code, all of this code has been put into its own class and the calling methods do not have to declared unsafe. The name of this class is named:

WinFileIO – provides the capability to utilize the ReadFile and Writefile windows IO functions. Based upon extensive testing, these functions are the most efficient way to perform file I/O from C# and C++.

How The Test Program Works

The user interface provides the following buttons:

Run All – tests the Read File and Write File functions. Similar to pressing the Read File and Write File buttons.
Read File – tests the read file methods for each class listed above. Each test consists of reading in 3 text files with sizes of roughly < 1mb, 10mb, and 50mb.
Write File – tests the write file methods for each class listed above. Each test consists of reading in 3 text files with sizes of roughly < 1mb, 10mb, and 50mb.
WinFileIO Unit Tests – tests each public interface I/O method in the class to show that it works correctly.
Testing Methodology:

Each test is consistent in the way benchmarking is done. For each test function, the current time is obtained before the I/O function begins, and is then retrieved right after the test ends. Benchmarking includes the time it takes to open and close the file, except for the last set of tests which only measure the time it takes to read or write the files.

Each test consists of reading in or writing out 3 files:

< 1 MB – approximately .66 megabytes.
10 MB – approximately 10 megabytes.
50 MB – approximately 50 megabytes.
The test machine consists of the following parts:

CPU – INTEL i7-950.
Memory – 6 GB
OS – Windows 7 Pro which is contained on a solid state drive.
Hard drive – Western Digital 1TB SATA III 6GB/S 7200RPM 64MB CACHE, which is where the data files reside.
IDE – Visual Studio 2008 standard edition with .NET framework version 3.5 SP1.
Read Methods Tested:

File class methods:

ReadAllLines – reads all lines of the file into a string array. See TestReadAllLines.
ReadAllText – reads the entire contents of the file into a string. See TestReadAllText.
ReadAllBytes – reads the entire contents of the file into a byte array. See TestReadAllBytes.
BinaryReader methods:

Read – reads the entire contents of the file into a character array. See TestBinaryReader1.
StreamReader methods:

Read(1) – reads the entire contents of the file into a character array using the single argument constructor. See TestStreamReader1.

Read(2) – reads the entire contents of the file into a character array. Uses a constructor to specify a sector aligned buffer size. See TestStreamReader2.
Read(3) – a loop is used to read in the entire contents of the file into a character array. Uses a constructor to specify a sector aligned buffer size. The loop is terminated when the Peek function indicates there is no more data.
ReadBlock – reads the entire contents of the file into a character array. Uses a constructor to specify a sector aligned buffer size. See TestStreamReader5.
ReadToEnd – a loop is used to read in the entire contents of the file into a character array. Uses a constructor to specify a sector aligned buffer size. The loop is terminated when the Peek function indicates there is no more data. See TestStreamReader4.
ReadBlock – reads the entire contents of the file into a character array. Uses a constructor to specify a sector aligned buffer See TestStreamReader3.
ReadLine – reads the entire contents of the file line by line into a string. Uses a constructor to specify a sector aligned buffer size. See TestStreamReader3.
FileStream methods:

Read(1) – reads the entire contents of the file into a byte array. See TestFileStreamRead1.
Read(2) – reads the entire contents of the file into a byte array and parse into lines. See TestFileStreamRead2.
Read(3) – reads the entire contents of the file into a byte array and parse into lines. See TestFileStreamRead2A.
Read(4) – reads the entire contents of the file into a byte array. Uses the RandomAccess option in the constructor to determine if there is any impact on performance. See TestFileStreamRead3.
BeginRead(1) – reads the entire contents of the file into a byte array asynchronously. See TestFileStreamRead4.
BeginRead(2) – reads the entire contents of the file into a byte array asynchronously and parses into lines. See TestFileStreamRead5.
BeginRead(3) – reads the entire contents of the file into a byte array asynchronously and parses into lines. Identical to TestFileStreamRead5 except for using a different threading locking mechanism. See TestFileStreamRead6.
BeginRead(4) – reads the entire contents of the file into a byte array asynchronously. Uses no locking mechanism. See TestFileStreamRead7.
BeginRead(5) – reads the entire contents of the file into a byte array asynchronously and parses into lines. See TestFileStreamRead8.
WinFileIO methods:

Read – reads the specified number of bytes into an array.
ReadUntilEOF – reads the entire contents of a file into an array.
ReadBlocks – reads the specified number of bytes into an array.
Write Methods Tested:

File class methods:

WriteAllLines – writes all lines in a string array to a file. See TestWriteAllLines.
WriteAllText – writes the entire contents in a string to a file. See TestWriteAllText.
WriteAllBytes – writes the entire contents of a byte buffer to a file. See TestWriteAllBytes.
BinaryWriter methods:

Write – writes the entire contents of a character array to a file. See TestBinaryWriter1.
StreamWriter methods:

Write – writes the entire contents a character array to a file. See TestStreamWriter1.
FileStream methods:

Write(1) – writes the entire contents of a byte array to a file. See TestFileStreamWrite1.
Write(2) – writes the entire contents of a byte array to a file. See TestFileStreamWrite2.
Write(3) – writes the entire contents of a byte array to a file. See TestFileStreamWrite3.
WinFileIO methods:

Write – writes the entire contents of an array to a file. See TestWriteFileWinAPI1.
WriteBlocks – writes the entire contents of an array to a file. See TestWriteFileWinAPI2.
WinFileIO Class:

This class was designed to make it easy to use the Windows ReadFile and WriteFile methods. It handles all of the unsafe operations with pointers. Calling methods do not have to be declared unsafe. Implements the IDisposable interface which means that the Dispose method should be called when the object is no longer needed. If there is a problem with any method in this class, it will throw an exception with the Windows error information. If the function returns, then this indicates success. The only exception to this is the Close method.

Constructors:

WinFileIO() – default. If this constructor is used, then the PinBuffer function must be called.
WinFileIO(Array Buffer) – this constructor should be used most of the time. The Buffer is used to read in or write out the data. The array passed in can be of any type provided it does not contain any references or pointers. So, byte, char, int, long, and double arrays should all work. But string arrays will not since strings use pointers. The code has only been tested with byte arrays.
Methods:

void PinBuffer(Array Buffer) – this method pins the buffer in memory and retrieves a pointer to it which is used for all I/O operations. UnpinBuffer is called by this function so it need not be called by the user. This function only needs to be called if the default constructor is used or a different buffer needs to be used for reading or writing.
void OpenForReading(string FileName) – opens a file for reading. The argument FileName must contain the path and filename of the file to be read.
void OpenForWriting(string FileName) – opens a file for writing. If the file exists, it will be overwritten.
int Read(int BytesToRead) – reads in a file up to BytesToRead The return value is the number of bytes read. BytesToRead must not be larger than the size of the buffer specified in the constructor or PinBuffer.
int ReadUntilEOF() – reads in the entire contents of the file. The file must be <= 2GB. If the buffer is not large enough to read the file, then an ApplicationException will be thrown. No check is made to see if the buffer is large enough to hold the file. If this is needed, then use the ReadBlocks method.
int ReadBlocks(int BytesToRead) – reads a total of BytesToRead at a time. There is a limit of 2gb per call. BytesToRead should not be larger than the size of the buffer specified in the constructor or PinBuffer.
int Write(int BytesToWrite) – writes a buffer out to a file. The return value is the number of bytes written to the file.
int WriteBlocks(int NumBytesToWrite) – writes a buffer out to a file. The return value is the number of bytes written to the file.
bool Close() – closes the file. If this method succeeds, then true is returned. Otherwise, false is returned.
BenchMark Read Results::

Running the read file tests:
Total time reading < 1MB with File.ReadAllLines = 00:00:00.0030002
Total time reading 10MB with File.ReadAllLines = 00:00:00.0640037
Total time reading 50MB with File.ReadAllLines = 00:00:00.3540202
Total time reading < 1MB with File.ReadAllText = 00:00:00.0040002
Total time reading 10MB with File.ReadAllText = 00:00:00.0360020
Total time reading 50MB with File.ReadAllText = 00:00:00.1630093
Total time reading < 1MB with File.ReadAllBytes = 00:00:00
Total time reading 10MB with File.ReadAllBytes = 00:00:00.0050003
Total time reading 50MB with File.ReadAllBytes = 00:00:00.0260015

Total time reading < 1MB with BinaryReader.Read = 00:00:00.0020001
Total time reading 10MB with BinaryReader.Read = 00:00:00.0270016
Total time reading 50MB with BinaryReader.Read = 00:00:00.1260072

Total time reading < 1MB with StreamReader1.Read = 00:00:00.0010001
Total time reading 10MB with StreamReader1.Read = 00:00:00.0200011
Total time reading 50MB with StreamReader1.Read = 00:00:00.0960055
Total time reading < 1MB with StreamReader2.Read(large buf) = 00:00:00.0010001
Total time reading 10MB with StreamReader2.Read(large buf) = 00:00:00.0160009
Total time reading 50MB with StreamReader2.Read(large buf) = 00:00:00.0750043
Total time reading < 1MB with StreamReader3.ReadBlock = 00:00:00.0010001
Total time reading 10MB with StreamReader3.ReadBlock = 00:00:00.0150008
Total time reading 50MB with StreamReader3.ReadBlock = 00:00:00.0750043
Total time reading < 1MB with StreamReader4.ReadToEnd = 00:00:00.0020001
Total time reading 10MB with StreamReader4.ReadToEnd = 00:00:00.0320018
Total time reading 50MB with StreamReader4.ReadToEnd = 00:00:00.1720099
Total time reading < 1MB with mult StreamReader5.Read = 00:00:00.0020001
Total time reading 10MB with mult StreamReader5.Read = 00:00:00.0430025
Total time reading 50MB with mult StreamReader5.Read = 00:00:00.0850048
Total time reading < 1MB with StreamReader6.ReadLine = 00:00:00.0020002
Total time reading 10MB with StreamReader6.ReadLine = 00:00:00.0310017
Total time reading 50MB with StreamReader6.ReadLine = 00:00:00.1510087
Total time reading < 1MB with StreamReader7.Read parsing = 00:00:00.1470084
Total time reading 10MB with StreamReader7.Read parsing = 00:00:00.1600091
Total time reading 50MB with StreamReader7.Read parsing = 00:00:00.2260129

Total time reading < 1MB with FileStream1.Read no parsing = 00:00:00.0080005
Total time reading 10MB with FileStream1.Read no parsing = 00:00:00.0040002
Total time reading 50MB with FileStream1.Read no parsing = 00:00:00.0190011
Total time reading < 1MB with FileStream2.Read parsing = 00:00:00.1220070
Total time reading 10MB with FileStream2.Read parsing = 00:00:00.1220069
Total time reading 50MB with FileStream2.Read parsing = 00:00:00.1370079
Total time reading < 1MB with multiFileStream2A.Read parsing = 00:00:00.1180067
Total time reading 10MB with multiFileStream2A.Read parsing = 00:00:00.1210070
Total time reading 50MB with multiFileStream2A.Read parsing = 00:00:00.1320075
Total time reading < 1MB with FileStream3.Read(Rand) no parsing= 00:00:00
Total time reading 10MB with FileStream3.Read(Rand) no parsing = 0:00:00.0030002
Total time reading 50MB with FileStream3.Read(Rand) no parsing = 00:00:00.0170009
Total time reading < 1MB with FileStream4.BeginRead no parsing = 0:00:00.0020001
Total time reading 10MB with FileStream4.BeginRead no parsing = 0:00:00.0040002
Total time reading 50MB with FileStream4.BeginRead no parsing = 00:00:00.0180011
Total time reading < 1MB with FileStream5.BeginRead parsing = 0:00:00.0020001
Total time reading 10MB with FileStream5.BeginRead parsing = 0:00:00.0280016
Total time reading 50MB with FileStream5.BeginRead parsing = 0:00:00.1370079
Total time reading < 1MB with FileStream6.BeginRead parsing = 00:00:00.0030002
Total time reading 10MB with FileStream6.BeginRead parsing = 00:00:00.0280016
Total time reading 50MB with FileStream6.BeginRead parsing = 00:00:00.1360077
Total time reading < 1MB with FileStream7.BeginRead = 00:00:00
Total time reading 10MB with FileStream7.BeginRead = 00:00:00.0050003
Total time reading 50MB with FileStream7.BeginRead = 00:00:00.0240014
Total time reading < 1MB with FileStream8.BeginRead parsing = 00:00:00.0020001
Total time reading 10MB with FileStream8.BeginRead parsing = 00:00:00.0310018
Total time reading 50MB with FileStream8.BeginRead parsing = 00:00:00.1480085

Total time reading < 1MB with WFIO1.Read No Parsing = 00:00:00.0020001
Total time reading 10MB with WFIO1.Read No Parsing = 00:00:00.0020001
Total time reading 50MB with WFIO1.Read No Parsing = 00:00:00.0120007
Total time reading < 1MB with WFIO2.ReadUntilEOF No Parsing = 00:00:00.0010001
Total time reading 10MB with WFIO2.ReadUntilEOF No Parsing = 00:00:00.0030001
Total time reading 50MB with WFIO2.ReadUntilEOF No Parsing = 00:00:00.0140008
Total time reading < 1MB with WFIO3.ReadBlocks API No Parsing= 00:00:00.0010001
Total time reading 10MB with WFIO3.ReadBlocks API No Parsing = 00:00:00.0030002
Total time reading 50MB with WFIO3.ReadBlocks API No Parsing = 00:00:00.0130008

Total time reading < 1MB with BinaryReader.Read = 00:00:00.0010001
Total time reading 10MB with BinaryReader.Read = 00:00:00.0220012
Total time reading 50MB with BinaryReader.Read = 00:00:00.1080062
Total time reading < 1MB with StreamReader2.Read(large buf) = 00:00:00.0010001
Total time reading 10MB with StreamReader2.Read(large buf) = 00:00:00.0150008
Total time reading 50MB with StreamReader2.Read(large buf) = 00:00:00.0690040
Total time reading < 1MB with FileStream1.Read no parsing = 00:00:00.0010000
Total time reading 10MB with FileStream1.Read no parsing = 00:00:00.0030002
Total time reading 50MB with FileStream1.Read no parsing = 00:00:00.0130008
Total time reading < 1MB with WFIO.Read No Open/Close = 00:00:00.0010001
Total time reading 10MB with WFIO.Read No Open/Close = 00:00:00.0030001
Total time reading 50MB with WFIO.Read No Open/Close = 00:00:00.0130008
Read file tests have completed.

Analysis Of Read Results:

The File class provides the simplest way to read in a class. The ReadAllBytes method of this class provides a fairly efficient way to read in a file and is only bested by the read methods in the FileStream and WinFileIO classes. From the results, it appears that the best StreamReader and BinaryReader read methods are roughly 3 to 5 times slower than the ReadAllBytes method.

The FileStream read methods were shown to be the fastest way to read a file into memory using a method from the .NET Framework. The synchronous method of reading the entire file into memory in TestFileStreamRead1 and TestFileStreamRead3 proved to be the best of this set of tests with TestFileStreamRead3 taking top honors by a hair. The only difference between these two tests is that the file is opened with the SequentialScan option in TestFileStreamRead1 .vs. opening the file with RandomAccess in TestFileStreamRead3. Since there are always other OS activities going on while running a benchmark, it is hard to know if one method is superior to another when it is this close. However, these tests have been tested on other systems multiple times with different Windows OSs with the same results, so in this case it appears that the TestFileStreamRead3 method is marginally superior.

The biggest disappointment came with the 5 FileStream asynchronous tests given in TestFileStreamRead4 – TestFileStreamRead8. These tests all show that reading in a file asynchronously is inferior to reading it in synchronously. This is even true if other activities like parsing a file is done in between reads. For example, compare the results of TestFileStreamRead2A which reads in a file synchronously and parses the data against the results of TestFileStreamRead5 which reads in a file asynchronously and parses the data while the next block is read in asynchronously. Even when the locks have been removed (see TestFileStreamRead8), it is still at least 10% slower than reading the file in synchronously and then parsing the file afterwards (see TestFileStreamRead2A).

The WinFileIO class proved to be the fastest way to read a file in. It is between 33% to 50% faster than the fastest FileStream read method based upon the measured times above. However, the last set of tests – TestBinaryReader1NoOpenClose through TestReadFileWinAPINoOpenClose measure how quickly the files are read in after the file is opened. According to the results, the FileStream read method is just as fast as any of the WinFileIO read methods. So, it looks like the .NET framework takes longer to open a file than the windows CreateFile function.

Benchmark Write Results:

Running the write file Tests:
Total time writing < 1MB with File.WriteAllLines = 00:00:00.0050003
Total time writing 10MB with File.WriteAllLines = 00:00:00.0350020
Total time writing 50MB with File.WriteAllLines = 00:00:00.1620093
Total time writing < 1MB with File.TestWriteAllText = 00:00:00.0040002
Total time writing 10MB with File.TestWriteAllText = 00:00:00.0270016
Total time writing 50MB with File.TestWriteAllText = 00:00:00.1440082
Total time writing < 1MB with File.WriteAllBytes = 00:00:00.3560204
Total time writing 10MB with File.WriteAllBytes = 00:00:00.3390194
Total time writing 50MB with File.WriteAllBytes = 00:00:00.3530202

Total time writing < 1MB with BinaryWriter.Write = 00:00:00.0010001
Total time writing 10MB with BinaryWriter.Write = 00:00:00.0050003
Total time writing 50MB with BinaryWriter.Write = 00:00:00.3040174

Total time writing < 1MB with StreamWriter1.Write = 00:00:00.0030002
Total time writing 10MB with StreamWriter1.Write = 00:00:00.0230013
Total time writing 50MB with StreamWriter1.Write = 00:00:00.1140065

Total time writing < 1MB with FileStream1.Write no parsing = 00:00:00.0010001
Total time writing 10MB with FileStream1.Write no parsing = 00:00:00.0050003
Total time writing 50MB with FileStream1.Write no parsing = 00:00:00.3670210
Total time writing < 1MB with FileStream2.Write no parsing = 00:00:00.0070004
Total time writing 10MB with FileStream2.Write no parsing = 00:00:00.1060061
Total time writing 50MB with FileStream2.Write no parsing = 00:00:00.5000286
Total time writing < 1MB with FileStream3.Write no parsing = 00:00:00.0100006
Total time writing 10MB with FileStream3.Write no parsing = 00:00:00.1150066
Total time writing 50MB with FileStream3.Write no parsing = 00:00:00.5840334

Total time writing < 1MB with WFIO1.Write No Parsing = 00:00:00.0020001
Total time writing 10MB with WFIO1.Write No Parsing = 00:00:00.0050003
Total time writing 50MB with WFIO1.Write No Parsing = 00:00:00.3530202
Total time writing < 1MB with WFIO2.WriteBlocks No Parsing = 00:00:00.0010001
Total time writing 10MB with WFIO2.WriteBlocks No Parsing = 00:00:00.0060003
Total time writing 50MB with WFIO2.WriteBlocks No Parsing = 00:00:00.0260015
Write file tests have completed.

ANALYSIS OF WRITE RESULTS:

The File class provides the simplest way to write a file out. Unlike the ReadAllBytes method for reading files, WriteAllBytes is less efficient than WriteAllText according to the results above.

One interesting result is that the times to write out the < 1MB file and 10 MB file for the BinaryWriter, FileStream, and WinFileIO classes are quite similar and fast. However, the time to write out the 50 MB file takes around 60 times longer than the 10 MB file. This does not apply to the WinFileIO.WriteBlocks method which proved to be the fastest way to write a file out. The most likely reason for this is that WriteBlocks writes the file out in 65,536 byte chunks. However, the TestFileStreamWrite3 test also writes out the file in 65,536 byte chunks and proved to be the slowest method. I can’t think of a good explanation for this other than perhaps the FileStream.Write method has some issues.

 
Comments Off on Efficient File I/O From C#

Posted by on December 3, 2013 in .NET Programming

 

VSS Plugin version 1.6.2 for Eclipse 3.3 (europa)

VSS Plugin version 1.6.2 for Eclipse 3.3

A Team provider plug in for the Eclipse IDE. Enables VSS actions to be integrated with the Eclipse IDE release 3.3 (Europa). If you’d like to make a donation see below for details.

Last Modified: 09-Sep-2007

Screen shot of the plugin (Click to enlarge).

1 Getting Started

This plug-in should work with Eclipse release 3.3 SDK RCx, and the upcoming 3.3 SDK release. It enables the user to perform Microsoft Visual SourceSafe (VSS) actions from within the IDE. The former support for older Eclipse versions has now been dropped. Please use the older releases of the plugin of you use an non 3.3 compliant Eclipse base.

1.1 Prerequisites

  • Eclipse release 3.3 SDK (Europa Release), for Windows 98/ME/2000/XP. Please note that is requires the full SDK-version (I think this still applies).
  • A licensed and functional Microsoft Visual SourceSafe client version 6.0, preferably upgraded with the latest   service pack, which currently is SP 6. For further information see http://msdn.microsoft.com/ssafe/.    It’s very important to understand that the VSS Plugin for Eclipse does not provide you with   either a copy of Microsoft Visual SourceSafe or any license for using Microsoft Visual SourceSafe. The plugin requires   a functional licensed copy of Microsoft Visual SourceSafe for operation.
  • The plugin has been tested with the english version of VSS and it might also work on other VSS language versions, but some customization might be needed. See org/vssplugin/messages.properties for more information. The current version of the plugin uses the VSS Ole Automation API for integation.

1.2 Installation

  1. Download the latest version from http://sourceforge.net/projects/vssplugin/. Please note that if you are using WSAD 5.x or Eclipse 2.0 you can only use the older 2.0 compabillity releases. The same applies to older Eclipse 3.0 based versions.
  2. Unpack the zip-file into your eclipse plug in directory. Also make sure that any old version of the VSS plugin is removed.
  3. Restart the Eclipse IDE
  4. You can check if the plug in is running via Help -> About Eclipse Platform -> Plug in Details   scroll through the list and it should be there.
  5. Should be it. I also recommend to enable the Label Decorator function – if it is not enabled by default.

1.3 Donations

I have a paypal account for receiving donations. If you like the plugin and would like to make a donation please use paypal.

1.4 What’s new in the latest major release (1.6.0)?

  • Some updates in the Compare Dialog. The user can now select if comments should show, expand/collapse tree, select if labels should show. All actions available from the context menu.
  • Some updates in the Team Project Set Import/Export
  • 3.1 RCx Support
  • Support for online/offline mode. A VSS repository in offline mode no VSS actions are enabled. This is useful for running with the plugin configured and not having access to the VSS database.
  • Support for error/warning decorations in the Check Out-view.
  • Added support for comments for checkouts. The feature is controlled by a separate option in the preference page.
  • Added support for VSS Refresh Log view. The view shows which files that have been added, deleted or updated when executing any of the Refresh/Update State/Get Latest version-actions.
  • Better data in compare and replace views (check in time, by whom, version).
  • Added support on VSS Info page for shares. Now one can see if a file is shared and which shared vss paths it have.

1.5 Getting started

The VSS Plugin works on a per Eclipse project basis. Each project in your workspace can be configured separately and can mount a VSS database. If you need to mount more than on VSS database you must use separate Eclipse projects.

Each project can have one or more path mappings between the local workspace and the VSS database and the plugin requires at least one mapping for operation. For example: You have a source directory in your workspace /java/src and in the VSS all files below /java/src should be mapped to $/project-x/java/src, then you have a mapping from /java/src to $/project-x/java/src. It is always legal to only use / mapped to $/ but this is probably a rare case.

More mappings can be added if needed. The plugin will always use the “best mapping” in the sens of longest equal path.

For example three mappings:     /src/java => $/project-x/src/java     /src/jsp => $/project-x/webapp     /src => $/project-x/other

Results in:     /src/java/x/y/Test.java => $/project-x/src/java/x/y/Test.java     /src/java/Test.java => $/project-x/src/java/Test.java     /src/jsp/test.jsp => $/project-x/webapp/test.jsp     /src/test.jsp => $/project-x/other/test.jsp     /test.jsp => This file is not managed by the plug in.

How to enable the plug in?

1. Configure a team provider for your project. This is done by using the right click context menu    on the Eclipse project. Team -> Share Project, which brings up the select repository wizard dialog.

2. Select VSS Configuration Wizard. Select the appropriate settings. The next button will bring you    to the mapping configuration, but if you only need one mapping press finish.

  • Username is the username used for authentication in the VSS database.
  • Password is the corresponding password. Can be blank.
  • VSS directory is the full absolute directory path to the VSS Database holding the srcsafe.ini file. Then add the first mapping.
  • Source dir is the Eclipse project dir, which is the base dir for all operations. For example if you’re Eclipse project uses   /src as it’s root directory for all source, you should select that directory for this setting. This must be a   valid Eclipse project directory path.
  • Relative mount point is the VSS project (directory), which is the root of all operations in the VSS database. If the   source code you are interested in lies in the VSS Project $/web-application use that directory as relative mount point.   This must be a valid VSS project path.

3. Your project is now configured for using the VSS Plugin.

4. If you now bring up the right click context menu on the project and select Team, there will some additional functions    available. The context menu option will vary depending on the status of the file. If you have any trouble with that    an option isn’t available, but it should be, always try to do a refresh and see what happens. All errors within the plugin    can be found in the Eclipse log-file located at “your workspace”\.metadata\.log always check that if you have any trouble.

  • Refresh, always does a full Get Latest Version and then queries the VSS database for the status (checked out, existing, and so on..)   for each file within the database. You use this each time you want the VSS Plugin to have the correct   state for each file. It can be a time consuming since it has to query the database separately for each file.
  • Get Latest Version, get the latest version from the VSS repository. If a writable copy exists of a file   the user is prompted if the local copy should be replaced and any dirty open editor with the file   should be reverted.
  • Update Status, works like the Refresh but without the “Get Latest Version”, which makes it faster lightweight operation.         Release 1.3 of the plugin also supports status updates by using a low priority baclground thread. You can enable this in the preference.
  • Check Out, checks out the file/files from the repository.  If a writable copy exists of a file   the user is prompted if the local copy should be replaced and any dirty open editor with the file   should be reverted.
  • Check In, checks the file/files with changes into the VSS repository. The user is prompted to save all dirty   editors before any check in action is executed..
  • Undo Checkout, releases the file/files in the repository. The user is prompted if the file is changed, not   checked out for the current project. All affected files corresponding editors will be reverted after the undo,   even dirty editors.
  • Commit Changes – Tries to add all local files and check-in all files currently checked-out. The user is prompted for a selection of        files to add. Easy to use for commiting all changes made back to the VSS database.
  • Synchronize with Repository – Brings up the plattforms Synchronize view with a full diff of all local files with the files/folders in the VSS database.         Only added/deleted/changed resources are shown in the view. Local files which needs to be addes to the database is shown with a + (plus) sign and files deleted from        the database ate shown with a – (minus) sign.
  • Add to VSS, adds a local files to the VSS database.
  • Delete from VSS, deletes an existing file from the VSS database. It also removes the local copy.
  • Deconfigure VSS, only available on the project root folder; remove the VSS Plug in from the project.   After a configuration removal it might be necessary to close he project and reopen it for updating the view.

How to view/edit the configuration settings or configured mappings?

To view the configuration settings use the properties in the context menu on the project root folder and select VSS Configuration or VSS Mappings. On each resource one can always check its properties to find out status of the file, like where it’s mapped and so on. Found under context menu -> properties -> VSS Info.

How to show the .scc files not showing in the navigator view?

Why? You can disable the filter using the filer menu on the top right corner in the view.

How to support multiple checkouts?

To be able to use multiple checkous for a project you must enable this option in the

How to enable status showing for each file/folder in the project?

This is done via the workbench preference settings. Use Window -> Preferences -> Workbench -> Label Decorations -> and enable VSS Plug in Team Decorator.

  • Each file/folder known to exist in the VSS database is shown with a       little “database”         icon.
  • All files known to be checked out will have the checkoutee shown after the       filename.
  • All files, which the current user has checked out, will have a small checked         icon.
  • All files that have unkown state will have a small         icon, until a refresh is done.
  • Mapped folders will have a small         icon showing where the root of a mapping is.
  • Files which is not known to have the latest version locally have a small *-icon (asterix).

The Team Decorator is useful but it also requires some extra cpu and will make the start-up of the IDE somewhat slower, especially if there are a lot of files shown in the tree view.

Are there any preferences?

Preferences are found under Window -> Preferences -> Team -> VSS. – Show number of checked out files in each folder. Enabled this will show the number of   checked out as a number after the folder/package name.   – Always assume recursive refresh/get latest version on folders. Disabled this will bring up   a dialog, asking the user if the operation should be recursive, when   executing a refresh/get latest version on a folder.

How to enable shortcut keys?

This is done by enabling the VSS Plugin action set. Enable it for each perspective under Window -> Customize Perspective -> Other -> VSS Plugin menu and shortcut keys

The action is invoked on the current active editor or the current selection if there is no active editor. Perfect with code browsing for a fast check out/check in for a small change.

There is also a known problem with the menu on startup before any editor activation/deactivation or before any of the menu actions have been invoked the disablement of some menu options do not work, which might lead to unexpeted faults.

The currently supported keys are:    Ctrl+Alt+U -> Undo Check Out    Ctrl+Alt+I -> Check In    Ctrl+Alt+O -> Check Out    Ctrl+Alt+R -> Refresh    Ctrl+Alt+A -> Add

The shortcuts keys does not work?

This might a problem with keybinding collision within the Eclipse plattform. There might be some other plugin which uses the same shortcut key. By editing plugin.xml you can modify them if you have any problem. See the action set defintions near the bottom of the file.

Also consider that as long as there is an open editor it will take precedence over any selection in any view. Currently there does not seem to be any way to check which part has focus within the platform.

Some files are ignored by the VSS plugin, how to enable them?

Currently the filename patterns *.class, *.scc, .project, .classpath are available as ignored resources. Enable them under Window -> Preferences -> Team -> Ignored Resources. All files matching any of the enabled patterns will be ignored by the VSS plugin.

Is there a view of all checked out files?

Such a view can be found under Window => Show View => Other => VSS => Checked Out Files. To find all currently checked-out files in    a project use the full refresh.    You can disable showing files checked out to other users using the supplied filter. The sort-order can also be changed.

Nothing happens when I run an action?

Check the Eclipse log-file located at “your workspace”\.metadata\.log for any exception and file a bug-report.

Can I move and rename files from in the VSS?

All rename, delete and move operations in the workspace are now intercepted by the VSS plugin. The user is always prompted before the corresponding action is executed in the VSS database. One should note that moving of a single file between folders does an add and then a delete, which causes the file to loose all VSS history. This is a limitation in the VSS, it only support move of projects and not files, don’t ask me why??

Can I import/export all VSS project settings?

Use the Team Import/Export function in the platform. Projects configured with VSS support all mappings, database path and so on will be exported.

On import if you have the project-decription files (.project, .classpath) stored in the VSS and they are mapped to the project’s root folder the import function will ask if it should use project-decription files for creating a new project.

I also recommend you try out Eclipse Project Set Editor, which now supports the VSS plugin, acknowledgements to Martin Zvieger and Dirk Baumann who provided this.

Is there any way to check differences between local files and files in the Database?

Synchronize View

The new Synchronize with Repository action brings up the plattforms Synchronize view with a full diff of all local files with the files/folders in the VSS database.         Only added/deleted/changed resources are shown in the view. Local files which needs to be added to the database is shown with a + (plus) sign and files deleted from        the database ate shown with a – (minus) sign. Together with the Commit Changes action is very easy to commit your changes back to the VSS Database.         This is still an early version of it, but I find it usefull.

The Commit Changes action tries to add all local files and check-in all files currently checked-out. The user is prompted for a selection of        files to add. Easy to use for commiting all changes made back to the VSS database.

Compare/Merge Viewers

To compare single files you can use the compare viewer available under the Comapre With-menu. This will bing up a full dialog showing versions in the VSS database and differences between that version any the local file.

Screen shot of Compare Viewer (Click to enlarge).

Thers is also a merge action under the team-menu which brings up a merge viewer, which looks similar to the Compare-viewer but with the change that the left side is editable.

The user can also select if comments should show, expand/collapse tree, select if labels should show. All actions available from the context menu.

Help! Something seems wrong, the views are not showed correctly, the context meny does does not show or I get somekind of COM error.

If this happends the most likely cause is due to some unreported error or some major configuration error. You can always try to disable the VSS    plugin by removing the <nature>org.vssplugin.core.VSSPluginProvider</nature> line from the .project file and restart. Then reconfigure your project.

Another issue can be that your local VSS installation is somehow corrupt. Usally when you see a COMException, or     registry-GUID it’s your installation thas is corrupt. Applying the latest service-pack should solve the problems. For further information see http://msdn.microsoft.com/ssafe/

The Eclipse log-file located at “your workspace”\.metadata\.log.

The plugin does not seem to work with WSAD 5.1.

Since WSAD 5.1 is based on Eclipse 2.1 it is not supported. Use the older 2.0-compabillity release intead.

2. Known problems

  • The menu and shortcut key support enablement/disablement is not correctly   updated until first invocation or editor change.
  • After moving a file and and error occures an extra read-only dialog is shown.   This dialog comes from inside eclipse and I can’t right now find a way to get rid of it.
  • See todo list.

3. Changes To Previous Versions

3.1. Changes in Version 0.8

  • Initial release.

3.2. Changes in Version 0.9

  • Added support for recursive Undo Checkout and Check-in operations.
  • Added support for prompting for save of dirty editors on check in.
  • Added support for revert all dirty editors after undo checkout
  • Added menu and shortcut keys support via ActionSet
  • Some requested bugfixes
  • Fixed support for UNDO Checkout with a saved changed editor.
  • Added support for removing all stored states, when a project is deconfigured
  • Added support for automatic update of the view after a configuration removal

3.3. Changes in Version 0.9.1

  • VSS usernames with spaces in are now supported.
  • Added filter for .scc files in package explorer. Acknowledgment to Thomas Kelch for   providing this feature.
  • Bug for jdk 1.3 resolved
  • Separate bin and src distributions.

3.4. Changes in Version 0.9.2

  • Added support for better error handling and integration with the SS.exe.   Ask question instead of showing error.      – Undo Check out when thr local files has changed.     – Undo Check out File not checked out from this project      – Check out to a already writable copy.     – Get Latest Version to a already writable copy.     – Check in: File not checked out from this project
  • Add support for Yes TO ALL and NO TO ALL options in dialog
  • Some other bugfixes
  • Added caching of overlay images in LabelDecorator for better performance.
  • Introduced new state for files with unknown state. Used for decoration. If a       file/folder does not have a known state a small ? icon is shown, until a       manuall refresh is done. This gives much better startup performance       when a full refresh hasn’t been done.
  • Fixed better progress monitor feedback.
  • Added workaround for problem with SS.EXE Status output, not having the same       output format for all users.
  • Support for IMoveDeleteHook hook in the eclipse platform. This function is still in beta   and needs more testing. When a delete, rename or move is issued on a VSS controlled   project the user is asked if the corresponding action should be executed within the   VSS.
  • Support for removing all stored states, when a project is removed   or a file is removed from the local file system.
  • The need for -consoleLog command line option removed when running   with JRE 1.4.0_01.
  • Last set SS.EXE-path, username and password settings saved in the configuration wizard.
  • When only one file is selected for an action a busy cursor is used instead of   the progress bar indicator.
  • Added support for changing configuration settings.
  • Addressed problem with package explorer not showing status updates correctly. Although   it seem like only the status of java files can be correctly updated. All other files are   ignored by the package exporer.
  • Removed dirty state for so long.

3.5. Changes in Version 1.0 beta

  • Some minor bugfixes.
  • I’ve added a confirm box to Delete, Check Out, Check In and Undo Check Out when more than 10 files   are affected.
  • Fixed errormessage when setting up the VSS settings for a project and the .project file is read-only.
  • Moved configuration settings to xml-file found in .metadata\.plugins\org.vssplugin\dialog_settings.xml.   The old settings should be automatically converted to the new format on the first startup.
  • Add support for better local folder VSS project mapping management, not only one folder   but several different mappings. Acknowledgement to Brian Ciccolo for inspriation for this feature.
  • Show small arrow icon on folders with mapping.
  • Added VSS Info property page.
  • Changed patterns added to ignored resources to be enabled by default.
  • Added preferencepage for the plugin and added some requested features to it.            – Number of checked out files on a folder/package.    – Refresh/get latest version/check in/check out/undo check out on folder the user should be able to select   if the operation should be recursive or not.
  • Hide password in configuration dialog.

3.6. Changes in Version 1.0

  • Some minor bugfixes.
  • Support for comment on checkin
  • Added support for issue 610984 (rename checked out files)
  • Added support for password issue 609977, 609993
  • Added support using CVS at the same time as VSS. Bug 610464
  • Fixed bug 610520
  • Setup.exe distribution. Acknowledgement to Lennart Benoot for providing the NSIS-script for creating the installer.

3.7. Changes in Version 1.1 (Never Released)

  • Full rewrite the VSS integration stuff to use VSS OLE Automation API instead of via SS.EXE. Major performance improvements.
  • Comment on add
  • Comment template for both add and check-in
  • Handle permissions in VSS, for example a user with read-only cannot do a check out
  • Added support for export/import team project sets. This feature is used to export all VSS configuration settings      to a file, which then can be imported. For example on another Eclipse instance. The function is found under Right click context Menu -> Export -> Team Project Sets.       Currently unconfigured projects       with the same name as in the export can be imported. An existing configuration can never be overwritten.
  • Automatic checkout file on try to edit, like refactorings and so on.
  • Automatic removal of files deleted from the VSS Database during operations.
  • Automatic creation of non existent sub-directories on add
  • Ask user before automatic removal

3.8. Changes in Version 1.2

  • Canceling a checkin does not seem to work fixed.
  • Discovering no configuration for the given project reset sharing settings for this project and open it as an unshared project.
  • Warning given when ss.ini is unreadable or database is corrupt.
  • Execute and view of diff with VSS from within eclipse (on a per file basis). Early version (exprimental).
  • Get Latest of a label
  • Moved almost all user-strings into the Policy-file. For translations in other languages.
  • Changed key-mappings From Ctrl-Shift to Ctrl-Alt for better integration with the M4 release.
  • Added small * icon showing that the local file is not known as the latest version.
  • When adding comments doing a check-in file, it should possible to add comments to a standard list.     This standard list can be chosen from when commenting a file on checkin.

3.9. Changes in Version 1.2.1

  • Fixed bug 668589, Context menu very slow on large project
  • Fixed bug 669437, Compare in v1.2 does not compare with latest
  • Fixed bug 669183, VSS project config wizard needs window title
  • Fixed bug 669179, VSS preference page too big
  • Plus some additional bug-fixes.
  • Added View of Checked Out Files with sorting, filters and context menu. The view is found under Window => Show View => Other => VSS => Checked Out Files.

3.10. Changes in Version 1.3

  • Added support for “Replace With” under “VSS version…”-dialog. Makes it possible to load back an old version of a  specific file and not only through the label as is is in the “Team” menu.
  • Changed drawing order of overlay icons in the LabelDecorator after recommendation from the Eclipse Team.
  • Fixed some JDK 1.3 issues.
  • Added update status action, which updates the state of a resource without retrieving the latest version.
  • Shortcut key confirmation, on undo checkout. Enable it using the preference page.
  • Added Replace with VSS Version and Compare to Latest VSS Version.
  • Added context menu to compare dialog, supports “Get Version” and “Compare to Local”
  • Support for a low priority background thread updating resource statuses.
  • Moved flush status operation to end of WorkspaceModifyOperation
  • Added Merge Action
  • Some additional bugfixes. Got one fix from the Eclipse Team. The Eclipse M5-release the Find dialog does not expect a file to be writeable.
  • Handle multiple checkouts in VSS. Can be enabled for each project in the configure project settings. The support should be considered beta. All Ideas for enhancement are welcome.
  • Merge a local-version with a VSS-version

3.11. Changes in Version 1.4

  • Finally fixed status updates of decorations in views to work better and faster.
  • A Simple VSS Tree View.. Don’t really see the need for it, but it’s a start.
  • Bugfix of “same comment” function not working as supposed.
  • Changed comment dialog. Cancel button now works as supposed.
  • Added new feature for synchronizing/Comparing whole trees, with the Synchronize view. It’s still in the early stage but I find it very usefull.
  • Added support for VSS Plugin to editor context menu in Text and Java-editor.
  • Some internal refactorings for the code.

3.12. Changes in Version 1.4.1

  • Change so that the background updater thread, never modifies the workspace, which enables us to run without the workspace lock.       It should have the effect that while running it does not lock out other workspace operations.
  • Support for [ 706811 ] Check in: leave last comment
  • Support for 700924 Selectable labels in VSS Info property pane
  • Changed to that Get Latest Version follows the same scheme for enablement as the Refresh operation
  • Improved the import/export Team Project Set. Added the possibility to create a new project when importing a Team Project Set. If a .project and a .classpath is found in the VSS-Database the project is created and is fully refreshed. Thanks to Lev Gimelfarb for providing this feature.
  • Fixed issue that the username and password are exported by default in Team Project Sets. The user is now prompted when exporting if the username should be included in the export. If no username is supplied during and import the user is asked to supply the username and/or password.

3.13. Changes in Version 1.5

  • Fixed: [ 729609 ] resouceNotExists.message: refactoring packages
  • Fixed: [ 731228 ] Problems with removing mappings
  • Fixed: [ 731229 ] Decorators remain after deconfiguring
  • Fixed: [ 738713 ] Rename package name => doesn’t check out correctly
  • Some other bugs
  • Support for setting a configued VSS project as offline/online. Setting it to offline means that no actions can be executed. This is good for working with a configured project and not having the VSS database online. The current support does not keep track of which files that has been deleted, moved and so on.
  • Support for Label decorations in the VSS Checkout view, both system vide decorations and problem marker decorations through jdt.ui.ProblemDecorator. Fixes [ 755294 ] no decorators on checked out files view
  • Added support for VSS Refresh Log view. The view shows which files tha are added, deleted and updated when executing any of the Refresh/Update State/Get Latest version-actions.
  • Support for plugin to ask to unset the read-only flag if the file is read-only, when trying to do an edit. Also added actions for this when using the plugin in offline-mode.
  • Changed COM-bridge version to 20030227, for IEnumVariant support. This enabled better vss-data in several views.
  • Added support for check-out on save-calls used from the CompareViewer. Now it possible to compare two files edit the contents and on save the user will be asked for check-out if necessary.
  • Added support for VSS comments during a rename operation (if the file is checked out). Patch provided by Simon Lieschke.
  • Added support for “Check In/add/Commit”-dialog allows you to keep the file(s) checked out locally after the add/check-in operation.
  • Added support for comments for checkouts. The feature is controlled by a separate option in the preference page.
  • Added support on VSS Info page for shares. Now one can see if a file is shared and which shared vss paths it has.

3.14. Changes in Version 1.5.1

  • Added support for german translations. Acknowlegement to Marc Pompl for providing the translations.

3.15. Changes in Version 1.5.2

  • Dropped support for Eclipse version 2.0 and 2.1.
  • Added compare with latest to editor menus and window menu.
  • Fix to address the problem with open editors not always replacing it’s contents after the files had changed on disk (after check-in, check out, get latest..)
  • The Compare/Replace/Merge dialog is not modal any more.
  • Only 3.0 M6 release or later. Added support for QuuickDiff provider.
  • Only 3.0 M6 release or later. Added support for the New Synchronize View.

3.16. Changes in Version 1.6

  • Performance update for Checked out files view during updates.
  • Dropped Jawin as COM-bridge. Use SWT’s internal support instead.
  • 3.0 RC2 Support
  • Several bugfixes

3.17. Changes in Version 1.6.1

  • Some updates in the Compare Dialog. No the user can select if comments should show, expand/collapse tree, select if labels should show. All actions available from the context menu.
  • 3.1 RCx Support
  • Some bugfixes
  • Some updates in the Team Project Set Import/Export

3.18. Changes in Version 1.6.2

  • 3.3 Support
  • New extension hooks for various vss commands, provided by Michal Hlavac and Filip Vanek. This enables the possibility to add your own extensions to the plugin, by implementing IVSSCommandsHook and adding extension points from schema/vssCommandsHook.exsd in your plugin.

4. TODO/Wishlist

Priority Tasks

Low Priority Tasks

  • Ask user for add file to VSS after saving a newly created local file. This feature requires bug-fixing in the Eclipse-plattform
  • The fix should be something like keep the VSS dialog open and  MODAL until the file is checked out, preventing the user from  going back to the editor until the file is checked out.
  • Support for Cloaked projects/Add support for configuring which mappings are recursive and which are not. Perhaps use the Exclution filter settings in JDT? Or should this be a property on each folder in the workspace? Is this a good idea?
  • Fix some workaround for none recursive actions with related mappings. Low priority.
  • Investigate if it’s possible to support for SCC API. Low priority.
  • Support for select files to handle on recursive operations. Low priority.
  • that we didn’t find a way to label a file or project it can be done in VSS Explorer (menu File > Label). Is this maybe a future change or not?
  • Suggested fix is to add a yield() call during the recursive  processing of the directory structure to obtain the  updates. VSSPluginProvider.execute(IRecursiveOperation  operation, IResource resource, int depth, IProgressMonitor progress): //snip… // Collect the responses in the multistatus. for (int i = 0; !progress.isCanceled() && (i <  members.length); i++) { yield(); multiStatus.add(execute(operation, members[i],  childDepth, progress)); } //snip…
  • (futuristic) When checking in a file, it is parsed and compared with the  older version. From this data the plugin could suggest comments. eg added  member field mName, added method getName(), … This feature could be useful for other version control systems too.
  • I’d like the version to be compared to be the pinned version rather than the “latest in another stream” version – This a bug in the VSS API. See if it’s possible to find a work-around.

5. Copyrights and Support

© 2002-2007 Marcus Nylander (marcus.nylander@bredband.net).

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

More info and updates are located at: http://sourceforge.net/projects/vssplugin/

 
Comments Off on VSS Plugin version 1.6.2 for Eclipse 3.3 (europa)

Posted by on May 28, 2013 in .NET Programming, Programming Tools

 

MVC 4 Razor View Engine Syntax

About Razor View Engine

Many ASP.NET Web pages have C# or VB code blocks in the same place as HTML markup. In some occasions this combination is uncomfortable for writing and delimiting code. To deal with that problem, Razor was designed as an easy to learn, compact and expressive view engine that enables a fluid coding workflow.

Razor is not a new programming language itself, but uses C# or Visual Basic syntax for having code inside a page without ASP.NET delimiter: <%= %>. Razor file extension is ‘cshtml’ for C# language, and ‘vbhtml’ for Visual Basic.

Razor Syntax – The fundamentals

 
  1. ‘@’ is the magic character that precedes code instructions in the following contexts:
    1. ‘@’ For a single code line/values:
      A single code line inside the markup:
      cshtml
      <p>
         Current time is: @DateTime.Now
      </p>
      vbhtml
      <p>
         Current time is: @DateTime.Now
      </p>
    2. ‘@{ … }’ For code blocks with multiple lines:
      cshtml
      @{ 
           var name = “John”;
           var nameMessage = "Hello, my name is " + name + " Smith";
      } 
      vbhtml
      @Code 
           Dim name = “John”
           Dim nameMessage = "Hello, my name is " + name + " Smith"
      End Code
    3. ‘@:’ For single plain text to be rendered in the page.
      cshtml
      @{ 
          @:The day is: @DateTime.Now.DayOfWeek. It is a <b>great</b> day!
      }
      vbhtml
      @Code 
          @:The day is: @DateTime.Now.DayOfWeek. It is a <b>great</b> day!
      End Code
  2. HTML markup lines can be included at any part of the code:
    It is no need to open or close code blocks to write HTML inside a page. If you want to add a code instruction inside HTML, you will need to use ‘@’ before the code:
    cshtml
    @if(IsPost) { 
         <p>Hello, the time is @DateTime.Now and this page is a postback!</p>
    } else { 
         <p>Hello, today is: </p> @DateTime.Now
    }
    vbhtml
    @If IsPost Then 
         @<p>Hello, the time is @DateTime.Now and this page is a postback!</p>
     Else  
         @<p>Hello, today is: </p> @DateTime.Now
    End If
  3. Razor uses code syntax to infer indent:
    Razor Parser infers code ending by reading the opening and the closing characters or HTML elements. In consequence, the use of openings “{“ and closings “}” is mandatory, even for single line instructions:
    cshtml
    // This won’t work in Razor. Content has to be wrapped between { }
    if( i < 1 ) int myVar=0;
    vbhtml
    // This won’t work in Razor. Content has to be wrapped between { }
    If i < 1 Then   Dim myVar As int =0 End if
    

Conditionals and loops with inline HTML

Here you will find examples of conditionals with inline html.
  • If statement:
    cshtml
    <p>Single line If</p>
    @if(result != ""){
        <p>Result: @result</p>
    }
    vbhtml
    <p>Single line If</p>
    @If result <> "" Then
        @<p>Result: @result</p>
    End If
    cshtml
    <p>Code block If</p>
    
    @{
        var showToday = false;
    
        if(showToday){
            @DateTime.Today;
        } else{
            <text>Sorry!</text>
        }
    }
    vbhtml
    <p>Code block If</p>
    
    @Code
        Dim showToday = false
    
        If showToday Then
            @DateTime.Today
        Else
            @<text>Sorry!</text>
        End if
    End Code
  • Foreach statement:
    cshtml
    <p> Single Line Foreach </p>
    <ul>
    @foreach (var myItem in Request.ServerVariables){ 
        <li>@myItem</li> 
    }
    </ul>
    vbhtml
    <p> Single Line Foreach </p>
    <ul>
    @For Each myItem in Request.ServerVariables 
        @<li>@myItem</li> 
    Next myItem
    </ul>
    cshtml
    <p> Code block Foreach </p>
    @{
        <h3>Team Members</h3> string[] teamMembers = {"Matt", "Joanne", "Robert", "Nancy"};
        foreach (var person in teamMembers)
        {
            <p>@person</p>
        }
    }
    vbhtml
    <p> Code block Foreach </p>
    @Code
        @<h3>Team Members</h3> 
        Dim teamMembers() As String = {"Matt", "Joanne", "Robert", "Nancy"}
        For Each person in teamMembers
                @<p>@person</p>
        Next person
    End Code
  • While statement:
    cshtml
    @{
        var countNum = 0; 
        while (countNum < 50) {
            countNum += 1;
            <p>Line #@countNum: </p>
        }
    }
    vbhtml
    @Code
        Dim countNum = 0 
        Do While countNum < 50
            countNum += 1
            @<p>Line #@countNum: </p>
        Loop
    End Code

Comments

Comments in Razor are delimited by @**@. If you are inside a C# code block, you can also use // and /* */ comment delimiters.
cshtml
@*
    A Razor Comment
*@
@{
    //A C# comment
    /* A Multi
         line C# comment
    */
}
vbhtml
@*
    A Razor Comment
*@
@Code
    //A C# comment
    /* A Multi
         line C# comment
    */
End Code
 
Comments Off on MVC 4 Razor View Engine Syntax

Posted by on April 11, 2013 in .NET Programming

 

File Sorting in .NET C#

Sorting files in a directory based on the creation date. Array.Sort to sort the FileInfo.Additionally, you can use a Comparer delegate to avoid having to declare a class just for the comparison:

public string pathToFiles;
ConfigurationManager.AppSettings[“Path”].ToString();
public string conStringUSERSSQL = System.Configuration.ConfigurationManager.ConnectionStrings[“usersSQL”].ConnectionString;
string HTMLContents;

if (Directory.Exists(pathToFiles))
{
DirectoryInfo di = new DirectoryInfo(pathToFiles);
FileInfo[] rgFiles = di.GetFiles(“*.*”, SearchOption.TopDirectoryOnly);
Array.Sort<FileInfo>(rgFiles, delegate(FileInfo a, FileInfo b)
{
return b.LastWriteTime.CompareTo(a.LastWriteTime);
});
string toReplace = “.pdf”;
foreach (FileInfo fi in rgFiles)
{
HTMLContents = HTMLContents + “<TR>”;
HTMLContents = HTMLContents + “<TD class=’HeaderControl’ align=’left’><li><a class=’center’ target=’_blank’ href=/” + Session[“groupID”].ToString().Trim().Replace(” “, “%20”).ToLowerInvariant() + “/” + fi.Name.Replace(” “, “%20″).ToLowerInvariant() + ” target=_blank>” + fi.Name.Replace(“.htm”, “”).ToString().Replace(“.PDF”, “”).ToString().Replace(“.XLS”, “”).ToString().Replace(“.LNK”, “”).ToString() + “</a></li></td><td class=’HeaderControl’>” + fi.LastWriteTime.ToShortDateString().ToString() + “</td>”;
HTMLContents = HTMLContents + “</TR>”;
}
HTMLContents = HTMLContents + “</table>”;
this.ClientDocumentsDiv.InnerHtml = HTMLContents.ToString();
}
else
{
// create the directory with the groupID
DirectoryInfo di = Directory.CreateDirectory(pathToFiles);
this.ClientDocumentsDiv.InnerHtml = “<center><img src=’images/folderIcon.JPG’ align=center><BR><font color=’#211F44′ size=+1>There are no files uploaded in the Area</font></center>”;
}

 
Comments Off on File Sorting in .NET C#

Posted by on June 8, 2012 in .NET Programming

 

Understanding ASP.NET View State

Microsoft® ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks. In my experiences as a trainer and consultant, view state has caused the most confusion among ASP.NET developers. When creating custom server controls or doing more advanced page techniques, not having a solid grasp of what view state is and how it works can come back to bite you. Web designers who are focused on creating low-bandwidth, streamlined pages oftentimes find themselves frustrated with view state, as well. The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE. This hidden form field can easily get very large, on the order of tens of kilobytes. Not only does the __VIEWSTATE form field cause slower downloads, but, whenever the user posts back the Web page, the contents of this hidden form field must be posted back in the HTTP request, thereby lengthening the request time, as well.

Introduction

Microsoft® ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks. In my experiences as a trainer and consultant, view state has caused the most confusion among ASP.NET developers. When creating custom server controls or doing more advanced page techniques, not having a solid grasp of what view state is and how it works can come back to bite you. Web designers who are focused on creating low-bandwidth, streamlined pages oftentimes find themselves frustrated with view state, as well. The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE. This hidden form field can easily get very large, on the order of tens of kilobytes. Not only does the __VIEWSTATE form field cause slower downloads, but, whenever the user posts back the Web page, the contents of this hidden form field must be posted back in the HTTP request, thereby lengthening the request time, as well.

This article aims to be an in-depth examination of the ASP.NET view state. We’ll look at exactly what view state is storing, and how the view state is serialized to the hidden form field and deserialized back on postback. We’ll also discuss techniques for reducing the bandwidth required by the view state.

Note   This article is geared toward the ASP.NET page developer rather than the ASP.NET server control developer. This article therefore does not include a discussion on how a control developer would implement saving state. For an in-depth discussion on that issue, refer to the book Developing Microsoft ASP.NET Server Controls and Components.

Before we can dive into our examination of view state, it is important that we first take a quick moment to discuss the ASP.NET page life cycle. That is, what exactly happens when a request comes in from a browser for an ASP.NET Web page? We’ll step through this process in the next section.

The ASP.NET Page Life Cycle

Each time a request arrives at a Web server for an ASP.NET Web page, the first thing the Web server does is hand off the request to the ASP.NET engine. The ASP.NET engine then takes the request through a pipeline composed of numerous stages, which includes verifying file access rights for the ASP.NET Web page, resurrecting the user’s session state, and so on. At the end of the pipeline, a class corresponding to the requested ASP.NET Web page is instantiated and theProcessRequest() method is invoked (see Figure 1).

Click here for larger image.

Figure 1. ASP.NET Page Handling

This life cycle of the ASP.NET page starts with a call to the ProcessRequest() method. This method begins by initializing the page’s control hierarchy. Next, the page and its server controls proceed lock-step through various phases that are essential to executing an ASP.NET Web page. These steps include managing view state, handling postback events, and rendering the page’s HTML markup. Figure 2 provides a graphical representation of the ASP.NET page life cycle. The life cycle ends by handing off the Web page’s HTML markup to the Web server, which sends it back to the client that requested the page.

Note   A detailed discussion of the steps leading up to the ASP.NET page life cycle is beyond the scope of this article. For more information read Michele Leroux-Bustamante’s Inside IIS & ASP.NET. For a more detailed look at HTTP handlers, which are the endpoints of the ASP.NET pipeline, check out my previous article on HTTP Handlers.

What is important to realize is that each and every time an ASP.NET Web page is requested it goes through these same life cycle stages (shown in Figure 2).

ms972976.viewstate_fig02(en-us,MSDN.10).gif

Figure 2. Events in the Page Life Cycle

Stage 0 – Instantiation

The life cycle of the ASP.NET page begins with instantiation of the class that represents the requested ASP.NET Web page, but how is this class created? Where is it stored?

ASP.NET Web pages, as you know, are made up of both an HTML portion and a code portion, with the HTML portion containing HTML markup and Web control syntax. The ASP.NET engine converts the HTML portion from its free-form text representation into a series of programmatically-created Web controls.

When an ASP.NET Web page is visited for the first time after a change has been made to the HTML markup or Web control syntax in the .aspx page, the ASP.NET engine auto-generates a class. If you created your ASP.NET Web page using the code-behind technique, this autogenerated class is derived from the page’s associated code-behind class (note that the code-behind class must be derived itself, either directly or indirectly, from the System.Web.UI.Page class); if you created your page with an in-line, server-side <script> block, the class derives directly from System.Web.UI.Page. In either case, this autogenerated class, along with a compiled instance of the class, is stored in the WINDOWS\Microsoft.NET\Framework\version\Temporary ASP.NET Files folder, in part so that it doesn’t need to be recreated for each page request.

The purpose of this autogenerated class is to programmatically create the page’s control hierarchy. That is, the class is responsible for programmatically creating the Web controls specified in the page’s HTML portion. This is done by translating the Web control syntax—<asp:WebControlName Prop1="Value1" ... />—into the class’s programming language (C# or Microsoft® Visual Basic® .NET, most typically). In addition to the Web control syntax being converted into the appropriate code, the HTML markup present in the ASP.NET Web page’s HTML portion is translated to Literal controls.

All ASP.NET server controls can have a parent control, along with a variable number of child controls. The System.Web.UI.Page class is derived from the base control class (System.Web.UI.Control), and therefore also can have a set of child controls. The top-level controls declared in an ASP.NET Web page’s HTML portion are the direct children of the autogenerated Page class. Web controls can also be nested inside one another. For example, most ASP.NET Web pages contain a single server-side Web Form, with multiple Web controls inside the Web Form. The Web Form is an HTML control (System.Web.UI.HtmlControls.HtmlForm). Those Web controls inside the Web Form are children of the Web Form.

Since server controls can have children, and each of their children may have children, and so on, a control and its descendents form a tree of controls. This tree of controls is called the control hierarchy. The root of the control hierarchy for an ASP.NET Web page is the Page-derived class that is autogenerated by the ASP.NET engine.

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

 
Comments Off on Understanding ASP.NET View State

Posted by on February 3, 2012 in .NET Programming

 
 
%d bloggers like this: