Hello,
Here is a little piece of code:
#include <stdio.h>
#include <stdarg.h>
void MyPrintf(char const* format, va_list args);
void MyVariadicPrintf(char const* format, ...);
void MyPrintf(char const* format, va_list args)
{
vprintf(format, args);
}
void MyVariadicPrintf(char const* format, ...)
{
va_list args;
va_start(...
Has anyone experienced any issues with using the mstest attribute [AssemblyInitialize] when running tests with TestDriven.Net?
I've tried 2.14 RTM and 2.22 RTM and neither seem to work for me. When I execute the test, the assembly init method isn't being executed. It's like TD.Net doesn't recongize the attribute.
Any tips/ideas/clues i...
I was wondering whether you could create your own .NET Attribute classes for PowerShell and use them in scripts e.g.
[DebugAttribute=true]
function DoSomeThing()
{
"I don't run in Release mode"
}
...
I was investigating some framework code (the System.AppDomain.GetDynamicDir method) and this was all the assembler showed:
[MethodImpl(MethodImplOptions.InternalCall)]
private extern string GetDynamicDir();
What happens when this method is called? I don't mean this specific method, but methods with this attribute in general.
...
Is it possible to create a library that can be consumed from .Net 2.0 and also allows .Net 3.0+ consumers to benefit from DataContracts if they wish?
I don't see any technical obstacle for this other than the library that contains the different DataContract related attributes is a .Net 3.0 library. Can these attributes be implemented ma...
Hi,
I have a custom attribute which is applied to class properties and the class itself. Now all the classes that must apply my custom attribute are derived from a single base class.
How can I restrict my Custom Attribute so that it can be applied to only those classes, that must derive from my base class? How do I do this ?
Thanks,
...
I have a class Bar like this:
class Foo : IFoo {
[Range(0,255)]
public int? FooProp {get; set}
}
class Bar : IFoo
{
private Foo foo = new Foo();
public int? FooProp { get { return foo.FooProp; }
set { foo.FooProp= value; } }
}
I need to find the attribute [Range(0,255)] reflecting ONLY on the property ...
Hi. I have a Model Book with a virtual attribute for create a Editor from the Book form.
The code looks like:
class Book < ActiveRecord::Base
has_many :book_under_tags
has_many :tags, :through => :book_under_tags
has_one :editorial
has_many :written_by
has_many :authors, :through => :written_by
def editorial_string
self...
What kind of things have you used custom .NET attributes for in the real world?
I've read several articles about them, but I have never used custom attributes.
I feel like I might be overlooking them when they could be useful.
EDIT
I am talking about attributes that you create, not ones that are already included in the framework.
...
I'm using System.ComponentModel.DataAnnotations to give codesmith (using reflection to parse the field-attributes on BE) UI-hints to build my views. But I find DataAnnotations is limited enough. I like something richest, building new custom attributes where one could have more settings to build also complex user interface. I'm too lazy t...
Suppose I have the following (trivially simple) base class:
public class Simple
{
public string Value { get; set; }
}
I now want to do the following:
public class PathValue : Simple
{
[XmlAttribute("path")]
public string Value { get; set; }
}
public class ObjectValue : Simple
{
[XmlAttribute("object")]
public str...
I created a label using Interface Builder, and now I want to set the background color of the label using code instead of IB's color picker. (I want to do this so that I can define the color using RGB and eventually change the colorspace for the label.)
I'm in cocoa. How do I edit the attributes of an IB object using code?
My code lo...
Can someone explain to me what sort of an abstraction in the parser / compiler a dummy variable or attribute corresponds to?
PURE SUBROUTINE F(X, Y)
IMPLICIT NONE
REAL, INTENT(INOUT) :: X, Y, C
C REAL :: A, B
C REAL, SAVE :: C = 3.14E0
PARAMETER (C = 3.14E0, X = 32, Y = X)
X = Y + 2 * ...
let's say I have
public delegate DataSet AutoCompleteDelegate(
string filter, long rowOffset);
can I make the following class to enforce that method signature? (just a conjured up idea):
public class MiddleTier
{
[Follow(AutoCompleteDelegate)]
public DataSet Customer_AutoComplete(string filter, long rowOffset)
{
...
I am looking for a way to change the value of the DisplayName attribute of a property at run-time. Is this even possible in Windows Forms?
...
I like to update just the value of my checkbox in a asp grid.
so i thought i bind the id to the checkbox ( but how?) and fire an update in code behind by clicking the checkbox.
but how can I get the ID, and where I have to bind this id to get it in code behind in the event?
Thanks
...
I am just beginning WatiN and in a lot of blogs I see attributes like [TestMethod] or simply [Test] used.
For Example:
MSForge Blog Post
etc. etc.
but when I attempt:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;
using WatiN.Core.UnitTests;
using WatiN.Core.Constraints;
usi...
I have a class like this:
private class MyClass {
[DisplayName("Foo/Bar")]
public string FooBar { get; private set; }
public string Baz { get; private set; }
public bool Enabled;
}
When I create a List<MyClass> and assign it to the DataSource of a DataGridView, the grid shows me two columns, "Foo/Bar" and "Baz". This is ...
What is the necessity for the GUID attribute? why don't just let the compiler handle this automatically?!
...
I thought the following line of code should work fine: $(".1").attr('href', '#Home');
Right?
But why isn't it working when I integrate it with another jQuery script?
$(window).bind("load", function() {
$('.1').click(function() {
$('.1').removeClass('tab1');
$('.2').removeClass('active2');
$('.3').removeClass('active3...