Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / DataGridViewComponentPropertyGridSite.cs / 1 / DataGridViewComponentPropertyGridSite.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Windows.Forms.Design {
using System;
using System.Design;
using System.CodeDom;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
internal class DataGridViewComponentPropertyGridSite : ISite {
private IServiceProvider sp;
private IComponent comp;
private bool inGetService = false;
public DataGridViewComponentPropertyGridSite(IServiceProvider sp, IComponent comp) {
this.sp = sp;
this.comp = comp;
}
/** The component sited by this component site. */
///
///
/// When implemented by a class, gets the component associated with the .
///
public IComponent Component {get {return comp;}}
/** The container in which the component is sited. */
///
///
/// When implemented by a class, gets the container associated with the .
///
public IContainer Container {get {return null;}}
/** Indicates whether the component is in design mode. */
///
///
/// When implemented by a class, determines whether the component is in design mode.
///
public bool DesignMode {get {return false;}}
/**
* The name of the component.
*/
///
///
/// When implemented by a class, gets or sets the name of
/// the component associated with the .
///
public String Name {
get {return null;}
set {}
}
public object GetService(Type t) {
if (!inGetService && sp != null) {
try {
inGetService = true;
return sp.GetService(t);
}
finally {
inGetService = false;
}
}
return null;
}
}
}
// 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
- TaskFactory.cs
- CommentAction.cs
- ManagementNamedValueCollection.cs
- FlowDocumentPageViewerAutomationPeer.cs
- DataComponentNameHandler.cs
- XD.cs
- IntegerValidator.cs
- EntityConnectionStringBuilder.cs
- TokenBasedSet.cs
- HyperLinkStyle.cs
- X509SecurityTokenAuthenticator.cs
- MethodRental.cs
- ParameterElementCollection.cs
- CodeRemoveEventStatement.cs
- ConfigsHelper.cs
- TogglePattern.cs
- RootProfilePropertySettingsCollection.cs
- SqlInternalConnection.cs
- IconConverter.cs
- DataSourceView.cs
- InitializationEventAttribute.cs
- FixedSOMGroup.cs
- EditorPartCollection.cs
- NativeWindow.cs
- MasterPageBuildProvider.cs
- EndpointConfigContainer.cs
- RewritingPass.cs
- DataSetViewSchema.cs
- PointHitTestResult.cs
- CodeTypeReference.cs
- HighlightVisual.cs
- ThrowHelper.cs
- DictionaryItemsCollection.cs
- StateMachineExecutionState.cs
- StringComparer.cs
- DrawingContextWalker.cs
- TextServicesLoader.cs
- CodeTypeDelegate.cs
- WeakReference.cs
- OutArgumentConverter.cs
- AggregateException.cs
- NetworkInterface.cs
- FileCodeGroup.cs
- RequestCachePolicyConverter.cs
- CancelEventArgs.cs
- FontEmbeddingManager.cs
- RoleServiceManager.cs
- AssemblyBuilderData.cs
- FormViewPageEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- CodeDomLocalizationProvider.cs
- Math.cs
- ExpressionPrinter.cs
- MenuItemAutomationPeer.cs
- Point3DConverter.cs
- CmsUtils.cs
- DataGridViewCellStyle.cs
- ValidatorCompatibilityHelper.cs
- TTSVoice.cs
- ResourceReferenceExpressionConverter.cs
- CompilerErrorCollection.cs
- PathStreamGeometryContext.cs
- BCLDebug.cs
- DataRowExtensions.cs
- OpenTypeLayout.cs
- QueryAsyncResult.cs
- BlurBitmapEffect.cs
- DummyDataSource.cs
- ProfileEventArgs.cs
- XmlNodeReader.cs
- BooleanKeyFrameCollection.cs
- ConnectionManagementElementCollection.cs
- NamespaceMapping.cs
- TickBar.cs
- CustomErrorsSection.cs
- PreservationFileReader.cs
- MetadataItem_Static.cs
- ControlEvent.cs
- StrokeCollectionConverter.cs
- CompareValidator.cs
- UInt64Storage.cs
- RepeaterItemEventArgs.cs
- SetIndexBinder.cs
- TransformPattern.cs
- WebPartEditorApplyVerb.cs
- WorkBatch.cs
- TraceSection.cs
- DocumentReference.cs
- PersonalizationProvider.cs
- ProtocolsConfigurationHandler.cs
- TextRangeSerialization.cs
- WmfPlaceableFileHeader.cs
- ThrowHelper.cs
- TrackingQueryElement.cs
- IntMinMaxAggregationOperator.cs
- Module.cs
- EventDescriptorCollection.cs
- FixUpCollection.cs
- ServiceMemoryGates.cs
- PropertyGrid.cs