Can I decorate advanced PowerShell functions with my own custom attributes?
For example: function TestThis() { [MySpecialCustomAttribute] [CmdletBinding()] Param(...) Process{...} } ...
For example: function TestThis() { [MySpecialCustomAttribute] [CmdletBinding()] Param(...) Process{...} } ...
I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller { public ObjectController(IDataService dataService) { DataService = dataService; } public IDataService DataService { get;set;} } The Authorize attribute is defined as "Inherited=true" in the framework. So when i...
I have something that looks like the following: [CoolnessFactor] interface IThing {} class Tester { static void TestSomeInterfaceStuff<T>() { var attributes = from attribute in typeof(T).GetCustomAttributes(typeof(T), true) where attributes == typeof(CoolnessFactorAttribu...
I have downloaded a web project from CodePlex and am getting the following error in Application_Start: System.Security.SecurityException: That assembly does not allow partially trusted callers. This project references several other assemblies from other open source projects. My theory is that one of these do not have the AllowP...
I'm considering the use of C++ for a personal project. I would like to make it platform independent (no Mono please, since some platforms don't yet support it), and that's why I considered C++. I have one doubt, however. I've grown quite fond of C#'s attributes, and I would like to know if I can use something similar in C++. Also, is i...
Hi, I'm trying to use jquery to switch between three images once you click on the image. Upon clicking on the third image, it switches it back to the first picture. Is there a way to adapt the following to switch between more than two pictures, and for it to allow more than it switching once? $(document).ready(function() { $("#clic...
Hello. I've already read the MSDN article about it. It seems internally it is the way c# sets which is the function that is going to work as indexer(am I right?). Now, I've seen the following example: [DefaultMemberAttribute("Main")] public class Program { public static void Main() { ... } } Now, I don't get it what i...
Hi, Are attributes applied to an abstract method in a base class applied to the overridden versions in the child classes? I hope the question is clear enough without an example. ...
Is it possible to get both the attribute name and the value of an element? Basically i want to get the name and the values of all attributes of a single element, in order to write them into a Javascript Object like this: obj { key: "value", another_key: "another_value", } Thx for any response ...
<div class="item"> <p><img src="images/photos_sample1.jpg" border="0" rel="images/google_map.jpg"></p> <p>Dining Area</p> </div> <div class="item"> <p><img src="images/photos_sample2.jpg" border="0" rel="images/sample_photo.jpg"></p> <p>Pool Area</p> </div> I have this html code, and I want to get the rel ...
I need to know if there's any way (or another distinct approach) to an attribute knows something about what is being decorated for him. For example: class Cat { public Cat() { } [MyAttribute] public House House { get; set; } } Inside MyAttribute I must do some preprocessing with the house object... class MyAttribute : At...
i trying around with JanRain openid, i'm already add some required fields like email, nickname etc.. and some optional fields but openid provider dont send back to me any information but user's openid url. I'm trying on localhost. ...
Say we've got requirements for all the functionality we want to build. Each requirement is listed in a Word doc with an associated ID. For instance, Requirement 123 is "each refund, if processed the same business day as the last payment, should be processed as a cancellation and will incur no refund processing fee". What I'd like is for...
Is it safe to use the attributes collection of a web control to store extra data? e.g. DropDownList ddl = new DropDownList(); ddl.Attributes.Add("ExtraData", "SomeData"); ...
Hello. I'd like to know if my textBox1 variable has the ABCAttribute. How can I check this? ...
Hello. My typical application has a couple of textboxes, checkbuttons, radiobuttons, and so. I always want to load the settings the user used the last time when the program starts, and also want to save the settings as the users clicks "Save settings" or closes the application. When the user attempts to save the settings, I'll have to c...
Hi, I have an attribute and i want to load text to the attribute from a resource file. [IntegerValidation(1, 70, ErrorMessage = Data.Messages.Speed)] private int i_Speed; But i keep getting "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type" It works pe...
I think there must be an attribute to hide a public property from the datagridview. But I can't find it. ...
I am trying to join two tables to map to a single entity using NHibernate.Mapping.Attributes. It works when there is only one property in the joined table. However, when there are additional properties they get mapped to the primary table instead of the joined table. [Class(Table = "primarytable")] public class Entity { [Id(0, Name ...
Hello, I have a a datacontract which has important attributes on. For example, in the following code: [DataMember] [Description("My Description")] public string Name { get; set; } I want the Description attribute to be auto generated on the client proxy. Is there any solution, or workarounds besides massive duplication? Many thanks...