Ejemplo n.º 1
0
        public FormFileStateSet()
        {
            InitializeComponent();

            this.SuspendLayout();

            // Create data for combobox
            StringCollection grades = new StringCollection();

            grades.AddRange(new string[] { FileStates.Init.ToString(), FileStates.WorkInProcess.ToString(), FileStates.Release.ToString() });

            // Set the combobox
            this.listViewMain.AddComboBoxCell(-1, 1, grades);

            if (Globals.SourceDirectoryPath != null && Globals.TargetDirectoryPath != null)
            {
                newList = new FileInfoList(Globals.SourceDirectoryPath, Globals.TargetDirectoryPath);
                newList.GetFiles(Globals.SourceDirectoryPath, true);

                var row = 0;
                foreach (FileInfoEx file in newList)
                {
                    var lvItem = new ListViewItem(file.FileName);
                    lvItem.SubItems.Add(((FileStates)(file.FileState)).ToString());

                    this.listViewMain.Items.Insert(0, lvItem);

                    row++;
                }
            }

            this.ResumeLayout();
        }