VSS Sourcesafe automatic logon

No comments

To logon sourcesafe automaticly:

Create userenvironment

variable SSUSER value your username

the password can be specified the same way: SSPWD

spanspan

Posted via email from Henris blogg

No comments :

Post a Comment

sourcesafe share/branch

No comments

How to a share/branch a project in sourcesafe.

Say I have

$/Tools/MyTool/v1.0.0

in sourcesafe.

Now I want to create

$/Tools/MyTool/v2.0.0

either by sharing (links to same copy of file)  or branching (separate files, copied at branching)

Instead of doing the obvious, Rightclick v1.0.0 and select share etc here's how you do it:

1)         select the place you want the files to end, in this example

            $/Tools/MyTool

2)         rightclick and select Share to …

3)         now select your version i.e $/Tools/MyTool/v1.0.0,

            and optionally select Branch after share for a separate copy

4)         in the next dialog you can specify a name, in this example it should bee v2.0.0

            remember to select recursive

Thank MS for not being this counterintuitive usually… :)

Happy branching

span

Posted via email from Henris blogg

No comments :

Post a Comment

Sort List

No comments

Sort with a delegate:

Sorts a list by name/string

List<VomWS.Variabel> liste = new List<Variabel>();

liste.AddRange(samling.Liste);

liste.Sort(delegate(VomWS.Variabel v1, VomWS.Variabel v2) { return v1.Navn.CompareTo(v2.Navn); });

Sort with Comparer:

Sorts a list by date in descending order

List<OppgaveInformasjon> liste = HentOppgaverDA(oppgaveType, dato, AntDager);

liste.Sort(new OppgaveInformasjonDatoDescCompare());

    public class OppgaveInformasjonDatoDescCompare : IComparer<VOMVariabler.VomWS.OppgaveInformasjon>

    {

        public int Compare(VOMVariabler.VomWS.OppgaveInformasjon x, VOMVariabler.VomWS.OppgaveInformasjon y)

        {

            return DateTime.Compare(y.DatoRegistrert, x.DatoRegistrert);

        }

    }

Posted via email from Henris blogg

No comments :

Post a Comment

Mouse hourglass and back

No comments

    public partial class frmOppgaver : Form

    {

        Cursor før;

        private void SettMusHourglass()

        {

            før = this.Cursor;

            this.Cursor = Cursors.WaitCursor;

        }

        private void SettMusTilbake()

        {

            this.Cursor = før;

        }

            }

Posted via email from Henris blogg

No comments :

Post a Comment

delegate find

No comments

ModulSamling m = modulsamling.Find(delegate(ModulSamling ms) { return ms.ID== item.Tag; });

Instead of:

ModulSamling m=FindModul(modulsamling, item.Tag);

privat ModulSamling FindModul(List<ModulSamling list, string tag)

{

      foreach(ModulSamling m in list)

      {

            if(m.ID==tag)

                  return m;

      }

      return null;

}

Posted via email from Henris blogg

No comments :

Post a Comment

Convert a list from one type to another using Predicate and ConvertAll

No comments

List<Variabel> lv = new List<Variabel>();

lv.AddRange(liste);

List<string> lst = lv.ConvertAll<string>(delegate(Variabel g) { return g.Navn; });

Converts a list of objects with type Variabel,

to a list of strings.

Variabel contains a string property called Navn, and this is what gets translated to the list of strings,

{ return g.Navn)}

Posted via email from Henris blogg

No comments :

Post a Comment