Ejemplo n.º 1
0
        public static void ButtonFillDirectoryClicked()
        {
            var dlg = new UIFolderRegPickerWindow(MW, true);

            if (dlg.ShowDialog() ?? false)
            {
                var work       = new Thread(DirectoryFill);
                var abortEvent = new ManualResetEvent(false);
                var w          = new UIPerformWorkWindow(MW, abortEvent, "Count directories...");
                work.Start(new Tuple <UIFolderRegPickerWindow, UIPerformWorkWindow>(dlg, w));
                if (w.ShowDialog() ?? false)
                {
                    int target = 1;
                    if (dlg.IsFilesInclude)
                    {
                        target = 3;
                    }
                    MW.SetContent();
                    if (MW.CmbxRightsType.SelectedIndex != target)
                    {
                        MW.CmbxRightsType.SelectedIndex = target;
                    }
                    MW.SetContent(_fillData);
                }
                work.Join();
            }
        }
Ejemplo n.º 2
0
        private static void DirectoryFill(object o)
        {
            var t = (Tuple <UIFolderRegPickerWindow, UIPerformWorkWindow>)o;

            _sb            = new StringBuilder();
            _ww            = t.Item2;
            _currentFiles  = 0;
            _isFileInclude = t.Item1.IsFilesInclude;
            _isRecursing   = t.Item1.IsRecursing;
            _maxFiles      = CalcDirCount(t.Item1.PathName) + 1;
            UpdateDirectory(t.Item1.PathName);
            _fillData = _sb.ToString();
            t.Item2.AbortEvent.Set();
        }
Ejemplo n.º 3
0
        private static void RegistryFill(object o)
        {
            var t = (Tuple <UIFolderRegPickerWindow, UIPerformWorkWindow>)o;

            _sb            = new StringBuilder();
            _ww            = t.Item2;
            _currentFiles  = 0;
            _isFileInclude = t.Item1.IsFilesInclude;
            _isRecursing   = t.Item1.IsRecursing;
            var key = UIFolderRegPickerWindow.GetKeyFromString(t.Item1.PathName);

            _maxFiles = CalcKeyCount(key) + 1;
            UpdateRegKey(key);
            _fillData = _sb.ToString();
            t.Item2.AbortEvent.Set();
        }
Ejemplo n.º 4
0
        public void SetContent(string content = null)
        {
            var setContent = content ?? string.Empty;

            if (setContent.Length < CONTENT_CHUNK_SIZE)
            {
                EdtContent.Text = setContent;
                return;
            }
            EdtContent.TextChanged -= EdtContent_OnTextChanged;
            var    abortEvent = new ManualResetEvent(false);
            var    dlg        = new UIPerformWorkWindow(this, abortEvent, "Displaying content", "Displaying content: {0,3}%");
            Thread work       = new Thread(ContentUpdate);

            work.Start(new Tuple <string, UIPerformWorkWindow>(setContent, dlg));
            dlg.ShowDialog();
            work.Join();
        }
Ejemplo n.º 5
0
        public static void ButtonFillServicesClicked()
        {
            var work       = new Thread(ServiceFill);
            var abortEvent = new ManualResetEvent(false);
            var dlg        = new UIPerformWorkWindow(MW, abortEvent, "Count services...");

            work.Start(dlg);
            if (dlg.ShowDialog() ?? false)
            {
                MW.SetContent();
                if (MW.CmbxRightsType.SelectedIndex != 0)
                {
                    MW.CmbxRightsType.SelectedIndex = 0;
                }
                MW.SetContent(_fillData);
            }
            work.Join();
        }
Ejemplo n.º 6
0
        public static void ButtonFillRegistryClicked()
        {
            var dlg = new UIFolderRegPickerWindow(MW, false);

            if (dlg.ShowDialog() ?? false)
            {
                var work       = new Thread(RegistryFill);
                var abortEvent = new ManualResetEvent(false);
                var w          = new UIPerformWorkWindow(MW, abortEvent, "Count reg-keys...");
                work.Start(new Tuple <UIFolderRegPickerWindow, UIPerformWorkWindow>(dlg, w));
                if (w.ShowDialog() ?? false)
                {
                    MW.SetContent();
                    if (MW.CmbxRightsType.SelectedIndex != 4)
                    {
                        MW.CmbxRightsType.SelectedIndex = 4;
                    }
                    MW.SetContent(_fillData);
                }
                work.Join();
            }
        }