Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / StartUpEventArgs.cs / 1305600 / StartUpEventArgs.cs
//-------------------------------------------------------------------------------------------------- // File: StartupEventArgs.cs // // Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // // Description: // This event is fired when the application starts - once that application�s Run() // method has been called. // // The developer will typically hook this event if they want to take action at startup time // // History: // 08/10/04: kusumav Moved out of Application.cs to its own separate file. // 05/09/05: hamidm Created StartupEventArgs.cs and renamed StartingUpCancelEventArgs to StartupEventArgs // //--------------------------------------------------------------------------- using System.ComponentModel; using System.Windows.Interop; using MS.Internal.PresentationFramework; using System.Runtime.CompilerServices; using MS.Internal; using MS.Internal.AppModel; namespace System.Windows { ////// Event args for Startup event /// public class StartupEventArgs : EventArgs { ////// constructor /// internal StartupEventArgs() { _performDefaultAction = true; } ////// Command Line arguments /// public String[] Args { get { if (_args == null) { _args = GetCmdLineArgs(); } return _args; } } internal bool PerformDefaultAction { get { return _performDefaultAction; } set { _performDefaultAction = value; } } private string[] GetCmdLineArgs() { string[] retValue = null; if (!BrowserInteropHelper.IsBrowserHosted && ( ( Application.Current.MimeType != MimeType.Application ) || ! IsOnNetworkShareForDeployedApps() )) { string[] args = Environment.GetCommandLineArgs(); Invariant.Assert(args.Length >= 1); int newLength = args.Length - 1; newLength = (newLength >=0 ? newLength : 0); retValue = new string[newLength]; for (int i = 1; i < args.Length; i++) { retValue[i-1] = args[i]; } } else { retValue = new string[0]; } return retValue; } // // Put this into a separate Method to avoid loading of this code at JIT time. // // // Explicitly tell the compiler that we don't want to be inlined. // This will prevent loading of system.deployment unless we are a click-once app. // [MethodImplAttribute (MethodImplOptions.NoInlining )] private bool IsOnNetworkShareForDeployedApps() { return System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed ; } private String[] _args; private bool _performDefaultAction; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetadataCache.cs
- DataGridViewRowStateChangedEventArgs.cs
- PasswordPropertyTextAttribute.cs
- MailWebEventProvider.cs
- Inflater.cs
- LayoutEvent.cs
- EventProviderWriter.cs
- EncodingDataItem.cs
- EntityAdapter.cs
- FreezableCollection.cs
- TextEndOfSegment.cs
- DuplexChannel.cs
- GroupItemAutomationPeer.cs
- ChannelSinkStacks.cs
- MetadataItem.cs
- Itemizer.cs
- CodeThrowExceptionStatement.cs
- XhtmlMobileTextWriter.cs
- TextBreakpoint.cs
- AxisAngleRotation3D.cs
- ServiceModelExtensionCollectionElement.cs
- ToolBarPanel.cs
- SqlDeflator.cs
- SqlServer2KCompatibilityAnnotation.cs
- BaseWebProxyFinder.cs
- XmlUtf8RawTextWriter.cs
- DiagnosticsConfiguration.cs
- DataGridViewColumn.cs
- InvokeWebServiceDesigner.cs
- MailMessageEventArgs.cs
- DateTimeStorage.cs
- HuffModule.cs
- EndSelectCardRequest.cs
- ConsoleCancelEventArgs.cs
- NegatedConstant.cs
- TreeNodeCollectionEditor.cs
- HyperLinkColumn.cs
- FullTrustAssemblyCollection.cs
- SpecialTypeDataContract.cs
- ToolboxItemFilterAttribute.cs
- ArcSegment.cs
- HyperLinkStyle.cs
- NamespaceInfo.cs
- MultiBinding.cs
- OdbcUtils.cs
- SmtpFailedRecipientException.cs
- ReadOnlyDictionary.cs
- EntityClientCacheKey.cs
- tooltip.cs
- ByteConverter.cs
- DataSetUtil.cs
- DiagnosticSection.cs
- PolyLineSegment.cs
- HostedTransportConfigurationBase.cs
- HtmlHead.cs
- HtmlTableCellCollection.cs
- PersonalizationState.cs
- ControlPropertyNameConverter.cs
- ImmutableCollection.cs
- DetailsViewInsertEventArgs.cs
- ControlFilterExpression.cs
- LinqDataSourceDisposeEventArgs.cs
- RawUIStateInputReport.cs
- relpropertyhelper.cs
- OrderPreservingSpoolingTask.cs
- ExclusiveNamedPipeTransportManager.cs
- SafeRsaProviderHandle.cs
- TextBox.cs
- Size.cs
- TextElementEnumerator.cs
- WmiEventSink.cs
- Style.cs
- Metadata.cs
- ZipPackage.cs
- CodeExpressionStatement.cs
- DuplexClientBase.cs
- InstanceLockedException.cs
- SqlConnectionStringBuilder.cs
- LabelLiteral.cs
- ViewStateException.cs
- SID.cs
- XmlSchemaIdentityConstraint.cs
- DataTableMapping.cs
- ReadWriteSpinLock.cs
- SqlProfileProvider.cs
- TimeZoneNotFoundException.cs
- XmlTypeAttribute.cs
- DateTimeEditor.cs
- ComponentChangingEvent.cs
- PermissionToken.cs
- UpdateCommand.cs
- SponsorHelper.cs
- Constants.cs
- BezierSegment.cs
- SrgsSubset.cs
- LabelInfo.cs
- CustomAttributeSerializer.cs
- TrustSection.cs
- PhoneCall.cs
- DesignTimeVisibleAttribute.cs