Exemplo n.º 1
0
        public void LoadFilter(string filterName)
        {
            // Is this an already fully qualified name?
            if (DosUtils.ExistFast(filterName) == false)
            {
                // No, then lets assume it came from the user's tools directory
                filterName = MOG_ControllerSystem.LocateTool(filterName + ".sync");
            }

            SyncFilterComboBox.Text = Path.GetFileNameWithoutExtension(filterName);
            SyncFilterComboBox.Tag  = filterName;

            if (DosUtils.ExistFast(filterName))
            {
                //if (ClassificationTreeView.Visible)
                //{
                // Reset the tree
                ClassificationTreeView.Initialize(OnWorkerCompleteLoadFilter);
                //}
                //else
                //{
                //    OnWorkerCompleteLoadFilter();
                //}
            }
        }
Exemplo n.º 2
0
        private void SyncDelButton_Click(object sender, EventArgs e)
        {
            if (SyncFilterComboBox.SelectedItem != null)
            {
                ComboBoxItem item = SyncFilterComboBox.SelectedItem as ComboBoxItem;
                if (item != null)
                {
                    string filterFileName = item.FullPath;

                    if (MOG_Prompt.PromptResponse("Delete filter?", "Are you sure you want to delete this filter?\n" + item.FullPath, MOGPromptButtons.YesNo) == MOGPromptResult.Yes)
                    {
                        if (DosUtils.ExistFast(filterFileName) && DosUtils.DeleteFast(filterFileName))
                        {
                            UpdateFilterDropDown("");

                            mFilter.Clear();
                            //if (ClassificationTreeView.Visible)
                            //{
                            ClassificationTreeView.Initialize();
                            //}

                            SyncSaveButton.Enabled  = false;
                            SyncFilterComboBox.Text = mOriginalSyncComboBoxMessage;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        public bool Load(string filename)
        {
            if (DosUtils.ExistFast(filename))
            {
                MOG_Ini ini = new MOG_Ini(filename);
                if (ini != null)
                {
                    Clear();
                    AddExclusions(ini.GetString("Sync", "Exclusions"));
                    AddInclusions(ini.GetString("Sync", "Inclusions"));
                    return(true);
                }
            }

            return(false);
        }