Is there anyway to remove unused namespaces across a whole project or solution at once
i know you can do it file by file but is there anyway to do this in one step for all files in a project ? thks, ak ...
i know you can do it file by file but is there anyway to do this in one step for all files in a project ? thks, ak ...
when a dll is created out of the source code in a given namespaces a,b with functions a::open,b::open will there be any conflict in calling these function. ...
In the past I've always gone and called my namespace for a particular project the same as the project (and principle class) e.g.: namespace KeepAlive { public partial class KeepAlive : ServiceBase {... Then from other projects whenever i've called that class its always been: KeepAlive.KeepAlive()... I'm now beginning to thi...
I am using .NET2.0. Let's say a have a simple aspx form with txtInput and btnSomeAction <asp:TextBox ID="txtInput" runat="server"></asp:TextBox> <asp:Button ID="btnSomeAction" runat="server" CommandName="SomeAction" Text="Do"/> Then within the code behind the form I have Protected Sub btnSomeAction_Click(ByVal sender As System....
Assuming a class called Bar in a namespace called foo, which syntax do you prefer for your source (.cpp/.cc) file? namespace foo { ... void Bar::SomeMethod() { ... } } // foo or void foo::Bar::SomeMethod() { ... } I use namespaces heavily and prefer the first syntax, but when adding code using the Visual Studio Class Wizar...
What is the difference between using #include<filename> and #include<filename.h> in c++ which of the two is used and why it is used ...
What's the difference between the two..?? ...
Hopefully this is a really quick one ;) I have written a lexer / parser specification in ANTLR3, and am targeting the CSharp2 target. The generated code works correctly, but I can't get ANTLR to put the C# output into a namespace. The relevant section of the Grammar file is as follows: grammar MyGrammar; options { language = CSh...
Hi all, I am using JAXB1 (v1.0.6) for marshaling/unmarshaling on Spring WS 1.0.4 and JDK 1.4.2. Everything was working well until I have tried to add namespaces to the original XSD files from which I have generated java classes by JAXB, so that the system could accept requests with namespaces. Now, when I send a requst to my system, I...
I am working on some code written by a co-worker who no longer works with the company, and I have found the following code: (which I have cut down below) namespace NsA { namespace NsB { namespace NsC { namespace { class A { /*etc*/ }; class B { /*etc*/ }; } namespace { class C { /*etc*/ }; } } } }...
Is it acceptable to add types to the std namespace. For example, I want a TCHAR-friendly string, so is the following acceptable? #include <string> namespace std { typedef basic_string<TCHAR> tstring; } Or should I use my own namespace? ...
I have been using anonymous namespaces to store local data and functions and wanted to know when the data is initialized? Is it when the application starts in the same way as static data or is it compiler dependent? For example: // foo.cpp #include "foo.h" namespace { const int SOME_VALUE = 42; } void foo::SomeFunc(int n) { if...
I need to create an XmlDocument with a root element containing multiple namespaces. Am using C# 2.0 or 3.0 Here is my code: XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("JOBS", "http://www.example.com"); doc.AppendChild(root); XmlElement job = doc.CreateElement("JOB", "http://www.example.com"); root.Append...
A longwinded question - please bear with me! I want to programatically create an XML document with namespaces and schemas. Something like <myroot xmlns="http://www.someurl.com/ns/myroot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/ns/myroot http://www.someurl.com/xml/...
A related question to one I asked earlier... Just checking on something: Should the order of the xmlns, xmlns:xsi and xsi:schemaLocation attributes in an XML file matter? I'm finding that it does - at least when using XML Notepad 2007 to view the XML file. For example (assuming that my XML file is legal according to my schema) this gi...
Hi @ all :) I'm still new with C#, and I'm working on a project where we also use WPF, and the WPF DataGrid Toolkit (See at CodePlex), which hasn't yet been released into the framework. Due to the nature of the project, it's 100% sure we will be altering some controls of the assembly later. My co-workers have decided to redefine every ...
Hi there is there a possibility to get an object from a specific namespace? Perhaps with the System.Reflections? I want to get all objects from type ITestType in the namespace Test.TestTypes as Objects so that I have a list of instances of TestType1, TestType2, TestType3 and so on. Can Someone help me? I don't know where to search for th...
This is silly, but I haven't found this information. If you have names of concepts and suitable references, just let me know. I'd like to understand how should I validate a given named id for a generic entity, like, say, an email login, just like Yahoo, Google and Microsoft do. I mean... If you do have an user named foo, trying to crea...
Is there a way to select all classes within a folder and assign a namespace to each of them in visual studio? If there is no tool to do it, is there a regex pattern that will match everything before the class declatarion, but after the imports? ...
All the member variables and member functions in my class ClassA are static. If a user is trying (by mistake) to create an object of this class, he receives a warning: "ClassA, local variable never referenced", because all the functions are static, so this object is never referenced. So, I want to prevent the user from trying to create...