示例#1
0
        private void WriteDefaultFile()
        {
            try
            {
                if (!File.Exists(JLIFile))
                {
                    CustomJumpItem j1 = new CustomJumpItem();
                    j1.Categorie   = "File";
                    j1.Chemin      = @"C:\Windows\notepad.exe";
                    j1.Icone       = @"C:\Windows\notepad.exe";
                    j1.Titre       = "Notepad";
                    j1.Description = "Open notepad.";

                    CustomJumpItem j2 = new CustomJumpItem();
                    j2.Categorie   = "Folder";
                    j2.Chemin      = @"C:\Windows\explorer.exe";
                    j2.Icone       = @"C:\Windows\explorer.exe";
                    j2.Arguments   = @"/root,c:\";
                    j2.Titre       = "Opens 'C:'";
                    j2.Description = "Open the explorer by pointing directly at C :";

                    listeCustomJumpItem.Clear();
                    listeCustomJumpItem.Add(j1);
                    listeCustomJumpItem.Add(j2);

                    WriteFile();
                }
            }
            catch { }
        }
示例#2
0
        private void AddTask()
        {
            if (!TestFields())
            {
                return;
            }

            CustomJumpItem ji = GetSelJumpItem();

            if (ji != null)
            {
                listeCustomJumpItem.Remove(ji);
            }

            CustomJumpItem item = new CustomJumpItem();

            item.Categorie   = txt_Categ.Text;
            item.Chemin      = txt_Chemin.Text;
            item.Icone       = txt_Icone.Text;
            item.Arguments   = txt_Arg.Text;
            item.Titre       = txt_Nom.Text;
            item.Description = txt_Description.Text;

            listeCustomJumpItem.Add(item);

            RefreshList();
        }
示例#3
0
        private void WriteDefaultFile()
        {
            try
            {
                if (!File.Exists(JLIFile))
                {
                    CustomJumpItem j1 = new CustomJumpItem();
                    j1.Categorie   = "Fichier";
                    j1.Chemin      = @"C:\Windows\notepad.exe";
                    j1.Icone       = @"C:\Windows\notepad.exe";
                    j1.Titre       = "Notepad";
                    j1.Description = "Ouvre notepad.";

                    CustomJumpItem j2 = new CustomJumpItem();
                    j2.Categorie   = "Dossier";
                    j2.Chemin      = @"C:\Windows\explorer.exe";
                    j2.Icone       = @"C:\Windows\explorer.exe";
                    j2.Arguments   = @"/root,c:\";
                    j2.Titre       = "Ouvre 'C:'";
                    j2.Description = "Ouvre l'explorateur en pointant directement sur C:.";

                    listeCustomJumpItem.Clear();
                    listeCustomJumpItem.Add(j1);
                    listeCustomJumpItem.Add(j2);

                    WriteFile();
                }
            }
            catch { }
        }
示例#4
0
        private void SupprTask()
        {
            CustomJumpItem ji = GetSelJumpItem();

            if (ji != null)
            {
                listeCustomJumpItem.Remove(ji);
                RefreshList();
            }
        }
示例#5
0
        private CustomJumpItem GetSelJumpItem()
        {
            CustomJumpItem ji = null;

            if (list_Tasks.SelectedIndex != -1)
            {
                string selItem = (list_Tasks.SelectedItem as string);
                ji = listeCustomJumpItem.First(i => i.Affichage == selItem);
            }

            return(ji);
        }
示例#6
0
        private void list_Tasks_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            btn_Modifier.IsEnabled  = !(list_Tasks.SelectedIndex == -1);
            btn_Supprimer.IsEnabled = !(list_Tasks.SelectedIndex == -1);

            CustomJumpItem ji = GetSelJumpItem();

            if (ji != null)
            {
                txt_Categ.Text       = ji.Categorie;
                txt_Chemin.Text      = ji.Chemin;
                txt_Nom.Text         = ji.Titre;
                txt_Arg.Text         = ji.Arguments;
                txt_Icone.Text       = ji.Icone;
                txt_Description.Text = ji.Description;
            }
        }