Inheritance: AbstractController, IRemoteRepositoryController
Example #1
0
        private void loadSelectiveSyncCheckboxes()
        {
            foreach (System.Windows.Forms.CheckBox check in remoteFoldersCheckboxes)
            {
                this.Controls.Remove(check);
            }
            remoteFoldersCheckboxes.Clear();

            List<RepositoryItem> remoteItems = new RemoteRepositoryController(null).RootFolders;
            List<RepositoryItem> localItems = new PhysicalRepositoryController(repoDao.MainActive).RootFolders;
            List<RepositoryItem> totalItems = new List<RepositoryItem>();

            totalItems = remoteItems;
            foreach (RepositoryItem i in localItems)
            {
                if (!remoteItems.Contains(i))
                {
                    totalItems.Add(i);
                }
            }

            ignoreFolders = repoIgnore.All(repoDao.RootRepo());
            foreach (RepositoryItem item in totalItems)
            {
                this.checkedListBox1.Items.Add(item.Key, !ignoreFolders.Any(i => i.Path.Equals(item.Key)));
            }
            backgroundWorker1.RunWorkerAsync();
        }
Example #2
0
        void InitializeCheckboxesFolders()
        {
            remoteFoldersCheckboxes = new List<NSButton> ();
            List<RepositoryItem> remoteItems = new RemoteRepositoryController (null).RootFolders;
            List<RepositoryItem> localItems = new PhysicalRepositoryController (new LocalRepository(this.SQFolderText.StringValue, "", true, true)).RootFolders;

            foreach (RepositoryItem item in remoteItems)
            {
                NSButton chk = new NSButton () {
                    Frame = new RectangleF (82,  Frame.Height - 100 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18),
                    Title = item.Key
                };
                chk.SetButtonType(NSButtonType.Switch);
                chk.State = NSCellStateValue.On;
                remoteFoldersCheckboxes.Add (chk);
            }

            foreach (RepositoryItem item in localItems)
            {
                if (!remoteItems.Contains (item)) {
                    NSButton chk = new NSButton () {
                        Frame = new RectangleF (82, Frame.Height - 100 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18),
                        Title = item.Key
                    };
                    chk.SetButtonType (NSButtonType.Switch);
                    chk.State = NSCellStateValue.On;
                    remoteFoldersCheckboxes.Add (chk);
                }
            }

            foreach (NSButton chk in remoteFoldersCheckboxes)
            {
                ContentView.AddSubview (chk);
            }
        }
        //Helpers
        private void loadFolders()
        {
            foreach (NSView view in foldersView.Subviews) {
                view.RemoveFromSuperview ();
            }

            remoteFoldersCheckboxes = new List<NSButton> ();
            List<RepositoryItem> remoteItems = new RemoteRepositoryController (null).RootFolders;
            List<RepositoryItem> localItems = new PhysicalRepositoryController (repoDao.MainActive).RootFolders;
            List<RepositoryItem> totalItems = remoteItems;
            for (int i = 0; i < localItems.Count; i++) {
                if (!remoteItems.Contains (localItems [i])) {
                    totalItems.Add (localItems [i]);
                }
            }

            ignoreFolders = repoIgnore.All (repoDao.RootRepo ());

            for (int i = 0; i <totalItems.Count; i++) {
                NSButton chk = new NSButton () {
                    Frame = new RectangleF (5,  256 - ((remoteFoldersCheckboxes.Count + 1) * 17), 300, 18),
                    Title = remoteItems[i].Key,
                    StringValue = remoteItems[i].Key
                };
                chk.SetButtonType(NSButtonType.Switch);

                if(ignoreFolders.Any(j => j.Path.Equals(totalItems[i].Key)))
                    chk.State = NSCellStateValue.Off;
                else
                    chk.State = NSCellStateValue.On;

                remoteFoldersCheckboxes.Add (chk);
                foldersView.AddSubview (chk);
            }
        }
Example #4
0
        private void InitializeComponentCheckboxesFolders()
        {
            foreach (System.Windows.Forms.CheckBox check in remoteFoldersCheckboxes) {
                this.Controls.Remove(check);
            }
            remoteFoldersCheckboxes.Clear();
            //
            // CheckBoxes
            //
            List<RepositoryItem> remoteItems = new RemoteRepositoryController(null).RootFolders;
            List<RepositoryItem> localItems = new PhysicalRepositoryController(new LocalRepository(label2.Text, "", true, true)).RootFolders;
            List<RepositoryItem> totalItems = new List<RepositoryItem>();

            totalItems = remoteItems;
            foreach (RepositoryItem i in localItems) {
                if (!remoteItems.Contains(i)) {
                    totalItems.Add(i);
                }
            }

            foreach (RepositoryItem item in totalItems)
            {
                System.Windows.Forms.CheckBox checkBox1 = new System.Windows.Forms.CheckBox();
                checkBox1.BackColor = System.Drawing.Color.Transparent;
                checkBox1.Checked = true;
                checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
                checkBox1.Location = new System.Drawing.Point(82, 100 + ((remoteFoldersCheckboxes.Count + 1) * 17));
                checkBox1.Name = "checkBox1";
                checkBox1.Size = new System.Drawing.Size(250, 17);
                checkBox1.TabIndex = 17;
                checkBox1.Text = item.Key;
                checkBox1.UseVisualStyleBackColor = false;
                remoteFoldersCheckboxes.Add(checkBox1);
            }
            foreach (CheckBox item in remoteFoldersCheckboxes)
            {
                this.Controls.Add(item);
            }
        }