Exemple #1
0
        /// <summary>
        /// On Click Merge Filter Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMergeFilter_Click(object sender, EventArgs e)
        {
            //set the defaults if not already set
            if (_assetfilters.DefaultsNotSet)
            {
                DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
                _assetfilters.FillRolesFilterHolderFromDir(dir);
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                FilterDlg filterDlg = null;
                string    fileExt   = Path.GetExtension(txtPath.Text);
                if (fileExt.Equals(".xbimf", StringComparison.OrdinalIgnoreCase))
                {
                    Dictionary <FileInfo, OutPutFilters> FedFilters = _assetfilters.SetFedModelFilter <FileInfo>(MapRefModelsRoles);
                    filterDlg = new FilterDlg(_assetfilters, true, FedFilters);
                }
                else
                {
                    MapRefModelsRoles.Clear();
                    RoleFilter roles = SetRoles();
                    _assetfilters.ApplyRoleFilters(roles);
                    filterDlg = new FilterDlg(_assetfilters, true);
                }

                //read only
                if (filterDlg != null)
                {
                    filterDlg.ShowDialog();
                }
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #2
0
        /// <summary>
        /// On Click Class filter Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClassFilter_Click(object sender, EventArgs e)
        {
            DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);

            //set the defaults if not already set
            if (_assetfilters.DefaultsNotSet)
            {
                _assetfilters.FillRolesFilterHolderFromDir(dir);
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                FilterDlg filterDlg = new FilterDlg(_assetfilters);
                if (filterDlg.ShowDialog() == DialogResult.OK)
                {
                    _assetfilters = filterDlg.RolesFilters;
                    _assetfilters.WriteXMLRolesFilterHolderToDir(dir);
                }
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
        /// <summary>
        /// On Click Merge Filter Button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMergeFilter_Click(object sender, EventArgs e)
        {
            //set the defaults if not already set
            if (_assetfilters.DefaultsNotSet)
            {
                DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
                _assetfilters.FillRolesFilterHolderFromDir(dir);
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                FilterDlg filterDlg = null;
                string fileExt = Path.GetExtension(txtPath.Text);
                if (fileExt.Equals(".xbimf", StringComparison.OrdinalIgnoreCase))
                {
                    Dictionary<FileInfo, OutPutFilters> FedFilters = _assetfilters.SetFedModelFilter<FileInfo>(MapRefModelsRoles);
                    filterDlg = new FilterDlg(_assetfilters, true, FedFilters);
                }
                else
                {
                    MapRefModelsRoles.Clear();
                    RoleFilter roles = SetRoles();
                    _assetfilters.ApplyRoleFilters(roles);
                    filterDlg = new FilterDlg(_assetfilters, true);
                }

                //read only
                if (filterDlg != null)
                {
                    filterDlg.ShowDialog();
                }
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
            
        }
 /// <summary>
 /// On Click Class filter Button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnClassFilter_Click(object sender, EventArgs e)
 {
     DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
     //set the defaults if not already set
     if (_assetfilters.DefaultsNotSet)
     {
         
         _assetfilters.FillRolesFilterHolderFromDir(dir);
     }
     try
     {
         Cursor.Current = Cursors.WaitCursor;
         FilterDlg filterDlg = new FilterDlg(_assetfilters);
         if (filterDlg.ShowDialog() == DialogResult.OK)
         {
             _assetfilters = filterDlg.RolesFilters;
             _assetfilters.WriteXMLRolesFilterHolderToDir(dir);
         }
     }
     finally
     {
         Cursor.Current = Cursors.Default;
     }
     
 }