示例#1
0
        public SourceSupervisor(ISparkSource source)
        {
            _source = source;

            IVsHierarchy hierarchy;
            uint         itemid;
            IVsTextLines buffer;

            _source.GetDocument(out hierarchy, out itemid, out buffer);

            _path = GetDocumentPath(hierarchy, itemid);


            //Spark.Web.Mvc.SparkView
            //MyBaseView

            var settings = new VsProjectSparkSettings(hierarchy)
            {
                PageBaseType = source.GetDefaultPageBaseType()
            };

            var viewFolder = new VsProjectViewFolder(_source, hierarchy);

            _engine = new SparkViewEngine(settings)
            {
                ViewFolder = viewFolder
            };

            _grammar = new MarkupGrammar(settings);
        }
示例#2
0
        public SourceSupervisor(ISparkSource source)
        {
            _source = source;

            IVsHierarchy hierarchy;
            uint itemid;
            IVsTextLines buffer;
            _source.GetDocument(out hierarchy, out itemid, out buffer);

            _path = GetDocumentPath(hierarchy, itemid);

            //Spark.Web.Mvc.SparkView
            //MyBaseView

            var settings = new VsProjectSparkSettings(hierarchy)
                               {
                                   PageBaseType = source.GetDefaultPageBaseType()
                               };

            var viewFolder = new VsProjectViewFolder(_source, hierarchy);

            _engine = new SparkViewEngine(settings)
                          {
                              ViewFolder = viewFolder
                          };

            _grammar = new MarkupGrammar(settings);
        }
示例#3
0
        public VsProjectViewFolder(ISparkSource source, IVsHierarchy hierarchy)
        {
            _source = source;
            _hierarchy = hierarchy;

            _root = new HierarchyItem(_hierarchy, 0xfffffffe);
            var child = _root.FirstChild;
            while (child != null)
            {
                if (string.Equals(child.Name, "Views", StringComparison.InvariantCultureIgnoreCase))
                {
                    _views = child;
                    break;
                }
                child = child.NextSibling;
            }
        }
示例#4
0
        public VsProjectViewFolder(ISparkSource source, IVsHierarchy hierarchy)
        {
            _source    = source;
            _hierarchy = hierarchy;

            _root = new HierarchyItem(_hierarchy, 0xfffffffe);
            var child = _root.FirstChild;

            while (child != null)
            {
                if (string.Equals(child.Name, "Views", StringComparison.InvariantCultureIgnoreCase))
                {
                    _views = child;
                    break;
                }
                child = child.NextSibling;
            }
        }
示例#5
0
 public void OnSourceAssociated(ISparkSource pSource)
 {
     var sourceSupervisor = new SourceSupervisor(pSource);
     pSource.SetSupervisor(sourceSupervisor);
 }
示例#6
0
        public void OnSourceAssociated(ISparkSource pSource)
        {
            var sourceSupervisor = new SourceSupervisor(pSource);

            pSource.SetSupervisor(sourceSupervisor);
        }
 public Service(ISparkSource source, IElasticSink sink, IMonitor monitor)
 {
     _source = source;
     _sink = sink;
     _monitor = monitor;
 }