Exemplo n.º 1
0
        public FormMain()
        {
            InitializeComponent();

            _counter = new Counter();
            formData = new MainFormData();
            savePath = "";
            _globalSettings = new GlobalSettings();

            //Mentett fájlok helyének meghatározása
            setSavePath();

            myControlInit();

            _formTimer1 = new FormTimer(_counter);
            _formTimer1.SetCounterDefaultColors();
            _formTimer2 = new FormTimer(_counter);
            _formTimer2.SetCounterDefaultColors();
            _formTimer2.Formatum = 1;
            _formTimer1.Hide();

            SetCounterData();
        }
Exemplo n.º 2
0
        //form pozíció
        private void ReadMainFormDataXML()
        {
            try
            {
                if (File.Exists(savePath + @"\formData.xml"))
                {
                    XDocument xmlFormData = XDocument.Load(savePath + @"\formData.xml");
                    MainFormData tmpFormData = new MainFormData(int.Parse(xmlFormData.Root.Element("Mainform").Attribute("top").Value),
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("left").Value),
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("width").Value),
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("height").Value),
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("zChecked").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucMonitorPreviewBoxMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucucMonitorControlBoxMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucFontSizeBoxMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucCounterTypeChangerMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucCounterMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucTimeDirectionMinimize").Value) == 1 ? true : false,
                                                                int.Parse(xmlFormData.Root.Element("Mainform").Attribute("ucTimeSettingsMinimize").Value) == 1 ? true : false

                                                                );
                    this.Top = tmpFormData.Top;
                    this.Left = tmpFormData.Left;
                    this.Width = tmpFormData.Width;
                    this.Height = tmpFormData.Height;
                    if (tmpFormData.UcMonitorPreviewBoxMinimize) ucMonitorPreviewBox1.Minimize();
                    if (tmpFormData.UcMonitorControlBoxMinimize) ucMonitorControlBox1.Minimize();
                    if (tmpFormData.UcFontSizeBoxMinimize) ucFontSizeBox1.Minimize();
                    if (tmpFormData.UcCounterTypeChangerMinimize) ucCounterTypeChanger1.Minimize();
                    if (tmpFormData.UcCounterMinimize) ucCounter1.Minimize();
                    if (tmpFormData.UcTimeDirectionMinimize) ucTimeDirection1.Minimize();
                    if (tmpFormData.UcTimeSettingsMinimize) ucTimeSettings1.Minimize();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }