Search Results

Search found 13331 results on 534 pages for 'fluent interface'.

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

  • How to fix error - "@interface interfaceName : someEnumeration" gives error "cannot find interface '

    - by Paul V
    How can I solve "cannot find interface declaration 'someEnumeration', superclass of 'interfaceName'" error? What steps will reproduce the problem? Compiling Wsdl2ObjC Targeting groupwise.wsdl file Fixing non-valid file names of output csource code like ".h" + ".m" and objects inside source files Moving up one of the @interface BEFORE it was used futher in code! What is the expected output? Something working What do you see instead? 33 errors. "Inherited" from only 3 similar Inheritances of a typedef enum object by a class. All errors are typical: typedef enum types_StatusTrackingOptions { types_StatusTrackingOptions_none = 0, types_StatusTrackingOptions_None, types_StatusTrackingOptions_Delivered, types_StatusTrackingOptions_DeliveredAndOpened, types_StatusTrackingOptions_All, } types_StatusTrackingOptions; types_StatusTrackingOptions types_StatusTrackingOptions_enumFromString(NSString *string); NSString * types_StatusTrackingOptions_stringFromEnum(types_StatusTrackingOptions enumValue); @interface types_StatusTracking : types_StatusTrackingOptions { ... and here I'm having error "cannot find interface declaration for 'types_StatusTrackingOptions', superclass of 'types_StatusTracking'". What version of the product are you using? On what operating system? Wsdl2ObjC - rev 168, OS - Mac OS X 10.6.2, iPhone SDK - 3.2, Simulator - v. 3.1.2 - 3.1.3, wsdl - for GroupWise v.8, NDK released 2008-12-23, wsdl and xsd files are attached. P.S. GroupWise.wsdl + .xsd files could be downloaded from http://code.google.com/p/wsdl2objc/issues/detail?id=99

    Read the article

  • Can I use metro style interface in my own web application?

    - by LukeP
    I am wondering if I would need to license the Metro style or if I can just freely use it in my own applications. I mean, is it patented or protected in any way that would prevent me from building my own implementation? I effectively would like to copy the visible part of it. I like to idea of being able to: Provide an interface which is used somewhere else (as in 1 less to learn) Use the interface that has been tested for usability (I personally like it) Have the possibility of getting free publicity because of implementing full Metro style web application while not associated with Microsoft, etc.

    Read the article

  • Spring 3 DI using generic DAO interface

    - by Peders
    I'm trying to use @Autowired annotation with my generic Dao interface like this: public interface DaoContainer<E extends DomainObject> { public int numberOfItems(); // Other methods omitted for brevity } I use this interface in my Controller in following fashion: @Configurable public class HelloWorld { @Autowired private DaoContainer<Notification> notificationContainer; @Autowired private DaoContainer<User> userContainer; // Implementation omitted for brevity } I've configured my application context with following configuration <context:spring-configured /> <context:component-scan base-package="com.organization.sample"> <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation" /> </context:component-scan> <tx:annotation-driven /> This works only partially, since Spring creates and injects only one instance of my DaoContainer, namely DaoContainer. In other words, if I ask userContainer.numberOfItems(); I get the number of notificationContainer.numberOfItems() I've tried to use strongly typed interfaces to mark the correct implementation like this: public interface NotificationContainer extends DaoContainer<Notification> { } public interface UserContainer extends DaoContainer<User> { } And then used these interfaces like this: @Configurable public class HelloWorld { @Autowired private NotificationContainer notificationContainer; @Autowired private UserContainer userContainer; // Implementation omitted... } Sadly this fails to BeanCreationException: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.organization.sample.dao.NotificationContainer com.organization.sample.HelloWorld.notificationContainer; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.organization.sample.NotificationContainer] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Now, I'm a little confused how should I proceed or is using multiple Dao's even possible. Any help would be greatly appreciated :)

    Read the article

  • Storing Interface type in ASP.NET Profile

    - by NathanD
    In my ASP.NET website all calls into the data layer return entities as interfaces and the website does not need to know what the concrete type is. This works fine, but I have run into a problem when trying to store one of those types into the user Profile. My interface implements ISerializable, like the following: public interface IInsured : IPerson, IEntity, ISerializable and the concrete type in the datalayer does implement ISerializable. My Profile property in web.config is: <add name="ActiveInsured" type="FacadeInterfaces.IInsured" serializeAs="Binary" defaultValue="[null]"/> It compiles just fine, but I get a runtime error on Profile.Save() saying that the interface cannot be serialized. I have also tried it with serializeAs="Xml". I thought that if my interface implemented ISerializable it would work. Anybody had this problem before or know of a workaround?

    Read the article

  • Java: why is declaration not sufficient in interface?

    - by HH
    Big class contains Format-interfcase and Format-class. The Format-class contains the methods and the interface has the values of the fields. I could have the fields in the class Format but the goal is with Interface. So do I just create dummy-vars to get the errors away, design issue or something ELSE? KEY: Declaration VS Initialisation Explain by the terms, why you have to init in interface. What is the logic behind it? To which kind of problems it leads the use of interface? Sample Code having the init-interface-problem import java.util.*; import java.io.*; public class FormatBig { private static class Format implements Format { private static long getSize(File f){return f.length();} private static long getTime(File f){return f.lastModified();} private static boolean isFile(File f){if(f.isFile()){return true;}} private static boolean isBinary(File f){return Match.isBinary(f);} private static char getType(File f){return Match.getTypes(f);} private static String getPath(File f){return getNoErrPath(f);} //Java API: isHidden, --- SYSTEM DEPENDED: toURI, toURL Format(File f) { // PUZZLE 0: would Stack<Object> be easier? size=getSize(f); time=getTime(f); isfile=isFile(f); isBinary=isBinary(f); type=getType(f); path=getPath(f); //PUZZLE 1: how can simplify the assignment? values.push(size); values.push(time); values.push(isfile); values.push(isBinary); values.push(type); values.push(path); } } public static String getNoErrPath(File f) { try{return f.getCanonicalPath(); }catch(Exception e){e.printStackTrace();} } public static final interface Format { //ERR: IT REQUIRES "=" public long size; public long time; public boolean isFile=true; //ERROR goes away if I initialise wit DUMMY public boolean isBinary; public char type; public String path; Stack<Object> values=new Stack<Object>(); } public static void main(String[] args) { Format fm=new Format(new File(".")); for(Object o:values){System.out.println(o);} } }

    Read the article

  • Delphi interface cast using TValue

    - by conciliator
    I've recently experimented extensively with interfaces and D2010 RTTI. I don't know at runtime the actual type of the interface; although I will have access to it's qualified name using a string. Consider the following: program rtti_sb_1; {$APPTYPE CONSOLE} uses SysUtils, Rtti, TypInfo, mynamespace in 'mynamespace.pas'; var ctx: TRttiContext; InterfaceType: TRttiType; Method: TRttiMethod; ActualParentInstance: IParent; ChildInterfaceValue: TValue; ParentInterfaceValue: TValue; begin ctx := TRttiContext.Create; // Instantiation ActualParentInstance := TChild.Create as IParent; {$define WORKAROUND} {$ifdef WORKAROUND} InterfaceType := ctx.GetType(TypeInfo(IParent)); InterfaceType := ctx.GetType(TypeInfo(IChild)); {$endif} // Fetch interface type InterfaceType := ctx.FindType('mynamespace.IParent'); // This cast is OK and ChildMethod is executed (ActualParentInstance as IChild).ChildMethod(100); // Create a TValue holding the interface TValue.Make(@ActualParentInstance, InterfaceType.Handle, ParentInterfaceValue); InterfaceType := ctx.FindType('mynamespace.IChild'); // This cast doesn't work if ParentInterfaceValue.TryCast(InterfaceType.Handle, ChildInterfaceValue) then begin Method := InterfaceType.GetMethod('ChildMethod'); if (Method <> nil) then begin Method.Invoke(ChildInterfaceValue, [100]); end; end; ReadLn; end. The contents of mynamespace.pas is as follows: {$M+} IParent = interface ['{2375F59E-D432-4D7D-8D62-768F4225FFD1}'] procedure ParentMethod(const Id: integer); end; {$M-} IChild = interface(IParent) ['{6F89487E-5BB7-42FC-A760-38DA2329E0C5}'] procedure ChildMethod(const Id: integer); end; TParent = class(TInterfacedObject, IParent) public procedure ParentMethod(const Id: integer); end; TChild = class(TParent, IChild) public procedure ChildMethod(const Id: integer); end; For completeness, the implementation goes as procedure TParent.ParentMethod(const Id: integer); begin WriteLn('ParentMethod executed. Id is ' + IntToStr(Id)); end; procedure TChild.ChildMethod(const Id: integer); begin WriteLn('ChildMethod executed. Id is ' + IntToStr(Id)); end; The reason for {$define WORKAROUND} may be found in this post. Question: is there any way for me to make the desired type cast using RTTI? In other words: is there a way for me to invoke IChild.ChildMethod from knowing 1) the qualified name of IChild as a string, and 2) a reference to the TChild instance as a IParent interface? (After all, the hard-coded cast works fine. Is this even possible?) Thanks!

    Read the article

  • How to add member variable to an interface in c#

    - by Nassign
    I know this may be basic but I cannot seem to add a member variable to an interface. I tried inheriting the interface to an abstract class and add member variable to the abstract class but it still does not work. Here is my code: public interface IBase { void AddData(); void DeleteData(); } public abstract class AbstractBase : IBase { string ErrorMessage; abstract AddData(); abstract DeleteData(); }

    Read the article

  • Interface for classes that have nothing in common

    - by Tomek Tarczynski
    Lets say I want to make few classes to determine behaviour of agents. The good practice would be to make some common interface for them, such interface (simplified) could look like this: interface IModel { void UpdateBehaviour(); } All , or at least most, of such model would have some parameters, but parameters from one model might have nothing in common with parameters of other model. I would like to have some common way of loading parameters. Question What is the best way to do that? Is it maybe just adding method void LoadParameters(object parameters) to the IModel? Or creating empty interface IParameters and add method void LoadParameters(IParameters parameters)? That are two ideas I came up with, but I don't like either of them.

    Read the article

  • Creating Mock object of Interface with type-hint in method fails on PHPUnit

    - by Mark
    I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array $params); } Then I try to make a Mock object of this interface with PHPUnit 3.4, but I get the following error: Fatal error: Declaration of Mock_Action_b389c0b1::execute() must be compatible with that of Action::execute() in D:\Xampp\xampp\php\PEAR\PHPUnit\Framework\TestCase.php(1121) : eval()'d code on line 2 I looked through the stack trace I got from PHPUnit and found that it creates a Mock object that implements the interface Action, but creates the execute method in the following way: <?php public function execute($request, array $params) As you can see, PHPUnit takes over the array type-hint, but forgets about \requests\Request. Which obviously leads to an error. Does anyone knows a workaround for this error? I also tried it without namespaces, but I still get the same error.

    Read the article

  • Constructor in a Interface?

    - by Sebi
    I know its not possible to define a constructor in a interface. But im wondering why, because i think i could be very useful. So you could be sure that some fields in a class are defined for every implementaiton of this interface. For example consider the following message class: public class MyMessage { public MyMessage(String receiver) { this.receiver = receiver; } private String receiver; public void send() { //some implementation for sending the mssage to the receiver } } If a define a Interface for this class so that i can have more classes which implement the message interface, i can only define the send method and not the constructor. So how can i assure that every implementation of this class really has an receiver setted? If i use a method like setReceiver(String receiver) i can't be sure that this method is really called. In the constructor i could assure it.

    Read the article

  • C# naming convention for extension methods for interface

    - by Sarah Vessels
    I typically name my C# interfaces as IThing. I'm creating an extension method class for IThing, but I don't know what to name it. On one hand, calling it ThingExtensions seems to imply it is an extension class to some Thing class instead of to the IThing interface. It also makes the extension class be sorted away from the interface it extends, when viewing files alphabetically. On the other hand, naming it IThingExtensions makes it look like it is an interface itself, instead of an extension class for an interface. What would you suggest?

    Read the article

  • VS2010 Implement Generic Interface expansion doesn't use specified type

    - by TJB
    Using the release version of Visual Studio 2010 I think there's a difference in the "Implement Interface" expansion from VS2008 If I speicify an interface and implement it in a class as so: public interface IRepository<T> where T : IModel { T Get<T>(int id); void Update<T>(); int Add<T>(T item); } public class MockRepository : IRepository<MockUser> { // ... } Then use the "Implement Interface" expansion and get this: public class MockRepository : IRepository<MockUser> { public T Get<T>(int id) { throw new NotImplementedException(); } public void Update<T>() { throw new NotImplementedException(); } public int Add<T>(T item) { throw new NotImplementedException(); } } Instead of what I expected public class MockRepository : IRepository<MockUser> { public MockUser Get<MockUser>(int id) { throw new NotImplementedException(); } public void Update<MockUser>() { throw new NotImplementedException(); } public int Add<MockUser>(MockUser item) { throw new NotImplementedException(); } } The IDE uses the type variable name from the generic interface definition T instead of the specified concrete type MockUser. Is this a bug? Or is something new just for VS2010 / .Net 4.0?

    Read the article

  • Implementing few methods of a interface class-C#

    - by Jankhana
    Is it possible in C# to have a class that implement an interface that has 10 methods declared but implementing only 5 methods i.e defining only 5 methods of that interface??? Actually I have an interface that is implemented by 3 class and not all the methods are used by all the class so if I could exclude any method???

    Read the article

  • iPhone: Interface Builder leaks memory?

    - by Stefan Klumpp
    I have been working on an iPhone project, where we created all the user interface programmatically in code. Now I'm going to start a new iPhone project and thinking of using Interface Builder instead, because it has been recommended to me as being a very useful tool, creating less headache than writing everything in code and in general much faster (regarding development time). However, my team members have some concerns due to previous problems with using Interface Builder and resulting memory leaks. Therefor they suggest building everything in code again. I don't know where these concerns come from, but maybe someone with more experience than we have can give some insight on that topic. Doing a simple Google search doesn't really provide any information proofing that there are any problems with memory leaks created by the Interface Builder itself.

    Read the article

  • Interface injection in Spring Framework

    - by Aubergine
    There is article in here, however I am still in doubt, as some people keep confusing me. Doesn't Spring really support Interface injection at all? So what I want to clarify: setSomething(somethingInterface something); // this IS NOT interface injection, IT IS setter injection? Interface injection is when you just write `implements someExportedModuleInterface' and it configures it automatically? Could you please give an example of how this interface injection is done with Spring 'aware' interfaces? I am writing dissertation and I want to be sure what I am saying is not lie and correct.

    Read the article

  • How to define colors in XCodes' Interface Builder?

    - by favo
    Hi, I would like to copy colors between elements in the interface builder or define them using RGB values. I.e. copy the background color of a button to another button without duplicating the button. Or: Enter an exact RGB code using the interface builder. Currently I can do this only programmatically but the interface builder is meant to design the GUI, so there must be such possibilities. Thank you all in advance for your answers.

    Read the article

  • How to map an interface in nhibernate?

    - by Josh
    I'm using two class NiceCustomer & RoughCustomer which implment the interface ICustomer. The ICustomer has four properties. They are: 1) Property Id() As Integer 2) Property Name() As String 3) Property IsNiceCustomer() As Boolean 4) ReadOnly Property AddressFullText() As String I don't know how to map the interface ICustomer, to the database. I get an error like this in the inner exception. "An association refers to an unmapped class: ICustomer" I'm using Fluent and NHibernate. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • 6 Prominent Features of New GMail User Interface

    - by Gopinath
    GMail’s user interface has got a big make over today and the new user interface is available to everyone. We can switch to the new user interface by click on “Switch to the new look” link available at the bottom right of GMail (If you are on IE 6 or similar type of bad browsers, you will not see the option!). I switched to the new user interface as soon I noticed the link and played with it for sometime. In this post I want to share the prominent features of all new GMail interface. 1. All New Conversations Interface GMail’s threaded conversations is a game changing feature when it was first introduced by Google. For  a long time we have not seen much updates to the threaded conversation views. In the new GMail interface, threaded conversation sports a great new look – conversations are always visible in a horizontal fashion as opposed to stack interface of earlier version. When you open a conversation, you get a quick glance of individual thread without expanding the thread. Readability is improved a lot now.  Check image after the break 2. Sender Profile Photos In Email Threads Did you observe the above screenshot of conversations view? It has profile images of the participants in the thread. Identifying person of a thread is much more easy. 3. Advanced Search Box Search is the heart of Google’s business and it’s their flagship technology. GMail’s search interface is enhanced to let you quickly find the required e-mails. Also you can create mail filters from the search box without leaving the screen or opening up a new popup. 4. Gmail Automatically Resizing To Fit Multiple Devices There is no doubt that this is post PC era where people started using more of tablets and big screen smartphones than ever. The new user interface of GMail automatically resizes itself to fit the size of screen seamlessly. 5. HD Images For Your Themes, Sourced from iStockphoto Are you bored with minimalistic GMail interface and the few flashy themes? Here comes GMail HD themes backed by stock photographs sourced from iStockPhoto website. If you have a widescreen HD monitor then decorate your inbox with beautiful themes. 6. Resize Labels & Chat Panels Now you got a splitter between Labels & Chat panel that lets resize their height as you prefer. Also Label panel auto expands its height when you mouse over to show you hidden labels if any. Video – overview of new GMail features This article titled,6 Prominent Features of New GMail User Interface, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Interface contracts – forcing code contracts through interfaces

    - by DigiMortal
    Sometimes we need a way to make different implementations of same interface follow same rules. One option is to duplicate contracts to all implementation but this is not good option because we have duplicated code then. The other option is to force contracts to all implementations at interface level. In this posting I will show you how to do it using interface contracts and contracts class. Using code from previous example about unit testing code with code contracts I will go further and force contracts at interface level. Here is the code from previous example. Take a careful look at it because I will talk about some modifications to this code soon. public interface IRandomGenerator {     int Next(int min, int max); }   public class RandomGenerator : IRandomGenerator {     private Random _random = new Random();       public int Next(int min, int max)     {         return _random.Next(min, max);     } }    public class Randomizer {     private IRandomGenerator _generator;       private Randomizer()     {         _generator = new RandomGenerator();     }       public Randomizer(IRandomGenerator generator)     {         _generator = generator;     }       public int GetRandomFromRangeContracted(int min, int max)     {         Contract.Requires<ArgumentOutOfRangeException>(             min < max,             "Min must be less than max"         );           Contract.Ensures(             Contract.Result<int>() >= min &&             Contract.Result<int>() <= max,             "Return value is out of range"         );           return _generator.Next(min, max);     } } If we look at the GetRandomFromRangeContracted() method we can see that contracts set in this method are applicable to all implementations of IRandomGenerator interface. Although we can write new implementations as we want these implementations need exactly the same contracts. If we are using generators somewhere else then code contracts are not with them anymore. To solve the problem we will force code contracts at interface level. NB! To make the following code work you must enable Contract Reference Assembly building from project settings. Interface contracts and contracts class Interface contains no code – only definitions of members that implementing type must have. But code contracts must be defined in body of member they are part of. To get over this limitation, code contracts are defined in separate contracts class. Interface is bound to this class by special attribute and contracts class refers to interface through special attribute. Here is the IRandomGenerator with contracts and contracts class. Also I write simple fake so we can test contracts easily based only on interface mock. [ContractClass(typeof(RandomGeneratorContracts))] public interface IRandomGenerator {     int Next(int min, int max); }   [ContractClassFor(typeof(IRandomGenerator))] internal sealed class RandomGeneratorContracts : IRandomGenerator {     int IRandomGenerator.Next(int min, int max)     {         Contract.Requires<ArgumentOutOfRangeException>(                 min < max,                 "Min must be less than max"             );           Contract.Ensures(             Contract.Result<int>() >= min &&             Contract.Result<int>() <= max,             "Return value is out of range"         );           return default(int);     } }   public class RandomFake : IRandomGenerator {     private int _testValue;       public RandomGen(int testValue)     {         _testValue = testValue;     }       public int Next(int min, int max)     {         return _testValue;     } } To try out these changes use the following code. var gen = new RandomFake(3);   try {     gen.Next(10, 1); } catch(Exception ex) {     Debug.WriteLine(ex.Message); }   try {     gen.Next(5, 10); } catch(Exception ex) {     Debug.WriteLine(ex.Message); } Now we can force code contracts to all types that implement our IRandomGenerator interface and we must test only the interface to make sure that contracts are defined correctly.

    Read the article

  • The term "interface" in C++

    - by Flexo
    Java makes a clear distinction between class and interface. (I believe C# does also, but I have no experience with it). When writing C++ however there is no language enforced distinction between class and interface. Consequently I've always viewed interface as a workaround for the lack of multiple inheritance in Java. Making such a distinction feels arbitrary and meaningless in C++. I've always tended to go with the "write things in the most obvious way" approach, so if in C++ I've got what might be called an interface in Java, e.g.: class Foo { public: virtual void doStuff() = 0; ~Foo() = 0; }; and I then decided that most implementers of Foo wanted to share some common functionality I would probably write: class Foo { public: virtual void doStuff() = 0; ~Foo() {} protected: // If it needs this to do its thing: int internalHelperThing(int); // Or if it doesn't need the this pointer: static int someOtherHelper(int); }; Which then makes this not an interface in the Java sense anymore. Instead C++ has two important concepts, related to the same underlying inheritance problem: virtual inhertiance Classes with no member variables can occupy no extra space when used as a base "Base class subobjects may have zero size" Reference Of those I try to avoid #1 wherever possible - it's rare to encounter a scenario where that genuinely is the "cleanest" design. #2 is however a subtle, but important difference between my understanding of the term "interface" and the C++ language features. As a result of this I currently (almost) never refer to things as "interfaces" in C++ and talk in terms of base classes and their sizes. I would say that in the context of C++ "interface" is a misnomer. It has come to my attention though that not many people make such a distinction. Do I stand to lose anything by allowing (e.g. protected) non-virtual functions to exist within an "interface" in C++? (My feeling is the exactly the opposite - a more natural location for shared code) Is the term "interface" meaningful in C++ - does it imply only pure virtual or would it be fair to call C++ classes with no member variables an interface still?

    Read the article

  • Implementation of interface when using child class of a parent class in method of interface

    - by dotnetdev
    I don't have access to my dev environment, but when I write the below: interface IExample void Test (HtmlControl ctrl); class Example : IExample { public void Test (HtmlTextArea area) { } I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework). Thanks

    Read the article

  • FluentPath: a fluent wrapper around System.IO

    - by Bertrand Le Roy
    .NET is now more than eight years old, and some of its APIs got old with more grace than others. System.IO in particular has always been a little awkward. It’s mostly static method calls (Path.*, Directory.*, etc.) and some stateful classes (DirectoryInfo, FileInfo). In these APIs, paths are plain strings. Since .NET v1, lots of good things happened to C#: lambda expressions, extension methods, optional parameters to name just a few. Outside of .NET, other interesting things happened as well. For example, you might have heard about this JavaScript library that had some success introducing a fluent API to handle the hierarchical structure of the HTML DOM. You know? jQuery. Knowing all that, every time I need to use the stuff in System.IO, I cringe. So I thought I’d just build a more modern wrapper around it. I used a fluent API based on an essentially immutable Path type and an enumeration of such path objects. To achieve the fluent style, a healthy dose of lambda expressions is being used to act on the objects. Without further ado, here’s an example of what you can do with the new API. In that example, I’m using a Media Center extension that wants all video files to be in their own folder. For that, I need a small tool that creates directories for each video file and moves the files in there. Here’s the code for it: Path.Get(args[0]) .Select(p => p.Extension == ".avi" || p.Extension == ".m4v" || p.Extension == ".wmv" || p.Extension == ".mp4" || p.Extension == ".dvr-ms" || p.Extension == ".mpg" || p.Extension == ".mkv") .CreateDirectory(p => p.Parent .Combine(p.FileNameWithoutExtension)) .Previous() .Move(p => p.Parent .Combine(p.FileNameWithoutExtension) .Combine(p.FileName)); This code creates a Path object pointing at the path pointed to by the first command line argument of my executable. It then selects all video files. After that, it creates directories that have the same names as each of the files, but without their extension. The result of that operation is the set of created directories. We can now get back to the previous set using the Previous method, and finally we can move each of the files in the set to the corresponding freshly created directory, whose name is the combination of the parent directory and the filename without extension. The new fluent path library covers a fair part of what’s in System.IO in a single, convenient API. Check it out, I hope you’ll enjoy it. Suggestions are more than welcome. For example, should I make this its own project on CodePlex or is this informal style just OK? Anything missing that you’d like to see? Is there a specific example you’d like to see expressed with the new API? Bugs? The code can be downloaded from here (this is under a new BSD license): http://weblogs.asp.net/blogs/bleroy/Samples/FluentPath.zip

    Read the article

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