Beispiel #1
0
        /**************************************************                                                                  **************************************************** *
        * ************************************************                                                                  **************************************************** *
        * ************************************************ CREATION DES FONCTIONS DE LANCEMENT SANS APPARITION DES FENETRES **************************************************** *
        * ************************************************                                                                  **************************************************** *
        * ************************************************                                                                  ******************************************************/

        /// <summary>
        /// Permet de choisir le fichier local automatiquement
        /// </summary>
        private void SetDefaultLocalPathINSTANT()
        {
            HideGroups();
            gLoginDetails.Visible = true;

            var account = string.Format("{0}@{1}", Program.Account.Account.Username, Program.Account.Account.Host);

            tLocalPath.Text = string.Format(@"{0}\iwit sync\", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            // string.Format(@"{0}\iwitSync\{1}", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), account);

            if (!System.IO.Directory.Exists(tLocalPath.Text))
            {
                System.IO.Directory.CreateDirectory(tLocalPath.Text);
            }

            rSyncAll.Checked  = true;
            this.AcceptButton = bFinish;
            bFinish.Enabled   = true;

            /*Mise en place de l'icone*/

            FolderIcon iconDefautltPath = new FolderIcon(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\iwit sync");

            iconDefautltPath.CreateFolderIcon(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\Iwit Systems\\iwit sync\\dossier-iwit.ico", "iwit sync");

            /*Mise en place de l'icone*/

            FolderIcon iconDefautltPath2 = new FolderIcon(tLocalPath.Text);

            iconDefautltPath2.CreateFolderIcon(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\Iwit Systems\\Iwit sync\\dossier-iwit.ico", "iwit sync");
        }
Beispiel #2
0
        private void CreateFolderIcon(string folderPath)
        {
            string     iconPath   = Directory.GetCurrentDirectory() + @"\Resources\icon-ecm-colored.ico";
            FolderIcon folderIcon = new FolderIcon(folderPath);

            folderIcon.CreateFolderIcon(iconPath, "Sync To ECM");
        }
Beispiel #3
0
        public HitomiExplorer()
        {
            InitializeComponent();

            smallImageList.ColorDepth = ColorDepth.Depth32Bit;
            largeImageList.ColorDepth = ColorDepth.Depth32Bit;

            smallImageList.ImageSize = new System.Drawing.Size(16, 16);
            largeImageList.ImageSize = new System.Drawing.Size(32, 32);

            smallImageList.Images.Add(FolderIcon.GetFolderIcon(
                                          FolderIcon.IconSize.Small,
                                          FolderIcon.FolderType.Closed));

            iconListManager = new IconListManager(smallImageList, largeImageList);

            PathTree.ImageList = smallImageList;
        }
Beispiel #4
0
        private void bNext_Click(object sender, EventArgs e)
        {
            switch (_currentTab)
            {
            /*
             * case AccountSetupTab.None:
             *  string lan = cLanguages.SelectedItem.ToString().Substring(cLanguages.SelectedItem.ToString().IndexOf("(") + 1);
             *  lan = lan.Substring(0, lan.Length - 1);
             *  Settings.General.Language = lan;
             *  SetLanguage(lan);
             *  SwitchTab(AccountSetupTab.Login);
             *  break;
             */
            case AccountSetupTab.Login:
                TryLogin();

                // TEST
                /* LocalFolder */
                if (!System.IO.Directory.Exists(tLocalPath.Text))
                {
                    System.IO.Directory.CreateDirectory(tLocalPath.Text);
                }

                /*Mise en place de l'icone*/
                FolderIcon iconDefautltPath = new FolderIcon(tLocalPath.Text);
                iconDefautltPath.CreateFolderIcon(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\Iwit Systems\\iwit sync\\dossier-iwit.ico", "iwit sync");

                tRemoteList.CheckBoxes  = false;
                tFullRemotePath.Visible = true;
                labFullPath.Text        = Common.Languages[UiControl.FullRemotePath];
                gRemoteFolder.Text      = Common.Languages[UiControl.RemotePath];

                /* RemoteFolder */
                var parentPath = Program.Account.Account.Host + tFullRemotePath.Text;
                Program.Account.AddPaths(tFullRemotePath.Text, tLocalPath.Text, parentPath);
                // Change directory to the specified remote folder
                Program.Account.Client.WorkingDirectory = Program.Account.Paths.Remote;



                /* FileSyncOption */
                tRemoteList.CheckBoxes  = true;
                tFullRemotePath.Visible = false;
                labFullPath.Text        = Common.Languages[UiControl.UncheckFiles];
                gRemoteFolder.Text      = Common.Languages[UiControl.SelectiveSync];
                PopulateRemoteList();
                SwitchTab(AccountSetupTab.MessageWelcome);

                /* forcer la syn auto */
                Program.Account.Account.SyncMethod = SyncMethod.Automatic;
                // FIN TEST
                break;

                /*
                 *  case AccountSetupTab.LocalFodler:
                 *      if (!System.IO.Directory.Exists(tLocalPath.Text))
                 *          System.IO.Directory.CreateDirectory(tLocalPath.Text);
                 *
                 *      tRemoteList.CheckBoxes = false;
                 *      tFullRemotePath.Visible = true;
                 *      labFullPath.Text = Common.Languages[UiControl.FullRemotePath];
                 *      gRemoteFolder.Text = Common.Languages[UiControl.RemotePath];
                 *      SwitchTab(AccountSetupTab.RemoteFolder);
                 *      PopulateRemoteList();
                 *      break;
                 *  case AccountSetupTab.RemoteFolder:
                 *      //parentPath = Program.Account.Account.Host + tFullRemotePath.Text;
                 *      Program.Account.AddPaths(tFullRemotePath.Text, tLocalPath.Text, parentPath);
                 *      // Change directory to the specified remote folder
                 *      Program.Account.Client.WorkingDirectory = Program.Account.Paths.Remote;
                 *      // ??
                 *      SwitchTab(AccountSetupTab.FileSyncOption);
                 *      break;
                 *  case AccountSetupTab.FileSyncOption:
                 *
                 *      tRemoteList.CheckBoxes = true;
                 *      tFullRemotePath.Visible = false;
                 *      labFullPath.Text = Common.Languages[UiControl.UncheckFiles];
                 *      gRemoteFolder.Text = Common.Languages[UiControl.SelectiveSync];
                 *      SwitchTab(AccountSetupTab.SelectiveSync);
                 *      PopulateRemoteList();
                 *      break;
                 */
            }
            bFinish.Enabled = (_currentTab == AccountSetupTab.FileSyncOption && rSyncAll.Checked) || _currentTab == AccountSetupTab.SelectiveSync || _currentTab == AccountSetupTab.MessageWelcome;
            ControlBox      = !(_currentTab == AccountSetupTab.MessageWelcome);
            bNext.Enabled   = !bFinish.Enabled;

            this.AcceptButton = bNext.Enabled ? bNext : bFinish;
        }
Beispiel #5
0
        public void LoadImageName()
        {
            // open folder, get all filenames
            //AppDomain.CurrentDomain.BaseDirectory

            string path = AppDomain.CurrentDomain.BaseDirectory + foldername;

            string[] filenames = Directory.GetFiles(path);


            // check filename to assign to variables
            foreach (var fullname in filenames)
            {
                string filename = Path.GetFileName(fullname);

                string[] tokens = StringProcess.SplitString(filename, new string[] { "_" });

                if (tokens[0].ToLower() == "Application".ToLower())
                {
                    ApplicationIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Option".ToLower())
                {
                    OptionIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Remove".ToLower())
                {
                    RemoveIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "RemoveAll".ToLower())
                {
                    RemoveAllIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Add".ToLower())
                {
                    AddIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Preview".ToLower())
                {
                    PreviewIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Start".ToLower())
                {
                    StartIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Refresh".ToLower())
                {
                    RefreshIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Help".ToLower())
                {
                    HelpIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Open".ToLower())
                {
                    OpenIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Save".ToLower())
                {
                    SaveIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Information".ToLower())
                {
                    InformationIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "File".ToLower())
                {
                    FileIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Folder".ToLower())
                {
                    FolderIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "Action".ToLower())
                {
                    ActionIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
                else if (tokens[0].ToLower() == "List".ToLower())
                {
                    ListIcon.Add
                    (
                        new MyString()
                    {
                        Value = path + filename
                    }
                    );
                }
            }
        }
Beispiel #6
0
 internal object GetFolderImage(int size)
 {
     return(FolderIcon.Get(size));
 }
Beispiel #7
0
        public void LoadImageName()
        {
            // open folder, get all filenames
            string path = AppDomain.CurrentDomain.BaseDirectory + foldername;

            string[] filenames = Directory.GetFiles(path);


            // check filename to assign to variables
            foreach (var fullname in filenames)
            {
                string filename = Path.GetFileName(fullname);

                string[] tokens = filename.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries);

                if (tokens[0].ToLower() == "Application".ToLower())
                {
                    ApplicationIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Option".ToLower())
                {
                    OptionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Remove".ToLower())
                {
                    RemoveIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "RemoveAll".ToLower())
                {
                    RemoveAllIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Add".ToLower())
                {
                    AddIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Preview".ToLower())
                {
                    PreviewIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Start".ToLower())
                {
                    StartIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Refresh".ToLower())
                {
                    RefreshIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Help".ToLower())
                {
                    HelpIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Open".ToLower())
                {
                    OpenIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Save".ToLower())
                {
                    SaveIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Information".ToLower())
                {
                    InformationIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "File".ToLower())
                {
                    FileIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Folder".ToLower())
                {
                    FolderIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "Action".ToLower())
                {
                    ActionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "List".ToLower())
                {
                    ListIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "UpDirection".ToLower())
                {
                    UpDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "RightDirection".ToLower())
                {
                    RightDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "DownDirection".ToLower())
                {
                    DownDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else if (tokens[0].ToLower() == "LeftDirection".ToLower())
                {
                    LeftDirectionIcon.Add
                    (
                        path + filename
                    );
                }
                else
                {
                    Images.Add
                    (
                        path + filename
                    );
                }
            }
        }