Ejemplo n.º 1
0
        private static void RestoreDefaultLanguage()
        {
            XmlItem xi = Root.FindItem("Designer").FindItem("Code");
            string  defaultLanguage = xi.GetProp("DefaultScriptLanguage");

            ReportSettings.DefaultLanguage = defaultLanguage == Language.Vb.ToString() ? Language.Vb : Language.CSharp;
        }
Ejemplo n.º 2
0
        private static void RestoreRightToLeft()
        {
            XmlItem xi  = Root.FindItem("UIOptions");
            string  rtl = xi.GetProp("RightToLeft");

            if (!String.IsNullOrEmpty(rtl))
            {
                switch (rtl)
                {
                case "Auto":
                    RightToLeft = CultureInfo.CurrentCulture.TextInfo.IsRightToLeft;
                    break;

                case "No":
                    RightToLeft = false;
                    break;

                case "Yes":
                    RightToLeft = true;
                    break;

                default:
                    RightToLeft = false;
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        private static void LoadPlugins()
        {
            // main assembly initializer
            ProcessMainAssembly();

            XmlItem pluginsItem = Root.FindItem("Plugins");

            for (int i = 0; i < pluginsItem.Count; i++)
            {
                XmlItem item       = pluginsItem[i];
                string  pluginName = item.GetProp("Name");

                try
                {
                    ProcessAssembly(Assembly.LoadFrom(pluginName));
                }
                catch
                {
                }
            }

            // For CoreWin
#if NETCOREAPP
            LoadPluginsInCurrentFolder();
#endif
        }
Ejemplo n.º 4
0
        private static void RestoreUIOptions()
        {
            RestoreRightToLeft();

            XmlItem xi = Root.FindItem("UIOptions");
            string  disableHotkeysStringValue = xi.GetProp("DisableHotkeys");

            if (!String.IsNullOrEmpty(disableHotkeysStringValue))
            {
                disableHotkeys = disableHotkeysStringValue.ToLower() != "false";
            }
            string disableBacklightStringValue = xi.GetProp("DisableBacklight");

            if (!String.IsNullOrEmpty(disableBacklightStringValue))
            {
                disableBacklight = disableBacklightStringValue.ToLower() != "false";
            }
        }
Ejemplo n.º 5
0
        private static void RestoreUIStyle()
        {
            XmlItem xi    = Root.FindItem("UIStyle");
            string  style = xi.GetProp("Style");

            if (!String.IsNullOrEmpty(style))
            {
                UIStyle = (UIStyle)Converter.FromString(typeof(UIStyle), style);
            }
        }
Ejemplo n.º 6
0
        private static void RestoreCompilerSettings()
        {
            XmlItem xi = Root.FindItem("CompilerSettings");

            CompilerSettings.Placeholder = xi.GetProp("Placeholder");

            string exceptionBehaviour = xi.GetProp("ExceptionBehaviour");

            if (!String.IsNullOrEmpty(exceptionBehaviour))
            {
                try
                {
                    CompilerSettings.ExceptionBehaviour =
                        (CompilerExceptionBehaviour)Converter.FromString(typeof(CompilerExceptionBehaviour),
                                                                         exceptionBehaviour);
                }
                catch
                {
                    CompilerSettings.ExceptionBehaviour = CompilerExceptionBehaviour.Default;
                }
            }
        }
Ejemplo n.º 7
0
        private static string Get(string id, XmlDocument locale)
        {
            string[] categories = id.Split(new char[] { ',' });
            XmlItem  xi         = locale.Root;

            foreach (string category in categories)
            {
                int i = xi.Find(category);
                if (i == -1)
                {
                    return(null);
                }
                xi = xi[i];
            }

            return(xi.GetProp("Text"));
        }
Ejemplo n.º 8
0
        private static void LoadPlugins()
        {
            // main assembly initializer
            ProcessAssembly(typeof(Config).Assembly);

            XmlItem pluginsItem = Root.FindItem("Plugins");

            for (int i = 0; i < pluginsItem.Count; i++)
            {
                XmlItem item       = pluginsItem[i];
                string  pluginName = item.GetProp("Name");

                try
                {
                    ProcessAssembly(Assembly.LoadFrom(pluginName));
                }
                catch
                {
                }
            }
        }
Ejemplo n.º 9
0
        private static string Get(string id, XmlDocument locale)
        {
            string[] categories = id.Split(new char[] { ',' });
            XmlItem  xi         = locale.Root;

            foreach (string category in categories)
            {
                int i = xi.Find(category);
                if (i == -1)
                {
                    return(id + " " + FBadResult);
                }
                xi = xi[i];
            }

            string result = xi.GetProp("Text");

            if (result == "")
            {
                result = id + " " + FBadResult;
            }
            return(result);
        }
Ejemplo n.º 10
0
        // we need this to prevent form.Load event to be fired *after* the form is displayed.
        // Used in the StandardDesignerForm.Load event
        internal static bool RestoreFormState(Form form, bool ignoreWindowState)
        {
            XmlItem xi = FDoc.Root.FindItem("Forms").FindItem(form.Name);

            if (!ignoreWindowState)
            {
                form.WindowState = xi.GetProp("Maximized") == "1" ? FormWindowState.Maximized : FormWindowState.Normal;
            }
            string left   = xi.GetProp("Left");
            string top    = xi.GetProp("Top");
            string width  = xi.GetProp("Width");
            string height = xi.GetProp("Height");

            if (left != "" && top != "")
            {
                form.Location = new Point(int.Parse(left), int.Parse(top));
            }
            if (width != "" && height != "")
            {
                form.Size = new Size(int.Parse(width), int.Parse(height));
            }
            return(xi.GetProp("Maximized") == "1");
        }