 |
|
|
 |
|
 |
I have an application coming up and will exaimne this futher it looks great.
cheers, Donsw My Recent Article : Organizational Structure within a Company for PMPs
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The %xxxxx% place holders display for a fraction of a second while the AboutBox form is loading. Does anyone have a solution for this?
Private Sub AboutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AboutToolStripMenuItem.Click Dim frmAbout As New AboutBox frmAbout.ShowDialog(Me) End Sub
modified on Wednesday, October 8, 2008 2:46 PM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I've resolved this issue by making the following change:
I moved the following from the AboutBox_Paint() method to the AboutBox_Load() method:
Cursor.Current = Cursors.WaitCursor PopulateLabels() Cursor.Current = Cursors.Default
Result:
''' ''' things to do when form is loaded ''' Private Sub AboutBox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'-- if the user didn't provide an assembly, try to guess which one is the entry assembly If _EntryAssembly Is Nothing Then _EntryAssembly = [Assembly].GetEntryAssembly End If If _EntryAssembly Is Nothing Then _EntryAssembly = [Assembly].GetExecutingAssembly End If
_ExecutingAssemblyName = [Assembly].GetExecutingAssembly.GetName.Name _CallingAssemblyName = [Assembly].GetCallingAssembly.GetName.Name Try '-- for web hosted apps, GetEntryAssembly = nothing _EntryAssemblyName = [Assembly].GetEntryAssembly.GetName.Name Catch ex As Exception End Try
_MinWindowHeight = AppCopyrightLabel.Top + AppCopyrightLabel.Height + OKButton.Height + 30
Me.TabPanelDetails.Visible = False If Not MoreRichTextBox.Visible Then Me.Height = Me.Height - MoreRichTextBox.Height End If
' Moved from AboutBox_Paint so that the placeholder text do not become visible Cursor.Current = Cursors.WaitCursor PopulateLabels() Cursor.Current = Cursors.Default
End Sub
''' ''' things to do when form is FIRST painted ''' Private Sub AboutBox_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint If Not _IsPainted Then _IsPainted = True Application.DoEvents() 'Cursor.Current = Cursors.WaitCursor 'PopulateLabels() 'Cursor.Current = Cursors.Default End If End Sub
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Thanks so much for this Jeff, it is a great piece of work.
The first time the form is displayed, I am able to select the details button. If I close the form and display it again, the details button is no longer visible - only the System Info... and OK buttons. Is this intentional?
Cheers
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
 | helpful  Abhijit Jana | 4:51 15 Jan '08 |
|
|
 |
|
 |
First off, thanks a ton for the extremely useful well-thought-out About Box!
I was trying to use the about box in a form, but kept getting a NonSupportedException in the AssemblyLastWriteTime function at the a.Location property of the assembly. The error was something like "Location is not supported for dynamically generated assemblies". Turns out that since I'm using an XslCompiledTransform (that uses reflection to emit a dynamic assembly), it was complaining.
I just moved that line down into the lower try/catch block and it works now 
private DateTime AssemblyLastWriteTime(Assembly a) { try { if (a.Location == null || a.Location == "") return DateTime.MaxValue; return File.GetLastWriteTime(a.Location); }catch(Exception){ return DateTime.MaxValue; } }
Bart: Look at me, I'm a grad student. I'm 30 years old and I made $600 last year. Marge: Bart, don't make fun of grad students. They've just made a terrible life choice.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for you help about box. I added the following extras you may want to put in your copy.
In the ReplaceTokens() function:
s = s.Replace("%fileversion%", EntryAssemblyAttrib("fileversion")) s = s.Replace("%infoversion%", EntryAssemblyAttrib("informationalversion"))
In the AssemblyAttribs() function:
Case "System.Reflection.AssemblyFileVersionAttribute" Value = CType(attrib, AssemblyFileVersionAttribute).Version.ToString
S.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Could someone give me any help as to how to instantiate the form. I'm a newbie and don't quite understand. When I include the AboutBox.vb and build the priject I get lots of errors, "not a member and not declaired. Do I need add all these items or is the design form included?
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
I used VB.Net to C# Converter 2.08 (For VB 2002, 2003 Projects) to convert this project,the code is converted but the issue is that the whole app throws a exception
Code here for review
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
quick and dirty.
the collection has never been populated. object obj = nvc[Name]; if ( null == obj ) { nvc.Add(Name, Value); }
Cheers Robert
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
yes i had seen that fixed the code actually to get it working under .net 2.0 so anybody wanting to use it can hook it up.Will upload soon.
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I submitted an update to the article which includes a full C# conversion of the solution.. it should be posted shortly!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Well hope to see this n and review the C# code.
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
cOOL
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I am using it in my project now. I made a change that I wanted to share, mostly to get your feedback. I try to avoid Select's that use strings, so I changed it to use a type handle, but I am not sure if it is better or not. What do you think?
(The old code is commented out below the changed code)
Private Function AssemblyAttribs(ByVal a As System.Reflection.Assembly) _ As Specialized.NameValueCollection Dim TypeName As String Dim Name As String Dim Value As String Dim nvc As New Specialized.NameValueCollection Dim r As New Regex("(\.Assembly|\.)(?[^.]*)Attribute$", RegexOptions.IgnoreCase)
For Each attrib As Object In a.GetCustomAttributes(False) Dim typ As Type = attrib.GetType() Dim typHandle As Integer = typ.TypeHandle.Value.ToInt32 TypeName = typ.ToString Name = r.Match(TypeName).Groups("Name").ToString Value = ""
Select Case typHandle Case GetType(System.CLSCompliantAttribute).TypeHandle.Value.ToInt32() Value = DirectCast(attrib, CLSCompliantAttribute).IsCompliant.ToString Case GetType(System.Diagnostics.DebuggableAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, Diagnostics.DebuggableAttribute).IsJITTrackingEnabled.ToString Case GetType(System.Reflection.AssemblyCompanyAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyCompanyAttribute).Company.ToString Case GetType(System.Reflection.AssemblyConfigurationAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyConfigurationAttribute).Configuration.ToString Case GetType(System.Reflection.AssemblyCopyrightAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyCopyrightAttribute).Copyright.ToString Case GetType(System.Reflection.AssemblyDefaultAliasAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyDefaultAliasAttribute).DefaultAlias.ToString Case GetType(System.Reflection.AssemblyDelaySignAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyDelaySignAttribute).DelaySign.ToString Case GetType(System.Reflection.AssemblyDescriptionAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyDescriptionAttribute).Description.ToString Case GetType(System.Reflection.AssemblyInformationalVersionAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyInformationalVersionAttribute).InformationalVersion.ToString Case GetType(System.Reflection.AssemblyKeyFileAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyKeyFileAttribute).KeyFile.ToString Case GetType(System.Reflection.AssemblyProductAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyProductAttribute).Product.ToString Case GetType(System.Reflection.AssemblyTrademarkAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyTrademarkAttribute).Trademark.ToString Case GetType(System.Reflection.AssemblyTitleAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, AssemblyTitleAttribute).Title.ToString Case GetType(System.Resources.NeutralResourcesLanguageAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, Resources.NeutralResourcesLanguageAttribute).CultureName.ToString Case GetType(System.Resources.SatelliteContractVersionAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, Resources.SatelliteContractVersionAttribute).Version.ToString Case GetType(System.Runtime.InteropServices.ComCompatibleVersionAttribute).TypeHandle.Value.ToInt32 Dim x As Runtime.InteropServices.ComCompatibleVersionAttribute x = DirectCast(attrib, Runtime.InteropServices.ComCompatibleVersionAttribute) Value = x.MajorVersion & "." & x.MinorVersion & "." & x.RevisionNumber & "." & x.BuildNumber Case GetType(System.Runtime.InteropServices.ComVisibleAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, Runtime.InteropServices.ComVisibleAttribute).Value.ToString Case GetType(System.Runtime.InteropServices.GuidAttribute).TypeHandle.Value.ToInt32 Value = DirectCast(attrib, Runtime.InteropServices.GuidAttribute).Value.ToString Case GetType(System.Runtime.InteropServices.TypeLibVersionAttribute).TypeHandle.Value.ToInt32 Dim x As Runtime.InteropServices.TypeLibVersionAttribute x = DirectCast(attrib, Runtime.InteropServices.TypeLibVersionAttribute) Value = x.MajorVersion & "." & x.MinorVersion Case GetType(System.Security.AllowPartiallyTrustedCallersAttribute).TypeHandle.Value.ToInt32 Value = "(Present)" Case Else Value = TypeName End Select
If nvc.Item(Name) = "" Then nvc.Add(Name, Value) End If Next
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I was hoping to just find how to get the AssemblyVersion of a build. This is much better!
Careful. We don't want to learn from this. --Bill Watterson, "Calvin and Hobbes"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Can this be done for web application featuring asp.net with vb.net ? If so which classes etc should be called.
Thanks. A.M
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |