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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientApiGenerator.cs
- StickyNoteContentControl.cs
- CallContext.cs
- BitmapEffect.cs
- RuntimeConfig.cs
- BufferModesCollection.cs
- DataContractSerializerFaultFormatter.cs
- UserInitiatedNavigationPermission.cs
- ObjectDataSourceDisposingEventArgs.cs
- SrgsRuleRef.cs
- TraceHandler.cs
- SafeReversePInvokeHandle.cs
- SqlBooleanizer.cs
- Buffer.cs
- ResXDataNode.cs
- Rijndael.cs
- DomainUpDown.cs
- SystemIPv4InterfaceProperties.cs
- RawUIStateInputReport.cs
- OrCondition.cs
- LineProperties.cs
- TimeSpanStorage.cs
- XmlSchemaAny.cs
- TextTrailingWordEllipsis.cs
- MediaCommands.cs
- IMembershipProvider.cs
- ParallelSeparator.xaml.cs
- SqlCacheDependencyDatabaseCollection.cs
- Validator.cs
- LocalFileSettingsProvider.cs
- SchemaImporterExtensionElement.cs
- GridViewEditEventArgs.cs
- DragSelectionMessageFilter.cs
- WriteFileContext.cs
- BigInt.cs
- Set.cs
- NumericUpDown.cs
- XmlLangPropertyAttribute.cs
- UserPersonalizationStateInfo.cs
- BitmapSizeOptions.cs
- DataServiceKeyAttribute.cs
- EllipticalNodeOperations.cs
- Base64Decoder.cs
- BookmarkInfo.cs
- XamlPointCollectionSerializer.cs
- DiscoveryDocumentSearchPattern.cs
- MarkupCompilePass2.cs
- PriorityRange.cs
- Int32AnimationBase.cs
- ParameterCollection.cs
- ConfigurationErrorsException.cs
- RightsManagementEncryptedStream.cs
- SafeNativeMethods.cs
- Attributes.cs
- ComplexLine.cs
- TemplateBindingExtensionConverter.cs
- XhtmlBasicFormAdapter.cs
- SignatureTargetIdManager.cs
- OperatingSystem.cs
- BitmapDecoder.cs
- UiaCoreApi.cs
- SqlBuffer.cs
- HtmlInputRadioButton.cs
- ApplicationBuildProvider.cs
- SolidBrush.cs
- _ConnectOverlappedAsyncResult.cs
- PreservationFileWriter.cs
- TrackingProfile.cs
- ProcessingInstructionAction.cs
- FunctionDefinition.cs
- IteratorFilter.cs
- DetailsViewInsertEventArgs.cs
- MetadataHelper.cs
- RepeatEnumerable.cs
- ServiceHostingEnvironment.cs
- CursorConverter.cs
- DataStreams.cs
- SplitContainer.cs
- OpenTypeCommon.cs
- TextDataBindingHandler.cs
- InkCanvasAutomationPeer.cs
- EndEvent.cs
- ResourceDefaultValueAttribute.cs
- CommandValueSerializer.cs
- MutexSecurity.cs
- CompositeFontParser.cs
- CommandDesigner.cs
- BinaryObjectInfo.cs
- CharacterMetricsDictionary.cs
- DateTimePicker.cs
- ColorBlend.cs
- DBConnection.cs
- LocationSectionRecord.cs
- _NetworkingPerfCounters.cs
- XmlSchemaGroupRef.cs
- RuleSetDialog.cs
- WindowsAuthenticationModule.cs
- altserialization.cs
- EventMetadata.cs
- GuidConverter.cs