public MaskDesignerDialog(MaskedTextBox instance, IHelpService helpService)
 {
     if (instance == null)
     {
         this.maskedTextBox = new MaskedTextBox();
     }
     else
     {
         this.maskedTextBox = MaskedTextBoxDesigner.GetDesignMaskedTextBox(instance);
     }
     this.helpService = helpService;
     this.InitializeComponent();
     DesignerUtils.ApplyListViewThemeStyles(this.listViewCannedMasks);
     base.SuspendLayout();
     this.txtBoxMask.Text = this.maskedTextBox.Mask;
     this.AddDefaultMaskDescriptors(this.maskedTextBox.Culture);
     this.maskDescriptionHeader.Text = System.Design.SR.GetString("MaskDesignerDialogMaskDescription");
     this.maskDescriptionHeader.Width = this.listViewCannedMasks.Width / 3;
     this.dataFormatHeader.Text = System.Design.SR.GetString("MaskDesignerDialogDataFormat");
     this.dataFormatHeader.Width = this.listViewCannedMasks.Width / 3;
     this.validatingTypeHeader.Text = System.Design.SR.GetString("MaskDesignerDialogValidatingType");
     this.validatingTypeHeader.Width = ((this.listViewCannedMasks.Width / 3) - SystemInformation.VerticalScrollBarWidth) - 4;
     base.ResumeLayout(false);
     this.HookEvents();
 }
Ejemplo n.º 2
0
 public StashTabPicker(int numStashTabs, SettingsService settings, IHelpService helpService)
 {
     InitializeComponent();
     _numStashTabs = numStashTabs;
     _settings     = settings;
     _helpService  = helpService;
 }
Ejemplo n.º 3
0
        public ViewModelLoader() 
        {
            unityContainer = new UnityContainer();

            RegisterTypes();

            string kinectSetting = ConfigurationManager.AppSettings["KinectService"].ToString();
            string sourceSetting = ConfigurationManager.AppSettings["SourceService"].ToString();
            string boardSetting = ConfigurationManager.AppSettings["BoardService"].ToString();
            string helpSetting = ConfigurationManager.AppSettings["HelpService"].ToString();


            kinectService = unityContainer.Resolve<IKinectService>(kinectSetting);
            sourceService = unityContainer.Resolve<ISourceService>(sourceSetting);
            boardService = unityContainer.Resolve<IBoardService>(boardSetting);
            helpService = unityContainer.Resolve<IHelpService>(helpSetting);

            var prop = DesignerProperties.IsInDesignModeProperty; 
            var isInDesignMode = (bool)DependencyPropertyDescriptor
                .FromProperty(prop, typeof(FrameworkElement))
                .Metadata.DefaultValue; 
            
            if (!isInDesignMode) 
            { 
                kinectService.Initialize();
                sourceService.Initialize();
                helpService.Initialize();
            } 
        }
Ejemplo n.º 4
0
 private void ShowHelp()
 {
     if (this.serviceProvider != null)
     {
         IHelpService service = this.serviceProvider.GetService(typeof(IHelpService)) as IHelpService;
         if (service != null)
         {
             service.ShowHelpFromKeyword(base.GetType().FullName + ".UI");
         }
         else
         {
             IUIService service2 = this.serviceProvider.GetService(typeof(IUIService)) as IUIService;
             if (service2 != null)
             {
                 service2.ShowError(Messages.NoHelp);
             }
         }
     }
     else
     {
         IUIService service3 = (IUIService)this.GetService(typeof(IUIService));
         if (service3 != null)
         {
             service3.ShowError(Messages.NoHelp);
         }
     }
 }
        private void AutoFormat_HelpRequested(object sender, HelpEventArgs e)
        {
            if (dgrid == null || dgrid.Site == null)
            {
                return;
            }
            IDesignerHost host = dgrid.Site.GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (host == null)
            {
                Debug.Fail("Unable to get IDesignerHost.");
                return;
            }

            IHelpService helpService = host.GetService(typeof(IHelpService)) as IHelpService;

            if (helpService != null)
            {
                helpService.ShowHelpFromKeyword("vs.DataGridAutoFormatDialog");
            }
            else
            {
                Debug.Fail("Unable to get IHelpService.");
            }
        }
Ejemplo n.º 6
0
 public MaskDesignerDialog(MaskedTextBox instance, IHelpService helpService)
 {
     if (instance == null)
     {
         this.maskedTextBox = new MaskedTextBox();
     }
     else
     {
         this.maskedTextBox = MaskedTextBoxDesigner.GetDesignMaskedTextBox(instance);
     }
     this.helpService = helpService;
     this.InitializeComponent();
     DesignerUtils.ApplyListViewThemeStyles(this.listViewCannedMasks);
     base.SuspendLayout();
     this.txtBoxMask.Text = this.maskedTextBox.Mask;
     this.AddDefaultMaskDescriptors(this.maskedTextBox.Culture);
     this.maskDescriptionHeader.Text  = System.Design.SR.GetString("MaskDesignerDialogMaskDescription");
     this.maskDescriptionHeader.Width = this.listViewCannedMasks.Width / 3;
     this.dataFormatHeader.Text       = System.Design.SR.GetString("MaskDesignerDialogDataFormat");
     this.dataFormatHeader.Width      = this.listViewCannedMasks.Width / 3;
     this.validatingTypeHeader.Text   = System.Design.SR.GetString("MaskDesignerDialogValidatingType");
     this.validatingTypeHeader.Width  = ((this.listViewCannedMasks.Width / 3) - SystemInformation.VerticalScrollBarWidth) - 4;
     base.ResumeLayout(false);
     this.HookEvents();
 }
 public WendingMachineService(IWendingMachineRepository wendingMachineRepository, IDrinksRepository drinksRepository, IDrinkService drinkService, IHelpService helpService)
 {
     _wendingMachineRepository = wendingMachineRepository;
     _drinksRepository         = drinksRepository;
     _drinkService             = drinkService;
     _helpService = helpService;
 }
 public TranslationService(IConnectionFactory connection, ICacheService cache, IHttpContextAccessor httpContextAccessor, IHelpService help)
 {
     connectionFactory = connection;
     cacheService      = cache;
     httpContext       = httpContextAccessor.HttpContext;
     helpService       = help;
 }
Ejemplo n.º 9
0
        /// <summary>
        ///  Gets the mask property value from the MaskDesignerDialog.
        /// </summary>
        /// <remarks>
        ///  <para>
        ///   The <see cref="IUIService"/> is used to show the mask designer dialog within VS so it doesn't get
        ///   blocked if focus is moved to another app.
        ///  </para>
        /// </remarks>
        internal static string EditMask(
            ITypeDiscoveryService discoveryService,
            IUIService uiService,
            MaskedTextBox instance,
            IHelpService helpService)
        {
            Debug.Assert(instance is not null, "Null masked text box.");
            string mask = null;

            // Launching modal dialog in System aware mode.
            using MaskDesignerDialog dialog = DpiHelper.CreateInstanceInSystemAwareContext(
                      () => new MaskDesignerDialog(instance, helpService));

            dialog.DiscoverMaskDescriptors(discoveryService);  // fine if service is null.

            // Show dialog from VS.
            DialogResult result = uiService is not null?uiService.ShowDialog(dialog) : dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                mask = dialog.Mask;

                // ValidatingType is not browsable so we don't need to set the property through the designer.
                if (dialog.ValidatingType != instance.ValidatingType)
                {
                    instance.ValidatingType = dialog.ValidatingType;
                }
            }

            // Will return null if dlgResult != OK.
            return(mask);
        }
Ejemplo n.º 10
0
        public ViewModelLoader()
        {
            unityContainer = new UnityContainer();

            RegisterTypes();

            string kinectSetting = ConfigurationManager.AppSettings["KinectService"].ToString();
            string sourceSetting = ConfigurationManager.AppSettings["SourceService"].ToString();
            string boardSetting  = ConfigurationManager.AppSettings["BoardService"].ToString();
            string helpSetting   = ConfigurationManager.AppSettings["HelpService"].ToString();


            kinectService = unityContainer.Resolve <IKinectService>(kinectSetting);
            sourceService = unityContainer.Resolve <ISourceService>(sourceSetting);
            boardService  = unityContainer.Resolve <IBoardService>(boardSetting);
            helpService   = unityContainer.Resolve <IHelpService>(helpSetting);

            var prop           = DesignerProperties.IsInDesignModeProperty;
            var isInDesignMode = (bool)DependencyPropertyDescriptor
                                 .FromProperty(prop, typeof(FrameworkElement))
                                 .Metadata.DefaultValue;

            if (!isInDesignMode)
            {
                kinectService.Initialize();
                sourceService.Initialize();
                helpService.Initialize();
            }
        }
Ejemplo n.º 11
0
 private void ShowHelp()
 {
     if (serviceProvider != null)
     {
         IHelpService helpService = serviceProvider.GetService(typeof(IHelpService)) as IHelpService;
         if (helpService != null)
         {
             helpService.ShowHelpFromKeyword(this.GetType().FullName + ".UI");
         }
         else
         {
             IUIService uisvc = serviceProvider.GetService(typeof(IUIService)) as IUIService;
             if (uisvc != null)
             {
                 uisvc.ShowError(Messages.NoHelp);
             }
         }
     }
     else
     {
         IUIService uisvc = (IUIService)GetService(typeof(IUIService));
         if (uisvc != null)
         {
             uisvc.ShowError(Messages.NoHelp);
         }
     }
 }
Ejemplo n.º 12
0
 public BackupSettings(IPlayerItemDao playerItemDao, SettingsService settings, IHelpService helpService)
 {
     InitializeComponent();
     _playerItemDao = playerItemDao;
     _settings      = settings;
     _helpService   = helpService;
 }
Ejemplo n.º 13
0
 public HelpModule(DiscordSocketClient client, CommandService commands, IHelpService help, DataService data)
 {
     _client   = client;
     _commands = commands;
     _help     = help;
     _data     = data;
 }
Ejemplo n.º 14
0
        public VMIContextViewModel( IContext context, IPluginConfigAccessor config, ILogService logService, IHelpService helpService )
        {
            DisplayName = "Object explorer";

            Context = context;
            Config = config;
            HelpService = helpService;

            InitializeCommands();

            _plugins = new Dictionary<IPluginInfo, VMIPlugin>();
            _allServices = new Dictionary<IServiceInfo, VMIService>();
            _dynamicServices = new Dictionary<IServiceInfo, VMIService>();
            _serviceRefs = new Dictionary<IServiceReferenceInfo, VMIService>();
            _assemblies = new Dictionary<IAssemblyInfo, VMIAssembly>();

            _pluginRunner = Context.GetService<PluginRunner>( true );
            _pluginRunner.ApplyDone += new EventHandler<ApplyDoneEventArgs>( OnApplyDone );

            NotificationService = context.GetService<INotificationService>();

            Assemblies = new VMCollection<VMIAssembly, IAssemblyInfo>( PluginRunner.Discoverer.AllAssemblies, FindOrCreate );
            Plugins = new VMCollection<VMIPlugin, IPluginInfo>( PluginRunner.Discoverer.AllPlugins.OrderBy( p => p.PublicName ), FindOrCreate );
            AllServices = new VMCollection<VMIService, IServiceInfo>( PluginRunner.Discoverer.AllServices, FindOrCreate );
            DynamicServices = new VMCollection<VMIService, IServiceInfo>( PluginRunner.Discoverer.AllServices.Where( p => p.IsDynamicService ), FindOrCreateDynamic );
            Categories = new ObservableCollection<VMIFolder>();

            _vmLogConfig = new VMLogConfig( this, logService );
            _vmLogConfig.Initialize();

            OsInfo = new VMOSInfo( this );

            VMApplicationInfo = new VMApplicationInfo( this );

            Dictionary<string, List<IPluginInfo>> categoryFolders = new Dictionary<string, List<IPluginInfo>>();
            foreach( IPluginInfo plugin in PluginRunner.Discoverer.AllPlugins )
            {
                foreach( string categ in plugin.Categories )
                {
                    List<IPluginInfo> col;
                    if( !categoryFolders.TryGetValue( categ, out col ) )
                    {
                        col = new List<IPluginInfo>();
                        col.Add( plugin );
                        categoryFolders.Add( categ, col );
                    }
                    else
                    {
                        col.Add( plugin );
                    }
                }
            }
            foreach( KeyValuePair<string, List<IPluginInfo>> item in categoryFolders )
            {
                VMCollection<VMAlias<VMIPlugin>, IPluginInfo> collection = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( item.Value, ( info ) => { return new VMAlias<VMIPlugin>( FindOrCreate( info ), null ); } );
                VMIFolder folder = new VMIFolder( collection, item.Key );
                Categories.Add( folder );
            }
        }
Ejemplo n.º 15
0
 public HelpController(IHelpService helpService,
                       ILoggerFactory loggerProvider, ExtendedUserManager userManager, ReferenceData referenceData)
 {
     _helpService   = helpService;
     _userManager   = userManager;
     _referenceData = referenceData;
     _logger        = loggerProvider.CreateLogger <HelpController>();
 }
Ejemplo n.º 16
0
 public LanguageController(ITranslationService service, UserManager <OpalUser> userManager, SignInManager <OpalUser> signInManager, IHelpService help, IMemoryCache memoryCache)
 {
     translationService = service;
     _userManager       = userManager;
     _signInManager     = signInManager;
     helpService        = help;
     cache = memoryCache;
 }
Ejemplo n.º 17
0
 public AccountController(IFriendService frS, IAccountService serv, IMessageService mesSer, IHelpService h)
 {
     Helper        = h;
     messService   = mesSer;
     friendService = frS;
     userService   = serv;
     Mapper        = AutoMapperWEBConfig.Mapper;
 }
Ejemplo n.º 18
0
        private void BindingFormattingDialog_HelpRequestHandled()
        {
            IHelpService service = this.context.GetService(typeof(IHelpService)) as IHelpService;

            if (service != null)
            {
                service.ShowHelpFromKeyword("vs.BindingFormattingDialog");
            }
        }
        internal void ShowHelp()
        {
            IHelpService service = this.GetService(typeof(IHelpService)) as IHelpService;

            if (service != null)
            {
                service.ShowHelpFromKeyword(HELP_KEYWORD);
            }
        }
        private void DataGridViewAddColumnDialog_HelpRequestHandled()
        {
            IHelpService service = this.liveDataGridView.Site.GetService(iHelpServiceType) as IHelpService;

            if (service != null)
            {
                service.ShowHelpFromKeyword("vs.DataGridViewAddColumnDialog");
            }
        }
Ejemplo n.º 21
0
 public TransferStashService2(IPlayerItemDao playerItemDao, TransferStashServiceCache cache, TransferStashService transferStashService, SafeTransferStashWriter stashWriter, SettingsService settings, IHelpService helpService)
 {
     _playerItemDao        = playerItemDao;
     _cache                = cache;
     _transferStashService = transferStashService;
     _stashWriter          = stashWriter;
     _settings             = settings;
     _helpService          = helpService;
 }
Ejemplo n.º 22
0
        private void ShowHelp()
        {
            IHelpService service = (IHelpService)this.calendar.Site.GetService(typeof(IHelpService));

            if (service != null)
            {
                service.ShowHelpFromKeyword("net.Asp.Calendar.AutoFormat");
            }
        }
Ejemplo n.º 23
0
 public HelpController(IHelpService helpService, ILinkService linkService)
 {
     _HelpService  = helpService;
     _ILinkService = linkService;
     helpDetails   = _HelpService.GetHelps(new HelpSearchView()
     {
         HelpCode = HelpCode.HelpCenter
     }, 1, 20).ToList();
 }
Ejemplo n.º 24
0
        public override void ShowHelp()
        {
            IHelpService service = (IHelpService)base.GetSelectedComponent().Site.GetService(typeof(IHelpService));

            if (service != null)
            {
                service.ShowHelpFromKeyword(this.HelpKeyword);
            }
        }
Ejemplo n.º 25
0
        private void ShowHelp()
        {
            IHelpService service = (IHelpService)this.site.GetService(typeof(IHelpService));

            if (service != null)
            {
                service.ShowHelpFromKeyword("net.Asp.RegularExpressionEditor");
            }
        }
Ejemplo n.º 26
0
        private void FormatStringDialog_HelpRequestHandled()
        {
            IHelpService service1 = this.context.GetService(typeof(IHelpService)) as IHelpService;

            if (service1 != null)
            {
                service1.ShowHelpFromKeyword("vs.FormatStringDialog");
            }
        }
        private void DataGridViewCellStyleBuilder_HelpRequestHandled()
        {
            IHelpService service = this.context.GetService(typeof(IHelpService)) as IHelpService;

            if (service != null)
            {
                service.ShowHelpFromKeyword("vs.CellStyleDialog");
            }
        }
        private void OnClickHelpButton(object source, EventArgs e)
        {
            IHelpService helpService = (IHelpService)this.component.Site.GetService(typeof(IHelpService));

            if (helpService != null)
            {
                helpService.ShowHelpFromKeyword(HELP_KEYWORD);
            }
        }
Ejemplo n.º 29
0
        /// <summary>
        ///  Called when it is time for the tab order UI to go away.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (region != null)
                {
                    region.Dispose();
                    region = null;
                }

                if (host != null)
                {
                    IOverlayService os = (IOverlayService)host.GetService(typeof(IOverlayService));
                    if (os != null)
                    {
                        os.RemoveOverlay(this);
                    }

                    IEventHandlerService ehs = (IEventHandlerService)host.GetService(typeof(IEventHandlerService));
                    if (ehs != null)
                    {
                        ehs.PopHandler(this);
                    }

                    IMenuCommandService mcs = (IMenuCommandService)host.GetService(typeof(IMenuCommandService));
                    if (mcs != null)
                    {
                        foreach (MenuCommand mc in newCommands)
                        {
                            mcs.RemoveCommand(mc);
                        }
                    }

                    // We sync add, remove and change events so we remain in sync with any nastiness that the
                    // form may pull on us.
                    //
                    IComponentChangeService cs = (IComponentChangeService)host.GetService(typeof(IComponentChangeService));
                    if (cs != null)
                    {
                        cs.ComponentAdded   -= new ComponentEventHandler(OnComponentAddRemove);
                        cs.ComponentRemoved -= new ComponentEventHandler(OnComponentAddRemove);
                        cs.ComponentChanged -= new ComponentChangedEventHandler(OnComponentChanged);
                    }

                    IHelpService hs = (IHelpService)host.GetService(typeof(IHelpService));
                    if (hs != null)
                    {
                        hs.RemoveContextAttribute("Keyword", "TabOrderView");
                    }

                    host = null;
                }
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 30
0
        private void ShowHelpTopic()
        {
            Debug.Assert(_site != null);
            IHelpService helpService = (IHelpService)_site.GetService(typeof(IHelpService));

            if (helpService != null)
            {
                helpService.ShowHelpFromKeyword("net.Mobile.TemplatingOptionsDialog");
            }
        }
 public MaskedTextBoxDesignerActionList(MaskedTextBoxDesigner designer) : base(designer.Component)
 {
     this.maskedTextBox = (MaskedTextBox) designer.Component;
     this.discoverySvc = base.GetService(typeof(ITypeDiscoveryService)) as ITypeDiscoveryService;
     this.uiSvc = base.GetService(typeof(IUIService)) as IUIService;
     this.helpService = base.GetService(typeof(IHelpService)) as IHelpService;
     if (this.discoverySvc != null)
     {
         IUIService uiSvc = this.uiSvc;
     }
 }
Ejemplo n.º 32
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider is null)
            {
                return(value);
            }

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc is null)
            {
                return(value);
            }

            if (_linkAreaUI is null)
            {
                IHelpService helpService = (IHelpService)provider.GetService(typeof(IHelpService));

                // child modal dialog -launching in System Aware mode
                _linkAreaUI = DpiHelper.CreateInstanceInSystemAwareContext(() => new LinkAreaUI(this, helpService));
            }

            string             text = string.Empty;
            PropertyDescriptor prop = null;

            if (context != null && context.Instance != null)
            {
                prop = TypeDescriptor.GetProperties(context.Instance)["Text"];
                if (prop != null && prop.PropertyType == typeof(string))
                {
                    text = (string)prop.GetValue(context.Instance);
                }
            }

            string originalText = text;

            _linkAreaUI.SampleText = text;
            _linkAreaUI.Start(edSvc, value);

            if (edSvc.ShowDialog(_linkAreaUI) == DialogResult.OK)
            {
                value = _linkAreaUI.Value;

                text = _linkAreaUI.SampleText;
                if (!originalText.Equals(text) && prop != null && prop.PropertyType == typeof(string))
                {
                    prop.SetValue(context.Instance, text);
                }
            }

            _linkAreaUI.End();

            return(value);
        }
Ejemplo n.º 33
0
 private void OnClickHelpButton(object source, EventArgs e)
 {
     if (this.provider != null)
     {
         IHelpService helpService = (IHelpService)provider.GetService(typeof(IHelpService));
         if (helpService != null)
         {
             helpService.ShowHelpFromKeyword(HELP_KEYWORD);
         }
     }
 }
Ejemplo n.º 34
0
 private void ShowHelp()
 {
     if (this.ServiceProvider != null)
     {
         IHelpService service = (IHelpService)this.ServiceProvider.GetService(typeof(IHelpService));
         if (service != null)
         {
             service.ShowHelpFromKeyword(this.HelpTopic);
         }
     }
 }
 public DataGridViewCellStyleBuilder(IServiceProvider serviceProvider, IComponent comp)
 {
     this.InitializeComponent();
     this.InitializeGrids();
     this.listenerDataGridView = new DataGridView();
     this.serviceProvider = serviceProvider;
     this.comp = comp;
     if (this.serviceProvider != null)
     {
         this.helpService = (IHelpService) serviceProvider.GetService(typeof(IHelpService));
     }
     this.cellStyleProperties.Site = new DataGridViewComponentPropertyGridSite(serviceProvider, comp);
 }
 internal static string EditMask(ITypeDiscoveryService discoverySvc, IUIService uiSvc, MaskedTextBox instance, IHelpService helpService)
 {
     string mask = null;
     using (MaskDesignerDialog dialog = new MaskDesignerDialog(instance, helpService))
     {
         dialog.DiscoverMaskDescriptors(discoverySvc);
         DialogResult result = (uiSvc != null) ? uiSvc.ShowDialog(dialog) : dialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             mask = dialog.Mask;
             if (dialog.ValidatingType != instance.ValidatingType)
             {
                 instance.ValidatingType = dialog.ValidatingType;
             }
         }
     }
     return mask;
 }
Ejemplo n.º 37
0
        internal static IShapeDescriptor EditShape(IUIService uiService, object instance, IHelpService helpService, object currentValue)
        {
#if FRAMEWORK20
            ShapeEditorForm editor = new ShapeEditorForm();
            editor.Value = currentValue as IShapeDescriptor;
            if (uiService != null)
                uiService.ShowDialog(editor);
            else
                editor.ShowDialog();

            if (editor.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                currentValue = editor.Value;
            }

            editor.Dispose();

#endif
			return currentValue as IShapeDescriptor;
        }
Ejemplo n.º 38
0
        public ViewModel(IKinectService kinectService, ISourceService sourceService, IBoardService boardService, IHelpService helpService) 
        {
            user = new UserState();

            idleJobQueue = new Queue<Action>();

            this.helpService = helpService;
            this.helpService.NewHelpMessage += new EventHandler<HelpMessageEventArgs>(helpService_NewHelpMessage);

            this.kinectService = kinectService; 

            this.sourceService = sourceService;
            this.sourceService.EventsUpdated += new EventHandler<SourceEventArgs>(sourceService_EventsUpdated);

            this.boardService = boardService;
            this.boardService.BoardsUpdated += new EventHandler(boardService_BoardsChanged);

            appIdleTimer = new DispatcherTimer();
            appIdleTimer.Interval = TimeSpan.FromMinutes(1);
            appIdleTimer.Tick += new EventHandler(appIdle_Tick);
            appIdleTimer.Start();
        }
Ejemplo n.º 39
0
 public HelpController(IHelpService helpService)
 {
     _helpService = helpService;
 }
Ejemplo n.º 40
0
		public void RemoveLocalContext(IHelpService localContext)
		{
		}
 public LinkAreaUI(LinkAreaEditor editor, IHelpService helpService)
 {
     this.editor = editor;
     this.helpService = helpService;
     this.InitializeComponent();
 }
Ejemplo n.º 42
0
        protected override void Dispose(bool disposing) {
            if (disposing) {
                Debug.WriteLineIf(CompModSwitches.DebugGridView.TraceVerbose,  "PropertyGridView:Dispose");
                if (scrollBar != null) scrollBar.Dispose();
                if (listBox != null) listBox.Dispose();
                if (dropDownHolder != null) dropDownHolder.Dispose();
                scrollBar = null;
                listBox = null;
                dropDownHolder = null;

                ownerGrid = null;
                topLevelGridEntries = null;
                allGridEntries = null;
                serviceProvider = null;
                
                topHelpService = null;

                if (helpService != null && helpService is IDisposable)
                    ((IDisposable)helpService).Dispose();

                helpService = null;

                if (edit != null) {
                    edit.Dispose();
                    edit = null;
                }

                if (fontBold != null) {
                    fontBold.Dispose();
                    fontBold = null;

                }

                if (btnDropDown != null) {
                    btnDropDown.Dispose();
                    btnDropDown = null;
                }

                if (btnDialog != null) {
                    btnDialog.Dispose();
                    btnDialog = null;
                }

                if (toolTip != null) {
                    toolTip.Dispose();
                    toolTip = null;
                }
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 43
0
 void IHelpService.RemoveLocalContext(IHelpService localContext)
 {
   if ((_SubContextList != null) && (_SubContextList.IndexOf(localContext) != -1))
   {
     _SubContextList.Remove(localContext);
     if (_Context != null)
     {
       NativeMethods.ThrowOnFailure(_Context.RemoveSubcontext(((HelpService) localContext)._Cookie));
     }
     ((HelpService) localContext)._ParentService = null;
   }
 }
Ejemplo n.º 44
0
        //****
        //****
        //**** IDisposable Implementation
        //****
        //****

        ///     Disposes of the DesignContainer.  This cleans up any objects we may be holding
        ///     and removes any services that we created.
        public void Dispose() {
        
            // Dispose the loader before destroying the designer.  Otherwise, the
            // act of destroying all the components on the designer surface will
            // be reflected in the loader, deleting the user's file.
            if (designerLoader != null) {
                try 
                {
                    designerLoader.Flush();
                }
                catch (Exception e1) 
                {
                    Debug.Fail("Designer loader '" + designerLoader.GetType().Name + "' threw during Flush: " + e1.ToString());
                    e1 = null;
                }

                try {
                    designerLoader.Dispose();
                }
                catch (Exception e2) {
                    Debug.Fail("Designer loader '" + designerLoader.GetType().Name + "' threw during Dispose: " + e2.ToString());
                    e2 = null;
                }
                designerLoader = null;
            }

            // Unload the document.
            UnloadDocument();

            // No services after this!
            serviceContainer = null;

            // Now tear down all of our services.
            if (menuEditorService != null) {
                IDisposable d = menuEditorService as IDisposable;
                if (d != null) d.Dispose();
                menuEditorService = null ;
            }

            if (selectionService != null) {
                IDisposable d = selectionService as IDisposable;
                if (d != null) d.Dispose();
                selectionService = null;
            }

            if (menuCommandService != null) {
                IDisposable d = menuCommandService as IDisposable;
                if (d != null) d.Dispose();
                menuCommandService = null;
            }

			if (toolboxService != null) 
			{
				IDisposable d = toolboxService as IDisposable;
				if (d != null) d.Dispose();
				toolboxService = null;
			}

            if (helpService != null) {
                IDisposable d = helpService as IDisposable;
                if (d != null) d.Dispose();
                helpService = null;
            }

            if (referenceService != null) {
                IDisposable d = referenceService as IDisposable;
                if (d != null) d.Dispose();
                referenceService = null;
            }

            // Destroy our document window.
            if (documentWindow != null) {
                documentWindow.Dispose();
                documentWindow = null;
            }
        }
Ejemplo n.º 45
0
 public ViewHelpViewModel(INavigationService navigationService, IHelpService helpService)
 {
     this.navigationService = navigationService;
     this.helpService = helpService;
 }
 private IHelpService GetHelpService()
 {
     if ((this.helpService == null) && (this.ServiceProvider != null))
     {
         this.topHelpService = (IHelpService) this.ServiceProvider.GetService(typeof(IHelpService));
         if (this.topHelpService != null)
         {
             IHelpService service = this.topHelpService.CreateLocalContext(HelpContextType.ToolWindowSelection);
             if (service != null)
             {
                 this.helpService = service;
             }
         }
     }
     return this.helpService;
 }
Ejemplo n.º 47
0
 /// <devdoc>
 ///     Removes a context that was created with CreateLocalContext
 /// </devdoc>
 void IHelpService.RemoveLocalContext(IHelpService localContext) {
     if (subContextList == null) {
         return;
     }
     
     int index = subContextList.IndexOf(localContext);
     if (index != -1) {
         subContextList.Remove(localContext);
         if (context != null) {
             NativeMethods.ThrowOnFailure( context.RemoveSubcontext(((HelpService)localContext).cookie) );
         }
         ((HelpService)localContext).parentService = null;
     }
 }
Ejemplo n.º 48
0
 // Methods
 internal static string EditMask(ITypeDiscoveryService discoverySvc, IUIService uiSvc, MaskedTextBoxAdv instance, IHelpService helpService)
 {
     string mask = null;
     Type formType = Type.GetType("System.Windows.Forms.Design.MaskDesignerDialog, System.Design, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
     ConstructorInfo ci = formType.GetConstructor(new Type[] { typeof(MaskedTextBox), typeof(IHelpService) });
     Form form = ci.Invoke(new object[]{instance.MaskedTextBox, helpService}) as Form;
     
     try
     {
         MethodInfo mi = formType.GetMethod("DiscoverMaskDescriptors");
         mi.Invoke(form, new object[]{discoverySvc});
         //form.DiscoverMaskDescriptors(discoverySvc);
         DialogResult result = (uiSvc != null) ? uiSvc.ShowDialog(form) : form.ShowDialog();
         if (result == DialogResult.OK)
         {
             PropertyInfo pi = formType.GetProperty("Mask");
             mask = (string)pi.GetValue(form, null);
             pi = formType.GetProperty("ValidatingType");
             Type validatingType = pi.GetValue(form, null) as Type;
             //mask = form.Mask;
             if (validatingType == instance.ValidatingType)
             {
                 return mask;
             }
             instance.ValidatingType = validatingType;
         }
     }
     finally
     {
         form.Dispose();
     }
     return mask;
 }
Ejemplo n.º 49
0
 private IHelpService GetHelpService() {
     if (helpService == null && ServiceProvider != null) {
         topHelpService = (IHelpService)ServiceProvider.GetService(typeof(IHelpService));
         if (topHelpService != null) {
              IHelpService localHelpService = topHelpService.CreateLocalContext(HelpContextType.ToolWindowSelection);
              if (localHelpService != null) {
                 helpService = localHelpService;
              }
         }
     }
     return helpService;
 }
Ejemplo n.º 50
0
 private void UpdateHelpAttributes(IHelpService helpSvc, GridEntry entry, bool addAsF1) {
     if (entry == null) {
        return;
     }
     
     UpdateHelpAttributes(helpSvc, entry.ParentGridEntry, false);
     string helpKeyword = entry.HelpKeyword;
     if (helpKeyword != null) {
        helpSvc.AddContextAttribute("Keyword", helpKeyword, addAsF1 ? HelpKeywordType.F1Keyword : HelpKeywordType.GeneralKeyword);
     }
 }
 public void Dispose()
 {
     IDisposable d;
     if (this.designerLoader != null)
     {
         try
         {
             this.designerLoader.Flush();
         }
         catch (Exception e1)
         {
             Debug.Fail("Designer loader '" + this.designerLoader.GetType().Name + "' threw during Flush: " + e1.ToString());
             e1 = null;
         }
         try
         {
             this.designerLoader.Dispose();
         }
         catch (Exception e2)
         {
             Debug.Fail("Designer loader '" + this.designerLoader.GetType().Name + "' threw during Dispose: " + e2.ToString());
             e2 = null;
         }
         this.designerLoader = null;
     }
     this.UnloadDocument();
     this.serviceContainer = null;
     if (this.menuEditorService != null)
     {
         d = this.menuEditorService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.menuEditorService = null;
     }
     if (this.selectionService != null)
     {
         d = this.selectionService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.selectionService = null;
     }
     if (this.menuCommandService != null)
     {
         d = this.menuCommandService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.menuCommandService = null;
     }
     if (this.toolboxService != null)
     {
         d = this.toolboxService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.toolboxService = null;
     }
     if (this.helpService != null)
     {
         d = this.helpService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.helpService = null;
     }
     if (this.referenceService != null)
     {
         d = this.referenceService as IDisposable;
         if (d != null)
         {
             d.Dispose();
         }
         this.referenceService = null;
     }
     if (this.documentWindow != null)
     {
         this.documentWindow.Dispose();
         this.documentWindow = null;
     }
 }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.scrollBar != null)
         {
             this.scrollBar.Dispose();
         }
         if (this.listBox != null)
         {
             this.listBox.Dispose();
         }
         if (this.dropDownHolder != null)
         {
             this.dropDownHolder.Dispose();
         }
         this.scrollBar = null;
         this.listBox = null;
         this.dropDownHolder = null;
         this.ownerGrid = null;
         this.topLevelGridEntries = null;
         this.allGridEntries = null;
         this.serviceProvider = null;
         this.topHelpService = null;
         if ((this.helpService != null) && (this.helpService is IDisposable))
         {
             ((IDisposable) this.helpService).Dispose();
         }
         this.helpService = null;
         if (this.edit != null)
         {
             this.edit.Dispose();
             this.edit = null;
         }
         if (this.fontBold != null)
         {
             this.fontBold.Dispose();
             this.fontBold = null;
         }
         if (this.btnDropDown != null)
         {
             this.btnDropDown.Dispose();
             this.btnDropDown = null;
         }
         if (this.btnDialog != null)
         {
             this.btnDialog.Dispose();
             this.btnDialog = null;
         }
         if (this.toolTip != null)
         {
             this.toolTip.Dispose();
             this.toolTip = null;
         }
     }
     base.Dispose(disposing);
 }