WindowsFormsEditorServiceHelper.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / WindowsFormsEditorServiceHelper.cs / 1 / WindowsFormsEditorServiceHelper.cs

                            using System.Web.UI.Design.Util; 
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.ComponentModel;
using System.ComponentModel.Design; 

namespace System.Web.UI.Design.WebControls { 
    internal sealed class WindowsFormsEditorServiceHelper : IWindowsFormsEditorService, IServiceProvider { 
        private ComponentDesigner _componentDesigner;
 
        public WindowsFormsEditorServiceHelper(ComponentDesigner componentDesigner) {
            _componentDesigner = componentDesigner;
        }
 
        #region IWindowsFormsEditorService Members
        void IWindowsFormsEditorService.CloseDropDown() { 
        } 

        void IWindowsFormsEditorService.DropDownControl(System.Windows.Forms.Control control) { 
        }

        DialogResult IWindowsFormsEditorService.ShowDialog(System.Windows.Forms.Form dialog) {
            return UIServiceHelper.ShowDialog(this, dialog); 
        }
        #endregion 
 
        #region ComponentDesigner Members
        object IServiceProvider.GetService(Type serviceType) { 
            if (serviceType == typeof(IWindowsFormsEditorService)) {
                return this;
            }
            else { 
                IComponent component = _componentDesigner.Component;
                if (component != null) { 
                    ISite site = _componentDesigner.Component.Site; 
                    if (site != null) {
                        return site.GetService(serviceType); 
                    }
                }
            }
            return null; 
        }
        #endregion 
} 
}

// 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK