Exemplo n.º 1
0
        public int FDoIdle(uint grfidlef)
        {
            PuppetLanguageService ls = GetService(typeof(PuppetLanguageService)) as PuppetLanguageService;

            if (ls != null)
            {
                ls.OnIdle((grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0);
            }

            return(0);
        }
Exemplo n.º 2
0
        protected PuppetPackage()
        {
            ServiceCreatorCallback callback = new ServiceCreatorCallback(
                delegate(IServiceContainer container, Type serviceType)
            {
                if (typeof(PuppetLanguageService) == serviceType)
                {
                    PuppetLanguageService language = new PuppetLanguageService();
                    language.SetSite(this);

                    // register for idle time callbacks
                    IOleComponentManager mgr = GetService(typeof(SOleComponentManager)) as IOleComponentManager;
                    if (componentID == 0 && mgr != null)
                    {
                        OLECRINFO[] crinfo = new OLECRINFO[1];
                        crinfo[0].cbSize   = (uint)Marshal.SizeOf(typeof(OLECRINFO));
                        crinfo[0].grfcrf   = (uint)_OLECRF.olecrfNeedIdleTime |
                                             (uint)_OLECRF.olecrfNeedPeriodicIdleTime;
                        crinfo[0].grfcadvf = (uint)_OLECADVF.olecadvfModal |
                                             (uint)_OLECADVF.olecadvfRedrawOff |
                                             (uint)_OLECADVF.olecadvfWarningsOff;
                        crinfo[0].uIdleTimeInterval = 1000;
                        int hr = mgr.FRegisterComponent(this, crinfo, out componentID);
                    }

                    return(language);
                }
                else
                {
                    return(null);
                }
            });

            // proffer the LanguageService
            (this as IServiceContainer).AddService(typeof(PuppetLanguageService), callback, true);
        }
Exemplo n.º 3
0
 public LineScanner(PuppetLanguageService service)
 {
     this.lex     = new Puppet.Lexer.Scanner();
     this.service = service;
 }
 public PuppetSource(PuppetLanguageService service, IVsTextLines textLines, Colorizer colorizer)
     : base(service, textLines, colorizer)
 {
 }