I have this thumbnail list and would like push the image paths (sources) into an array: tn_array
<ul id="thumbnails">
<li><img src="somepath/tn/004.jpg" alt="fourth caption" /></a></li>
<li><img src="somepath/tn/005.jpg" alt="fifth caption" /></a></li>
<li><img src="somepath/tn/006.jpg" alt="sixth caption" /></a></li>
</ul>
...
I am trying to store an object as an attribute in another object but can't seem to access it.
Is it possible?
<script language="javascript">
$(document).ready(function() {
//create a TestObject
function TestObject() {
this.testProperty = "green";
}
//and an instance of it
var testObject = new TestObject()...
Why cant i set $_SERVER['DOCUMENT_ROOT'] as attribute?
see example code
class foo
{
private $path = $_SERVER['DOCUMENT_ROOT']; // generates error
private $blah;
public function __construct()
{
//code
}
public function setBla($bla)
{
$this->blah = $bla;
}
}
...
I am trying to use reflection to check if properties on a given class have a ReadOnly attribute set. The classes I am using are MVC View Models (using a partial "buddy" class for the metadata.
public partial class AccountViewModel
{
public virtual Int32 ID { get; set; }
public virtual decimal Balance { get; set; }
}
[...
Hi folks, what's the difference between using the Serializable attribute and implementing the ISerializable interface?
Please clarify.
TIA
...
Hi,
I would like to understand how to access a by its id and not trough array position,
example,
I dont want to do this,
$myXML->someNameHere[1]->home[0]
I want to go access someNameHere by its ID "hi"
Thanks a lot for your atention,
;D
...
As the question says, I am curious if any of you know about attributes that affect how the CLR will compile/optimize the bytecode. Is there an attribute that will affect code inlining decisions? Unroll loops?
Are there undocumented attributes on classes generated for anonymous types/delegates?
There's probably attributes to disable op...
I think I already know the answer to my question, but I want to put it out there anyway. I have an app with a ton of command handlers, each with special logic in their CanExecute methods to enable the bound Buttons appropriately.
Now I'm in a situation where I don't want any of the logic to execute, because execution results in calls t...
in my form i have this code
<form action="mail.php" class="contactForm" name="cform" method="post">
Problem is when i validate it tells me "name" is not allowed on xhtml strict.
is there a way i can use soem thing else for this.
thanks
...
Hi,
if you've got something like,
<hello id="1" name="myName1">
<anotherTag title="Hello">
</anotherTag>
</hello>
<hello id="2" name="myName2">
<anotherTag title="Hi">
</anotherTag>
</hello>
How to change the attributes of, for example, hello id 2, to name="William" ? Or the title hi to hello ?
Thanks a lot for your atention,
H'...
I wish to write a reusable library for querying against AD with LDAP. I'm using both ActiveDs COM objects and System.DirectoryServices.
Greatly inspired by Bart de Smet LINQ to AD, I have written a SchemaAttribute and an DirectoryAttributeAttribute classes to use with a DirectorySource(Of T) class (Yes, it's VBNET, but any C# code will ...
Take this sample class as an example:
[AttributeUsage(AttributeTargets.All, AllowMultiple=true)]
public class BugFixAttribute : System.Attribute
{
public int BugId { get; private set; }
public string Programmer { get; private set; }
public DateTime Date { get; private set; }
public string Comments { get; set; }
...
I want to be able to apply an attribute to an interface so that every method in any class that implements that interface will have the attribute applied to it.
I assumed it would look something like this:
[Serializable]
[AttributeUsage(AttributeTargets.All, Inherited = true)]
public sealed class TestAttribute : OnMethodBoundaryAspect
{...
Hi All,
I have a requirement to supply values from 2 select boxes to an Action Method. I'd like to know if there's a way to automatically extract all of the attributes from the selected options from each select box into a data object that I can pass to the server with my $.get?
Ideally, I could use a function like this:
http://plugin...
I wonder if you can help me with this.
I'm reading up about attributes and understand that they can be made to apply to different target entities with you code - (see Attribute Targets).
So, looking at the AssemblyInfo.cs file in my project, I can see the following:
[assembly: AssemblyTitle("AttributesDemo")]
[assembly: AssemblyDescri...
I'm using attribute-based validation, and I would like to limit what can be entered in theses attributes.
ex:
ThisValidatesSomethingAttribute(Type typeOfExceptionToThrowOnFailure)
so on use it is
[ThisValidatesSomething(typeof(MassiveFailureException))]
public int SomeIntParameter()
is there a way to limit the types that can be e...
When I try to mock a class using Moq the method attribute gets inherited to the mock class, but not the parameter attribute.
Basically the row "let a = (ArgumentsAttribute) p.GetCustomAttributes(typeof (ArgumentsAttribute), true).SingleOrDefault()" doesnt return the attribute.. Run the code to see where it fails.
How do I make this tes...
I generated some of my C# code with an external tool. Each generated class has an attribute GeneratedCodeAttribute. Why is my generator creating this attribute?
...
Alright, so after a few hours of me playing around to no avail, I built a model:
[AttributeUsage(AttributeTargets.All)]
public class PublicAttribute : System.Attribute
{
public enum Access { Public, Private }
public PublicAttribute(string Name, Access acs)
{
}
public PublicAttribute(string Name, Access acs, Action ge...
EDIT:
I'd better rephrase:
How can I shift the GET-implementation of a Class property to a / using a custom attribute? (I've added instantation vars (classname, propertyname) to the attribute, however I'd rather have these automatically fetched ofcourse.)
Public Class CustomClass
<CustomAttributeClass(ClassName:="CustomClass", Prope...