RSS 2.0
Sign In
# Friday, 02 June 2006

Download sample code.

In our recent .NET 2.0 GUI project our client ingenuously asked us to implement undo and redo facility. Nothing unusual nowadays, however it's still not the easiest thing in the world to implement.

Naturally you want to have this feature for a free. You do not want to invest too much time to support it. We had no much time to implement this "sugar" also. I know, I know, this is important for a user, however when you're facing a big project with a lot of logic to be implemented in short time you're starting to think it would be nice to have undo and redo logic that works independently (at least almost independently) on business logic.

Thus, what's that place where we could plug this service? - Exactly! - It's data binding layer.

When you're binding your data to controls the "Type Descriptor Architecture" is used to retrieve and update the data. Fortunately this architecture is allowing us to create a data wrapper (ICustomTypeDescriptor). Such wrapper should track property modifications of the data object thus providing undo and redo service. In short that's all, other are technical details.

Let's look at how undo and redo service goes into the action. Instead of:

  bindingSource.DataSource = data;

you have to write:

  bindingSource.DataSource = Create-UndoRedo-Wrapper(data);

There should also be a class to collect and track actions. User should create an instance of this class to implement the simplest form of code with undo and redo support:

  // Create UndoRedoManager.
  undoRedoManager = new UndoRedoManager();
  // Create undo and redo wrapper around the data object.
  // Bind controls.
  dataBindingSource.DataSource =
    new UndoRedoTypeDescriptor(data, undoRedoManager);

Now turn our attention to the implementation of the undo and redo mechanism. There are two types in the core: UndoRedoManager and IAction. The first one is to track actions, the later one is to define undo and redo actions. UndoRedoManager performs either "Do/Redo", or "Undo" operations over IAction instances. We have provided two useful implementations of the IAction interface: UndoRedoTypeDescriptor - wrapper around an object that tracks property changes, and UndoRedoList - wrapper around the IList that tracks collection modifications. Users may create their implementations of the IAction to handle other undo and redo activities.

We have created a sample application to show undo and redo in action. You can download it from here.

Friday, 02 June 2006 22:49:40 UTC  #    Comments [0] -
Announce
# Tuesday, 30 May 2006

We're building a .NET 2.0 GUI application. A part of a project is a localization. According to advices of msdn we have created *.resx files and sent them to foreign team that performs localization using WinRes tool.

Several of our user controls contained SplitContainer control. We never thought this could present a problem. Unfortunately it is!

When you're trying to open resx for a such user control you're getting:

Eror - Failed to load the resource due to the following error:
System.MissingMethodException: Constructor on type 'System.Windows.Forms.SplitterPanel' not found.

We started digging the WinRes.exe (thanks to .NET Reflector) and found the solution: we had to define the name of split container the way that its parent name appeared before (in ascending sort order) than splitter itself.

Say if you have a form "MyForm" and split container "ASplitContainer" then you should rename split container to say "_ASplitContainer".  In this case resources are stored as:

Name Parent Name
MyForm  
_ASplitContainer MyForm
_ASplitContainer.Panel1 _ASplitContainer
_ASplitContainer.Panel2 _ASplitContainer

This makes WinRes happy. :-)

Tuesday, 30 May 2006 10:13:18 UTC  #    Comments [0] -
Tips and tricks
# Tuesday, 01 November 2005

Today we had spent some time looking for samples of web-services in RPC/encoded style, and we have found a great site http://www.xmethods.com/. This site contains a lot of web-services samples in Document/literal and RPC/encoded styles. We think this link will be useful for both developers and testers.

Tuesday, 01 November 2005 10:51:37 UTC  #    Comments [0] -
Tips and tricks
# Tuesday, 18 October 2005

Actually this build is used WSE 2.0 SP3 and contains minor bug fixes. All the sources published on GotDotNet site (SCCBridge workspace). Pay attention that for now the sources include SCCProvider project that is MSSCCI implementation. I've decided to publish this project since Microsoft freely publish their interface and documentation for all VSIP.

Tuesday, 18 October 2005 16:08:21 UTC  #    Comments [6] -
SCCBridge
# Thursday, 16 June 2005

As I wrote early in our blog, the latest version SCCBridge allows accessing to SCCBridge server via proxy. Here is some explanation what you should do in order to establish such connection:

1) open RepositoryExplorer;
2) click “Settings” button;
3) set “Default service URL” property to “http://proxy:1234/BridgeServer/Repository.asmx” ;
4) set “Endpoint URL” to “http://serverhost/BridgeServer/Repository.asmx”;
5) click “OK”.

Now you can do login.

 

P.S. Pay attention that “serverhost” is a host name used by proxy to route requests to.

Thursday, 16 June 2005 11:50:43 UTC  #    Comments [1] -
SCCBridge
# Tuesday, 31 May 2005

Yesterday we had ran into following problem: how to retrieve session object from within Java web-service? The crucial point of the problem was that we are generating automatically our web-service from Java bean and this web-service works under WebSphere v5.1.1.

After some time we had spent to find acceptable solution, we have found that it's possible either to implement “session substitution” using EJB SessionBean or somehow to retrieve HttpSession instance.

The first approach has a lot of advantages before the second one, but it requires to implement bunch of EJB objects (session bean itself, home object etc.). The second approach just solve our problem for web-service via HTTP, and no more, but... it requires only few lines to be changed in Java bean code. This second approach is based on implementation of javax.xml.rpc.server.ServiceLifecyle interface for our Java bean. For details take a look at the following article: “Web services programming tips and tricks: Build stateful sessions in JAX-RPC applications“.

Actually, only two additional methods init() and destroy() were implemented. The init() method retrieves (during initialization) an ServletEndpointContext instance that is stored somewhere in private filed of the bean. Further the ServletEndpointContext.getHttpSession() is called in order to get HttpSession. So easy, so quickly - we just was pleased.

Tuesday, 31 May 2005 12:03:33 UTC  #    Comments [0] -
Tips and tricks
# Tuesday, 03 May 2005

In the class definition you often read:

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

But do not be very susceptible for these assurances. Sometimes you read this, because of help template had this text.

Let's look at Encoding::GetEncoding static method:

public static Encoding GetEncoding(string name)
{
  return Encoding.GetEncoding(EncodingTable.GetCodePageFromName(name));
}

and

internal static int GetCodePageFromName(string name)
{
   if (name == null)
     throw new ArgumentNullException("name");

  object obj1 = EncodingTable.hashByName[name];

  if (obj1 != null)
    return (int) obj1;

  name = name.ToLower(CultureInfo.InvariantCulture);
  obj1 = EncodingTable.hashByName[name];

  if (obj1 != null)
    return (int) obj1;

  int num1 = EncodingTable.internalGetCodePageFromName(name);

  EncodingTable.hashByName[name] = num1;

  return num1;
}

You see now, in the least successful case, when our encoding isn't still cached, we shall cache it in the EncodingTable.hashByName.

I just want to point out that hashtable write operation isn't thread safe.

Tuesday, 03 May 2005 13:53:58 UTC  #    Comments [0] -
Tips and tricks
# Sunday, 20 February 2005

Eventually the SCCBridge project became really open source project. From now its sources (version 1.1.0.0) are accessible from GotDotNet site. Releases, documentation and some interesting things about the project you still can find here. Welcome to all developers who want to participate in advancing of this project.

Sunday, 20 February 2005 21:43:08 UTC  #    Comments [8] -
SCCBridge
# Thursday, 11 November 2004

Today the next version of SCCBridge server and client were published. Feel free to download them from our download page.

What's new in this version:

  • The access to Source Safe database is implemented using COM+ object. This approach allows to avoid problems with access to VSS database on the LAN and simplify configuration.
  • The more intelligent List command is implemented. It can retrieve list of files/folders without checking whether files are pinned. This accelerates the list retrieving up to 2-3 times. 
  • The folders tree caching in Repository Explorer is implemented.
  • The caching of files/folders info in source code control provider for Visual Studio .NET 2003 IDE is improved.
  • Source code control provider for IDE now doesn't require user's credentials for each project in the solution.
  • Source code control provider can open now solutions created with Source Safe.
  • Fix: checkout during file editing in Repository Explorer.
  • History dialog allows to determine either a specified or whole history period to get history data.
  • Repository Explorer and source code control provider support the same configuration file now.
  • FileSystemBridge is removed from the installation.
  • Some security improvement is implemented:
    • From now the SCCBridge client supports Windows Integrated and Basic authentication.
    • The ability to use IE non-dynamic proxy settings is implemented.
    • The endpoint URL is now implemented. This allows to use web service behind the routers and/or firewalls.
    • The SCCBridge client encrypts VSS user name, password and database before send them to the web service.
    • The user doesn't see projects when he doesn't have any right on it. The users' rights on projects can be determined by VSS Admin utility.

P.S. Comments and suggestions are welcome.

Thursday, 11 November 2004 22:21:03 UTC  #    Comments [41] -
SCCBridge
# Thursday, 28 October 2004

Yesterday I've came across an interesting article that compares different version control systems like CVS, SourceSafe and several others. Some information in this article is not correct, but anyway it's close to true. So, it will be very useful to study this comparison, if you are going to select a version control system to work with it.

Also, some time ago, I've found page, which describes third party products for Visual SourceSafe. This is an interesting collection of links to third party SourceSafe managers, GUI, scripts, remote control systems, add-ins and so on. Take a look at this collection...

Thursday, 28 October 2004 08:47:46 UTC  #    Comments [0] -

# Wednesday, 15 September 2004

We just have seen the BizTalk competition results. We are out of the game. :(
Our congratulations to the BTS 2004 Developer Competition winners:

  1. Paul Somers of London, England; BizTalk Server Management Tool entry
  2. Scott Colestock of Champlin, Minnesota; BizTalk Server 2004 Nant deployment
  3. Pallavi Narayanaswamy of Bangalore, India; BizTalk TIBCO adapter
  4. Darrin Weber of Allentown, Pennsylvania; Scheduled Orchestration execution

For more details about winners and participants see Scott Woodgate's blog...

Anyway, in course this competition we have created the first freeware MQSeries adapter for BizTalk Server 2004 and have designed a way to integrate legacy applications into BizTalk orchestrations without HIS 2000.

Wednesday, 15 September 2004 05:36:07 UTC  #    Comments [0] -
BizTalk Server
# Monday, 06 September 2004

Recently we have sent our entry to BizTalk Server 2004 Developer Competition.
Let's see how it will go. ;-)

The entry integrates mainframe's COBOL applications with BizTalk Server 2004. It includes following elements:

  • MQ adapter, which supports both MQSeries server and client, and implements receive, send, solicit-response and request-response communication patterns.
  • Pipeline components that do run-time data transformations and support CICS DPL conversation protocol.
  • Design-time tools to generate annotated XML schemas and C# sources from COBOL copybooks. The assemblies generated from these sources are used by CICS DPL pipeline components at run-time to transform XML to and from CICS DPL raw data messages.

The entry provides pure .NET solution for consuming legacy applications from BizTalk Server 2004 without using of Host Integration Server 2000 at run-time. It includes documentation, executable files and sources of the adapter, pipeline components, and examples that demonstrate their capabilities. Feel free to download it from GotDotNet web site: http://workspaces.gotdotnet.com/MulticonnBizTalkExtensibility

Monday, 06 September 2004 09:37:40 UTC  #    Comments [0] -
BizTalk Server
# Monday, 23 August 2004

Today I've found that when BridgeServer works under IIS 6 (on Windows Server 2003), it cannot connect to remote database, even with all changes in machine.config file (as I did for IIS 5 on Windows 2000). I've spent some time to investigate this problem (thanks to Pawel Bojkowski for his persistency and assistance with tests) and I've found the following solution of this problem:

  1. Open "Computer Management" tool ("Start/Control Panel/Administrative Tools/Computer Management").
  2. Expand "Services and Applications" node.
  3. Expand "Internet Information Service (IIS) Manager" node.
  4. Right click "Application Pools". 
    • Select "New" menu item.
    • Then select "Application pool..." menu item.
    • Specify Application Pool ID as "BridgeServer".
    • Click "OK".
    • Right click on "BridgeServer" application pool and then select "Properties" menu item.
    • Select "Identity" tab.
    • Change "Application pool identity" to "Configurable".
    • Provide domain user name and password. This user should be member of IIS_WPG group and have enough access rights to the folder where VSS database is stored.
    • Click "OK".
  5. Expand "Web Sites" node.
  6. Expand "Default Web Site" node.
  7. Right click "BridgeServer" web application and then select "Properties" menu item.
    • Change application pool to "BridgeServer".
    • Click "OK".
  8. Restart "Default Web Site".
Monday, 23 August 2004 13:59:57 UTC  #    Comments [0] -
SCCBridge
# Tuesday, 01 June 2004

Yesterday I was looking for an information about how to implement impersonation using of ServicedComponents, and accidentally, I've found a very funny and at the same time dramatic story. This is rather realistic story recounts of “cooperation” between two kind of IT specialists: one from mainframe world and another from the world of present-day technologies. Be sure that such type a conversation can take a place in our days. I wish to everybody who works on an edge of technologies (as we do) to escape such lot.

Tuesday, 01 June 2004 15:09:48 UTC  #    Comments [0] -

# Wednesday, 26 May 2004

Until May 24, 2004 there were only WSE 2.0 Technology Preview, but from now, the “release version” of WSE 2.0 is accessible. Microsoft eventually has published “release version” of WSE 2.0. The main changes from version 2.0 Technology Preview are:

  • The Policy mapping model has changed. There is now a single file that contains both the send and receive mapping. See the documentation for more information.
  • Security context tokens can now be issued automatically by a service. The element in the configuration file turns this on. SecurityContextTokens issued by 3rd parties are no longer supported out-of-box and require customized coding.
  • Security context tokens can now be issued automatically by a service. The element in the configuration file turns this on.
  • The Microsoft.Web.Services2.Security.Signature class has been obsoleted. Use the Microsoft.Web.Services2.Security.MessageSignature class instead.
  • The Microsoft.Web.Services.Routing namespace has been removed. The HTTP Router is now supported as Microsoft.Web.Services2.Messaging.SoapHttpRouter
  • The interfaces for transports and channels have been reworked.
  • Custom transports may be registered in the app.config / web.config files. Existing transports may be removed and/or reconfigured. See the WSE.config file for examples and additional information.
  • The Microsoft.Web.Services.Security.SecureConversation namespace has been moved into the Microsoft.Web.Services2.Security namespace.
  • The Microsoft.Web.Services.Trust namespace has been moved into the Microsoft.Web.Services2.Security namespace.
  • The incorrectly named Microsoft.Web.Services.Security.SaML class has been renamed to Microsoft.Web.Services2.Security.SAML and contains a more complete set of definitions.

Besides they have changed some namespaces, and, as a consequence the fully qualified name of WSE 2.0 assembly also was changed. These changes are very weird for SCCBridge project. Due to this reason the new build of SCCBridge server and SCCBridge client are published today. From now, both server and client sides of SCCBridge project are using of “release version“ of WSE 2.0.

P.S. The best thing in these changes, from my point of view, is an improved documentation that included in “release version” of WSE 2.0.

Wednesday, 26 May 2004 14:54:25 UTC  #    Comments [2] -

Archive
<2006 June>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678
Statistics
Total Posts: 387
This Year: 3
This Month: 0
This Week: 0
Comments: 1905
Locations of visitors to this page
Disclaimer
The opinions expressed herein are our own personal opinions and do not represent our employer's view in anyway.

© 2024, Nesterovsky bros
All Content © 2024, Nesterovsky bros
DasBlog theme 'Business' created by Christoph De Baene (delarou)