Esempio n. 1
0
        /// <summary>
        /// Get default export parameters for user
        /// </summary>
        /// <param name="rf"></param>

        void GetDefaultExportParameters(ResultsFormat rf)
        {
            string txt = Preferences.Get("SpotfireExportDefaults");

            do
            {
                if (!Lex.IsNullOrEmpty(txt))
                {
                    try
                    {
                        string[] sa = txt.Split('\t');
                        rf.OpenMode                = (SpotfireOpenModeEnum)int.Parse(sa[0]);
                        rf.QualifiedNumberSplit    = QnfSplitControl.DeserializeQualifiedNumberSplit(sa[1]);
                        rf.DuplicateKeyTableValues = bool.Parse(sa[2]);
                        rf.ViewStructures          = bool.Parse(sa[3]);
                        break;                         // finish up
                    }
                    catch (Exception ex) { ex = ex; }  // fall through to defaults on error
                }
                rf.OpenMode             = SpotfireOpenModeEnum.None;
                rf.QualifiedNumberSplit =                 // split by qualifier and numeric value
                                          QnfEnum.Split | QnfEnum.Qualifier | QnfEnum.NumericValue;
                rf.DuplicateKeyTableValues = false;
                rf.ViewStructures          = false;
            } while (false);

            if (rf.QueryManager != null && rf.QueryManager.Query != null &&
                rf.QueryManager.Query.DuplicateKeyValues)
            {
                rf.DuplicateKeyTableValues = true;
            }

            return;
        }
Esempio n. 2
0
        /// <summary>
        /// Get default export parameters for user
        /// </summary>
        /// <param name="rf"></param>

        void GetDefaultExportParameters(ResultsFormat rf)
        {
            string txt = Preferences.Get("SdFileExportDefaults");

            do
            {
                if (!Lex.IsNullOrEmpty(txt))
                {
                    try
                    {
                        string[] sa = txt.Split('\t');
                        rf.StructureFlags             = (MoleculeTransformationFlags)int.Parse(sa[0]);
                        rf.QualifiedNumberSplit       = QnfSplitControl.DeserializeQualifiedNumberSplit(sa[1]);
                        rf.DuplicateKeyTableValues    = bool.Parse(sa[2]);
                        rf.AllowExtraLengthFieldNames = bool.Parse(sa[3]);
                        rf.RunInBackground            = bool.Parse(sa[4]);
                        break;                         // finish up
                    }
                    catch (Exception ex) { ex = ex; }  // fall through to defaults on error
                }
                rf.StructureFlags       = MoleculeTransformationFlags.None;
                rf.QualifiedNumberSplit =                 // split by qualifier and numeric value
                                          QnfEnum.Split | QnfEnum.Qualifier | QnfEnum.NumericValue;
                rf.DuplicateKeyTableValues    = false;
                rf.AllowExtraLengthFieldNames = false;
                rf.RunInBackground            = false;
            } while (false);

            if (rf.QueryManager != null && rf.QueryManager.Query != null &&
                rf.QueryManager.Query.DuplicateKeyValues)
            {
                rf.DuplicateKeyTableValues = true;
            }
            return;
        }
Esempio n. 3
0
        /// <summary>
        /// Get default export parameters for user
        /// </summary>
        /// <param name="rf"></param>

        void GetDefaultExportParameters(ResultsFormat rf)
        {
            string txt = Preferences.Get("ExcelExportDefaults");

            do
            {
                if (!Lex.IsNullOrEmpty(txt))
                {
                    try
                    {
                        string[] sa = txt.Split('\t');
                        rf.HeaderLines             = int.Parse(sa[0]);
                        rf.FixedHeightStructures   = bool.Parse(sa[1]);
                        rf.QualifiedNumberSplit    = QnfSplitControl.DeserializeQualifiedNumberSplit(sa[2]);
                        rf.DuplicateKeyTableValues = bool.Parse(sa[3]);
                        rf.RunInBackground         = bool.Parse(sa[4]);
                        rf.ExportStructureFormat   = (ExportStructureFormat)Enum.Parse(typeof(ExportStructureFormat), sa[5], true);

                        break;                         // finish up
                    }
                    catch (Exception ex) { ex = ex; }  // fall through to defaults on error
                }
                rf.HeaderLines           = 2;
                rf.FixedHeightStructures = false;
                rf.QualifiedNumberSplit  =                // split by qualifier and numeric value
                                           QnfEnum.Split | QnfEnum.Qualifier | QnfEnum.NumericValue;
                rf.DuplicateKeyTableValues = false;
                rf.RunInBackground         = false;
                rf.ExportStructureFormat   = ExportStructureFormat.Insight;
            } while (false);

            if (rf.QueryManager != null && rf.QueryManager.Query != null &&
                rf.QueryManager.Query.DuplicateKeyValues)
            {
                rf.DuplicateKeyTableValues = true;
            }
            return;
        }
Esempio n. 4
0
        public static void Load()
        {
            string value;
            int    i1;

            PrefDict = UserObjectDao.GetUserParameters(Security.UserName);

            SS.I.PreferredProjectId =             // get preferred project
                                      Get("PreferredProject", "DEFAULT_FOLDER");

            SS.I.TableColumnZoom     = GetInt("TableColumnZoom", 100);
            SS.I.GraphicsColumnZoom  = GetInt("GraphicsColumnZoom", 100);
            SS.I.ScrollGridByPixel   = GetBool("ScrollGridByPixel", false);           // default to row scrolling
            SS.I.AsyncImageRetrieval = GetBool("AsyncImageRetrieval", true);

            try             // get preferred number format
            {
                value = Get("DefaultNumberFormat", "SigDigits");
                EnumUtil.TryParse(value, out SS.I.DefaultNumberFormat);

                SS.I.DefaultDecimals = GetInt("DefaultDecimals", 3);
            }
            catch (Exception ex) { }

            SS.I.RepeatReport =             // repeating report across page
                                GetBool("RepeatReport", false);

            MqlUtil.DefaultToSingleStepQueryExecution =             // default to single step query execution
                                                        GetBool("DefaultToSingleStepQueryExecution", false);

            if (MqlUtil.DefaultToSingleStepQueryExecution)
            {
                QueryEngine.SetParameter("DefaultToSingleStepQueryExecution", MqlUtil.DefaultToSingleStepQueryExecution.ToString());                 // set in QE for current session
            }
            SS.I.FindRelatedCpdsInQuickSearch =
                GetBool("FindRelatedCpdsInQuickSearch", true);

            SS.I.RestoreWindowsAtStartup =             // get bool for restoring windows at startup
                                           GetBool("RestoreWindowsAtStartup", false);

            SS.I.BreakHtmlPopupsAtPageWidth =
                GetBool("BreakHtmlPopupsAtPageWidth", true);

            try             // qualified number splitting
            {
                value = Get("QualifiedNumberSplit");
                SS.I.QualifiedNumberSplit = QnfSplitControl.DeserializeQualifiedNumberSplit(value);
            }
            catch (Exception ex) { }

            SS.I.HilightCidChanges =
                GetBool("HilightCorpIdChanges", true);

            SS.I.RemoveLeadingZerosFromCids =
                GetBool("RemoveLeadingZerosFromCids", true);

            SS.I.GridMarkCheckBoxesInitially =             // (always false initially now)
                                               GetBool("GridMarkCheckBoxesInitially", false);

            value = Get("DefaultHorizontalAlignment", MetaColumn.SessionDefaultHAlignment.ToString());
            MetaColumn.SessionDefaultHAlignment = (HorizontalAlignmentEx)Enum.Parse(typeof(HorizontalAlignmentEx), value, true);

            value = Get("DefaultVerticalAlignment", MetaColumn.SessionDefaultVAlignment.ToString());
            MetaColumn.SessionDefaultVAlignment = (VerticalAlignmentEx)Enum.Parse(typeof(VerticalAlignmentEx), value, true);

            SS.I.EvenRowBackgroundColor =
                Color.FromArgb(GetInt("EvenRowBackgroundColor", Color.WhiteSmoke.ToArgb()));                 // slightly contrasting color

            SS.I.OddRowBackgroundColor =
                Color.FromArgb(GetInt("OddRowBackgroundColor", Color.White.ToArgb()));

            ClientDirs.DefaultMobiusUserDocumentsFolder = Preferences.Get("DefaultExportFolder", ClientDirs.DefaultMobiusUserDocumentsFolder);

            MoleculeFormat molFormat = MoleculeFormat.Molfile;

            value = Get("PreferredMoleculeFormat", "Molfile");
            if (Enum.TryParse(value, out molFormat))
            {
                MoleculeMx.PreferredMoleculeFormat = molFormat;
            }

            return;
        }