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
- fixedPageContentExtractor.cs
- ProtocolsSection.cs
- ClipboardProcessor.cs
- RoutedEventConverter.cs
- DataFormats.cs
- TaskFileService.cs
- XPathNodeInfoAtom.cs
- ByteAnimationUsingKeyFrames.cs
- ArrayList.cs
- CompressedStack.cs
- ServiceReference.cs
- SoapRpcMethodAttribute.cs
- EventEntry.cs
- ActivityDesignerAccessibleObject.cs
- HttpListenerContext.cs
- SBCSCodePageEncoding.cs
- ValueUnavailableException.cs
- HierarchicalDataBoundControl.cs
- TreeChangeInfo.cs
- DropDownHolder.cs
- RegexReplacement.cs
- BaseTreeIterator.cs
- LinearGradientBrush.cs
- HttpHandlersSection.cs
- WizardStepBase.cs
- DesignerVerb.cs
- PropertyToken.cs
- XslCompiledTransform.cs
- DiscoveryEndpointValidator.cs
- ImageConverter.cs
- NativeMethods.cs
- EndpointIdentityExtension.cs
- WebPartConnectionCollection.cs
- SqlException.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- WriteStateInfoBase.cs
- RuleSettings.cs
- TreeNode.cs
- EntityDataSourceDataSelectionPanel.cs
- CompiledXpathExpr.cs
- MenuItemStyleCollection.cs
- XmlHierarchicalEnumerable.cs
- ConfigXmlReader.cs
- ListBase.cs
- OperationContractAttribute.cs
- DataSourceCacheDurationConverter.cs
- ApplicationException.cs
- GeneralTransform2DTo3DTo2D.cs
- URLAttribute.cs
- PlanCompilerUtil.cs
- StringUtil.cs
- TargetPerspective.cs
- ImageFormat.cs
- ToolStripCustomTypeDescriptor.cs
- CharacterString.cs
- SiteMapDataSourceView.cs
- SafeNativeMemoryHandle.cs
- SelectionChangedEventArgs.cs
- Propagator.Evaluator.cs
- DetailsView.cs
- XhtmlBasicPhoneCallAdapter.cs
- GridViewDeletedEventArgs.cs
- SqlBulkCopyColumnMappingCollection.cs
- Canvas.cs
- Exception.cs
- HtmlShimManager.cs
- UTF32Encoding.cs
- DBDataPermissionAttribute.cs
- PageCodeDomTreeGenerator.cs
- WebBrowserSiteBase.cs
- CalendarDay.cs
- SHA256Managed.cs
- DrawingAttributes.cs
- KeyValuePairs.cs
- Viewport3DAutomationPeer.cs
- DoubleCollection.cs
- SqlProfileProvider.cs
- ToggleButtonAutomationPeer.cs
- CompositionCommandSet.cs
- SemaphoreSecurity.cs
- OrCondition.cs
- _NegotiateClient.cs
- MenuScrollingVisibilityConverter.cs
- EventDescriptorCollection.cs
- ApplicationDirectoryMembershipCondition.cs
- ScrollBar.cs
- TransformerInfo.cs
- DataControlFieldCollection.cs
- HostedTransportConfigurationBase.cs
- UserPreferenceChangedEventArgs.cs
- XmlSchemaComplexContentRestriction.cs
- FontFaceLayoutInfo.cs
- VisualStyleElement.cs
- DataGridPagingPage.cs
- RightNameExpirationInfoPair.cs
- grammarelement.cs
- PageMediaType.cs
- TableRow.cs
- ShadowGlyph.cs
- ConfigXmlElement.cs