Exemplo n.º 1
0
        public void loadFM()
        {
            this.IsEnabled = false;
            this.reset(false);
            clearAllFields();

            WindowLoading windowLoading = new WindowLoading(this);

            windowLoading.Owner   = this;
            windowLoading.Opacity = 0;
            windowLoading.setLoading(globalFuncs.localization.WindowLoadingLabels[0]);
            windowLoading.Show();
            Storyboard s = globalFuncs.FadeInElement(windowLoading, globalFuncs.windowDuration, globalFuncs.windowFinalOpacity, false);

            s.Completed += delegate(object _sender, EventArgs _e) { windowLoadingFadeInCompleted(ref windowLoading); };
            s.Begin();
        }
Exemplo n.º 2
0
        public void startLoading(WindowLoading windowLoading)
        {
            globalFuncs.scoutTimer.start();
            context.init();

            bool check = context.loaded;

            if (globalFuncs.isDebug)
            {
                check = true;
            }
            if (check)
            {
                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new updateLabelDelegate(windowLoading.setLoading),
                    globalFuncs.localization.WindowLoadingLabels[1] + " " + context.fm.MetaData.CurrentVersion + " ..." + globalFuncs.localization.WindowLoadingLabels[2]);

                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new updateLabelDelegate(windowLoading.setInfo),
                    globalFuncs.localization.WindowLoadingLabels[3]);

                if (!globalFuncs.isDebug)
                {
                    context.loadFMData();
                }

                if (!globalFuncs.isDebug)
                {
                    this.Dispatcher.BeginInvoke(
                        System.Windows.Threading.DispatcherPriority.Normal,
                        new updateLabelDelegate(this.updateDate),
                        context.fm.MetaData.IngameDate.ToLongDateString());
                }

                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new updateLabelDelegate(windowLoading.setInfo),
                    globalFuncs.localization.WindowLoadingLabels[4]);

                context.loadScoutData();

                this.PlayerSearch.fullName.TextBox.AutoSuggestionList        = globalFuncs.playersFixed;
                this.PlayerSearch.fullName.TextBox.DisplayAutoSuggestionList = globalFuncs.players;
                this.StaffSearch.fullName.TextBox.AutoSuggestionList         = globalFuncs.staffFixed;
                this.StaffSearch.fullName.TextBox.DisplayAutoSuggestionList  = globalFuncs.staff;
                this.TeamSearch.name.TextBox.AutoSuggestionList     = globalFuncs.clubs;
                this.PlayerSearch.nation.TextBox.AutoSuggestionList = globalFuncs.countries;
                this.StaffSearch.nation.TextBox.AutoSuggestionList  = globalFuncs.countries;
                this.TeamSearch.nation.TextBox.AutoSuggestionList   = globalFuncs.countries;
                this.PlayerSearch.club.TextBox.AutoSuggestionList   = globalFuncs.clubs;
                this.StaffSearch.club.TextBox.AutoSuggestionList    = globalFuncs.clubs;
                this.TeamSearch.stadium.TextBox.AutoSuggestionList  = globalFuncs.stadiums;

                globalFuncs.scoutTimer.stop();
                String str = "";
                if (!globalFuncs.isDebug)
                {
                    str = globalFuncs.localization.WindowLoadingLabels[5] + " " + context.fm.MetaData.CurrentVersion + " " +
                          globalFuncs.localization.WindowLoadingLabels[6] + " "
                          + globalFuncs.scoutTimer.seconds() + " " + globalFuncs.localization.WindowLoadingLabels[7];
                }
                else
                {
                    str = globalFuncs.localization.WindowLoadingLabels[5] + " debug " +
                          globalFuncs.localization.WindowLoadingLabels[6] + " "
                          + globalFuncs.scoutTimer.seconds() + " " + globalFuncs.localization.WindowLoadingLabels[7];
                }

                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new updateLabelDelegate(windowLoading.setLoading),
                    "");

                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new updateLabelDelegate(windowLoading.setLoading),
                    str);
                Thread.Sleep(1000);

                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new windowFinishLoadingDelegate(windowLoading.finishLoading),
                    true);
            }
            else
            {
                globalFuncs.scoutTimer.stop();
                for (int i = 5; i >= 0; --i)
                {
                    String str = globalFuncs.localization.WindowLoadingLabels[8] + Environment.NewLine +
                                 globalFuncs.localization.WindowLoadingLabels[9] + Environment.NewLine + Environment.NewLine +
                                 globalFuncs.localization.WindowLoadingLabels[10] + " " + i + " " + globalFuncs.localization.WindowLoadingLabels[7];
                    this.Dispatcher.BeginInvoke(
                        System.Windows.Threading.DispatcherPriority.Normal,
                        new updateLabelDelegate(windowLoading.setLoading),
                        str);
                    Thread.Sleep(1000);
                }
                this.Dispatcher.BeginInvoke(
                    System.Windows.Threading.DispatcherPriority.Normal,
                    new windowFinishLoadingDelegate(windowLoading.finishLoading),
                    false);
            }
        }
Exemplo n.º 3
0
        public void windowLoadingFadeInCompleted(ref WindowLoading windowLoading)
        {
            windowStartLoadingDelegate d = new windowStartLoadingDelegate(this.startLoading);

            d.BeginInvoke(windowLoading, null, null);
        }