I am currently working on a project where I will be using Mantisbt's API to integrate bugtracking features into my program, however I have hit a snag.
I used wsdl.exe to generate a c# client library.
I am trying to get the reproducibility, severity, and priority from mantis (preferably in an ObjectRef array) to display it to the end-user so that they may select it from a drop down list. I managed to get the categories using the following line:
this.connector.mc_project_get_categories(username,password,projectid);
However, there doesn't seem to be a similar line for the other fields I am looking for.
I think you're looking for mc_enum_reproducibilities . This is preferred to hard-coding your own values, since the MantisBT installation may be customized to have other reproducibilities.
Reproducibility, severity, priority and similar fields are enumerations in the Mantis PHP files and must be hard-coded in. The values and text are found in the core/constant_inc.php file.
From these definitions you can create your own ObjectRef to pass.
Related
I'm digging into a project, dealing with Windows Portable Devices (WPD). Everything I am going through has WPD_[some name], WPD_[some other thing], etc. All the documentation pages I find refer to these constants. But under the hood, these constants are directly associated to some constant GUID values.
How / where do these constants exists? Some documentation says to look into PortableDevices.h, and everything I look for on that just points to more named constants, not the corresponding GUIDs.
For example,
WPD_CATEGORY_CAPABILITIES = Guid("0cabec78-6b74-41c6-9216-2639d1fce356")
Another page to show a good example of all these "WPD_" references can be found on Microsoft's pages.
Having a look around, I found the Magic Number Database which lists all of these values. The link, with a filter applied to only show those you need, is
https://www.magnumdb.com/search?q=title%3AWPD_%2A+AND+valuetype%3ASystem.Guid
However, that site also gives the path of the file in which those values are sourced from which points at the Windows Driver Kit so my advice would be to grab that, install it and find the header file in this folder (you may need to tweak the version number if the WDK has been updated):
%ProgramFiles(x86)%\Windows Kits\10\Include\10.0.19041.0\um\PortableDevice.h
Download the WDK from here.
I use HelpNDoc for providing a chm-file for the context sensitive help in my application.
In this software you define a help-ID and a corresponding help-context.
The help-ID for example maybe "SystemSetup" and the help-context is 57.
Now my question:
I can call the help this way:
System.Windows.Forms.Help.ShowHelp(null, #"myhelp.chm", HelpNavigator.TopicId, "57");
and all works well, but can I some how call ShowHelp with the help-ID ("SystemSetup") instead?
I ask this cause the help-context can change, but the help-ID stays always the same.
There is no easy way to do that. The Topic ID is the best thing you have to directly point to a topic. The software we use to generate the CHM files allows names to be given to topics, which can be retrieved using your code.
If that doesn't work for you, and the only thing you have is the name, you might get it done by using the Topic enum value and the name of the HTML file (if it is distinct enough).
Something like this could be what you need (you can retrieve the html file name through an CHM viewer):
System.Windows.Forms.Help.ShowHelp(null, #"myhelp.chm", HelpNavigator.Topic, "SystemSetup.html");
I don't know which option is better. That is up to you and your specific scenario.
HelpNDoc uses the following pattern to name topic files: "HELP_ID.htm" where HELP_ID is the chosen unique Help Id for that topic. So you can reliably open a specific topic using the following command:
System.Windows.Forms.Help.ShowHelp(null, #"help.chm", HelpNavigator.Topic, "HELP_ID.htm");
Also, as you found out, HelpNDoc is able to generate a source file with constants. And you can automate its generation and include it in your build process by creating a new "Code" build. See the step by step guide: How to create a new documentation output to be published
I'm currently working with a Chinese SMB server, on which almost all the company files are stored.
As the structure doesn't change, I'd like to be able to put a "label" on files, based on a rules (something that allow me to handle generated files, which includes dates for example).
I need only support for win7 and above, and I'd like my informations to be read from a text file rather than relying on some metadata or client's data.
So I thought of writting a shell extension to do the work. My problem is, that by looking at the documentation, I didn't find something that allow me to change the name. The best solution I've found so far is to go with the infotip handler, but I wondering if anyone has a better way to do this.
In short, it needs:
1) To be compatible with win7 (and above),
2) To be visible at first sight
3) To use a readonly fs
After extensive research, I've found that the best way to do it is to write a Shell Namespace extension.
I'll be able to provide a virtual directory representing my server's structure, and translate the names the way I want.
This seems a little overkill though, but there's no other way to change the informations displayed as the display name is managed by an IShellFolder which provides it to an IShellView
One excellent source of informations I've found about it, and the most up to date so far, is an article on Michael Edenfiled's blog
We have been asked to provide all of the possible error messages in our code for support purposes.
Unfortunately they are not all located in resource files so I figure that if we can get a list of all of the strings in the app we can then filter out the error messages from there.
Is there anything that would let me do this in a C# app?
Cheers
How about using the find function like such
You can also use regular expressions if you have pattern and be detailed in your search by changing the "Use" to "Regular Expressions"
If you have ReSharper 5 you can use their localization feature to help you do this.
Enable localization for your project, then right click the project and select Find Code Issues. It will list all instances of a string hardcoded into the application. (Unless you have Localizable(false) set)
If you can think of a consistent string that you use on each message line (eg "throw new exception(" or "MessageBox.Show(", it may be as simple as hitting Ctrl+Shift+F in Visual Studio (find in files), typing it in, then copying the results to a file.
Before you jump into Regex land, check this out: Regex to parse C# source code to find all strings
I'm sure there are some RegEx expressions or some such you could run on your code base and maybe catch all strings. Seeing as how this is a business requirement and you're likely to be repeating this in the future, I'd refactor to get all my error messages in a structured format first. Then, automate the analysis of the structured format.
Resource files might be appropriate.
I'm trying to write some documentation for a webservice that has been provided by one of our vendors for an application we're integrating. A bunch of the interface is custom objects defined in the web service itself. The vendor has put up significant resistance to providing any documentation for this application and so I've taken it upon myself to do their job for them [against my better judgement].
The documentation they have provided frankly is embarassing and I'm trying to make as short work of this as I possibly can to put some good quality docs together. I know that as I don't have access to their source, I can't just run it through nDoc/Sandcastle to spit out an API doc, but I was wondering if (as a half way house) there was an easy way to export the intellisense to a text file without me having to write a utility to specificially iterate through each of the object types defined and reflect the members out to text?
If I could do this, it would at least make sure that I have a good quality document structure where I can just fill in the blanks. Having to skip back and forth to Visual Studio to check the intellisense for every class member is a very laborious way of doing this.
Does anyone have any ideas?
If it is a web service that you are trying to document, couldnt you then parse out the WSDL?
If you are accessing a remote Web Service, then I think you have access to the corresponding WSDL: what about parsing it and look for just the information you need?
Or using a tool to do this (I Googled for "wsdl documentation generator")?
Or even using WSDL.exe to generate some dummy code from the WSDL and then document it, perhaps helped by GhostDoc?
HTH
Could you use Reflection to dump out the methods etc.?
Reflection is the feature in .Net, which enables us to get some information about object in runtime. That information contains data of the class. Also it can get the names of the methods that are inside the class and constructors of that object.
I think VS.net generates documentation for intellisense. For existing assemblies, it is already on your file system (e.g. C:\Windows\Microsoft.NET\Framework\v2.0.50727\en)
Try using the assembly from the vendor in VS.NET. Use process explorer or any such tool from sysinternals to see what files are being loaded. I am sure, you will find that there is an xml file created for the custom assembly (which is used to show the Intellisense and documentation available with it).
Hope that helps.
EDIT: I think the same folder (where your custom assemblies are located) will have the xml files for documentation.
If you have the dll's could you not decompile them and then recompile and use nDoc? That should give you a reasonalbe start.
Could you just use reflector (from redgate) to view the assembly (decompiled) instead of reproducing a API document. I'm not sure what else you would get of reflecting and building your on document that you wouldn't see live in reflector (of course this would depend on their writing readable code.
Maybe this is crazy, but could you take a screenshot of the full listing, and run it through an OCR program?