Search Results

Search found 5917 results on 237 pages for 'wix extension'.

Page 10/237 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • [Visual Studio Extension Of The Day] Test Scribe for Visual Studio Ultimate 2010 and Test Professional 2010

    - by Hosam Kamel
      Test Scribe is a documentation power tool designed to construct documents directly from the TFS for test plan and test run artifacts for the purpose of discussion, reporting etc... . Known Issues/Limitations Customizing the generated report by changing the template, adding comments, including attachments etc… is not supported While opening a test plan summary document in  Office 2007, if you get the warning: “The file Test Plan Summary cannot be opened because there are problems with the contents” (with Details: ‘The file is corrupt and cannot be opened’), click ‘OK’. Then, click ‘Yes’ to recover the contents of the document. This will then open the document in Office 2007. The same problem is not found in Office 2010. Generated documents are stored by default in the “My documents” folder. The output path of the generated report cannot be modified. Exporting word documents for individual test suites or test cases in a test plan is not supported. Download it from Visual Studio Extension Manager Originally posted at "Hosam Kamel| Developer & Platform Evangelist" http://blogs.msdn.com/hkamel

    Read the article

  • C# Extension Methods - To Extend or Not To Extend...

    - by James Michael Hare
    I've been thinking a lot about extension methods lately, and I must admit I both love them and hate them. They are a lot like sugar, they taste so nice and sweet, but they'll rot your teeth if you eat them too much.   I can't deny that they aren't useful and very handy. One of the major components of the Shared Component library where I work is a set of useful extension methods. But, I also can't deny that they tend to be overused and abused to willy-nilly extend every living type.   So what constitutes a good extension method? Obviously, you can write an extension method for nearly anything whether it is a good idea or not. Many times, in fact, an idea seems like a good extension method but in retrospect really doesn't fit.   So what's the litmus test? To me, an extension method should be like in the movies when a person runs into their twin, separated at birth. You just know you're related. Obviously, that's hard to quantify, so let's try to put a few rules-of-thumb around them.   A good extension method should:     Apply to any possible instance of the type it extends.     Simplify logic and improve readability/maintainability.     Apply to the most specific type or interface applicable.     Be isolated in a namespace so that it does not pollute IntelliSense.     So let's look at a few examples in relation to these rules.   The first rule, to me, is the most important of all. Once again, it bears repeating, a good extension method should apply to all possible instances of the type it extends. It should feel like the long lost relative that should have been included in the original class but somehow was missing from the family tree.    Take this nifty little int extension, I saw this once in a blog and at first I really thought it was pretty cool, but then I started noticing a code smell I couldn't quite put my finger on. So let's look:       public static class IntExtensinos     {         public static int Seconds(int num)         {             return num * 1000;         }           public static int Minutes(int num)         {             return num * 60000;         }     }     This is so you could do things like:       ...     Thread.Sleep(5.Seconds());     ...     proxy.Timeout = 1.Minutes();     ...     Awww, you say, that's cute! Well, that's the problem, it's kitschy and it doesn't always apply (and incidentally you could achieve the same thing with TimeStamp.FromSeconds(5)). It's syntactical candy that looks cool, but tends to rot and pollute the code. It would allow things like:       total += numberOfTodaysOrders.Seconds();     which makes no sense and should never be allowed. The problem is you're applying an extension method to a logical domain, not a type domain. That is, the extension method Seconds() doesn't really apply to ALL ints, it applies to ints that are representative of time that you want to convert to milliseconds.    Do you see what I mean? The two problems, in a nutshell, are that a) Seconds() called off a non-time value makes no sense and b) calling Seconds() off something to pass to something that does not take milliseconds will be off by a factor of 1000 or worse.   Thus, in my mind, you should only ever have an extension method that applies to the whole domain of that type.   For example, this is one of my personal favorites:       public static bool IsBetween<T>(this T value, T low, T high)         where T : IComparable<T>     {         return value.CompareTo(low) >= 0 && value.CompareTo(high) <= 0;     }   This allows you to check if any IComparable<T> is within an upper and lower bound. Think of how many times you type something like:       if (response.Employee.Address.YearsAt >= 2         && response.Employee.Address.YearsAt <= 10)     {     ...     }     Now, you can instead type:       if(response.Employee.Address.YearsAt.IsBetween(2, 10))     {     ...     }     Note that this applies to all IComparable<T> -- that's ints, chars, strings, DateTime, etc -- and does not depend on any logical domain. In addition, it satisfies the second point and actually makes the code more readable and maintainable.   Let's look at the third point. In it we said that an extension method should fit the most specific interface or type possible. Now, I'm not saying if you have something that applies to enumerables, you create an extension for List, Array, Dictionary, etc (though you may have reasons for doing so), but that you should beware of making things TOO general.   For example, let's say we had an extension method like this:       public static T ConvertTo<T>(this object value)     {         return (T)Convert.ChangeType(value, typeof(T));     }         This lets you do more fluent conversions like:       double d = "5.0".ConvertTo<double>();     However, if you dig into Reflector (LOVE that tool) you will see that if the type you are calling on does not implement IConvertible, what you convert to MUST be the exact type or it will throw an InvalidCastException. Now this may or may not be what you want in this situation, and I leave that up to you. Things like this would fail:       object value = new Employee();     ...     // class cast exception because typeof(IEmployee) != typeof(Employee)     IEmployee emp = value.ConvertTo<IEmployee>();       Yes, that's a downfall of working with Convertible in general, but if you wanted your fluent interface to be more type-safe so that ConvertTo were only callable on IConvertibles (and let casting be a manual task), you could easily make it:         public static T ConvertTo<T>(this IConvertible value)     {         return (T)Convert.ChangeType(value, typeof(T));     }         This is what I mean by choosing the best type to extend. Consider that if we used the previous (object) version, every time we typed a dot ('.') on an instance we'd pull up ConvertTo() whether it was applicable or not. By filtering our extension method down to only valid types (those that implement IConvertible) we greatly reduce our IntelliSense pollution and apply a good level of compile-time correctness.   Now my fourth rule is just my general rule-of-thumb. Obviously, you can make extension methods as in-your-face as you want. I included all mine in my work libraries in its own sub-namespace, something akin to:       namespace Shared.Core.Extensions { ... }     This is in a library called Shared.Core, so just referencing the Core library doesn't pollute your IntelliSense, you have to actually do a using on Shared.Core.Extensions to bring the methods in. This is very similar to the way Microsoft puts its extension methods in System.Linq. This way, if you want 'em, you use the appropriate namespace. If you don't want 'em, they won't pollute your namespace.   To really make this work, however, that namespace should only include extension methods and subordinate types those extensions themselves may use. If you plant other useful classes in those namespaces, once a user includes it, they get all the extensions too.   Also, just as a personal preference, extension methods that aren't simply syntactical shortcuts, I like to put in a static utility class and then have extension methods for syntactical candy. For instance, I think it imaginable that any object could be converted to XML:       namespace Shared.Core     {         // A collection of XML Utility classes         public static class XmlUtility         {             ...             // Serialize an object into an xml string             public static string ToXml(object input)             {                 var xs = new XmlSerializer(input.GetType());                   // use new UTF8Encoding here, not Encoding.UTF8. The later includes                 // the BOM which screws up subsequent reads, the former does not.                 using (var memoryStream = new MemoryStream())                 using (var xmlTextWriter = new XmlTextWriter(memoryStream, new UTF8Encoding()))                 {                     xs.Serialize(xmlTextWriter, input);                     return Encoding.UTF8.GetString(memoryStream.ToArray());                 }             }             ...         }     }   I also wanted to be able to call this from an object like:       value.ToXml();     But here's the problem, if i made this an extension method from the start with that one little keyword "this", it would pop into IntelliSense for all objects which could be very polluting. Instead, I put the logic into a utility class so that users have the choice of whether or not they want to use it as just a class and not pollute IntelliSense, then in my extensions namespace, I add the syntactical candy:       namespace Shared.Core.Extensions     {         public static class XmlExtensions         {             public static string ToXml(this object value)             {                 return XmlUtility.ToXml(value);             }         }     }   So now it's the best of both worlds. On one hand, they can use the utility class if they don't want to pollute IntelliSense, and on the other hand they can include the Extensions namespace and use as an extension if they want. The neat thing is it also adheres to the Single Responsibility Principle. The XmlUtility is responsible for converting objects to XML, and the XmlExtensions is responsible for extending object's interface for ToXml().

    Read the article

  • How to balance a non-symmetric "extension" based game?

    - by Klaim
    Most strategy games have fixed units and possible behaviours. However, think of a game like Magic The Gathering : each card is a set of rules. Regularly, new sets of card types are created. I remember that the firsts editions of the game have been said to be prohibited in official tournaments because the cards were often too powerful. Later extensions of the game provided more subtle effects/rules in cards and they managed to balance the game apparently effectively, even if there is thousands of different cards possible. I'm working on a strategy game that is a bit in the same position : every units are provided by extensions and the game is thought to be extended for some years, at least. The effects variety of the units are very large even with some basic design limitations set to be sure it's manageable. Each player choose a set of units to play with (defining their global strategy) before playing (like chooseing a themed deck of Magic cards). As it's a strategy game (you can think of Magic as a strategy game too in some POV), it's essentially skirmish based so the game have to be fair, even if the players don't choose the same units before starting to play. So, how do you proceed to balance this type of non-symmetric (strategy) game when you know it will always be extended? For the moment, I'm trying to apply those rules but I'm not sure it's right because I don't have enough design experience to know : each unit would provide one unique effect; each unit should have an opposite unit that have an opposite effect that would cancel each others; some limitations based on the gameplay; try to get a lot of beta tests before each extension release? Looks like I'm in the most complex case?

    Read the article

  • How can my WiX uninstall restore a registry value change?

    - by Thomas
    The installer I'm writing using WiX 3.0 uses a RegistryValue element to modify an existing registry value (originally written by our main product). I'm trying to figure out a way to restore the registry value when the user uninstalls my utility. I'd like to avoid using a custom action, but that might be the only recourse? TIA.

    Read the article

  • WiX custom action with DTF... quite confused...

    - by Joshua
    Okay, I have decided the only way I can do what I want to do with WiX (thanks to an old installer I didn't write that I now have to upgrade) is with some CUSTOM ACTIONS. Basically, I need to back up a file before the RemoveExistingProducts and restore that file again after RemoveExistingProducts. I think this is what's called a "type 2 custom action." The sequencing I think I understand, however, what I don't understand is first of all how I pass data to my C# action (the directory the file is in from the WiX) and how to reference my C# (DTF?) action with the Binary and CustomAction tags. Also, does all this need to be in a tag? All the examples show it that way. Here is what I have so far in the .WXS file... <Binary Id="backupSettingsAction.dll" SourceFile="backupSettingsAction.CA.dll"/> <CustomAction Id="BackupSettingsAction" BinaryKey="backupSettingsAction.dll" DllEntry="CustomAction" Execute="immediate" /> <InstallExecuteSequence> <Custom Action="backupSettingsAction.dll" Before="InstallInitialize"/> <RemoveExistingProducts After="InstallFinalize" /> <Custom Action="restoreSettingsAction.dll" After="RemoveExistingFiles"/> </InstallExecuteSequence> The file I need to back up is a settings file from the previous install (which needs to remain intact), it is located in the directory: <Directory Id="CommonAppDataFolder" Name="CommonAppData"> <Directory Id="CommonAppDataPathways" Name="Pathways" /> </Directory> And even has a Component tag for it, though I need to back the file up that exists already: <Component Id="Settings" Guid="A3513208-4F12-4496-B609-197812B4A953" NeverOverwrite="yes" > <File Id="settingsXml" ShortName="SETTINGS.XML" Name="Settings.xml" DiskId="1" Source="\\fileserver\Release\Pathways\Dependencies\Settings\settings.xml" Vital="yes" /> </Component> And this is referencing the C# file that Visual Studio (2005) created for me: namespace backupSettingsAction { public class CustomActions { [CustomAction] public static ActionResult CustomAction1(Session session) { session.Log("backing up settings file"); //do I hardcode the directory and name of the file in here, or can I pass them in? return ActionResult.Success; } } } Any help is greatly apprecaited. Thank you!

    Read the article

  • How to register file types/extensions with a WiX installer?

    - by OregonGhost
    I didn't find an explicit answer to this question in the WiX Documentation (or Google, for that matter). Of course I could just write the appropriate registry keys in HKCR, but it makes me feel dirty and I'd expect this to be a standard task which should have a nice default solution. For bonus points, I'd like to know how to make it "safe", i.e. don't overwrite existing registrations for the file type and remove the registration on uninstall only if it has been registered during installation and is unchanged.

    Read the article

  • IQueryable<T> Extension Method not working

    - by Micah
    How can i make an extension method that will work like this public static class Extensions<T> { public static IQueryable<T> Sort(this IQueryable<T> query, string sortField, SortDirection direction) { // System.Type dataSourceType = query.GetType(); //System.Type dataItemType = typeof(object); //if (dataSourceType.HasElementType) //{ // dataItemType = dataSourceType.GetElementType(); //} //else if (dataSourceType.IsGenericType) //{ // dataItemType = dataSourceType.GetGenericArguments()[0]; //} //var fieldType = dataItemType.GetProperty(sortField); if (direction == SortDirection.Ascending) return query.OrderBy(s => s.GetType().GetProperty(sortField)); return query.OrderByDescending(s => s.GetType().GetProperty(sortField)); } } Currently that says "Extension methods must be defined in a non-generic static class". How do i do this?

    Read the article

  • WIX: How can I register a new ISAPI Extension or Script Map on an existing Web App or Site?

    - by Cheeso
    I've seen the WebApplicationExtension element, but because it must be a child of WebApplication, it appears to require the creation of a new WebApplication. I don't want that. I want to create the extension (or script map) on an existing website. On uninstall, the website should remain but the extension (script map entry) should be removed. Anyone know how to do this in WIX? If I get no good answers, I guess I will have to do it within script before InstallFinalize.

    Read the article

  • ASP.Net MVC view unable to see HtmlHelper extension method

    - by larryq
    Hi everyone, We're going through an ASP.Net MVC book and are having trouble with using an extenstion method within our view. The Extension method looks like this: using System; using System.Runtime.CompilerServices; using System.Web.Mvc; namespace MvcBookApplication { public static class HtmlHelperExtensions { public static string JQueryGenerator(this HtmlHelper htmlHelper, string formName, object model); } } We use the extension method in our view like this: <%=Html.JQueryGenerator("createmessage", ViewData.Model)%> The problem is, that line of code says JQueryGenerator isn't a recognized method of HtmlHelper. I believe we've got the correct references set in the web project, but are there other things we can check? There's no using statement for views, is there?

    Read the article

  • Collect all extension methods to generic class in another generic class

    - by Hun1Ahpu
    I'd like to create a lot of extension methods for some generic class, e.g. for public class SimpleLinkedList<T> where T:IComparable And I've started creating methods like this: public static class LinkedListExtensions { public static T[] ToArray<T>(this SimpleLinkedList<T> simpleLinkedList) where T:IComparable { //// code } } But when I tried to make LinkedListExtensions class generic like this: public static class LinkedListExtensions<T> where T:IComparable { public static T[] ToArray(this SimpleLinkedList<T> simpleLinkedList) { ////code } } I get "Extension methods can only be declared in non-generic, non-nested static class". And I'm trying to guess where this restriction came from and have no ideas.

    Read the article

  • Allow user to download file and filename on client defaults to no extension

    - by Andrew
    I want the user to be able to download a file from a page and have the filename extension in the Save As dialog box to be defaulted to nothing. This is the code I'm using: Response.ContentType = "text/plain" Response.AppendHeader("content-disposition", "attachment; filename=FILE") Response.WriteFile("C:\Temp\FILE") Response.End() FILE is the actual file. It is saved on the server without any extension. Currently, the "Save As Type" drop down list in the dialog defaults to "Text Document". How can I make it so that it defaults to "All Files"?

    Read the article

  • Overriding LINQ extension methods

    - by Ruben Vermeersch
    Is there a way to override extension methods (provide a better implementation), without explicitly having to cast to them? I'm implementing a data type that is able to handle certain operations more efficiently than the default extension methods, but I'd like to keep the generality of IEnumerable. That way any IEnumerable can be passed, but when my class is passed in, it should be more efficient. As a toy example, consider the following: // Compile: dmcs -out:test.exe test.cs using System; namespace Test { public interface IBoat { void Float (); } public class NiceBoat : IBoat { public void Float () { Console.WriteLine ("NiceBoat floating!"); } } public class NicerBoat : IBoat { public void Float () { Console.WriteLine ("NicerBoat floating!"); } public void BlowHorn () { Console.WriteLine ("NicerBoat: TOOOOOT!"); } } public static class BoatExtensions { public static void BlowHorn (this IBoat boat) { Console.WriteLine ("Patched on horn for {0}: TWEET", boat.GetType().Name); } } public class TestApp { static void Main (string [] args) { IBoat niceboat = new NiceBoat (); IBoat nicerboat = new NicerBoat (); Console.WriteLine ("## Both should float:"); niceboat.Float (); nicerboat.Float (); // Output: // NiceBoat floating! // NicerBoat floating! Console.WriteLine (); Console.WriteLine ("## One has an awesome horn:"); niceboat.BlowHorn (); nicerboat.BlowHorn (); // Output: // Patched on horn for NiceBoat: TWEET // Patched on horn for NicerBoat: TWEET Console.WriteLine (); Console.WriteLine ("## That didn't work, but it does when we cast:"); (niceboat as NiceBoat).BlowHorn (); (nicerboat as NicerBoat).BlowHorn (); // Output: // Patched on horn for NiceBoat: TWEET // NicerBoat: TOOOOOT! Console.WriteLine (); Console.WriteLine ("## Problem is: I don't always know the type of the objects."); Console.WriteLine ("## How can I make it use the class objects when the are"); Console.WriteLine ("## implemented and extension methods when they are not,"); Console.WriteLine ("## without having to explicitely cast?"); } } } Is there a way to get the behavior from the second case, without explict casting? Can this problem be avoided?

    Read the article

  • Add php extension (geoip.so) to Zend Studio for code validation

    - by Agustinus
    Hi everyone, just have a short question here. I've just installed new php extension (geoip.so) using pecl to /usr/local/zend/lib/php_extensions/ and added the extension to the php.ini. Run the code and it works just fine. But Zend Studio is giving warning of undefined geoip function. Try to add the directory path above to the include path of Zend Studio, still the warning exists. Any clue how to remove this warning? Thank you in advance!! /Agustinus

    Read the article

  • Blank space after file extension -> weird FileInfo behaviour

    - by Axarydax
    Somehow a file has appeared in one of my directories, and it has space at the end of its extension - its name is "test.txt ". The weird thing is that Directory.GetFiles() returns me the path of this file, but I'm unable to retrieve file information with FileInfo class. The error manifests here: DirectoryInfo di = new DirectoryInfo("c:\\somedir"); FileInfo fi = di.GetFileSystemInfos("test*")[0] as FileInfo; //correctly fi.FullName is "c:\somedir\test.txt " //but fi.Exists==false (!) Is FileInfo class broken? Can I somehow retrieve information about this file? I really don't know how did that file appear on my file system, and I am unable to recreate some more of them. All of my attempts to create a new file with this type of extension have failed, but now my program is crashing when encoutering it. I can easily handle the exception when finding the file, but boy am I curious about this!

    Read the article

  • Compiling my own PHP extension on Windows with Visual Studio 2008

    - by Mickey Shine
    I wrote a PHP extension and it could be compiled and run under linux successfully. But on windows, I met some problems. I did the compiling on windows according to http://blog.slickedit.com/?p=128 with PHP source version 5.2.10, and after the compiling it generated the dll file. But when I tried to use the dll file, it reported me the memory problems when starting Apache(Wamp server). And then I started the debugging process, it seemed that REGISTER_INI_ENTRIES() had problems. Here is the PHP extension source code, http://www.bluefly.cn/xsplit.tar.gz , and it works fine on Linux. But I also want to make it work on Windows. Sorry I am not a pro so that I hope someone can help me. Any help is appreciated and thanks in advance~

    Read the article

  • creating PHP C/C++ extension modules using SWIG

    - by morpheous
    I have written some C/C++ extension modules for PHP, using the 'old fashioned way' - i.e. by using the manual way (as described by Sarah Golemon in her book). This is too fiddly for me, and since I am lazy, and would like to automate as much as possible. Also, I have used SWIG now to generate extensions to Python, and I am getting to like using it quite a lot. I am thinking of using SWIG to generate my future PHP extensions. I am using PHP v5.2 (and above) on my production servers. My questions are: Is SWIG PHP interface stable yet (i.e. ready for production)? If you answered yes to question 1 -are YOU using it in YOUR production site? Are there any 'gotchas' I need to be aware of when creating PHP extension ,modules using SWIG?

    Read the article

  • Java JFileChooser getAbsoluteFile Add File Extension

    - by ikurtz
    i have this issue working but i would like to know if there is a better way of adding the file extension? what i am doing right now is: String filePath = chooser.getSelectedFile().getAbsoluteFile() + ".html"; im adding the extension hard coded. and then saving to it. just wondering if there is a more robust/logical manner this can be implemented? thank you for your time. EDIT: i ask this as i would like my app to be portable across platforms. so adding .html manually i may make this a windows only solution.

    Read the article

  • Constrain generic extension method to base types and string

    - by hitch
    I want to have an extension method for XElement/XAttribute that allows me to apply a "ValueOrDefault" logic - perhaps with various slightly different implementations: ValueOrNull, ValueOrDefault, NumericValueOrDefault (which validates if the value is numeric), but I want to constrain these methods so that they can only work with ValueTypes or String (i.e. it does not really make sense to use any other reference types. Is it possible to do this with one implementation of each method, or will I have to have one where the constraint is "Structure" and one where the constraint is "String" - if I combine Structure and String in the generic constraint, I get the error : 'Structure' constraint and a specific class type constraint cannot be combined. An example of the current method implementation is as follows: <Extension()> _ Public Function ValueOrDefault(Of T As {Structure})(ByVal xe As XElement, ByVal defaultValue As T) As T If xe Is Nothing or xe.Value = "" Then Return defaultValue End If Return CType(Convert.ChangeType(xe.Value, GetType(T)), T) End Function

    Read the article

  • Ignore order of elements using xs:extension

    - by Peter Lang
    How can I design my xsd to ignore the sequence of elements? <root> <a/> <b/> </root> <root> <b/> <a/> </root> I need to use extension for code generation reasons, so I tried the following using all: <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://www.example.com/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.example.com/test" > <xs:complexType name="BaseType"> <xs:all> <xs:element name="a" type="xs:string" /> </xs:all> </xs:complexType> <xs:complexType name="ExtendedType"> <xs:complexContent> <xs:extension base="t:BaseType"> <xs:all> <!-- ERROR --> <xs:element name="b" type="xs:string" /> </xs:all> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="root" type="t:ExtendedType"></xs:element> </xs:schema> This xsd is not valid though, the following error is reported at <!-- ERROR -->: cos-all-limited.1.2: An all model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition. Documentation of cos-all-limited.1.2 says: 1.2 the {term} property of a particle with {max occurs}=1 which is part of a pair which constitutes the {content type} of a complex type definition. I don't really understand this (neither xsd nor English native speaker :) ). Am I doing the wrong thing, am I doing the right thing wrong, or is there no way to achieve this? Thanks!

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >