using svn tortoise features through code - c#

I am writing an application in c# that copies files, and I wanted to only copy files according to their tortoise-svn status.. i.e., I would like to divide the files into modified files vs unmodified.
Is there a way to do this? I've been looking at the different .exe files in the svn/bin folder, but haven't found anything. perhaps theres a dll I am overlooking?
Thanks

Talk to svn directly, use svn status.
http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.tour.cycle.examine.status

Thanks everyone for your help, it finally works... I got it to work using two methods:
either using a process in c# and calling the SubWCRev.exe (if you put in as a process argument the path of the file you want to check for svn modifications, you should get that detail as an output).
and the other way was adding the SubWCRevCOM.exe as a reference and then using it as so:
using LibSubWCRev;
SubWCRev subCheckMod = new SubWCRev();
subCheckMod.GetWCInfo(#file_to_check, true, true);
if (subCheckMod.HasModifications) {...}
thanks again everyone =]

Since your question is tagged as C#, I would suggest looking for .Net bindings to subversion.
SharpSvn looks like it would meet your needs.

TortoiseProc is used for automation, but you need to study its syntax.

If you wanted to use the exes that come with TortoiseSVN look at SubWCRev.exe.

Related

Running a SAS 9.2 program inside a C# project ?

I'm running SAS batch files daily but since SAS files are not compiled, they are available for viewing by simply opening the files with Notepad.
I was wondering if I could run a .SAS file from within a C# project, hence hiding the SAS code.
Thanks in advance for your help !
If you want to hide your SAS code, there are a few ways to do it without something quite so complicated. This topic is well covered here:
https://communities.sas.com/thread/34604?start=0&tstart=0
Stored programs and compiled macros are two very good solutions here; they're fairly easy to implement and allow you to deploy your code (just like a C# project or whatever) with a minimum of extra work.

How to check if the subversion URL is file or a directory using sharpsvn

First things first - I am sorry if you think this question is utterly stupid.
I am working on an application wherein the user can enter a SVN URL. It can either be a Directory or a file. I am using sharpsvn.
My aim is to somehow know if this url is a directory or a file.
For example : svn://svnrepository/Directory/pascal.cs
or svn://svnrepository/DirectoryName
are both valid entries. Its my job to differentiate between the two and bring out the fact that the former is a file while the latter is a directory.
Can this be done using sharpsvn ?
Thanks and Regards
Gagan
Condireng that it't only a wrapper over a real subversion, for you it should be enough to execute
svn info $path$
in the result set there has to be Node Type string. That would be give you description either it a directory or file.
Hope this helps.
You could use one of the following:
svnlook proplist
svn info
svn ls ... -depth empty
The last two are illustrated in "Check that an svn repository url does not exist".
You can encapsulate those calls in SVNSharp hook following the examples of "How can i get access to the SVN pre-commit message using SharpSVN?"

using sharpsvn client.status in c#

I've just read this question, and I have a question about it:
How do I set the client to look at a certain repository? In the example there's a use in the working copy's location, so how can the client know where to check for diffs?
Thanks :)
SVN stores the location of the repository inside the working copy, hence all of those .svn directories that appear after the first checkout.

Write Resource file for .net project using the command line

I need to create a resource file for a .net project (by hand) and compile it using the ResGen.exe tool provided by the .NET framework. I can't find any documentation for this. I need to write the resource file by hand because I'm in a situation where I don't want to download/buy extra tools (like VS) to generate this resource file, and also I feel more productive through the command-line (helps me understand how things really work).
So I need to write a resource file by hand to store an ICON in the executable and use it from within my program. I would also like to use this icon to represent my executable in Windows Explorer.
Any references would be great!
Visual C# Express Edition will do what you want for free. If nothing else you can download that, create the resource file and then use that as a subject for your admirable curiosity about 'how it really works'. This may also save you some time in manual experimentation to get it right the first time around.
These 2 links in conjunction provide information on using that tool to create and embed an icon file, it seems specific to C#. Of course i'm guessing at your full intention, let me know if this points you in the proper direction.
http://www.xtremedotnettalk.com/showthread.php?t=75449
specifically there is a post which states;
I think you should first create a *.resources-File from the Icon with the tool named "Resgen.exe"...
resgen App.ico App.ico.resources
the next step would be compiling...
csc /t:winexe /out:Keygen.exe /res:App.ico.resources /r:Crypto.dll /win32icon:App.ico Keygen.cs AssemblyInfo.cs
I'm sure you were here already.
http://msdn.microsoft.com/en-us/library/ccec7sz1(VS.80).aspx
You should check this link:
http://msdn.microsoft.com/en-us/library/ekyft91f.aspx
It explains what formatter is used and gives some code samples to generate one from code. You could then write a small wrapper app that you can call from the command line. No downloads needed!

Where is iTunes SDK/API documentation?

I downloaded a zipped archive from Apple that consists of a C++ header file and source. Included in this was a help file. For some reason this help file opens but I cannot read the content. Is there any other documentation outside of a help file for this? For c++ or c#?
If you are on Windows, you probably are looking for the "iTunes COM for Windows SDK".
Get a free ADC login here if you haven't done so already. Once you have done that, you can go to http://connect.apple.com and log in.
Click on "Developer Tools", and somewhere in the massive list of results is "iTunes COM for Windows SDK". Download that, it's just an ordinary zip file, and somewhere in there is a directory named iTunesCOMWindowsSDK. In that directory, there is a iTunesCOM.chm file that contains all the reference material you need.
If this is the help file you already have, you could consider decompiling the chm file using the hh.exe tool that comes with Windows.
It seems the only source for the iTunes COM documentation is now archived on github by https://stackoverflow.com/users/188792/joshkunz
The nice web page is here
http://www.joshkunz.com/iTunesControl/
And the github project is here
https://github.com/Joshkunz/iTunesControl
Solved.. The problem was a Windows Security feature was blocking the compiled help file from opening. I found the solution here:
http://weblog.helpware.net/?p=36
Note: this is not relevant but it feels like this code complements the question nicely - I would have put this in comments but comments don't seem to allow code formatting (d'uh).
Anyway, here is a C# example of how to dump all songs in the library:
dynamic iTunesApplication = Activator.CreateInstance(Type.GetTypeFromProgID("iTunes.Application"));
dynamic mainPlaylist = iTunesApplication.LibraryPlaylist;
for (int i = 1; i <= mainPlaylist.Tracks.Count; i++)
{
dynamic track = mainPlaylist.Tracks.Item(i);
Console.WriteLine(track.Location);
}
Thanks to Hogan for the great pointer to the documentation!

Categories