I am currently try to write a code generator and I would like the user to select the target type for a property on a class via a drop down, but to populate the drop down I need to know what types are available to the project.
How do I access via a VS extension the properties that have been loaded by the current project?
Check out my answer here:
How to access project code meta data?
You should be able to get the types from the code snippet I provided.
Related
I am using Crystal Reports for .Net Framework in Visual Studio Ultimate 2013. I am trying to use a class object as a data source. The application is ASP.Net MVC and I will populate the object before passing it to the report.
I am failing in adding the class to the report as an ADO.Net data source. I followed these steps in Database Expert:
Navigate to Create New Connection > ADO.Net (XML). Click Make New Connection. The ADO.Net (XML) window appears.
In the File Path field, choose the DLL that contains the class.
After choosing the DLL, the Class Name field populates with the classes in the DLL. I choose the class object that I want to use.
Click Finish to dismiss the ADO.Net (XML) window.
Back in the Database Expert window, I now have an item underneath ADO.Net (XML) for my class. When I expand that item, there is one entry named "get_Entries." This isn't the same as data sources for other classes used by other reports. Those have an item with the same name as the class.
Double click on the "get_Entries" item to add it to the report. An error message appears: "Logon failed. Details: crdb_adoplus: Common Language Runtime detected an invalid program."
For info, right-click on the bad data source item and select Properties. The dialog that pops up has this information:
Database Type: ADO.Net (XML)
Internal Connection ID: a GUID.
Class Name: The name of the class.
File Path: The path to the DLL that contains the class.
For comparison, the good data source items have the same information minus the file path.
I consulted with coworkers, searched the Internet and looked at the "Similar Questions" that SO suggested. None seem to know what is going on here. Any help would be appreciated.
Database Wizard -> project data -> .net objects.
select P.O.C.O. it should be in the namespace of the project referenced dll NO.
Then fill in the MVC controller P.O.C.O. with data and create your report after I apply it with SetDataSource
Till current moment I knew only one recipy to create form VC++ designer:
1. Add dialog resource and design what you want in designer.
2. Create MFC form by using designed dialog resources
But now I got project sample that has form and has no *.rs files with form information. Instead of that it has header file that has form icon. Header file contains many code that creates controls and sets style. It is also possible select from menu "View Designer". That makes me think that there is another way of creating form. Besides that looks that codes does't uses MFC.
How to create simple form application with designer that would generate header file (not resource) and not use MFC?
Unfortunately I can't "View Designer" because during this procedure error is generated:
C++ CodeDOM parser error: Line: 1520, Column: 42 --- Unknown type 'AxKgLib.AxKg'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.
Correct me if I'm wrong. Looks like I need registered ActiveX for this project. I have registered ocx that was included in source, but this didn't helped.
How to solve this problem? How to get list of all ocx that system has to make sure there is no required AxKgLib.AxKg? How to make designer to show me form without required control?
Often, when I'm looking for information of how to set certain properties of controls (I'm using Visual Studio primarily, but this question does apply to any IDE), the examples I find normally involve programatically setting said properties.
Here's an example, using the DataGridView.DefaultCellStyle property on MSDN:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.defaultcellstyle(v=vs.110).aspx
So my question is: is it better for a programmer to modify these properties by code, or is it better to use the IDE itself to change them via the properties pane? I realize that doing it the latter way will result in auto-generated code anyway, but it will be "somewhere else" in relation to the main bulk of user-generated code.
It depends on your requirements. If the app you are developing is planned to be dynamic, then it is a good idea to do it the way it is described in the reference you provided. For example, you may create a class containing the method which will set the basic settings of the gridview, so on every page you may just call this method and pass to it the gridview as a parameter instead of repeating setting the grid properties on every page.
Can I inspect a Core Data model from Xcode?
I want to see if the data are correctly stored into the database.
You can use this tool http://christian-kienle.de/CoreDataEditor
You can inspect all datas from your persistent store
There's no direct "show me some data stored at some path I specified somewhere in my code or at runtime that happens to use this model" feature.
If you want to view a file easily in Xcode, you'll need to add the file to your project (don't let it copy into project - just reference it in place) so you can select it in the navigator.
Caveat: This only works for text-based store types (like XML or some custom text-based store type you cooked up). If you use binary or SQLite store types, all you'll see is binary. There's no SQLite database browsing/editing functions in Xcode.
I have not come across a way to check the Core Data Modal directly from Xcode... right now I use "SQlite Database Browser" to check my database... its a good way to check your data in the database.. you can also execute queries on it...
P.S. If you do come across a way to check the Core Data Modal directly from Xcode, please do post it as an answer here...
I have a question concerning the class generation in Visual Studio 2008.
I use a web service which is added using Add Web Reference. It works great and all the classes seem to have been generated successfully. When I try to generate a class diagram using View Class Diagram for the project which uses the web service, I get:
Some of the selected type(s) cannot
be added to the class diagram. Check
the code for errors and ensure that
all required assemblies are
referenced
I have followed both of these suggestions, and the project has no errors or warnings. I get no error for other projects in the same solution which do not use any web service.
The web service http://foo.bar.com/wsdl/ in a bit anonymized form (though it still has the same structure, I just changed some names) can be found here if it is important for the answer: http://pastebin.com/rd7W9BA6
Append
As an example if I double left-click on class Age inside the WebService folder (in the tree) in Class View I get to see the public partial class Age in the file Reference.cs.
I can see the above Age class in Object browser as well.
It really seems like I have all the necessary information to build a class diagram. But when I right click on said class and choose View Class Diagram I get the error message quoted above.
If I right click any other class, which is not in the WebService folder, and choose View Class Diagram I get to see the diagram for the clicked class. So it must have something to do with it being generated from a WSDL-file.
Right click the project and choose Add Existing Item. Add the Reference.cs file to the project.
Now View Class Diagram for the entire project works as the Reference.cs-file may be accessed by the class diagram generator.
The downside is that you have a generated file as part of your project. And that it won't stay up to date as it is being copied when added. Thus this solution is really only to be used when in need of a class diagram, and then the added (copied) Reference.cs should be deleted as you will step in to conflicts if you don't. When you delete it, those classes are marked as unavailable in the class diagram. So export it as a picture first.