Discussion Group
Commented Issue: SparkSense throws an exception whenever it runs [6846]
279 ERROR System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgume ntException(ExceptionResource resource) at System.Collections.Generic.Dic tionary`2.Insert(TKey key, TValue value, Boolean add) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.BuildViewMapFromProjectEn vironment() at SparkSense.Parsing.ProjectExpl orer.get_ProjectViewFolder() at SparkSense.Parsing.ProjectExpl orer.GetViewFolder() at SparkSense.Parsing.ViewExplore r.InitCurrentView() at SparkSense.Parsing.ViewExplore r..ctor(IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionSource..ctor(ITextB uffer textBuffer, IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionListe
Commented Issue: SparkSense throws an exception whenever it runs [6846]
279 ERROR System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgume ntException(ExceptionResource resource) at System.Collections.Generic.Dic tionary`2.Insert(TKey key, TValue value, Boolean add) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.BuildViewMapFromProjectEn vironment() at SparkSense.Parsing.ProjectExpl orer.get_ProjectViewFolder() at SparkSense.Parsing.ProjectExpl orer.GetViewFolder() at SparkSense.Parsing.ViewExplore r.InitCurrentView() at SparkSense.Parsing.ViewExplore r..ctor(IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionSource..ctor(ITextB uffer textBuffer, IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionListe
Re: Special node use had no understandable attributes
I've made this really simple now, and copied both the
Application.spark and the view into another project and they work
fine.
So it must be something gone weird with the project. One thing worth
mentioning perhaps, I have two MVC2 projects in the same solution, one
of them is working, the other isn't.
Special node use had no understandable attributes
I'm getting this error message: "Special node use had no
understandable attributes"
Which suggests to me that I'm using the use tag with some incorrect
attributes.
However, I've swapped the Application.spark for one from another
simple app that works, and edited the view so it only has one line of
RE: HTML method and Html property in SparkView class
The upper-case HTML(x) method is when you have any value 'x' that you're explicitly stating is already html, and shouldn't be encoded.
Like a string Body that is known to contain markup you'd have ${HTML(Body)}
The name came from xhp's HTML() function. See [link] section "Escaping".
HTML method and Html property in SparkView class
In the SparkView class from the System.Web.Mvc assembly there is a
property called Html. There is also a method called HTML, which is a
problem if your using a case insensitive language.
I don't suppose the method could be renamed in a future version ?
Cheers,
John
RE: class keyword
There was an question about using spark as a template engine to output csharp source code - but the elements that look natural in an html or xml template look really out of place in a csharp file.
So that was an example of looking into creating an entirely different cs-file-friendly syntax. That syntax wouldn't need to understand elements and attributes at all - probably based more on something that looked like specialized comments.
Re: class keyword
Thanks for the suggestions. I went with my own SyntaxProvider which
was a copy of DefaultSyntaxProvider, that allowed me to replace
MarkupGrammer with my own were I removed the .Or(Swap(Ch("class"),
"@class"));
I noticed there was also a CSharpSyntaxProvider but that doesn't
appear to be referenced anywhere. Do you think in the future syntax
Re: Visual Studio intellisense
Re: Visual Studio intellisense
Thanks,
Sedat
ISparkExtension and adding attributes to IList<Node> in VisitNode
VisitNode in a custom ISparkExtension. This is code I am currently
trying but after adding the attribute to the tree and called
visitor.Accept(body), the attribute is not being written out at the
time of rendering.
var inputTags = body.Where(n => n is ElementNode && ((ElementNode)
Warning as Error
compilation error:
c:\source\blah.spark(24,205): error CS0618: Warning as Error:
'Foo.Bah(string)' is obsolete: 'use baz.'
This has only happened since upgrading from spark 1.0 and mvc 1 to
spark 1.1 and mvc 2. Does anyone know how to supress the error?
Re: Visual Studio intellisense
Henning
Re: Visual Studio intellisense
I saw the issue raised and I'll look into it. As I said in the blog post,
custom namespace prefixes are not yet supported but will be very soon.
The activitylog.xml only shows up if you run VS with the /log option from
the command line. But you should have to do that since those exceptions are
Re: Visual Studio intellisense
I couldn't get it working though. Whenever I type "${" or "<s:" (our
spark namespace), extension throws an exception. (there is no
"activitylog.xml" generated in the given directory)
I'll try to file a bug :)
Sedat
Created Issue: SparkSense throws an exception whenever it runs [6846]
279 ERROR System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgume ntException(ExceptionResource resource) at System.Collections.Generic.Dic tionary`2.Insert(TKey key, TValue value, Boolean add) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.ScanProjectItemForViews(P rojectItem projectItem) at SparkSense.Parsing.ProjectExpl orer.BuildViewMapFromProjectEn vironment() at SparkSense.Parsing.ProjectExpl orer.get_ProjectViewFolder() at SparkSense.Parsing.ProjectExpl orer.GetViewFolder() at SparkSense.Parsing.ViewExplore r.InitCurrentView() at SparkSense.Parsing.ViewExplore r..ctor(IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionSource..ctor(ITextB uffer textBuffer, IProjectExplorer projectExplorer) at SparkSense.StatementCompletion .CompletionListe
Re: Extending spark with custom attributes
in markup, but in controller using AuthorizeAttribute or marker
interfaces
On Aug 10, 3:07 pm, "Igor Loginov (aka ilog2000)" <ilog2...@gmail.com>
wrote:
Re: Extending spark with custom attributes
I would make the following:
1. I'd make a HtmlHelper extension method, let's say
DivWithPermission(string innerHtml, string permission) with tag
rendering rules inside.
2. I would use a brand new Spark feature "Bindings" to create a
binding for <div> like this:
<element name="div">Html.DivWithPermiss ion('child::*', '@permission')</
Re: Best way to make a grouped foreach
If you need each second product in pair on a new line, I'd suggest 1)
to make ViewModel with a list of product pairs, and 2) to put nested
unordered lists. Like this:
<ul>
<for each='var productPair in productPairs'>
<li>
<ul>
<li>$!{productPair.Products[0] }</li>
<li>$!{productPair.Products[1] }</li>
Re: Visual Studio intellisense
doesn't work.
