I need to add a custom attribute to the selected text in an NSTextView. So I can do that by getting the attributed string for the selection, adding a custom attribute to it, and then replacing the selection with my new attributed string.
So now I get the text view's attributed string as NSData and write it to a file. Later when I open t...
Hi
I have a WebBrowser control and try to set onclick and href attributes on all links.
foreach (HtmlElement link in webBrowser1.Document.Links)
{
link.SetAttribute("href", "http://www.google.com");
link.SetAttribute("onclick", "return false;");
}
It works well. When i out source code of outer html i see that attributes w...
I am using WCF and IServiceBehaviors, and adding EndPointDispatchers.
What I would like to check is that on the EndPointDispatcher is there any way of check to see which attributes have been set on the Service or Service Contract?
The reason for doing this is that if a Service has an attribute then a new Inspector will be added if not...
Suppose I want to throw a new exception when invoking a generic method with a type that doesn't have a required attribute. Is there a .NET exception that's appropriate for this situation, or, more likely, one that would be a suitable ancestor for a custom exception?
For example:
public static class ClassA
{
public static T DoSomet...
Hellow all,
I have the following xml lines:
<customer id="3" phone="123456" city="" /> <!--OK-->
<customer id="4" /> <!--OK-->
<customer id="3" phone="123456" /> <!--ERROR-->
<customer id="3" city="" /> <!--ERROR-->
"phone" and "city" attributes are optional, but if "phone" exists, a...
I'm trying to use Apache Lucene for tokenizing, and I am baffled at the process to obtain Tokens from a TokenStream.
The worst part is that I'm looking at the comments in the JavaDocs that address my question.
http://lucene.apache.org/java/3_0_1/api/core/org/apache/lucene/analysis/TokenStream.html#incrementToken%28%29
Somehow, an Attr...
How can I pass along attributes to my tasks in capistrano?
My goal is to deploy to multiple servers in a load balancer. I'd like to take each one out, deploy, and add it back in sequentially so no more than one server is down at any time.
I'm thinking it would be something along the lines of... (and the hosts array would be generated d...
I have a DropDownList and need to know its name in the code behind:
<select name="ctl00$cphMainContent$ddlTopic" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$ddlTopic\',\'\')', 0)" id="ctl00_cphMainContent_ddlTopic">
<option value="All">All</option>
</select>
I need to get the value "ctl00$cphMainContent$ddlTop...
Consider the following:
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
public class NotNullAttribute : Attribute
{
}
public class Class1
{
[return: NotNull]
public static string TestMethod([NotNull] string arg)
{
return arg + " + " + arg;
}
}
How, using System.Reflection, would you...
On a recent question about MVC attributes, someone asked whether using HttpPost and HttpDelete attributes on an action method would result in either request type being allowed or no requests being allowed (since it can't be both a Post and a Delete at the same time). I noticed that ActionMethodSelectorAttribute, from which HttpPostAttr...
Can you use a lambda expressions as an argument to an attribute? The motivation I am thinking of would be to eliminate reliance on magic strings
Cheers,
Berryl
...
hi, i have 4 links and i need to change the href attribute in a rel attribute.
i know i cannot do it so i'm trying to get the data from the href attribute, setting a new attribute (rel), inserting the data inside it and then removing the href attibute.
basically i'm doing this:
$('div#menu ul li a').each(function(){
var lin = $...
Hi,
I'm wondering if someone knows how to store an array into a user session?
This is the method to store a single attribute:
$this->getUser()->setAttribute('something', $something);
And the documentation says:
"User attributes can store any type of data (strings, arrays, and associative arrays)"
... but doesn't say anything more....
I found great explanation about the new RTTI in Delphi,but I don't understand one important thing about all I have read - Where can I use that?
What is it supposed to replace?
...
Hi,
I just wanna ask if there's a possibility to retrieve the contents of a 'dump' file from the recycle bin programatically. The contents that I'm looking for are file attributes like 'Date Last Modified, 'Data created', 'size', etc (without restoring the file itself to the original location to preserve the original attributes found wh...
I'm writing Validation attribute that sits on the class but inspects the properties of the class. I want it to set a validation message on each of the properties it finds to be invalid. How do I do this?
This is what I have got so far:
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class Li...
This might be a stupid question but Ill ask anyway,
I was reading "OOP Demystified: A Self-Teaching Guide by Jim Keogh and Mario Giannini" chapter 11 which covers interfaces. The examples in this book are C++.
I noticed that C++ uses ISerializable to make a class serializable which you would implement where as in C# you just attribute ...
I need to define an <img>'s src attribute in CSS. Is there a way to specify this attribute?
...
My searches keep turning up only guides explaining how to use and apply attributes to a class. I want to learn how to create my own attribute classes and the mechanics of how they work.
How are attribute classes instantiated? Are they instantiated when the class they are applied to is instantiated? Is one instantiated for each class ...
Hi All,
I'm pretty new to MVC 2 using the Entity Framework. I have two tables Company {ID int identity PK,Name nvarchar} and User {ID int identity PK,UserName nvarchar,CompanyID int FK}. A Foreign Key exists between User and Company.
I generated my ADO.NET Entity Data Model, a Controller and a view to insert a record. My HTML form has...