Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- SqlInternalConnectionTds.cs
- RewritingSimplifier.cs
- TypeListConverter.cs
- TransportManager.cs
- XmlTextAttribute.cs
- ScrollEvent.cs
- Image.cs
- SelectedGridItemChangedEvent.cs
- RolePrincipal.cs
- DATA_BLOB.cs
- PeerCollaborationPermission.cs
- SignatureDescription.cs
- WebScriptEnablingElement.cs
- CmsUtils.cs
- BuildResult.cs
- FixedSOMTable.cs
- itemelement.cs
- MatchAttribute.cs
- ModuleBuilder.cs
- CallbackValidatorAttribute.cs
- XmlMapping.cs
- DataServiceQueryProvider.cs
- DecoderReplacementFallback.cs
- RegexRunner.cs
- GPRECT.cs
- WebServiceParameterData.cs
- ListViewItem.cs
- TableDesigner.cs
- SectionInput.cs
- ToolStripDesignerAvailabilityAttribute.cs
- NavigationCommands.cs
- SHA1Cng.cs
- FlowDecision.cs
- CompositeTypefaceMetrics.cs
- RouteUrlExpressionBuilder.cs
- PrincipalPermission.cs
- EventHandlerList.cs
- WindowsStatusBar.cs
- CodeAccessPermission.cs
- ModifierKeysValueSerializer.cs
- HttpsTransportElement.cs
- WindowsScroll.cs
- GlobalProxySelection.cs
- BuilderPropertyEntry.cs
- MembershipPasswordException.cs
- FeatureSupport.cs
- RequestCacheValidator.cs
- MediaTimeline.cs
- ZipPackage.cs
- ExceptionHandlers.cs
- DataSourceCacheDurationConverter.cs
- RetrieveVirtualItemEventArgs.cs
- prompt.cs
- RenderingEventArgs.cs
- StyleCollectionEditor.cs
- InkSerializer.cs
- TypeConverterHelper.cs
- PixelFormats.cs
- CodeTryCatchFinallyStatement.cs
- AdPostCacheSubstitution.cs
- HyperlinkAutomationPeer.cs
- DiagnosticsConfiguration.cs
- ACL.cs
- Point3DCollectionConverter.cs
- AssertFilter.cs
- CodeThrowExceptionStatement.cs
- RotateTransform.cs
- PropertyEntry.cs
- TextEndOfLine.cs
- StringValidator.cs
- Padding.cs
- EditCommandColumn.cs
- TextEndOfSegment.cs
- ControlHelper.cs
- ReadOnlyCollection.cs
- ListViewSelectEventArgs.cs
- CodeGeneratorOptions.cs
- SapiRecoInterop.cs
- XmlSchemaObjectTable.cs
- TimeZone.cs
- Matrix3DStack.cs
- ParseHttpDate.cs
- NotifyParentPropertyAttribute.cs
- InputLanguageEventArgs.cs
- AvtEvent.cs
- ControlIdConverter.cs
- ExplicitDiscriminatorMap.cs
- DiagnosticStrings.cs
- DataGridHeaderBorder.cs
- Semaphore.cs
- ServiceBuildProvider.cs
- DocumentPageTextView.cs
- WithParamAction.cs
- CodeArrayIndexerExpression.cs
- TypeResolvingOptions.cs
- XmlAnyAttributeAttribute.cs
- MetaData.cs
- Input.cs
- SmiEventSink.cs
- Opcode.cs