Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / StartUpEventArgs.cs / 1 / 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: [....] Moved out of Application.cs to its own separate file. // 05/09/05: [....] 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
- SessionPageStatePersister.cs
- XmlRootAttribute.cs
- XmlException.cs
- RunClient.cs
- MobileCategoryAttribute.cs
- ImportCatalogPart.cs
- NetworkInformationPermission.cs
- InProcStateClientManager.cs
- HighContrastHelper.cs
- OneOfTypeConst.cs
- PeerCredentialElement.cs
- WinEventQueueItem.cs
- TransformerInfoCollection.cs
- Rule.cs
- AttributeEmitter.cs
- RootAction.cs
- EdmProperty.cs
- DataGridViewTextBoxCell.cs
- StoreItemCollection.Loader.cs
- cache.cs
- XmlSerializerNamespaces.cs
- DrawingServices.cs
- AttachInfo.cs
- OleDbRowUpdatingEvent.cs
- RawAppCommandInputReport.cs
- Library.cs
- SafeSystemMetrics.cs
- InternalDispatchObject.cs
- TextRangeAdaptor.cs
- EnumerableCollectionView.cs
- XmlSchemaRedefine.cs
- FontDialog.cs
- ScaleTransform.cs
- XmlToDatasetMap.cs
- DataSourceCacheDurationConverter.cs
- compensatingcollection.cs
- ProbeMatchesApril2005.cs
- TextBoxAutoCompleteSourceConverter.cs
- SqlDataRecord.cs
- EntitySet.cs
- ExpandSegment.cs
- CompModSwitches.cs
- FormatControl.cs
- AuthenticationSection.cs
- SelectedPathEditor.cs
- ToolStripContextMenu.cs
- ReflectPropertyDescriptor.cs
- EntityStoreSchemaGenerator.cs
- DtcInterfaces.cs
- ExpressionConverter.cs
- RowsCopiedEventArgs.cs
- DataObjectPastingEventArgs.cs
- KnownTypesProvider.cs
- XmlReaderDelegator.cs
- ArrayElementGridEntry.cs
- Scheduling.cs
- StorageModelBuildProvider.cs
- LinqToSqlWrapper.cs
- Types.cs
- ConfigurationValidatorBase.cs
- MultipleViewPattern.cs
- WebUtility.cs
- TextSerializer.cs
- ConnectionConsumerAttribute.cs
- MediaCommands.cs
- WindowsGraphicsCacheManager.cs
- RectAnimationClockResource.cs
- RuntimeWrappedException.cs
- MarshalByRefObject.cs
- UIAgentMonitor.cs
- UnionCodeGroup.cs
- WebPartTransformerAttribute.cs
- PreProcessInputEventArgs.cs
- ReaderWriterLock.cs
- RelationshipDetailsRow.cs
- TransformValueSerializer.cs
- KeyedHashAlgorithm.cs
- StoryFragments.cs
- VirtualDirectoryMappingCollection.cs
- GlobalizationAssembly.cs
- ProxyWebPartConnectionCollection.cs
- XmlAtomErrorReader.cs
- SpellCheck.cs
- InstancePersistenceContext.cs
- Publisher.cs
- Set.cs
- SqlXmlStorage.cs
- FontStretch.cs
- SocketElement.cs
- UpDownBase.cs
- DataContract.cs
- JavaScriptString.cs
- SemaphoreSecurity.cs
- PeerNearMe.cs
- TrackBarDesigner.cs
- _BasicClient.cs
- SpellerError.cs
- _LoggingObject.cs
- SafeHandles.cs
- WebPartMinimizeVerb.cs