Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / 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: 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. //-------------------------------------------------------------------------------------------------- // 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
- OverrideMode.cs
- SmiXetterAccessMap.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- SatelliteContractVersionAttribute.cs
- BitmapEffectRenderDataResource.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- NetStream.cs
- COM2PropertyDescriptor.cs
- StandardToolWindows.cs
- CustomAttribute.cs
- XmlILAnnotation.cs
- RowCache.cs
- BaseCollection.cs
- DBConcurrencyException.cs
- DataGridViewAdvancedBorderStyle.cs
- TraversalRequest.cs
- CachedPathData.cs
- SynchronizedInputPattern.cs
- Tile.cs
- MinMaxParagraphWidth.cs
- MetadataUtilsSmi.cs
- Debug.cs
- _IPv6Address.cs
- ToolboxItem.cs
- VectorAnimation.cs
- TransformGroup.cs
- CounterSampleCalculator.cs
- ColorDialog.cs
- PublisherIdentityPermission.cs
- ACE.cs
- StreamWriter.cs
- CacheDependency.cs
- LifetimeServices.cs
- ItemType.cs
- XmlExtensionFunction.cs
- PolyLineSegment.cs
- StorageAssociationTypeMapping.cs
- DesignerCategoryAttribute.cs
- Memoizer.cs
- ToolStripGripRenderEventArgs.cs
- RSAPKCS1SignatureDeformatter.cs
- StateDesigner.Helpers.cs
- CodeBinaryOperatorExpression.cs
- ValidationError.cs
- InfoCardSymmetricAlgorithm.cs
- Validator.cs
- UnknownWrapper.cs
- Cursor.cs
- Repeater.cs
- _LocalDataStore.cs
- SelectingProviderEventArgs.cs
- Light.cs
- Atom10FeedFormatter.cs
- DatePickerDateValidationErrorEventArgs.cs
- ClockGroup.cs
- ElementMarkupObject.cs
- ControlBindingsCollection.cs
- UInt32.cs
- Int32CollectionConverter.cs
- StringUtil.cs
- OleDbCommand.cs
- OdbcReferenceCollection.cs
- MemberPath.cs
- QueryConverter.cs
- WebHttpBindingElement.cs
- Panel.cs
- HttpListenerContext.cs
- LightweightCodeGenerator.cs
- DateTimeStorage.cs
- TextElement.cs
- Figure.cs
- PathStreamGeometryContext.cs
- EnvelopedPkcs7.cs
- LinkDesigner.cs
- DataSourceExpressionCollection.cs
- GeneralTransform2DTo3D.cs
- FileAccessException.cs
- CompiledIdentityConstraint.cs
- HitTestParameters.cs
- TypeBuilderInstantiation.cs
- ClientSponsor.cs
- CodeIndexerExpression.cs
- FixedSOMElement.cs
- DataGridViewCellEventArgs.cs
- SecurityElement.cs
- ProfileService.cs
- RangeExpression.cs
- AccessedThroughPropertyAttribute.cs
- altserialization.cs
- Monitor.cs
- EdmError.cs
- ConfigurationErrorsException.cs
- HybridObjectCache.cs
- PolicyChain.cs
- URL.cs
- TagPrefixAttribute.cs
- RSAProtectedConfigurationProvider.cs
- DiscardableAttribute.cs
- ScrollContentPresenter.cs
- ControlUtil.cs