Search Results

Search found 3165 results on 127 pages for 'triangle generation'.

Page 17/127 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Unique number identifier generation

    - by xwrs
    I have to create logic for generation unique number identifier for records in database. id, generated in database is a separate column. At this moment, when user calls "create record" action, I save new record, get its database id, generate record number using this id, then put it to the edit form. Using this way means that all entity fields should be nullable to save record to database. I don't like this way. I know that should be better way. Is there a better practice to generate unique number identifier? What is possibility of generating non-unique random numbers? Thank you

    Read the article

  • AtomicInteger for limited sequnce generation

    - by satish
    How can we use AtomicInteger for limited sequence generation say the sequence number has to be between 1 to 60. Once the sequece reaches 60 it has to start again from 1. I wrote this code though not quite sure wether this is thread safe or not? public int getNextValue() { int v; do { v = val.get(); if ( v == 60) { val.set(1); } } while (!val.compareAndSet(v , v + 1)); return v + 1; }

    Read the article

  • Anyone have experience calling Rake from MSBuild for code gen and other benefits? How did it go? Wha

    - by Charlie Flowers
    While programming in C# using Visual Studio 2008, I often wish for "automatic" code generation. If possible, I'd like to achieve it by making my MSBuild solution file call out to Rake, which would call Ruby code for the code generation, having the resulting generated files automatically appear in my solution. Here's one business example (of many possible examples I could name) where this kind of automatic code generation would be helpful. In a recent project I had an interface with some properties that contained dollar amounts. I wanted a second interface and a third interface that had the same properties as the first interface, except they were "qualified" with a business unit name. Something like this: public interface IQuarterlyResults { double TotalRevenue { get; set; } double NetProfit { get; set; } } public interface IConsumerQuarterlyResults { double ConsumerTotalRevenue { get; set; } double ConsumerNetProfit { get; set; } } public interface ICorporateQuarterResults { double CorporateTotalRevenue { get; set; } double CorporateNetProfit { get; set; } } In this example, there is a "Consumer Business Unit" and a "Corporate Business Unit". Every property on IQuarterlyResults becomes a property called "Corporate" + [property name] on ICorporateQuarterlyResults, and likewise for IConsumerQuarterlyResults. Why make interfaces for these, rather than merely having an instance of IQuarterlyResults for Consumer and another instance for Corporate? Because, when working with the calculator object I was building, the user had to deal with 100's of properties, and it is much less confusing if he can deal with "fully qualified" property names such as "ConsumerNetProfit". But let's not get bogged down in this example. It is only an example and not the main question. The main question is this: I love using Ruby and ERB for code generation, and I love using Rake to manage dependencies between tasks. To solve the problem above, what I'd like to do is have MSBuild call out to Rake, and have Rake / Ruby read the list of properties on the "core" interface and then generate the code to make all the dependent interfaces and their properties. This would get triggered every time I do a build, because I'd put it into the MSBuild file for the VS.NET solution. Has anyone tried anything like this? How did it work out for you? What insights can you share about pros, cons, tips for success, etc.? Thanks!

    Read the article

  • NHibernate HiLo generation and SQL 2005/8 Schemas

    - by Kirk Clawson
    I have an issue on my hands that I've spent several days searching for an answer to no avail... We're using HiLo Id generation, and everything seems to be working fine, as long as the entity table is in the same schema as the hibernate_unique_key table. The table structure is pretty simple. I have my hi value table in the db as dbo.hibernate_unique_key. Several entity table are also in the dbo schema, and they work without issue. Then we have tables under the "Contact" schema (such as Contact.Person and Contact.Address). In the Person Mapping file: <class name="Person" table="Person" schema="Contact"> <id name="Id" unsaved-value="0"> <generator class="hilo"> <param name="max_lo">100</param> </generator> </id> ... When I try to insert a Person entity, I get an error of "Invalid object name 'Contact.hibernate_unique_key'. That error is certainly clear enough. So I add: <param name="schema">dbo</param> to my mapping file/generator element. Now, when the SessionFactory is built, I get a "An item with the same key has already been added." error. So now I'm a bit stuck. I can't leave the HiLo generator without a schema, because it picks up the schema from the Class, and I can't specify the schema because it's already been added (presumably because it's my "default_schema" as identified in my XML cfg file). Am I completely hosed here? Must I either A) Keep all my tables in the dbo schema or B) Create a separate HiLo Key table for each unique schema in the DB? Neither of those scenarios is particularly palatable for my application, so I'm hoping that I can "fix" my mapping files to address this issue.

    Read the article

  • XML generation with java, trying to copy the whole node

    - by Pawel Mysior
    I've got an xml document that filled with people (parent node is "students", and there are 25+ "student" nodes). Each student looks like this: <student> <name></name> <surname></surname> <grades> <subject name=""> <small_grades></small_grades> <final_grade></final_grade> </subject> <subject name=""> <small_grades></small_grades> <final_grade></final_grade> </subject> </grades> <average></average> </student> Basically, what I want to do ('ve been asked to do) is to make a program that would get 3 students with the best average. While parsing the document and getting three best students isn't too difficult, the XML generation is a pain in the ass. Right now, what I'm doing is getting every single node from student and recreating it to a new file. Is there a way to copy the whole student node with everything that's in it? Regards, Paul

    Read the article

  • Memcache key generation strategy

    - by Maxim Veksler
    Given function f1 which receives n String arguments, would be considered better random key generation strategy for memcache for the scenario described below ? Our Memcache client does internal md5sum hashing on the keys it gets public class MemcacheClient { public Object get(String key) { String md5 = Md5sum.md5(key) // Talk to memcached to get the Serialization... return memcached(md5); } } First option public static String f1(String s1, String s2, String s3, String s4) { String key = s1 + s2 + s3 + s4; return get(key); } Second option /** * Calculate hash from Strings * * @param objects vararg list of String's * * @return calculated md5sum hash */ public static String stringHash(Object... strings) { if(strings == null) throw new NullPointerException("D'oh! Can't calculate hash for null"); MD5 md5sum = new MD5(); // if(prevHash != null) // md5sum.Update(prevHash); for(int i = 0; i < strings.length; i++) { if(strings[i] != null) { md5sum.Update("_" + strings[i] + "_"); // Convert to String... } else { // If object is null, allow minimum entropy by hashing it's position md5sum.Update("_" + i + "_"); } } return md5sum.asHex(); } public static String f1(String s1, String s2, String s3, String s4) { String key = stringHash(s1, s2, s3, s4); return get(key); } Note that the possible problem with the second option is that we are doing second md5sum (in the memcache client) on an already md5sum'ed digest result. Thanks for reading, Maxim.

    Read the article

  • RANDOM Number Generation in C

    - by CVS-2600Hertz-wordpress-com
    Recently i have begun development of a simple game. It is improved version of an earlier version that i had developed. Large part of the game's success depends on Random number generation in different modes: MODE1 - Truly Random mode myRand(min,max,mode=1); Should return me a random integer b/w min & max. MODE2 - Pseudo Random : Token out of a bag mode myRand(min,max,mode=2); Should return me a random integer b/w min & max. Also should internally keep track of the values returned and must not return the same value again until all the other values are returned atleast once. MODE3 - Pseudo Random : Human mode myRand(min,max,mode=3); Should return me a random integer b/w min & max. The randomisation ought to be not purely mathematically random, rather random as user perceive it. How Humans see RANDOM. * Assume the code is time-critical (i.e. any performance optimisations are welcome) * Pseudo-code will do but an implementation in C is what i'm looking for. * Please keep it simple. A single function should be sufficient (thats what i'm looking for) Thank You

    Read the article

  • How to loop video using NetStream in Data Generation Mode

    - by WesleyJohnson
    I'm using a NetStream in Data Generation Mode to play an embeded FLV using appendBytes. When the stream is finished playing, I'd like to loop the FLV file. I'm not sure how to achieve this. Here is what I have so far (this isn't a complete example): public function createBorderAnimation():void { // Load the skin image borderAnimation = Assets.BorderAnimation; // Convert the animation to a byte array borderAnimationBytes = new borderAnimation(); // Initialize the net connection border_nc = new NetConnection(); border_nc.connect( null ); // Initialize the net stream border_ns = new NetStream( border_nc ); border_ns.client = { onMetaData:function( obj:Object ):void{ trace(obj); } } border_ns.addEventListener( NetStatusEvent.NET_STATUS, border_netStatusHandler ); border_ns.play( null ); border_ns.appendBytes( borderAnimationBytes ); // Initialize the animation border_vd = new Video( 1024, 768 ); border_vd.attachNetStream( border_ns ); // Add the animation to the stage ui = new UIComponent(); ui.addChild( DisplayObject( border_vd ) ); grpBackground.addElement( ui ); } protected function border_netStatusHandler( event:NetStatusEvent ):void { if( event.info.code == "NetStream.Buffer.Flush" || event.info.code == "NetStream.Buffer.Empty" ) { border_ns.appendBytesAction( NetStreamAppendBytesAction.RESET_BEGIN ); border_ns.appendBytes( borderAnimationBytes ); border_ns.appendBytesAction( NetStreamAppendBytesAction.END_SEQUENCE ); } } This will loop the animation, but it starts chewing up memory like crazy. I've tried using NetStream.seek(0) and NetStream.appendBytesAction( NetStreamAppendBytesAction.RESET_SEEK ), but then I'm not sure what to do next. If you just try to call appendBytes again after that, it doesn't work, presumably because I'm appending the full byte array which has the FLV header and stuff? I'm not very familiar with how that all works. Any help is greatly appreciated.

    Read the article

  • Granite DS Actionscript Code Generation Ant cannot find class error

    - by Roaders
    I am trying to get my Ant build to run the granite DS Actionscript code generation task and am running into some problems. At the moment I am getting this error: BUILD FAILED C...\build.xml:62: Could not load Java class file: SampleDTOOne.class So the .class files are obviously being found. I am not however sure if this error means that the it cannot load the .class file or that it cannot find the actual java source code. My Ant task definition looks like this: <classpath> <pathelement location="C.../src/packages/" /> </classpath> <fileset dir="${base.build.dir}/jc/classes/gpbit/packageName"> <include name="*.class" /> </fileset> </gas3> I have tried many different values for the classpath but cannot get anythign to work. I do not like the path that I am using to find the .class files but again at the moment this is the only one I can get to work. None of the variables seem to make it any easier to get to this location. The fileset is definitely working as it definitely found the .clas files to include the name in the error message. More detailed error message: [gas3] Using output dir: C...trunk\plugin\build/etc/src/as3 [gas3] Using classpath: C...\trunk\plugin\src\packages [gas3] Loading all Java classes referenced by inner fileset(s) { [gas3] java.lang.ClassNotFoundException: SampleDTOOne [gas3] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361) any help much appreciated

    Read the article

  • Makefile - Dependency generation

    - by Profetylen
    I am trying to create a makefile that automatically compiles and links my .cpp files into an executable via .o files. What I can't get working is automated (or even manual) dependency generation. When i uncomment the below commented code, nothing is recompiled when i run make build. All i get is make: Nothing to be done for 'build'., even if x.h (or any .h file) has changed. I've been trying to learn from this question: Makefile, header dependencies, dmckee's answer, especially. Why isn't this makefile working? Clarification: I can compile everything, but when I modify any header file, the .cpp files that depend on it aren't updated. So, if I for instance compile my entire source, then I change a #define in the header file, and then run make build, and I get Nothing to be done for 'build'. (when I have uncommented either commented chunks of the below code). CC=gcc CFLAGS=-O2 -Wall LDFLAGS=-lSDL -lstdc++ SOURCES=$(wildcard *.cpp) OBJECTS=$(patsubst %.cpp, obj/%.o,$(SOURCES)) TARGET=bin/test.bin # Nothing happens when i uncomment the following. (automated attempt) #depend: .depend # #.depend: $(SOURCES) # rm -f ./.depend # $(CC) $(CFLAGS) -MM $^ >> ./.depend; # #include .depend # And nothing happens when i uncomment the following. x.cpp and x.h are files in my project. (manual attempt) #x.o: x.cpp x.h clean: rm -f $(TARGET) rm -f $(OBJECTS) run: build ./$(TARGET) debug: build nm $(TARGET) gdb $(TARGET) build: $(TARGET) $(TARGET): $(OBJECTS) @mkdir -p $(@D) $(CC) $(LDFLAGS) $(OBJECTS) -o $@ obj/%.o: %.cpp @mkdir -p $(@D) $(CC) -c $(CFLAGS) $< -o $@ include $(DEPENDENCIES)

    Read the article

  • Automatic incremental SQL Script generation for incremental, nightly builds when using Team Build in

    - by Steve Johnson
    hi all, hope that everybody here is OK. We are using VS 2008 as development tool, TFS 2008 as version control as well as build automation. Some of our developer use dbpro for databases changes and some use SQL Server management studio. I am trying to automate build for Web Application built using C# and VB.Net. Our scenario is such that we have a central database to which our web application connects. Whenever we supply our clients with a new functionality or a bug fix, we supply them incremental builds. The SQL script is checked into source control for every incremental build when they have made and tested there changes on our central DB Server. I want to generate Differential script that can be run at the client as an incremental update script. Now to come about it is a problem. Sometimes our developers tend to forget the database change-sets and the script in the source control is missing an SP or a two. Also, sometimes we need to insert default data into some of the tables that have strict stringent values and not test values. Like a table that contains Services provided by the panel, we add a new service name, signature, credentials and service address, etc etc in the ServiceTable. Besides this many other tables may have test data that may not be needed. If we use DataCompare, it will generate changeset for required data (important for client to enable certain services) and our test data that was added to the database as a result of our testing of the functionality or bug fix. Currently i am using SQLSchemaCompareTask (from Visual Studio 2008 Team Database Professional Power Tools API) in the TFSBuild.proj file of the build definition for TFS 2008. Using SQLSchemaCompareTask, the script generated contains database names like [dbo]. etc which are not desired as the script fails when run against SQL Server 2000 databses (Some of our client still use SQL Server 2000) databases as teh backend of the application. Also default data can't be generated by this process. To overcome this problem, i have to come up with a solution that can compare databases and generate script automatically that does not have to be manually reviewed again before being sent to the client. Please suggest effective methodology of such SQL script generation and suggest whether two different databases may be used or something ? Is there any toolkit or api that can enable build automation for SQL Server databases? Thank you all. Regards Steve

    Read the article

  • Source-to-source compiler framework wanted

    - by cheungcc_2000
    Dear all, I used to use OpenC++ (http://opencxx.sourceforge.net/opencxx/html/overview.html) to perform code generation like: Source: class MyKeyword A { public: void myMethod(inarg double x, inarg const std::vector<int>& y, outarg double& z); }; Generated: class A { public: void myMethod(const string& x, double& y); // generated method below: void _myMehtod(const string& serializedInput, string& serializedOutput) { double x; std::vector<int> y; // deserialized x and y from serializedInput double z; myMethod(x, y, z); } }; This kind of code generation directly matches the use case in the tutorial of OpenC++ (http://www.csg.is.titech.ac.jp/~chiba/opencxx/tutorial.pdf) by writing a meta-level program for handling "MyKeyword", "inarg" and "outarg" and performing the code generation. However, OpenC++ is sort of out-of-date and inactive now, and my code generator can only work on g++ 3.2 and it triggers error on parsing header files of g++ of higher version. I have looked at VivaCore, but it does not provide the infra-structure for compiling meta-level program. I'm also looking at LLVM, but I cannot find documentation that tutor me on working out my source-to-source compilation usage. I'm also aware of the ROSE compiler framework, but I'm not sure whether it suits my usage, and whether its proprietary C++ front-end binary can be used in a commercial product, and whether a Windows version is available. Any comments and pointers to specific tutorial/paper/documentation are much appreciated.

    Read the article

  • 2D polygon triangulation

    - by logank9
    The code below is my attempt at triangulation. It outputs the wrong angles (it read a square's angles as 90, 90. 90, 176) and draws the wrong shapes. What am I doing wrong? //use earclipping to generate a list of triangles to draw std::vector<vec> calcTriDraw(std::vector<vec> poly) { std::vector<double> polyAngles; //get angles for(unsigned int i = 0;i < poly.size();i++) { int p1 = i - 1; int p2 = i; int p3 = i + 1; if(p3 > int(poly.size())) p3 -= poly.size(); if(p1 < 0) p1 += poly.size(); //get the angle from 3 points double dx, dy; dx = poly[p2].x - poly[p1].x; dy = poly[p2].y - poly[p1].y; double a = atan2(dy,dx); dx = poly[p3].x - poly[p2].x; dy = poly[p3].y - poly[p2].y; double b = atan2(dy,dx); polyAngles.push_back((a-b)*180/PI); } std::vector<vec> triList; for(unsigned int i = 0;i < poly.size() && poly.size() > 2;i++) { int p1 = i - 1; int p2 = i; int p3 = i + 1; if(p3 > int(poly.size())) p3 -= poly.size(); if(p1 < 0) p1 += poly.size(); if(polyAngles[p2] >= 180) { continue; } else { triList.push_back(poly[p1]); triList.push_back(poly[p2]); triList.push_back(poly[p3]); poly.erase(poly.begin()+p2); std::vector<vec> add = calcTriDraw(poly); triList.insert(triList.end(), add.begin(), add.end()); break; } } return triList; }

    Read the article

  • Find all cycles in graph, redux

    - by Shadow
    Hi, I know there are a quite some answers existing on this question. However, I found none of them really bringing it to the point. Some argue that a cycle is (almost) the same as a strongly connected components (s. http://stackoverflow.com/questions/546655/finding-all-cycles-in-graph/549402#549402) , so one could use algorithms designed for that goal. Some argue that finding a cycle can be done via DFS and checking for back-edges (s. boost graph documentation on file dependencies). I now would like to have some suggestions on whether all cycles in a graph can be detected via DFS and checking for back-edges? My opinion is that it indeed could work that way as DFS-VISIT (s. pseudocode of DFS) freshly enters each node that was not yet visited. In that sense, each vertex exhibits a potential start of a cycle. Additionally, as DFS visits each edge once, each edge leading to the starting point of a cycle is also covered. Thus, by using DFS and back-edge checking it should indeed be possible to detect all cycles in a graph. Note that, if cycles with different numbers of participant nodes exist (e.g. triangles, rectangles etc.), additional work has to be done to discriminate the acutal "shape" of each cycle.

    Read the article

  • What most efficient method to find a that triangle which contains the given point?

    - by Christo
    Given the triangle with vertices (a,b,c): c / \ / \ / \ a - - - b Which is then subdivided into four triangles by halving each of the edges: c / \ / \ ca / \ bc /\ - - - /\ / \ / \ / \ / \ a- - - - ab - - - -b Wich results in four triangles (a, ab, ca), (b, bc, ab), (c, ca, bc), (ab, bc, ca). Now given a point p. How do I determine in which triangle p lies, given that p is within the outer triangle (a, b, c)? Currently I intend to use ab as the origin. Check whether it is to the left of right of the line "ca - ab" using the perp of "ca - ab" and checking the sign against the dot product of "ab - a" and the perp vector and the vector "p - ab". If it is the same or the dot product is zero then it must be in (a, ab, ca)... Continue with this procedure with the other outer triangles (b, ba, ab) & (c, ca, ba). In the end if it didn't match with these it must be contained within the inner triangle (ab, bc, ca). Is there a better way to do it?

    Read the article

  • Generate POCO classes in different project to the project with Entity Framework model

    - by Max
    I'm trying to use the Repository Pattern with EF4 using VS2010. To this end I am using POCO code generation by right clicking on the entity model designer and clicking Add code generation item. I then select the POCO template and get my classes. What I would like to be able to do is have my solution structured into separate projects for Entity (POCO) classes and another project for the entity model and repository code. This means that my MVC project could use the POCO classes for strongly typed views etc and not have to know about the repository or have to have a reference to it. To plug it all together I will have another separate project with interfaces and use IoC. Sounds good in my head I just don't know how to generate the classes into their own project! I can copy them and then change the namespaces on them but I wanted to avoid manual work whenever I change the schema in the db and want to update my model. Thanks

    Read the article

  • Good tools which generate NUnit unit tests for .NET assemblies in Visual Studio 2008

    - by andy
    Hey guys, I'm pretty new to Unit Testing so bare with me. I realize that best best practice is not to auto generate unit tests, however I'd like to use Code Generation to set-up the basic skeleton of the tests. Now, I know Visual Studio 2008 already has the built in "create tests", however, it just creates a flat list of all the classes it's going to test... and it's not for NUnit right? Ideally, I'd like the code generation to follow the folder AND namespace structure of the assembly its generating tests for. Can you guys recommend any good tools which generate NUnit unit tests for .NET assemblies in Visual Studio 2008? cheers!

    Read the article

  • WPF DataGrid AutoColumn generation via ICustomTypeDescriptor.

    - by panamack
    In a test project I've managed to AutoGenerate WPF DataGrid columns in the following scenario, where the data is stored in a Dictionary and binding is performed via PropertyDescriptors: public class People:List<Person>{ ... } public class Person:Dictionary<string,string>,INotifyPropertyChanged,ICustomTypeDescriptor { } The problem I'm having is in my real life project I'm using MVVM so it's *People*ViewModel which inherits ViewModelBase and hence can't inherit List<Person>. I've tried implementing IList<Person> instead with an internal List<Person> and explicitly setting the DataContext to an IList<Person> reference but that didn't work. I've seen a similar post on binding a win forms DataGridView here, so I'm wondering if the same sort of logic applies in WPF and primarily, what exactly causes the ICustomTypeDescriptor implementation to be picked up when inheriting List<T> that is missing when you simply implement IList<T> instead.

    Read the article

  • Zend Pdf generation from an action

    - by Nisanth
    Hi all, I have a controller Employee , in that i have the action detail . The detail action prints like the attached image. Suppose there is a save pdf button, i need to print this page as .pdf.. How can i do this ? Pls help me Thanks in advance Nisanth

    Read the article

  • VB6 ImageList Frm Code Generation

    - by DAC
    Note: This is probably a shot in the dark, and its purely out of curiosity that I'm asking. When using the ImageList control from the Microsoft Common Control lib (mscomctl.ocx) I have found that VB6 generates FRM code that doesn't resolve to real property/method names and I am curious as to how the resolution is made. An example of the generated FRM code is given below with an ImageList containing 3 images: Begin MSComctlLib.ImageList ImageList1 BackColor = -2147483643 ImageWidth = 100 ImageHeight = 45 MaskColor = 12632256 BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} NumListImages = 3 BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Form1.frx":0054 Key = "" EndProperty BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Form1.frx":3562 Key = "" EndProperty BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Form1.frx":6A70 Key = "" EndProperty EndProperty End From my experience, a BeginProperty tag typically means a compound property (an object) is being assigned to, such as the Font object of most controls, for example: Begin VB.Form Form1 Caption = "Form1" ClientHeight = 10950 ClientLeft = 60 ClientTop = 450 ClientWidth = 7215 BeginProperty Font Name = "MS Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = -1 'True Strikethrough = 0 'False EndProperty End Which can be easily seen to resolve to VB.Form.Font.<Property Name>. With ImageList, there is no property called Images. The GUID associated with property Images indicates type ListImages which implements interface IImages. This type makes sense, as the ImageList control has a property called ListImages which is of type IImages. Secondly, properties ListImage1, ListImage2 and ListImage3 don't exist on type IImages, but the GUID associated with these properties indicates type ListImage which implements interface IImage. This type also makes sense, as IImages is in fact a collection of IImage. What doesn't make sense to me is how VB6 makes these associations. How does VB6 know to make the association between the name Images - ListImages purely because of an associated type (provided by the GUID) - perhaps because it's the only property of that type? Secondly, how does it resolve ListImage1, ListImage2 and ListImage3 into additions to the collection IImages, and does it use the Add method? Or perhaps the ControlDefault property? Perhaps VB6 has specific knowledge of this control and no logical resolution exists?

    Read the article

  • Automatic INotifyPropertyChanged Implementation through T4 code generation?

    - by chrischu
    I'm currently working on setting up a new project of mine and was wondering how I could achieve that my ViewModel classes do have INotifyPropertyChanged support while not having to handcode all the properties myself. I looked into AOP frameworks but I think they would just blow up my project with another dependency. So I thought about generating the property implementations with T4. The setup would be this: I have a ViewModel class that declares just its Properties background variables and then I use T4 to generate the Property Implementations from it. For example this would be my ViewModel: public partial class ViewModel { private string p_SomeProperty; } Then T4 would go over the source file and look for member declarations named "p_" and generate a file like this: public partial class ViewModel { public string SomeProperty { get { return p_SomeProperty; } set { p_SomeProperty= value; NotifyPropertyChanged("SomeProperty"); } } } This approach has some advantages but I'm not sure if it can really work. So I wanted to post my idea here on StackOverflow as a question to get some feedback on it and maybe some advice how it can be done better/easier/safer.

    Read the article

  • WCF Proxy generation

    - by dragonfly
    Hi, I'm generating proxy using svcutil tool. My contract methods return objects of particular type. However generated proxy client interface has return value of type object. What is more I get exception with message: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] : The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:name. The InnerException message was 'XML 'Element' 'http://tempuri.org/:name' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'. Please see InnerException for more details. Any ideas what's going on?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >