// Adds a LocalizationExtenderProvider for the component this designer is initialized to support.
        public override void Initialize(IComponent component)
        {
            base.Initialize(component);

            // If no extender from this designer is active...
            if (codeDomLocalizationProvider == null)
            {
                // Adds a LocalizationExtenderProvider that provides localization support properties to the specified component.
                codeDomLocalizationProvider = new CodeDomLocalizationProvider(component.Site, component);
                codeDomLocalizationProvider.SetLocalizable(component, true);
            }
        }
        // If a LocalizationExtenderProvider has been added, removes the extender provider.
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            // If an extender has been added, remove it
            if (codeDomLocalizationProvider != null)
            {
                // Disposes of the extender provider.  The extender
                // provider removes itself from the extender provider
                // service when it is disposed.
                codeDomLocalizationProvider.Dispose();
                codeDomLocalizationProvider = null;
            }
        }
 internal ResourcePropertyMemberCodeDomSerializer(MemberCodeDomSerializer serializer, CodeDomLocalizationProvider.LanguageExtenders extender, CodeDomLocalizationModel model)
 {
     this._serializer = serializer;
     this._extender = extender;
     this._model = model;
 }
		protected override void Initialize()
		{
			CodeDomLocalizationModel model = FormsDesigner.Gui.OptionPanels.LocalizationModelOptionsPanel.DefaultLocalizationModel;
			
			if (FormsDesigner.Gui.OptionPanels.LocalizationModelOptionsPanel.KeepLocalizationModel) {
				// Try to find out the current localization model of the designed form
				CodeDomLocalizationModel existingModel = this.GetCurrentLocalizationModelFromDesignedFile();
				if (existingModel != CodeDomLocalizationModel.None) {
					LoggingService.Debug("Determined existing localization model, using that: " + existingModel.ToString());
					model = existingModel;
				} else {
					LoggingService.Debug("Could not determine existing localization model, using default: " + model.ToString());
				}
			} else {
				LoggingService.Debug("Using default localization model: " + model.ToString());
			}
			
			CodeDomLocalizationProvider localizationProvider = new CodeDomLocalizationProvider(designerLoaderHost, model);
			IDesignerSerializationManager manager = (IDesignerSerializationManager)designerLoaderHost.GetService(typeof(IDesignerSerializationManager));
			manager.AddSerializationProvider(new SharpDevelopSerializationProvider());
			manager.AddSerializationProvider(localizationProvider);
			base.Initialize();
			
			IComponentChangeService componentChangeService = (IComponentChangeService)this.GetService(typeof(IComponentChangeService));
			if (componentChangeService != null) {
				LoggingService.Debug("Forms designer: Adding ComponentAdded handler for nested container setup");
				componentChangeService.ComponentAdded += ComponentContainerSetUp;
			} else {
				LoggingService.Warn("Forms designer: Cannot add ComponentAdded handler for nested container setup because IComponentChangeService is unavailable");
			}
		}