Пример #1
0
        private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            LabelClosing.Visible = true;
            Application.DoEvents();

            foreach (var fc in GuiViewMain.GetFeatureRoot().GetChildFeatureInstance())
            {
                if (fc is CoreFeatureBase.ICloseCallback cfc)
                {
                    cfc.OnClosing();
                }
            }
        }
Пример #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            // INIT Tono.Gui.WinForm
            GuiViewMain.IsDrawEmptyBackground = false;
            Mes.SetDefault();
            Mes.SetCurrentLanguage((string)ConfigRegister.Current["LastLanguage", "en"]);
            FeatureLoader2.SetResources(Properties.Resources.ResourceManager);
            FeatureLoader2.SetUsingClass(GetType());
            GuiViewMain.Initialize(typeof(FeatureLoader2));
            Mes.Current.ResetText(this);
            Mes.Current.CodeChanged += OnMesCodeChanged;
            DateTimeEx.SetDayStrings(Mes.Current);
            GuiViewMain.GetFeatureRoot().ParseCommandLineParameter(Environment.GetCommandLineArgs());
            GuiViewMain.GetFeatureRoot().FlushFeatureTriggers();

            GuiViewMain.Zoom = new XyBase {
                X = 1090, Y = 1000,
            };
            GuiViewMain.Scroll = ScreenPos.FromInt(GuiViewMain.Scroll.X, 12);


            // Restore Form dimension
            Location = new Point
            {
                X = (int)ConfigRegister.Current["X", 12],
                Y = (int)ConfigRegister.Current["Y", 24],
            };
            Size = new Size
            {
                Width  = (int)ConfigRegister.Current["Width", 885],
                Height = (int)ConfigRegister.Current["Height", 236],
            };
            splitContainerMain.SplitterDistance = (int)ConfigRegister.Current["PaneSplitterY", 25];
            textBoxTalk.Text      = "";
            LabelTalkBarTime.Text = "";

            IsInInit = false;
        }