02 July, 2010 11:34
Silverlight Managed Extensability Framework and Prism
Posted by mimo under [ C# .net development , Silverlight ][ (0) Comment ] | [ (0) Trackbacks ]
We have been doing extensive development using Silverlight, and have run into some barriers with the design of the application we are working on. Some of the issues we were able to mitigate with MVVM pattern. However, as the app has become more complex, dependencies have crept in between the viewmodels and the parent application.We are also running into trouble managing commands and events associated with the application - how do you have several components subscribe to the same event set without having to connect viewmodels together?
The application's Xap file has also grown to be fairly large, and it will be necessary to split the application up into separate chunks that are loaded only when required. Our current structure will not allow this.
Upon doing research into how to address these issues, I discovered the Prism framework from the Microsoft Patterns and Practices group. This appeared to be a great way to address a number of the issues.
Prism is a framework for composing applications from separate modules. It contains an approach for injecting components into others using the Unity framework (also a patterns and practices framework) to eliminate dependencies. It also has a very nice looking commanding approach implemented through an event aggregator publish/subscribe mechanism.
However, during reading through commentary on Prism, I also found the Managed Extendability Framework, from a different part of Microsoft which looked initially like it was a competing approach to solve similar issues.
Microsoft often does things like this (take the whole Linq/ Linq-SQL/Ado.net entity framework/Windows Communication foundation maze as an example...) in which they come out with several almost the same but not completely technology bits that overlap. Inevitably one of the approaches will be adopted at the expense of the other, which forces developers who adopted the wrong one to refactor to the winner.
(More)01 February, 2010 17:33
WCF Debugging 404 error
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
WCF is a great technology, but it is difficult to configure, and often the error messages are cryptic - if in fact you can get it to return exceptions at all.
Fiddler is a great way to debug WCF based services, but even that sometimes doesn't work if you are using the visual studio/cassini based web host.
Fortunately, adding the following code into your web.config file will put any exception information into a log file:
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "c:tempwcfErrors.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
31 January, 2010 19:39
Clustering points for Silverlight Bing maps control
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
We are now finally underway building the first version of what will become the Menome system.
One of the things we needed was a way of clustering points on a map. The idea is to reduce the number of points as the user zooms out by combining points together to keep performance up and to reduce map clutter.
The algorithm operates by creating a 'screen grid' and passing this to the server. As the user zooms and moves around the map, the boundary window they are looking at in lat/long, the height and width of the current window in pixels and the zoom level are passed to the server.
The first level of filtering happens on the SQL server by doing an intersection of the boundary window with the point geography stored in the SQL server.
Points inside the boundary are returned to the web server, where above a given zoom threshold (10 for now), they are passed through the clustering class. The clustering class works by creating a grid out of the current window. Two nested loops are created, which loop through the grid cells. Each points coordinates converted from lat/long to pixel, and checked against the current grid cell. Points found in the same grid cell are grouped together into a single point, and stored into the grid cell list indexed by the X and Y cell index multiplied together.
Fortunately, Johannes Kebeck has posted an algorithm for doing this on his fantastic blog The algorithm he presents is setup to return javascript, and is written in VB, so we changed it slightly to return a SiteLocationPoint object and to operate in C#, since that is the language we are using for the application we are building.
We have turned this into a class, which takes a list of points, and returns a list of clustered points. The main change we had to make to the algorithm itself was modifying the it to use a Dictionary to store the clustered points in the gridCells object instead of a jagged array, which cannot be declared dynamically in C#.
We used a dictionary with the X*Y grid cell as a key for storing/extracting points in a given grid cell. The other modification we need to make, which I will post once we figure it out, is a way of changing the clustering density.
Click more to get the source code.
(More)19 March, 2009 09:29
Team based development systems - Article 1 - Tools
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
I recently completed an assessment and subsequent construction and deployment of a development management system for our software development team at Matrix
While Microsoft has brought out Team system for doing source control, automated build/test, its a fairly expensive product. It has the advantage of being an 'install and go' kind of thing, but the cost of it makes it prohibitive for smaller development teams.
There are also lots of great open source tools out there for performing these tasks that work very well. At Matrix where I work, I have assembled a set of tools that are doing a great job of letting us manage a very extensive set of code across a diverse team of people in a quick, easy and efficient manner. This blog post will review the tools we are using for this, and give examples of how to set it up.
(More)14 October, 2008 19:32
Configuring Silverlight to use a secured WCF Service
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
- add .xap -> application/x-silverlight-app to the mime type in IIS to get IIS to recognize and transmit the mime type
- add .xaml -> application/xaml+xml to the mime types in IIS to get IIS to recognize and transmit the mime type
- add the clientaccesspolicy.xml to the root folder in IIS to get the cross domain working for wcf debugging
- Ensure that you have the IIS virtual directory security set to use NT authentication only
(More)
14 October, 2008 18:49
While I am critical of Microsoft, its because I know they can do better than they have in recent years. If you put the dismal performance of Vista and the horrible marketing campaigns of late, Microsoft outside the consumer and platform sphere has created some incredibly innovative products for developers over the last few years. Linq, and WCF are just two recent examples - not to mention the new SQL server 2008 which is amazing as well - more on that in a later post...
Unfortunately, it is Microsoft business model that needs innovation - not their tools. It is mired in the world of PC software - often to the detriment of new and innovative ideas.
Fortunately, Silverlight looks like a breakthrough technology for Microsoft: mainly because it shows a change of attitude. Microsoft is finally getting serious about cross platform support, and the web as the application platform. I have often wondered why Microsoft has not made a .net VM host for other platforms - Mono aside. The obvious answer being fear of cannibalizing its windows franchise. I personally think Microsoft, if it were serious about this battle for the web, would make windows free for consumers, and instead shift its focus to a subscription service based model: say $50 a year for support for Windows or something to that effect. It would cost it a fortune initially, and would affect their stock price (could it get worse??) but would force the company to formally acknowledge what has already happened: Operating systems are a commodity.
Anyway - fantasy aside - It seems that Silverlight is at least a start at Microsoft opening its platform up to other operating systems.
Silverlight allows for .net managed code to run on any platform using Windows Presentation Framework. I am very excited about this, as many of the apps we are looking at building can then be made to run on any platform. It is of course possible to do this with Ajax, which I have done, but it will be nice to have the advantage of a full fledged debugger and a nice set of tools that finally is graphic designer friendly on the Microsoft side (Google of course has had this for a while with its GWT - I have never liked Microsoft's native implementation of asp.net Ajax - its complicated and messy).
I already have a version of a managed code graph written in C# using the open source Visifire control working in IE, Firefox, and Firefox on the mac (have to try linux next)... using the same code base. This graph gets its data from a WCF service that pulls data from our accounting system.
Here it is running in firefox on my MacBookPro:
Getting this working though was a bit difficult from a configuraion standpoint.
(More)07 September, 2008 22:15
SQL Server 2008 spatial extention
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Very exciting - we have setup SQL 2008 and I am now working on extending our syncrhonization system to incorporate spatial information....I will be making notes here as I work on figuring out the SQL spatial extensions. Some of these will be fairly simple to begin with, until I become familiar with the syntax.
To that end: one of our tables had lat/long information in it in standard floating point format. I needed a query to update this information into the new Geography column I created. The update query to do this:
update WaterWells set Coordinates =
geography::STPointFromText('POINT(' + CAST(LONGITUDE as varchar(50)) + ' ' + cast(LATTITUDE as varchar(50)) +')', 4326);
03 September, 2008 17:59
Bug in Dynamic Linq
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
As noted in another post, I am using Dynamic Linq to build a generic query tool for a service layer I am constructing. In the process of doing so, I have run into the following error when I try to pass a query in for a Guid:
Operator '=' incompatible with operand types 'Guid' and 'String'
21 August, 2008 12:38
Architecture Journal article published on Enterprise Identity Synchronization
Posted by mimo under [ Design Patterns , C# .net development , Systems Architechure , Memes ][ (0) Comment ] | [ (0) Trackbacks ]
Very exciting news - an article co-authored by Barry Lawrence of BSTGlobal and myself based on a system now in production at Matrix has just been published in the Microsoft Architecture Journal.
The article is on the subject of Enterprise Identity Synchronization and describes a synchronization pattern and associate system architecture for keeping enterprise identity data up to date between disparate systems. In effect - it is a system for replicating identity memes around an organization.
This has proven to be a fascinating project from a number of standpoints, and I have learned a great deal from the experience of being involved in designing and building a services oriented workflow architecture. The implementation of the system has also been very fascinating, and is a real case study in how systems, people and processes are inherently intertwined. I will write a number of blog posts on the outcome of this project over the next few weeks.
08 May, 2008 12:56
Linq dynamic querying
Posted by mimo under [ C# .net development , Workflow ][ (0) Comment ] | [ (0) Trackbacks ]
As part of the workflow service project, I need to build an XML querying framework.
For this to work on the back end, I would like to use Linq - but in order to do so, I need to have it be capable of handling dynamically generated queries derived from the query XML coming into the service.
It appears that Microsoft has produced samples of this - Dynamic Query.
There are a number of good examples around:
ScottGu's dynamic query example:
Blog post that includes a join example:
The issue though with Dynamic Linq is that you appear to trade the strong typing associated with standard Linq for the flexiblity of Dynamic query.
A query executed with Dynamic Linq returns as a type of 'DynamicClass1' etc. which cannot be cast to other types. This means that a generic mapping process of some kind would have to be used to get the data back into some kind of strongly typed form.
In the case of what I am working on, I don't need the strong typing. I am working on setting up a service entry point for generic querying of data associated with the service in question. The query language coming in will be constructed in XML, and defined using a typical XML query pattern.
These queries will be translated to dynamic linq, which is then executed and mapped back to XML from the generic dynamic class generated.
(More)04 October, 2007 10:47
Linking 64 bit SQL to 32 bit SQL server
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Was setting up to link our accounting database which runs on 32 bit SQL 2000 to our spatial database, which runs on 64 bit SQL 2005 and kept getting a strange error when executing the distributed query:
After trying the microsoft knowledge base article, which did not work, I found John Hofman's blog.
His method did work...Kudos you rule, and thanks for saving me hours of frustration!
(hit more to see original post).
(More)14 June, 2007 13:59
Multithreading on .net 2.0 or better
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Due to the issues with multithreading on .net 1.1, the Microsoft people have coded up a great addition to .net called the BackgroundWorker object. This gizmo allows you to quickly and easily setup multithreading for winforms apps. Seems to work very well, and is incredibly useful for building fast, responsive winforms UIs that communicate with data services.
The one trick though is when doing updates to UI components, you need to call the InvokeRequired to find out if the thread requires marshalling before accessing control in question.
This bit of code seems to do the trick:
//need to call InvokeRequired to check
//if thread need marshalling, to get the thread onto
//the same thread as the thread who owns the controls
if (this.InvokeRequired)
{
this.Invoke(new EventHandler(delegate
{
this.listBoxClients.Items.Add(listboxText.ToString());
}));
}
else
{
this.listBoxClients.Items.Add(listboxText.ToString());
}
14 June, 2007 08:29
Excel Smart Documents
Posted by mimo under [ C# .net development , Smart Documents ][ (0) Comment ] | [ (0) Trackbacks ]
One of the unfortunate side effects of deploying a fancy new accounting system that supports web service calls, is that people want to interface it with all sorts of things. One of the primary reporting interfaces therefore naturally becomes Excel.
Excel is a good tool for what it does, but for a programmer: it can be a nightmare to work in. Fortunately, the new VSTO 2005 is pretty good at turning the mess that is Excel into something possible to write good code in.
The key to this are Action Panes. These are useful: you can set up nice object oriented data interfaces/displays, and use them to pump data into excel's nasty world of ranges and cells.
The key is to make sure you completely separate your data bits from the spreadsheet bits. By this I mean put any data feeds into the action panes, and use named ranges and range object operations to 'push' the data into the spreadsheet. Don't use the Excel List Object unless you absolutely have to.
Users will typically build lot of logic built into spreadsheets, and you have virtually no control over what they do with the sheet once its in the 'wild'. Users will expect to be able to do all the normal things they would do with the spreadsheet and the specialized objects don't work exactly the same way as normal cells in the spreadsheet do. The Action Panes are nicely seperated, and the users can't modify them.
(More)04 June, 2007 12:32
Multithreading on .net 1.1
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Needed to build a multithreaded handler for getting data from multiple web service sources and combine the result together into a single graph.
Threading in winforms in .net 1.1 was tricky, since any forms object created on the primary thread will not like being accessed on a second thread (cross threading).
This is addressed in .net 2.0, by the BackgroundWorker object - and can be addressed in .net 1.1 by using various thread locking bits, but its a real pain to do.
Fortunately, Juval Lowy wrote up an excellent article on the subject of threading in both .net 2.0 and 1.1. The article includes examples of the issues of cross-threading, how to use the background worker in .net 2.0 and even goes so far as to write up a .net 1.1 equivalent object for use in .net 1.1. I used the object in a project I had to maintain in .net 1.1, and it works great.
Here are other Excellent articles related to .net multithreading:
http://www.devx.com/codemag/Article/20639?trk=DXRSS_DOTNET
http://weblogs.asp.net/rosherove/articles/BackgroundWorker.aspx
http://www.albahari.com/threading/part3.html#_BackgroundWorker
09 February, 2007 16:07
Regex for LSD Location Township Range
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
Needed to makeup a regex for matching Alberta Location Township Range formatted codes. It appears this will work:
[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9]W*
23 August, 2006 10:00
Ran into a weird one today..
Posted by mimo under [ C# .net development , Workflow ][ (0) Comment ] | [ (0) Trackbacks ]
Using SSIS from M$ SQL 2005 to build a massive data import for an accounting system (yes very painful). SSIS itself looks very good - however, I have been running into a few strange things.
For no particular reason, my packages stopped opening with a somewhat cryptic error that indicated the packages had been 'corrupted':
"package might be corrupted ssis"
Resolution turned out to be to re-regsvr the XML dlls. Don't know how, why or what would cause them to become unregistered, or why it would affect SSIS outside of their being required to parse the XML that makes up the package... At any rate, if you experience that error, then run:
regsvr32 msxml3.dll
regsvr32 msxml4.dll
regsvr32 msxml6.dll
This should clear it up...
(More)31 July, 2006 13:32
Cool bits for generating DAL layers
Posted by mimo under [ Design Patterns , C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
I have been busy refactoring the network, server and information infastructure layers for the company I work for recently. Now that that unpleasantness is nearly complete, I can again return to the more pleasant world of creating software.
However, even that has its dark side - of which one ongoing point of pain is the Data Access Layer.
(More)20 June, 2006 10:30
Cool new robot development gizmo
Posted by mimo under [ Ideas , C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
From... Microsoft!
While the comments I am getting are already 'Would you want to depend on a Robot running windows??' The development kit looks pretty good - the nice thing is that the components are pretty cheap....
I am interested both in this from a hobbyist standpoint, and potentially for work - we do lots of remote sensing activities, and having a cheap, fast way of building field sensor gizmos would be very cool...
http://msdn.microsoft.com/robotics/
http://www.roboticsconnection.com/index.html
(More)26 April, 2006 12:44
Sharepoint library event handler issue
Posted by mimo under [ C# .net development , Sharepoint ][ (0) Comment ] | [ (0) Trackbacks ]
Got my Sharepoint library event handler generic class working a few weeks ago.
Went through the process of setting up the Sharepoint Portal system on the server, and in the process did an upgrade on the system. Fortunately its not fully deployed yet, since as it turned out the installation of STS service pack 2 makes some changes to the security plumbing in sharepoint.
The impersonation technique I was using no longer is supported under SP2 - so I was suddenly getting strange intermitted 'Impersonation Failure' errors cropping up.
Some research into this revealed the following:
Document library event handlers that use object model code without explicit impersonation fail with the "Cannot complete this action" error message after Windows SharePoint Services Service Pack 2 is installed
21 March, 2006 16:02
Google Earth: How to use KML and Google Earth API to build a searchable database
Posted by mimo under [ C# .net development , Development , Google Earth ][ (0) Comment ] | [ (0) Trackbacks ]
I have been working on building a Google Earth search engine interface. I have successfully got it to the point where I can get two way communication going.
The idea is to have a page inside the Google Earth browser that displays search criteria for a database of items that have spatial locations displayed in the Google Earth client.
Executing a search will display the Placemarks of the items that match the search criteria.
I will be posting a set of articles on this subject coming up, and posting the source code for all of it to SourceForge. This will include a .net KML class library, as well as a sample Google Earth based data search web page.
(More)21 March, 2006 09:19
Windows Workflow FX
Posted by mimo under [ XML Resources , Ideas , C# .net development , Development , Workflow ][ (0) Comment ] | [ (0) Trackbacks ]
I have been hearing a lot about this both from Microsoft and from developers/companies I know in town.
Its a Don Box creation, and looks absolutely excellent. I was planning to build up a workflow engine of my own, as I require one for a number of things that I am working on, and have tried Biztalk a few times, only to find that its too complicated and fiddly for most workflow related tasks. I will have a look at the new version of Biztalk that is coming out shortly, but I think this Windows Workflow looks a great deal more applicable for most of the cases I am working on.
(More)31 December, 2005 13:11
Visual Studio code snippets
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
The new Visual Studio has a nice code snippet manager tool that is capable of auto-decorating code for you. It is also customizeable, which is great.
I like my properties for example to look a certain way, decorated with #region markup so that I can collapse/expand them to keep things looking clean.
By modifying the XML in the snippet source for property markup, I was able to get an auto-generated property markup setup for myself - which is a huge timesaver.
(More)28 December, 2005 16:58
Microsoft Enterprise Library for .net 2.0
Posted by mimo under [ Design Patterns , C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
There have been some changes made to the way the Enterprise Library is setup for the .net 2.0 framework. I will document the differences and how to here as I figure things out.
The first is that they have dropped the configuration block, as the 2.0 framework has a System.Configuration namespace that handles the configuration management internally.
Here is a sample:
(More)23 December, 2005 12:34
Smartphone Web Services
Posted by mimo under [ C# .net development , Smartphones ][ (0) Comment ] | [ (0) Trackbacks ]
How to setup the smartphone emulator to be able to access web services:
- Go to Settings, then Data Connections (Shortcut: L, 8, 9, 2).
- Change Work Connection to NetCard (Is that short for Network Card? Who knows? *shrug*).
- Click Done.
- Go into Internet Explorer (Shortcut: L, 4).
- Click Menu, then Options (Shortcut: R, 7).
- Uncheck Automatically detect settings.
- Change Select Network to Work.
- Click Done.
You can now browse around with IE and your WebService calls will now work as expected. Well, almost...remember that when adding your Web Reference for the name of the server, use the name of your local development machine, not "localhost". The emulator doesn't get that when you say localhost, you really mean your machine.
From HERE:
16 December, 2005 16:35
Serializing items with IDictionary interface
Posted by mimo under [ XML Resources , C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
Thanks to Greg Pringle for this one:
.Net does not support serializing anything with an IDictionary interface. I have run into a number of places where I would like to serialize/deserialize collections with that interface. Greg tracked down a way of doing this using an undocumented interface..
Details are here:
http://msdn.microsoft.com/msdnmag/issues/03/06/XMLFiles/
Answer is under “Q: I've noticed that XmlSerializer won't serialize objects that implement IDictionary by default. Is there any way around this?”
Update: Found an addtional possible alternative: Xtream serializer object found HERE
08 November, 2005 14:23
This looks entertaining...
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Have to give this one a try:
http://msdn.microsoft.com/coding4fun/diy/controllights/default.aspx
Haha - could build a remote pet feeder..
http://www.smarthome.com/6104.html
Wonder if this would work for babysitting? Save lots of $ on that...could wire it up to my smartphone! (just kidding)
19 October, 2005 22:17
Another great enterprise patterns resource
Posted by mimo under [ Design Patterns , C# .net development , OOPSLA , Opinions ][ (0) Comment ] | [ (0) Trackbacks ]
Found this while looking for some info on the crypto enterprise library block: http://www.pnplive.com/
The patterns team does great stuff - use it all the time. Unfortunately I just heard Ward Cunnignham is leaving Microsoft and the patterns team to join the Eclipse project. I had the honour of having a beer with Ward at last years OOPSLA confrence in Vancouver...
(More)18 October, 2005 10:57
Infopath date calculations
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
Date calculations in infopath taken from: http://blogs.msdn.com/infopath/
(stored it here for searchability)
(More)05 October, 2005 14:44
Moving infopath forms
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
There have been several occasions when I have needed to move an infopath form and/or web services its using.
Not a very easy thing to do: the URLs get all bound into the template, and are very tough to fix. This is a real nuisance - especially if you are doing dev/test on different servers.
Microsoft has just released a tool to deal with this though and its located here
26 September, 2005 07:54
Good site...
Posted by mimo under [ News , Design Patterns , C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
Was looking around the google code competition. Interesting - but primarily algorithm centric contest.
I would need to do some serious study to get my algorithms back up to par again before getting involved something like that. Even so - algorithms are something that is on my list of continuous improvement study items. From that contest link, I found the Top Coders site, which has a great set of tutorials and resources on algorithms:
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index
(More)18 September, 2005 15:34
Microsoft and new content meme mining technology
Posted by mimo under [ News , XML Resources , C# .net development , Development , Memes ][ (0) Comment ] | [ (0) Trackbacks ]
05 September, 2005 11:17
Database generation:
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Got a few things on the go that require the generation and read-back of SQL databases from class libraries and/or datasets.
Here are resources that I have found that pertain to this subject:
(More)24 August, 2005 13:17
POP 3 email components
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Been looking for a pop3 email component so that I can read email back from a server and process it. SA used to have a good one, but they have pulled it off their site. I don't feel like writing a component like that at present, unless I really really have to, as it would be time consuming to do, and while its of value, its something that should be out there already.
(More)24 August, 2005 08:14
Solution to multiple configuration management for enterprise library
Posted by mimo under [ Design Patterns , C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
At some point I will be getting into multiple configuration deployments for the code... So: in order to do that, it is convienient to have multiple configs for different environments.
This blog has a post and a plug-in for doing this...
23 August, 2005 12:35
Software factories and code generation
Posted by mimo under [ Ideas , Design Patterns , C# .net development , Development , Systems Architechure ][ (0) Comment ] | [ (0) Trackbacks ]
Investigating this forms processing engine I am working on has lead me to software factories. I have been reading the Software Factories book - its good.
Here are some additional resources I have found while investigating this.
(More)18 August, 2005 15:27
More regex
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
Regex for matching something in brackets but exclude brackets: (word)
(?<=()(.*)(?=))
Regex for getting time:
bd{2}:d{2}:d{2}
Regex for getting two letter words:
(?<=(?:s|G|A))w{2}(?=(?:s|Z|.|?|!))
Regex for seperating a number from leading zeros and a dash:
[123456789](d+)(?=-.+)
Some good regex tools:
http://www.codeproject.com/dotnet/RegexTutorial.asp
and the REgex coach is quite good as well.
13 July, 2005 09:21
Been battling a really tough exception - it manifests as a nullReferenceException - but not always with the same stack trace. Thanks to Jeff Attwoods exception code though, I have been able to build up a good base of data to go from for diagnosing the issue.
The latest information points back to disposal of forms again. Acccording to some information I found, the first place to look is the ShowDialog related forms - which as it turns out, must be manually disposed of...
29 June, 2005 16:43
To post the source of the great exception handler: its from Jeff Atwood on the CodeProject : he runs a website called the Coding Horror after Steve McConnels Code Complete...
Source is here:
http://www.codeproject.com/dotnet/ExceptionHandling.asp
His blog (GREAT reference) is here:
http://www.codinghorror.com/blog/
(More)29 June, 2005 16:23
I deployed the new version of the application I am working on to the user audience last night. The enterprise application updater block is working extremely well. There was only 1 machine that it did not work on, and that was due to the user not having applied updates in the last 3 years to the box...So the bits downloader was not present on the system in question.
I also have added an email exception handler that takes a screen capture and emails the exceptions to me with all the stack trace etc. It is done using some exception handler code I found I think on the code project (I likely listed it earlier in the blog here as its very very good and quite useful).
So now with the smartphone and with the exception manager, I can find out and nail down very quickly where, and what are causing errors with the system. I was finding that on only a few machines I was getting some strange exceptions. These seemed to be UI related, but not very specific.
AFter some digging I have found it may be due to a bug in .net 1.1.....
15 June, 2005 10:23
Reporting services Tricks
Posted by mimo under [ C# .net development , Services Oriented Architechure ][ (0) Comment ] | [ (0) Trackbacks ]
Been doing some work with reporting services. I should post some of the code here shortly when I get it finished up.
Reporting services is proving to be a great tool for doing all sorts of things. I remember how difficult it was to build reports - no longer. Anyone with any basic form of skill can set this thing up and get it workign in no time.
(More)07 June, 2005 16:32
OLAP Cubes, reporting services
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
After some thought, I have pursued MS OLAP cubes via analysis services coupled with reporting services as a way to plow through the mass of accunting data that exists in this accounting database.
(More)16 May, 2005 09:58
Biztalk development best practices
Posted by mimo under [ C# .net development , Workflow ][ (0) Comment ] | [ (0) Trackbacks ]
Article on best practices for team development with Biztalk. I have found lots of articles on how to set biztalk up, but just this one thus far on getting a team environment setup for developing...
(More)
05 May, 2005 11:21
Splash screens and user inactivity:
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Two good articles on how to impliment splash screens and detect user inactivity:
http://www.codeproject.com/csharp/uim.asp
http://www.developersdex.com/gurus/code/97.asp
(More)01 May, 2005 20:11
Launching browser from winforms app
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
I needed to launch the bug tracking app from my smart client application.
The following two lines of code are all you need:
using System.Diagnostics;
private void LaunchBrowser(string url)
{
ProcessStartInfo psi = new ProcessStartInfo(url);
_browserProcess = Process.Start(psi);
}
18 April, 2005 14:59
Deploying and managing winforms apps using Updater block
Posted by mimo under [ Design Patterns , C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
I am just working on setting up my in the latest m$ marketing speak, Smart Client application with the Enterprise Library updater block.
I am going to see if I can get it working off a linux server just for fun as well.
Method to be posted here as I figure it out.
(More)13 April, 2005 14:23
Nant building
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
As my current project is becoming more complex, I am now investigating Nant to automate builds of the project.
I would like to have it do a daily build, run unit tests, then put the build (if successful etc) into the correct locations with version # etc.
(More)13 April, 2005 14:23
Nant building
Posted by mimo under [ C# .net development , Development ][ (0) Comment ] | [ (0) Trackbacks ]
As my current project is becoming more complex, I am now investigating Nant to automate builds of the project.
I would like to have it do a daily build, run unit tests, then put the build (if successful etc) into the correct locations with version # etc.
(More)08 April, 2005 08:48
Excellent Winforms resources
Posted by mimo under [ C# .net development , User Interface , Systems Architechure ][ (0) Comment ] | [ (0) Trackbacks ]
I have been building a fairly sophisticated business metrics and time managment system for my employer recently.
To bring the tool to the next level, I am making use of a number of third party components. There are some excellent resources out there for this sort of develompent, both commercial and open source.
(More)24 March, 2005 15:20
Singleton Registry Pattern:
Posted by mimo under [ Design Patterns , C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Good example of a singleton pattern in C#
http://codeguru.earthweb.com/columns/DotNet/article.php/c7617/
I have a registry singleton source code pattern I will add up here once I get a few minutess
(More)23 March, 2005 09:41
Memory leaks and performance in managed code
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
01 March, 2005 17:57
Sorted collections
Posted by mimo under [ Design Patterns , C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Been working on trying to get sorted collections figured out in C#. My first cut at it was a bit gnarly - (the post is on here), but in my latest quest, I found this article on sorting custom collections by J Ambrose Little.
(More)01 March, 2005 15:50
C# technique for mapping database to object using reflection:
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
(More)
14 December, 2004 13:17
Embedded development using .net
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
This looks quite interesting - an embedded .net environment for sensor applications:
http://www.dotnetcpu.com/products.aspx?3
Its very inexpensive compared to the smart motes that run TinyOS as well - those are in the thousands of dollars for a kit, this one is 500 bucks.
More details here: http://www.windowsfordevices.com/news/NS4666205829.html
Now I know what I want for xmas ;-)
21 November, 2004 16:13
Calling web service from sharepoint
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Apparently there is a better way to handle web service calls from Sharepoint than I have been using.
I could not get a virtual directory under sharepoint working for hosting a web service - it looks like there is a technique for doing this, by supressing the processing of the directory by sharepoint (which makes sense). In addition, there are methods for eliminating the annoying activeX messages that pop up when calling in from an unsigned form.
(More)03 November, 2004 11:54
Two new ones:
Xtreme simplicity Refactory: http://www.xtreme-simplicity.net/
Jet Brain's resharper - http://www.jetbrains.com/resharper/
haven't tried them out yet, but certainly worth investigating!
02 November, 2004 15:03
Sortable Hashtable - extension using Eric Gunnersons Iter code
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
IComparable approach as we used previously, but that takes a little more work. What we need is a class that has an IComparable implementation that looks up the hashtable values from the keys, and then compares those values.SortHashValueItem. An instance of this class is created for each key in the hashtable, storing the hashtable key, the hashtable reference, and an IComparer object (if applicable). This class implements IComparable, and the CompareTo() function forwards the comparison to the values in the hashtable or the IComparer.ParticipantCollection registeredParticipants = ParticipantCollection.Find(m_currentOrgID, myEvent,
true);02 November, 2004 09:39
Digially signing data in infopath
Posted by mimo under [ C# .net development ][ (0) Comment ] | [ (0) Trackbacks ]
Page OptionsMihaela Cris August 2004 Applies to: Summary: Microsoft Office InfoPath 2003 Service Pack (SP) 1 provides new digital signatures features, as well as additions to the InfoPath object model for working with digital signatures programmatically. For example, you can specify sets of data in the form that can be signed separately. For each set of data that can be signed, you can specify whether to allow a single signature or multiple signatures, and the relationship among signatures. With these capabilities, you can customize the digital signatures feature so you can track the status of valuable data. (42 printed pages) ContentsIntroduction IntroductionMany business and organizational scenarios require the ability to protect and track valuable data exchanged through documents. Information about who creates the document, and how, when, and by whom certain data is approved is invaluable to readers and contributors to the document. This information reveals how the document was modified during its lifetime, and provides those who worked on the document with a method for certifying their contributions. Microsoft Office InfoPath 2003 SP 1 provides a way to add and track this kind of information by using digital signatures in documents and data created and managed with InfoPath forms. Digital signatures provide a standards-based method for helping to secure and certify all or specific parts of a document. By using digital certificates, encryption technologies, and other elements of the public key infrastructure, digital signatures provide a way to detect whether sensitive information has been tampered with and to confirm that the data originating from the signer has not been altered since it was signed. For information on how digital signature technology is implemented in the Microsoft Windows platform, see Digital Signatures. For information on digital certificates, see Digital Certificates. You can use digital signatures in InfoPath 2003 SP 1 to:
This article focuses on the second application of digital signatures: designing form templates that allow users to digitally sign the data in an entire form or parts of the form as they fill them out. For more information, see Digitally sign a form template. The digital signatures infrastructure for signing data in InfoPath forms follows the Worldwide Web Consortium (W3C) XML-Signature Syntax and Processing recommendation (XML Signatures). The infrastructure is based on support from Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office. XML Signatures is designed for transactions that involve XML documents and data. A powerful feature of XML Signatures is the ability to sign only specific sets of data within an XML document. For more information, see W3C XML-Signature Syntax and Processing. For more information on how XML Signatures are implemented in MSXML 5.0, see XML Digital Signatures. The digital signatures InfoPath creates also provide interoperability with the classes that Microsoft .NET Framework 1.1 provides for working with digital signatures. Applications that use the .NET Framework signature verification classes can verify the signatures that InfoPath creates. Similarly, the InfoPath digital signatures infrastructure can successfully verify digital signatures created by applications that use the .NET Framework digital signatures classes when the signatures are applied to data hosted in InfoPath forms. For more information and code samples, see Verify and Add Digital Signatures to Form Data in InfoPath 2003 Using MSXML 5.0 or .NET Framework Managed Code. In addition to the user interface commands and features for designing and editing forms that enable digital signing of data, InfoPath provides programmability support for digital signatures. For example, InfoPath allows access to the sets of signable data defined in the form, to the signatures associated with each set of signed data, and to the digital certificates used to create the signatures. You can customize the OnSign event handler in fully trusted forms, thus providing support for advanced processing of digital signatures in InfoPath forms. This article provides conceptual, procedural, and programming information on the following InfoPath data signing features:
Note The digital signatures features described in this article require InfoPath 2003 with Microsoft Office 2003 Service Pack 1 or later. For information on downloading Office 2003 updates, see the Office Online Downloads page. Valid Digital Certificates for Signing Data in InfoPath FormsNot all digital certificates can be used to sign data in InfoPath forms. For a certificate to be valid, it must be an X.509 digital certificate with the following set of characteristics:
Viewing and Managing Digital CertificatesYou can view and manage the digital certificates stored on a computer. To view and manage digital certificates
Certificates that InfoPath can use for signing data become a subset of the certificates installed in the Personal folder. The certificates of trusted certification authorities are installed in the Trusted Root Certification Authorities folder. Requesting a Digital Certificate from the Certificates Snap-inYou can request a digital certificate if your company or organizational intranet is configured to provide digital certificates from the Certificates Snap-in. To request a digital certificate from the Certificates Snap-in
Requesting a Digital Certificate from a Windows Server 2003 Certificate AuthorityYou can request a digital certificate if your company or organizational intranet is configured to provide digital certificates from a Microsoft Windows Server 2003 Certificate Authority. To request a digital certificate from a Microsoft Windows Server 2003 Certificate Authority
You can also obtain a digital certificate from a certification authority such as VeriSign, Inc., Entrust, or GlobalSign, or from your system administrator. Defining Counter-Signatures and Co-SignaturesWhen you set up specific parts of data for signing in a form that you create with InfoPath 2003 SP 1, you can choose to configure the digital signatures as either co-signatures or counter-signatures. Additionally, you can restrict the number of signatures to allow only one. When you configure digital signatures for the entire form, by default, optional counter-signatures can follow the initial signature. It is possible to allow only one signature when you configure a form for signing the entire form, but this requires writing custom code in the OnSign event hander. Co-signing is the action of allowing two or more parallel and independent signatures on the same set of data. The status of any co-signature does not affect the status of other co-signatures or prevent the addition of other signatures to the same set of data. Along with each signature, InfoPath stores some additional data, such as comments and non-repudiation data, in the Signature element of the document. If the signed data in the form is tampered with, all co-signatures associated with that set of data become invalid. If the data in the Signature element, such as the nonrepudiation data or the comments associated with it, is tampered with, then only that signature becomes invalid. When using co-signatures for a specific set of signed data, any signature in the list of co-signatures can be deleted at any time without affecting the other signatures. Additionally, InfoPath allows adding new co-signatures, even if the status of a previously added signature is other than Valid. Counter-signing is the action of signing data that includes another signature. Counter-signing requires that signatures have a precise sequence in which they can be deleted without invalidating the other signatures. Adding the first signature to a set of data signs the data itself. Adding a second signature does not sign the data in the form, but instead signs the first signature. Each additional counter-signature signs the previous signature. If the signed data itself is tampered with, only the first signature in the list becomes invalid; the status of the rest of the counter-signatures remains unchanged. If the data stored with a particular signature (in the Signature element) is tampered with, such as the comments or nonrepudiation information for that signature, then that signature and the following signature become invalid. For a specific set of signable data, only the last signature in the list can be deleted without affecting any of the others. For a set of signable data configured for counter-signatures, no other signatures can be added after a signature with the status other than Valid. That signature must be deleted before additional counter-signatures can be added. Table 1 summarizes the functionality associated with co-signatures and counter-signatures in InfoPath 2003 SP 1. Table 1. Types of Signatures and their Relationships in InfoPath 2003 SP 1
Designing InfoPath Forms with Digital SignaturesInfoPath 2003 SP 1 allows users either to sign all of the data in a form when they edit it, or to sign parts of the data in the form. You can implement these features when you design your InfoPath form templates, and you can customize the XPath expression with which you specify a set of signable data. Enabling Digital Signatures for the Entire FormWhen you enable digital signatures for an entire form, the form users must enter all the data they require before they sign the form. After the first signature is added, all controls in the form and the form's XML Document Object Model (DOM) become read-only, and the text [Signed] appears in the title bar. Other users who open the form cannot enter data; they can only add, remove, or verify counter-signatures. Signing the form locks all the data in the form, including data that does not appear in any of the views. This data includes the form header, which specifies the path to the form template. Because the form template path is signed, changing the path to the form template specified in the signed XML form (for example, to correct the path after moving the form template) invalidates the first signature, while any counter-signatures remain valid. If your usage scenario involves moving the form template, you can avoid invalidating any signatures by including all of the form data in a single section and defining this section as a set of signable data that uses counter-signatures. This approach not only solves the template location problem but also supports the features specific to partial signatures. These features include the in-document display of digital signatures and the ability to specify which controls are disabled when the data is signed. Configuring digital signatures for the entire form has the following consequences and features:
To limit users to only one signature when signing the entire form, you can customize the OnSign event. For more information and sample code, see Limiting the Number of Signatures in a SignedDataBlock Object. To enable digital signatures for the entire form
Figure 1. Enabling digital signatures for the entire form, including a prompt to sign the form if it is submitted without a signature Enabling Digital Signatures for Parts of the FormWhen you enable digital signatures for parts of the form, the signatures apply only to specific data in the form. To enable digital signing for specific data in the form, you must define a set of signable data. Each part of the form that requires signing must be associated with a set of signable data. The InfoPath user interface provides two ways to enable digital signatures for parts of the form: by using the Form Options dialog box or by using the Section Properties dialog box (applies only to Section or Optional Section controls). You can use either method to specify signing for a set of data; the difference is in the way InfoPath displays the signatures in the form view and in the way the controls become disabled by default when signed. You can enable digital signatures for specific data in the form for individual controls or for a group of controls. The control or group of controls can be in a container such as a section or optional section. The following limitations apply to digital signatures enabled for parts of a form:
Enabling Signatures for Parts of the Form with the Form Options Dialog BoxYou can use the Digital Signatures tab on the Forms Options dialog box to enable digital signatures for parts of the form and to create the specifications for sets of signable data (Figure 2).
Figure 2. Enabling digital signatures for parts of the form with the Form Options dialog box Note With the Digital Signatures tab on the Form Options dialog box, you can add, remove, and modify sets of signable data. It is the only user interface element with which you can delete the definitions of sets of signable data and change the mode for digitally signing data to signing the entire form, to signing sets of data, or to no signing whatsoever. You can only use the Section Properties dialog box to change from signing the entire form to signing sets of data. After you remove the definition for the last set of signable data from the Data in the form that can be signed list, you must explicitly select the Do not enable digital signatures option before you can close the dialog box. To enable digital signatures for part of the form by using the Form Options dialog box
The relationship between signatures on the set of signable data (Signature options) can be one of the following:
Figure 3. The Set of Signable Data dialog box To enable signatures for parts of a form, you must define at least one set of signable data, and you can define as many sets of signable data as you need. InfoPath disables the ability to specify a group in which to store signatures in form templates that were not created with an open schema. For such templates, InfoPath creates the signature container node automatically and adds it to the schema that InfoPath autogenerates during form design. To specify this setting for a form template that was created with an open schema, you must start your form template design with a node that has a content model with a wildcard character in the XML Signatures namespace, as follows: For a form that you configure for signing sets of data, InfoPath creates one container node for each set of signable data that you define. Each container node contains all signatures that are added to the assigned set of signable data. All signature container nodes are wrapped by another container node that is a child of the root node. Enabling Conditional Formatting for Digitally Signed DataWhen you enable digital signatures for parts of the form by using the Form Options dialog box, InfoPath does not disable the controls specified by the XPath expression defined for the set of signable data when the data is signed, although the associated XML DOM becomes read-only. Figure 4 shows the message InfoPath displays when a user attempts to edit controls that contain data that is already signed.
Figure 4. Message that InfoPath displays when user tries to edit data in a signed control For InfoPath to disable a control after it is signed, each control specified by the XPath expression must have a conditional formatting rule that specifies when InfoPath is to disable the control. To add a conditional formatting rule to a control
Figure 5 shows the conditional formatting rule added to a set of signable data.
Figure 5. Conditional formatting related to digital signatures in MySignature set of signable data You cannot apply read-only conditional formatting to container controls such as sections or optional sections. You can apply it only to basic controls such as text boxes, check boxes, option buttons, and list boxes. You can, however, apply other types of conditional formatting to sections and optional sections that you configure for digital signing. Enabling Signatures for Parts of the Form with the Section Properties Dialog BoxYou can use the Section Properties dialog box to enable digital signatures for the set of controls contained within a Section or Optional Section control. These two container controls are the only ones that support digital signatures and the only ones you can configure for digital signing directly through their properties dialog boxes. The user interface for several features is available only through the Digital Signatures tab of this dialog box (Figure 6). With the Section Properties dialog box, you can associate a set of signable data with a section. You can associate a set of signable data that you defined previously, or you can define the signable data when you define the association. With this dialog box, you can also enable one digital signature for all controls in an entire section. By default, all controls contained in the section become read-only when the section is signed. The XPath expression that defines the set of signable data associated with the section also defines the data that is signed when the section is signed. By customizing this XPath expression, you can add additional controls and data to the default set of data that is bound to the controls within the section. For more information, see Specifying the XPath Expression for a Set of Signable Data. By default, when you use the Section Properties dialog box to enable digital signatures, InfoPath adds conditional formatting to disable editing in all the controls in the section after the data is signed. The When signed, make controls read-only check box controls this feature, and it is selected by default. Any controls you add to the section after you configure the digital signatures settings for the section do not have conditional formatting set, unless you clear and then select the When signed, make controls read-only check box. You can also manually set conditional formatting for individual controls, as described in Enabling Conditional Formatting for Digitally Signed Data. The When signed, make controls read-only check box has three states:
Figure 6. Configuring a section control for digitally signing data Use the Digital Signatures tab of the Section Properties dialog box to:
When you use the Section Properties dialog box to associate a section with a set of signable data, InfoPath displays an icon and a Click here to sign this section link below the section when the user edits the form (Figure 7). When the user clicks this icon or link, InfoPath displays the Digital Signatures Wizard with which the user can select a digital certificate, sign the data, and then verify the signed data.
Figure 7. User interface elements that display in the form when you configure a section for signing data Table 2 summarizes the differences and similarities between enabling digital signatures in the Digital Signatures tab of either the Form Options or the Section Properties dialog box. Table 2. Differences in Enabling Digital Signatures in the Digital Signatures Tab of the Form Options or Section Properties Dialog Box
Enabling Digital Signatures and Defining Signable Data in a Single OperationYou can enable digital signatures for the controls within a section and define the set of signable data in a single operation. To enable digital signatures and define the set of signable data
Associating an Existing Set of Signable Data with a SectionYou can associate an existing set of signable data with a section. To associate an existing set of signable data with a section
Specifying the XPath Expression for a Set of Signable DataYou define a set of signable data by specifying an XPath expression that identifies the data to be signed. You specify this XPath expression in the Fields or groups to be signed field in the Set of Signable Data dialog box. You can type this value, or you can click the Select XPath button to create the expression in the Select a Field or Group dialog box. The XPath expression for a set of signable data follows the specifications of XPath expressions in an XML document. Table 3 shows examples of XPath expressions for signatures. Table 3. Examples of XPath Expressions for Sets of Signable Data
Note InfoPath does not accept XPath expressions that use axes other than To change or extend the definition of a set of signable data, you can modify the XPath expression that specifies the data to be signed. To modify the XPath expression for a set of signable data
To modify the XPath expression for a set of signable data to enable signing three sections in a form at once
After you perform these steps, you can see the Click here to sign this section icon and link following each of the three sections. When a user signs any one of these sections, all three sections are signed, and the signature appears after each section (assuming you selected the Show signatures in the section check box). Notes
Identifying Signed Data in the ViewWhen a user fills out a form, the user may point to or attempt to select a control or set of controls that contains data that is signed. If this happens, the signed control displays an icon in the upper right corner that indicates that the data bound to that control is locked and cannot be changed. InfoPath does not display this icon if you have configured the entire form for signing; instead, InfoPath disables the entire form. Figure 8 shows the icon indicating that the MySignedData text box control is signed and locked.
Figure 8. A signed text box control Understanding the Digital Signature Status and Verification ProcessWhile editing a form, a user can click Digital Signatures on the Tools menu or the Digital Signatures button on the toolbar to display a list of the digital signatures in the form in the Digital Signatures dialog box. The Status column in the list displays one of the values shown in Table 4 for each signature. Table 4. Digital Signature Status Values
The Status value displayed in the Digital Signatures dialog box results from a combination of the signature status (which can be valid, invalid, error, or unsupported) and the certificate status (which can be valid, error, revoked, not trusted, or expired), where the certificate status takes precedence over the signature status. For example, if the signature status is Valid (the hash of the signature indicates that the signature and the signed data have not been tampered with), but the certificate status is not trusted, InfoPath displays the combined status as Not Trusted. You can work programmatically with the Status property of the Signature and Certificate objects to access the status of the signature or certificate independently. To see a code sample that shows how to do this, see Building a Task Pane for Displaying Information about Digital Signatures. Figure 9 shows the signature status as displayed in the Status column of the Digital Signatures dialog box. Figure 10 shows a signature status message that InfoPath displays when the user attempts to apply an invalid signature while editing the form.
Figure 9. Signature status displayed in Status column of Digital Signatures dialog box
Figure 10. Invalid signature status message displayed during editing When you click the View Signed Form button in the Digital Signatures dialog box, InfoPath displays the Verify Digital Signature dialog box. This dialog box provides more detailed information about the state of the form when it was signed and the computer on which it was signed. When you click the View Certificate button, InfoPath displays the Windows Certificate dialog box, which provides details about the certificate used to sign the data. You can also access the status of the signature or the certificate through the digital signatures object model. For more information, see Using the InfoPath Object Model to Work with Forms Configured for Signing Data. The InfoPath infrastructure verifies the digital signatures in the form at the following times:
When a user loads your form, if InfoPath cannot identify any of the signatures in the form as valid, it displays a warning message. When a user edits your form, in the form view, InfoPath replaces the name of an invalid signature with the following text, in red: "There is a problem with this signature". InfoPath shows digital certificates that have a status of Not Trusted as available for use in signing, but such certificates create signatures that display the Not Trusted status. InfoPath does not show expired or revoked certificates as available for use in signing. The Verify Digital Signature Dialog Box and Nonrepudiation DataInfoPath stores the following additional nonrepudiation data with the signature and displays it in the Verify Digital Signature dialog box (Figure 11):
The form user signs |
















