Search Results

Search found 13 results on 1 pages for 'fraga'.

Page 1/1 | 1 

  • How to extend methods to a class not to its instances.

    - by Fraga
    Hi. Extending methods to any instance is really easy: public static string LeaveJustNumbers(this string text) { return Regex.Replace(text, @"[\D]", ""); } ... string JustNumbers = "A5gfb343j4".LeaveJustNumber(); But what if i want to extend methods to a sealed class like string, to work like: string.Format("Hi:{0}","Fraga"); Is there any way to do it?

    Read the article

  • Embed SWF into excel and change it flashvars when excel file is loaded

    - by Fraga
    Hi. I have a ShockwaveFlash embeded in excel. This SWF need 1 dynamic flashvar to run. I need to set it just before flash file is loaded, so flash can run without problems. Something like this. Private Sub Worksheet_Activate() ShockwaveFlash1.FlashVars = "DynamicData=123" ShockwaveFlash1.Play End Sub But it doesnt work. Ideas? PD: Macros was my first idea, any other solution could be better.

    Read the article

  • Call Activator.CreateInstance in a dll to intance class that reside inside Asp.Net App_Code

    - by Fraga
    Help, here is the idea: External.dll IMyClass NewCreated = (IMyClass)Activator.CreateInstance(Namespace.MyClass).UnWrap(); Asp.Net WebSite App_Code Namespace.MyClass.cs Bin External.dll Is that even posible? I have tried, a lot of posible combinations, like: Assembly.GetCallingAssembly().CreateInstance("Namespace.MyClass") Activator.CreateInstance(AppDomain.CurrentDomain,"Namespace","Namespace.MyClass") Assembly.GetExecutingAssembly().CreateInstance("Namespace.MyClass")

    Read the article

  • Measuring Programmers' Productivity. Bad, good or invasive?

    - by Fraga
    A client needs my company to develop an app that will be able to measure the programmer productivity, by getting information from VS, IE, SSMS, profiler and VMware. For example: Lines, Methods, Classes (Added, Deleted, Modified) How many time spent in certain file, class, method, specific task, etc. How many time in different stages of the development cycle (Design, Coding, Debugging, Compiling, Testing) Real lines of code. Etc They told me they want to implement PSP. Would you resign if a company wants to measure this way? OR Would you install this kind of software for self improvement?

    Read the article

  • Interfaces with structs, by reference using Generics

    - by Fraga
    I can't pass by reference an interface with a struct in it, what am I doing wrong? Here is the example code: class Processor<T> where T : new() { public Processor() { Data = new T(); } public T Data; } class PeriodsProcessor : Processor<Periods> { public PeriodsProcessor() { DataBase DB = new DataBase(); Console.WriteLine(Data.Value); DB.ModifyData<Period>(Data); Console.WriteLine(Data.Value); Console.ReadLine(); } } public class Period { public string Name; } public interface IDataTable<T> { string Value { get; set; } T Filter { get; set; } } [Serializable] public struct Periods : IDataTable<Period> { public string Value { get; set; } public Period Filter { get; set; } } public class DataBase { public void ModifyData<T>(IDataTable<T> data) where T : new() { data.Value = "CHANGE"; } } class Program { static void Main(string[] args) { PeriodsProcessor PeriodsProcessor = new PeriodsProcessor(); } }

    Read the article

  • Fast ArgumentNullException with attributes. It is possible?

    - by Fraga
    Hi. Is there any fast way to verify null arguments via attributes or something? Convert this: public void Method(type arg1,type arg2,type arg3) { if (arg1== null) throw new ArgumentNullException("arg1"); if (arg2== null) throw new ArgumentNullException("arg2"); if (arg3== null) throw new ArgumentNullException("arg3"); //Business Logic } Into something like this: [VerifyNullArgument("arg1","arg2","arg3")] public void Method(type arg1,type arg2,type arg3) { //Business Logic } Ideas? thanks guys.

    Read the article

  • Dequeue from messageQueue in the PeekCompleted Method

    - by Fraga
    i'm reading messages from MessageQueue using PeekCompleted, i do my process here and if everything go right, I need to remove it from the Queue! currenty i am using MyMessageQueue.Receive() and it works, but is this a reliable way of making sure each message will be processed right? MessageQueue MyMessageQueue; public Form1() { InitializeComponent(); MyMessageQueue = new MessageQueue(@".\private$\Dms"); MyMessageQueue.PeekCompleted += new PeekCompletedEventHandler(MessageQueue_PeekCompleted); MyMessageQueue.Formatter = new XmlMessageFormatter(new Type[] { typeof(string) }); MyMessageQueue.BeginPeek(); } void MessageQueue_PeekCompleted(object sender, PeekCompletedEventArgs e) { try { Debug.WriteLine("ToProcess:" + e.Message.Body); //Long process that maybe fail MyMessageQueue.Receive(); } finally { MyMessageQueue.BeginPeek(); } }

    Read the article

1